Header: cmain Purpose: Defines the main body of a C program. File: cmain.h Author: K.G. Begeman Use: #include "cmain.h" Description: cmain.h defines the main body for GIPSY applications written in C. C programmers have to use the MAIN_PROGRAM_ENTRY statement to declare the main. If they want to access the command line arguments they have to declare int cmain( int argc, char **argv ) where argc and argv have the same meaning as in the normal main. This header file also defines the macro: IDENTIFICATION(char *myname, char *version) which prints the name of the program, its version number and the date of compilation. Example: ..... #include "cmain.h" ..... MAIN_PROGRAM_ENTRY { init_c( ); IDENTIFICATION( "CLEAN", "1.2" ); ..... ..... finis_c( ); } or #include "cmain.h" ..... int cmain( int argc, char **argv ) { init_c( ); IDENTIFICATION( "CLEAN", "1.2" ); ..... ..... finis_c( ); } Updates: Jun 2, 1990: KGB Document created. Nov 26, 1990: KGB IDENTIFICATION macro added. Dec 19, 2008: JPT gfortran code section added. Apr 21, 2010: JPT gfortran main section for MacOS X Leopard. May 10, 2010: JPT command line arguments for MacOS X fixed. Jan 17, 2011: JPT always define main() regardless of necessity.