Beispiel #1
0
/*Precondition: I wanted the program to not be completely unsightly
*Postcondition: Literally calls every function and prints the program to the c file
*/
void printprogram(FILE *ofp, const char * programname, char * first, char * last, int numfunct){
	fprintf(ofp, "/*\n");   printstar(1, ofp);  fprintf(ofp, "*\t%s", programname);
    printstar(5, ofp);  fprintf(ofp, "*\t%s %s (%s)", first, last, __DATE__);
    printstar(1, ofp);  fprintf(ofp, "*/\n"); linespace(ofp);
    fprintf(ofp, "/*  Pre-processor Directives    */\n");
    fprintf(ofp, "/*included libraries*/\n");   fprintf(ofp, "\t%cinclude %cstdlib.h%c\n", 35, 60, 62);
    fprintf(ofp, "\t%cinclude %cstdio.h%c\n", 35, 60, 62);  newline(1,ofp);	fprintf(ofp, "/*included constants*/\n");
    fprintf(ofp, "/*included functions*/\n");	declarefunc(ofp, numfunct);		fprintf(ofp, "/*included external variables*/\n");
	fprintf(ofp, "/*included structures*/\n"); linespace(ofp);
    fprintf(ofp, "/*main function: describe the main function here*/\n");
    fprintf(ofp, "int main%c%c %c\n", 40,41,123);   fprintf(ofp, "\t/*initialize variables, files, and pointers below*/\n\n\n\n");
    fprintf(ofp, "\treturn 0%c\n", 59); fprintf(ofp, "%c", 125);    newline(1,ofp);	definefunc(ofp, numfunct);
}
Beispiel #2
0
obj definefunc(const wchar_t* ws,void (*p)(),int executionLevel=1){
	String s{wcs2StringT(ws)};
	return definefunc(s,p,executionLevel);
	
}