nixawk / hello-c

c programming
9 stars 11 forks source link

c - FILE ORGANIZATION #15

Open nixawk opened 7 years ago

nixawk commented 7 years ago

The organization of information within a file is as important to the readability and maintainability of your programs as the organization of information among files. In this section, we will discuss how to organize file information consistently. Figure 4 provides an overview of how program file and module information should be organized.

screen shot 2017-10-17 at 21 52 40
nixawk commented 7 years ago

File Prolog

A file prolog introduces the file to the reader. Every file must have a prolog. Figure 5 is an example of a prolog outline; field values are described below.

/********************************************************************
 * FILE NAME:                                                       *
 *                                                                  *
 * PURPOSE:                                                         *
 *                                                                  *
 * FILE REFERENCES:                                                 *
 *                                                                  *
 * Name I/O Description                                             *
 * ---- --- -----------                                             *
 *                                                                  *
 * EXTERNAL VARIABLES:                                              *
 * Source: < >                                                      *
 *                                                                  *
 * Name Type I/O Description                                        *
 * ---- ---- --- -----------                                        *
 *                                                                  *
 * EXTERNAL REFERENCES:                                             *
 *                                                                  *
 * Name Description                                                 *
 * ---- -----------                                                 *
 *                                                                  *
 * ABNORMAL TERMINATION CONDITIONS, ERROR AND WARNING MESSAGES:     *
 *                                                                  *
 * ASSUMPTIONS, CONSTRAINTS, RESTRICTIONS:                          *
 *                                                                  *
 * NOTES:                                                           *
 *                                                                  *
 * REQUIREMENTS/FUNCTIONAL SPECIFICATIONS REFERENCES:               *
 *                                                                  *
 * DEVELOPMENT HISTORY:                                             *
 *                                                                  *
 * Date Author Change Id Release Description Of Change              *
 * ---- ------ --------- ------- ---------------------              *
 *                                                                  *
 * ALGORITHM (PDL)                                                  *
 *                                                                  *
 *******************************************************************/