RCS Header: /home/amb/cxref/RCS/cxref.c 1.61 2003/06/27 18:06:38 amb Exp
C Cross Referencing & Documentation tool. Version 1.5e.
Included Files
Preprocessor definitions
The default value of the CPP command.
#define CPP_COMMAND "gcc -E -C -dD -dI"
The name of the file to read the configuration from.
#define CXREF_CONFIG_FILE ".cxref"
The command line switch that sets the format of the output, use all comments.
int option_all_comments
The command line switch that sets the format of the output, insert the comments verbatim into the output.
int option_verbatim_comments
The command line switch that sets the format of the output, remove the leading block comment marker.
int option_block_comments
The command line switch that sets the format of the output, ignore all comments.
int option_no_comments
The command line switch that sets the format of the output, do cross referencing.
int option_xref
The command line switch that sets the format of the output, produce warnings.
int option_warn
The command line switch that sets the format of the output, produce an index.
int option_index
The command line switch that sets the format of the output, produce raw output.
int option_raw
The command line switch that sets the format of the output, produce LaTeX output.
int option_latex
The command line switch that sets the format of the output, produce HTML output.
int option_html
The command line switch that sets the format of the output, produce RTF output.
int option_rtf
The command line switch that sets the format of the output, produce SGML output.
int option_sgml
The command line switch for the output name, the directory to use.
char* option_odir
The command line switch for the output name, the base part of the name.
char* option_name
The command line switch for the output name, the source tree root directory.
char* option_root
The name of the include directories specified on the command line.
char** option_incdirs
The information about the cxref run, the command line options.
char* run_command
The information about the cxref run, the cpp command and options.
char* run_cpp_command
The number of include directories on the command line.
int option_nincdirs
The current file that is being processed.
File CurFile
Local Variables
cpp_command
The actual cpp command that is built up, adding -D, -U and -I options.
static char** cpp_command
cpp_command_num
The number of arguments to the cpp command.
static int cpp_command_num
cpp_argument_num
The number of arguments to the -CPP argument.
static int cpp_argument_num
option_delete
The option to control the mode of operation.
static int option_delete
option_files
The names of the files to process.
static char** option_files
option_nfiles
The number of files to process.
static int option_nfiles
popen_pid
The process id of the pre-processor.
static pid_t popen_pid
Canonicalise a file name by removing '/../', '/./' and '//' references.
char* CanonicaliseName ( char* name )
- char* CanonicaliseName
- Returns the argument modified.
- char* name
- The original name
The same function is used in WWWOFFLE and cxref with changes for files or URLs.
The main function that calls the parser.
int main ( int argc, char** argv )
- int main
- Returns the status, zero for normal termination, else an error.
- int argc
- The command line number of arguments.
- char** argv
- The actual command line arguments
Calls CPP for the file to get all of the needed information.
static int DocumentTheFile ( char* name )
- int DocumentTheFile
- Returns 1 in case of error, else 0.
- char* name
- The name of the file to document.
The CPP is started as a sub-process, (using popen to return a FILE* for lex to use).
Read in the options from the configuration file.
static int ParseConfigFile ( void )
- int ParseConfigFile
- Returns the value returned by ParseOptions().
Parse the options from the command line or from the .cxref file.
static int ParseOptions ( int nargs, char** args, int fromfile )
- int ParseOptions
- Return 1 if there is an error.
- int nargs
- The number of arguments.
- char** args
- The actual arguments
- int fromfile
- A flag indicating that they are read from the .cxref file.
Print out the usage instructions.
static void Usage ( int verbose )
- int verbose
- If true then output a long version of the information.
Close the file to the to the preprocessor
static int pclose_execvp ( FILE* f )
- int pclose_execvp
- Return the error status.
- FILE* f
- The file to close.
A popen function that takes a list of arguments not a string.
static FILE* popen_execvp ( char** command )
- FILE* popen_execvp
- Returns a file descriptor.
- char** command
- The command arguments.