RCS Header: /home/amb/CVS/cxref/src/xref.c,v 1.21 2002-06-23 15:57:36 amb Exp
C Cross Referencing & Documentation tool. Version 1.5e.
Cross referencing of functions.
The names of the function cross reference files.
#define XREF_FUNC_FILE ".function"
#define XREF_FUNC_BACKUP ".function~"
The names of the variable cross reference files.
#define XREF_VAR_FILE ".variable"
#define XREF_VAR_BACKUP ".variable~"
The names of the include cross reference files.
#define XREF_INC_FILE ".include"
#define XREF_INC_BACKUP ".include~"
The names of the type cross reference files.
#define XREF_TYPE_FILE ".typedef"
#define XREF_TYPE_BACKUP ".typedef~"
The maximum type definition length
The maximum function name length.
The maximum filename length.
The name of the directory for the output.
extern char* option_odir
Defined in: | cxref.c |
The base name of the file for the output.
extern char* option_name
Defined in: | cxref.c |
The option for cross referencing.
extern int option_xref
Defined in: | cxref.c |
The option for indexing.
extern int option_index
Defined in: | cxref.c |
Create the appendix of files, global functions, global variables and types.
void CreateAppendix ( StringList files, StringList2 funcs, StringList2 vars, StringList2 types )
Prototyped in: | cxref.h | |
Calls: | AddToStringList() | slist.c |
AddToStringList2() | slist.c | |
ConcatStrings() | memory.c | |
fclose(), fgets(), fopen(), fscanf(), strlen() | ||
Called by: | main() | cxref.c |
References Variables: | option_index | cxref.c |
option_name | cxref.c | |
option_odir | cxref.c |
Cross reference the functions, variables and includes that are used in this file with the global functions, variables and includes. The types that are defined are also listed here.
void CrossReference ( File file, int outputs )
Prototyped in: | cxref.h | |
Calls: | AddToStringList() | slist.c |
ConcatStrings() | memory.c | |
check_for_called() | xref.c | |
check_for_caller() | xref.c | |
check_for_var() | xref.c | |
check_for_var_func() | xref.c | |
fixup_extern_var() | xref.c | |
exit(), fclose(), fgets(), fopen(), fprintf(), fputs(), fscanf(), rename(), strcmp(), unlink() | ||
Called by: | main() | cxref.c |
References Variables: | option_name | cxref.c |
option_odir | cxref.c | |
option_xref | cxref.c |
Delete the named file from the cross reference database.
void CrossReferenceDelete ( char* name )
Prototyped in: | cxref.h | |
Calls: | ConcatStrings() | memory.c |
fclose(), fgets(), fopen(), fprintf(), fputs(), fscanf(), rename(), strcmp(), unlink() | ||
Called by: | main() | cxref.c |
References Variables: | option_name | cxref.c |
option_odir | cxref.c |
Check through all of the functions in this file to see if any of them are called or referenced.
static void check_for_called ( File file, char* called, char* caller, char* filename )
Prototyped in: | xref.c | |
Calls: | AddToStringList2() | slist.c |
strcmp() | ||
Called by: | CrossReference() | xref.c |
Check through all of the functions in this file to see if any of them are callers or referencers.
static void check_for_caller ( File file, char* called, char* filename )
Prototyped in: | xref.c | |
Calls: | SafeMallocString() | memory.c |
strcmp() | ||
Called by: | CrossReference() | xref.c |
Check through all of the variables in this file to see if any of them are extern usage of others.
static void check_for_var ( File file, char* variable, char* filename, int scope, char* funcname )
Prototyped in: | xref.c | |
Calls: | AddToStringList2() | slist.c |
SafeMallocString() | memory.c | |
strcmp() | ||
Called by: | CrossReference() | xref.c |
Check through the function to see if it uses the variable, if func is NULL then check the file.
static int check_for_var_func ( File file, Variable var, Function func )
Prototyped in: | xref.c | |
Calls: | AddToStringList2() | slist.c |
SafeFree() | memory.c | |
SafeMallocString() | memory.c | |
strcmp() | ||
Called by: | CrossReference() | xref.c |
We can only now put in the location of the external variables that we found were used. Previously we did not know the location of their global definition.
static void fixup_extern_var ( Variable var, StringList2 refs )
Prototyped in: | xref.c | |
Calls: | SafeFree() | memory.c |
SafeMallocString() | memory.c | |
strcmp() | ||
Called by: | CrossReference() | xref.c |