You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			134 lines
		
	
	
		
			4.7 KiB
		
	
	
	
		
			Plaintext
		
	
			
		
		
	
	
			134 lines
		
	
	
		
			4.7 KiB
		
	
	
	
		
			Plaintext
		
	
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 | 
						|
== idioms.function ==
 | 
						|
/* 
 | 
						|
 * ===  FUNCTION  ======================================================================
 | 
						|
 *         Name:  |?FUNCTION_NAME|
 | 
						|
 *  Description:  
 | 
						|
 * =====================================================================================
 | 
						|
 */
 | 
						|
void<CURSOR>
 | 
						|
|FUNCTION_NAME| ( <+argument list+> )
 | 
						|
{
 | 
						|
<SPLIT>	return <+return value+>;
 | 
						|
}		/* -----  end of function |FUNCTION_NAME|  ----- */
 | 
						|
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 | 
						|
== idioms.function-static ==
 | 
						|
/* 
 | 
						|
 * ===  FUNCTION  ======================================================================
 | 
						|
 *         Name:  |?FUNCTION_NAME|
 | 
						|
 *  Description:  
 | 
						|
 * =====================================================================================
 | 
						|
 */
 | 
						|
static void<CURSOR>
 | 
						|
|FUNCTION_NAME| ( <+argument list+> )
 | 
						|
{
 | 
						|
<SPLIT>	return <+return value+>;
 | 
						|
}		/* -----  end of static function |FUNCTION_NAME|  ----- */
 | 
						|
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 | 
						|
== idioms.main ==
 | 
						|
#include	<stdlib.h>
 | 
						|
 | 
						|
/* 
 | 
						|
 * ===  FUNCTION  ======================================================================
 | 
						|
 *         Name:  main
 | 
						|
 *  Description:  
 | 
						|
 * =====================================================================================
 | 
						|
 */
 | 
						|
int
 | 
						|
main ( int argc, char *argv[] )
 | 
						|
{<CURSOR>
 | 
						|
<SPLIT>	return EXIT_SUCCESS;
 | 
						|
}				/* ----------  end of function main  ---------- */
 | 
						|
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 | 
						|
== idioms.enum ==
 | 
						|
enum |?ENUM_NAME| {<CURSOR>
 | 
						|
<SPLIT>};				/* ----------  end of enum |ENUM_NAME|  ---------- */
 | 
						|
 | 
						|
typedef enum |ENUM_NAME| |ENUM_NAME:c|;
 | 
						|
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 | 
						|
== idioms.struct ==
 | 
						|
struct |?STRUCT_NAME| {<CURSOR>
 | 
						|
<SPLIT>};				/* ----------  end of struct |STRUCT_NAME|  ---------- */
 | 
						|
 | 
						|
typedef struct |STRUCT_NAME| |STRUCT_NAME:c|;
 | 
						|
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 | 
						|
== idioms.union ==
 | 
						|
union |?UNION_NAME| {<CURSOR>
 | 
						|
<SPLIT>};				/* ----------  end of union |UNION_NAME|  ---------- */
 | 
						|
 | 
						|
typedef union |UNION_NAME| |UNION_NAME:c|;
 | 
						|
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 | 
						|
== idioms.printf == insert ==
 | 
						|
printf ( "<CURSOR>\n" );
 | 
						|
== idioms.scanf == insert ==
 | 
						|
scanf ( "<CURSOR>", & );
 | 
						|
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 | 
						|
== idioms.calloc ==
 | 
						|
|?POINTER|	= calloc ( (size_t)(<CURSOR><+COUNT+>), sizeof(<+TYPE+>) );
 | 
						|
if ( |POINTER|==NULL ) {
 | 
						|
	fprintf ( stderr, "\ndynamic memory allocation failed\n" );
 | 
						|
	exit (EXIT_FAILURE);
 | 
						|
}
 | 
						|
 | 
						|
free (|POINTER|);
 | 
						|
|POINTER|	= NULL;
 | 
						|
 | 
						|
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 | 
						|
== idioms.malloc ==
 | 
						|
|?POINTER|	= malloc ( sizeof(<CURSOR><+TYPE+>) );
 | 
						|
if ( |POINTER|==NULL ) {
 | 
						|
	fprintf ( stderr, "\ndynamic memory allocation failed\n" );
 | 
						|
	exit (EXIT_FAILURE);
 | 
						|
}
 | 
						|
 | 
						|
free (|POINTER|);
 | 
						|
|POINTER|	= NULL;
 | 
						|
 | 
						|
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 | 
						|
== idioms.sizeof == insert ==
 | 
						|
sizeof(<CURSOR><SPLIT>)
 | 
						|
== idioms.assert == insert ==
 | 
						|
assert(<CURSOR><SPLIT>);
 | 
						|
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 | 
						|
== idioms.open-input-file ==
 | 
						|
FILE	*|?FILEPOINTER|;										/* input-file pointer */
 | 
						|
char	*|FILEPOINTER|_file_name = "<CURSOR>";		/* input-file name    */
 | 
						|
 | 
						|
|FILEPOINTER|	= fopen( |FILEPOINTER|_file_name, "r" );
 | 
						|
if ( |FILEPOINTER| == NULL ) {
 | 
						|
	fprintf ( stderr, "couldn't open file '%s'; %s\n",
 | 
						|
			|FILEPOINTER|_file_name, strerror(errno) );
 | 
						|
	exit (EXIT_FAILURE);
 | 
						|
}
 | 
						|
<SPLIT>{-continue here-}
 | 
						|
if( fclose(|FILEPOINTER|) == EOF ) {			/* close input file   */
 | 
						|
	fprintf ( stderr, "couldn't close file '%s'; %s\n",
 | 
						|
			|FILEPOINTER|_file_name, strerror(errno) );
 | 
						|
	exit (EXIT_FAILURE);
 | 
						|
}
 | 
						|
 | 
						|
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 | 
						|
== idioms.open-output-file ==
 | 
						|
FILE	*|?FILEPOINTER|;										/* output-file pointer */
 | 
						|
char	*|FILEPOINTER|_file_name = "<CURSOR>";		/* output-file name    */
 | 
						|
 | 
						|
|FILEPOINTER|	= fopen( |FILEPOINTER|_file_name, "w" );
 | 
						|
if ( |FILEPOINTER| == NULL ) {
 | 
						|
	fprintf ( stderr, "couldn't open file '%s'; %s\n",
 | 
						|
			|FILEPOINTER|_file_name, strerror(errno) );
 | 
						|
	exit (EXIT_FAILURE);
 | 
						|
}
 | 
						|
<SPLIT>{-continue here-}
 | 
						|
if( fclose(|FILEPOINTER|) == EOF ) {			/* close output file   */
 | 
						|
	fprintf ( stderr, "couldn't close file '%s'; %s\n",
 | 
						|
			|FILEPOINTER|_file_name, strerror(errno) );
 | 
						|
	exit (EXIT_FAILURE);
 | 
						|
}
 | 
						|
 | 
						|
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 | 
						|
== idioms.fprintf == insert ==
 | 
						|
fprintf ( |?FILEPOINTER|, "<CURSOR>\n",  );
 | 
						|
== idioms.fscanf == insert ==
 | 
						|
fscanf ( |?FILEPOINTER|, "<CURSOR>", & );
 | 
						|
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 |