/*=======================================================================*/ #define PROGRAMMER "LASTNAME, Firstname" #define PROG_CODE "CODE" #define COURSE "ECE-1021" #define YEAR (2004) #define TERM "Spring Summer Fall" #define SECTION (0) #define ASSIGNMENT "Assignment Number" #define REVISION (0) #define TITLE "Template for Source Code Files" #define SUBTITLE "Last Modified on 09 AUG 04" #define EMAIL "emailname@domain.com" #define FILENAME "template.c" /*=======================================================================*/ /*=======================================================================*/ /* WAIVED COMPILER WARNINGS */ /*=======================================================================*/ /* In this section you should list any compiler warnings that remain and why you are accepting them. It is acceptable to indicate that the the reason is that you don't know how to get rid of it - the grader can then tell you how to handle it in the future. However, you might still lose points if it is something that you should know how to deal with already or that is present because you are violating Style Standards. Please remove these instructions! Linker Warning: No module definition file specified: using defaults Reason for Waiver: Can't suppress. Does not have adverse impact. */ /*=======================================================================*/ /* NOTES TO THE USER/GRADER */ /*=======================================================================*/ /* Place any notes that you feel the User/Grader should be aware of here. Please remove these instructions! */ /*=======================================================================*/ /* PROBLEM STATEMENT */ /*=======================================================================*/ /* In this section, type a brief description of the problem. Please remove these instructions! */ /*=======================================================================*/ /* DEVELOPMENT NOTES */ /*=======================================================================*/ /* Any notes or explanations that you want the Grader to see when they are grading your work should be presented here. Please remove these instructions! */ /*=======================================================================*/ /* PSEUDOCODE */ /*=======================================================================*/ /* You should include at least a top level breakdown of the tasks that the program will perform. In general, do NOT include the entire pseudocode, just the upper few levels. Please remove these instructions! */ /*=======================================================================*/ /* DEVIATIONS FROM SUBMITTED PSEUDOCODE */ /*=======================================================================*/ /* In this section you should list any differences between the pseudocode you submitted for grading and the program as you implemented it. If you did not submit any pseudocode, then you must put your entire pseudocode here or lose even more points. Please remove these instructions! */ /*=======================================================================*/ /*=======================================================================*/ /* CODE SECTION */ /*=======================================================================*/ /*=======================================================================*/ /*== INCLUDE FILES ======================================================*/ #include /* stdout, putc(), printf() */ /*== MACRO DEFINITIONS (OBJECT-LIKE) ====================================*/ #define FALSE (0) #define TRUE (!FALSE) #define BLANKLINE printf("\n") #define MARGIN (2) /* Left Margin in PrintHeader() */ #define LMARG printc(' ', MARGIN) /* Print Left Margin */ /*== EXIT CODE DEFINITIONS ==============================================*/ #define EXIT_PASS (0) #define EXIT_FAIL (1) /*== MACRO DEFINITIONS (FUNCTION-LIKE) ==================================*/ /*== TYPEDEF STATEMENTS =================================================*/ /*=======================================================================*/ /* STRUCTURE DEFINITIONS and FUNCTIONS */ /*=======================================================================*/ /*=======================================================================*/ /* SUPPORT FUNCTIONS ( functions not called directly by main() ) */ /*=======================================================================*/ int printc(char c, int n) { while ( (n--) && (c == putc(c, stdout)) ); /* EMPTY LOOP */ return n; } /*=======================================================================*/ /* PRIMARY FUNCTIONS ( functions called directly by main() ) */ /*=======================================================================*/ /*== FUNCTION PROTOTYPES (to Document Support Functions) ================*/ int printc(char c, int n); /*== PRIMARY FUNCTIONS ==================================================*/ void PrintHeader(void) { LMARG; printc('=', (78 - MARGIN)); putc('\n', stdout); LMARG; printf("Course....... %s-%i (%s %i)\n",COURSE,SECTION,TERM,YEAR); LMARG; printf("Programmer... %s (%s)\n", PROGRAMMER, PROG_CODE); LMARG; printf("Assignment... %s (Rev %i)", ASSIGNMENT, REVISION); LMARG; printf("(Source Code in %s)\n", FILENAME); LMARG; printf("Description.. %s\n", TITLE); LMARG; printf(" %s\n", SUBTITLE); LMARG; printc('=', (78 - MARGIN)); putc('\n', stdout); } /*=======================================================================*/ /* MAIN FUNCTION */ /*=======================================================================*/ /*== FUNCTION PROTOTYPES (to Document Primary Functions) ================*/ void PrintHeader(void); int main(void) { /* Variable Declarations */ /* Executable Code */ PrintHeader(); BLANKLINE; return(EXIT_PASS); } /*=======================================================================*/ /* END OF SOURCE CODE FILE */ /*=======================================================================*/