doc - program self documentation
doc(SOURCE)
Location of source file
SEPlibs documentation mechanism. When a program is called with no arguments and no in or out the begining of the file is searched for documentation. For C, the first comment
Standard practice is to give program usage description in comment lines at the beginning of the source file. Doc reads such comments from the file name it is passed and prints them (on the stderr file) when the program is invoked without inputs or arguments. Thus the prospective user need only type the program name to obtain a parameter description.
If the filename is a relative path the documentation will be searched for in the list of directories defined by the compile time variable DEFAULT_DOC_PATH followed by the list of directories in the environment variable ``SEP_DOC_PATH''. Both of these should be colon separated lists of directories.
Copying is done up to the end of the first comment block or preprocessor control symbol (# for C, % for Ratfor). Output is piped through more so that long descriptions can be viewed.
In the interest of increased portability, provision is made to input the comments directly as a (long) character string. (This is fairly messy, however, and compiler length limitations may interpose.)
The standard include file <sep.startup> generates the call `doc(SOURCE)'. The standard gnu-makefile rules for building seplib will automatically define SOURCE.
If the programmer predefines SOURCE via a #define they should only do so if it is not previously defined., e.g.
#ifndef SOURCE
#define SOURCE "./segy/programs/Segy.c"
#endif
seplib, more
If SOURCE has not been defined, the cc compiler will yell.
Unpredictable results if comments don't appear at the beginning of the program. Fortran version needs % to recognize end of comment stream.
self doc documentation manuals
sep