Line Name ----- ---- 247 add_def 246 add_file 216 clear_option 175 dec_ndefs 173 dec_nfiles 171 dec_nlang 167 dec_nobjbytes 165 dec_nobjects 177 dec_nrefs 169 dec_nstrings 163 global_deflist 162 global_filelist 161 global_langlist 160 global_langtable 184 inc_list_column 174 inc_ndefs 172 inc_nfiles 170 inc_nlang 166 inc_nobjbytes 164 inc_nobjects 176 inc_nrefs 168 inc_nstrings 197 inc_total_calls 191 inc_total_comments 194 inc_total_empty 193 inc_total_mixed 196 inc_total_rlength 195 inc_total_routines 192 inc_total_statements 144 list_column 217 list_enabled 142 list_file 219 log_brief_enabled 220 log_def_enabled 222 log_enabled 223 log_full_enabled 221 log_ref_enabled 218 log_silent_enabled 146 max_callers 147 max_html_byfile 148 max_html_xref 149 max_tree_depth 136 num_defs 135 num_files 134 num_lang 132 num_objbytes 131 num_objects 137 num_refs 133 num_strings 245 open_list_file 140 outfile_prefix 139 product_description 138 product_name 145 report_format 237 rpt_byfile_enabled 233 rpt_calls_enabled 231 rpt_defined_enabled 236 rpt_files_enabled 226 rpt_html_enabled 227 rpt_rtf_enabled 225 rpt_sdml_enabled 238 rpt_source_enabled 224 rpt_text_enabled 234 rpt_trees_enabled 232 rpt_undefined_enabled 229 rpt_vmshelp_enabled 228 rpt_winhelp_enabled 235 rpt_xrefs_enabled 143 separate_list 178 set_lang_table 185 set_list_column 187 set_max_callers 188 set_max_html_byfile 189 set_max_html_xref 190 set_max_tree_depth 215 set_option 182 set_outfile_prefix 180 set_product_description 179 set_product_name 186 set_report_format 183 set_separate_list 181 set_url_prefix 158 total_avglen 159 total_calls 152 total_comments 155 total_empty 150 total_files 151 total_lines 154 total_mixed 157 total_rlength 156 total_routines 153 total_statements 208 trace_blevel_enabled 203 trace_mem_enabled 205 trace_obj_enabled 209 trace_parser_enabled 207 trace_plevel_enabled 206 trace_rpt_enabled 204 trace_str_enabled 230 tree_inline_disabled 141 url_prefix
BEGINNING OF FILE
1: /****************************************************************************/ 2: /* */ 3: /* FACILITY: Routine Analyzer */ 4: /* */ 5: /* MODULE: Global Database Header */ 6: /* */ 7: /* AUTHOR: Steve Branam, Network Product Support Group, Digital */ 8: /* Equipment Corporation, Littleton, MA, USA. */ 9: /* */ 10: /* DESCRIPTION: This header file contains the definitions for the global */ 11: /* database used by Routine Analyzer. The global database contains all */ 12: /* program-permanant global data. Member access routines (get/set values) */ 13: /* and a number of general management routines are implemented here as */ 14: /* macros. */ 15: /* */ 16: /* REVISION HISTORY: */ 17: /* */ 18: /* V0.1-00 24-AUG-1994 Steve Branam */ 19: /* */ 20: /* Original version. */ 21: /* */ 22: /****************************************************************************/ 23: 24: #ifndef __GLOBDB_H /* If not already included... */ 25: #define __GLOBDB_H 26: #include <stdio.h> 27: #include "list.h" /* Generic list class. */ 28: #include "cmdopt.h" 29: #include "objects.h" 30: 31: /* */ 32: /* Report format types. */ 33: /* */ 34: 35: typedef enum { 36: FORMAT_TEXT, 37: FORMAT_SDML, 38: FORMAT_HTML, 39: FORMAT_RTF, 40: FORMAT_WINHELP, 41: FORMAT_VMSHELP 42: } report_output_format; 43: 44: /* */ 45: /* Object type. */ 46: /* */ 47: 48: typedef struct { 49: long nobjects; /* Current number of objects. */ 50: long nobjbytes; /* Current number of bytes. */ 51: long nstrings; /* Current number of strings. */ 52: long nlang; /* Current number of language */ 53: /* translations. */ 54: long nfiles; /* Current number of files. */ 55: long ndefs; /* Current number of defs. */ 56: long nrefs; /* Current number of refs. */ 57: char *productname; /* Product name string. */ 58: char *outprefix; /* Output file name prefix. */ 59: char *productdesc; /* Description file name. */ 60: char *urlprefix; /* HTML URL prefix. */ 61: FILE *listfile; /* Listing file ptr. */ 62: char **separatelist; /* List of separate routines. */ 63: int listcolumn; /* List output column. */ 64: long flags; /* Program enable flags. */ 65: report_output_format /* Report format. */ 66: rptformat; 67: int maxcallers; /* Maximum number of callers */ 68: /* allowed for expanded call */ 69: /* subtree. */ 70: int maxhtmlbyfile; /* Max lines in HTML by-file. */ 71: int maxhtmlxref; /* Max lines in HTML XREF file. */ 72: int maxtreedepth; /* Max tree expansion depth. */ 73: long lines; /* Total number of lines. */ 74: long comments; /* Number comment-only lines. */ 75: long statements; /* Number statement-only lines. */ 76: long mixed; /* Number mixed comment/ */ 77: /* statement lines. */ 78: long routines; /* Number routines defined in */ 79: /* source files. */ 80: long rlength; /* Length of all routine */ 81: /* defintion code. */ 82: long calls; /* Number of routine calls made */ 83: /* in all files. */ 84: LIST langlist; /* List of lang translations. */ 85: LIST filelist; /* List of source file records. */ 86: LIST deflist; /* List of routine defintions. */ 87: KEYWORD_DEFINITION /* Language translation table. */ 88: *langtable; 89: } GLOBAL_DATABASE; 90: 91: /* */ 92: /* Miscellaneous constants for the object. */ 93: /* */ 94: 95: #define MAX_FILE_NAME 256 /* Max length of file name. */ 96: 97: /* */ 98: /* Global flags. */ 99: /* */ 100: 101: #define TRACE_MEM_ENABLE (1 << 0) /* Trace enables. */ 102: #define TRACE_STR_ENABLE (1 << 1) 103: #define TRACE_OBJ_ENABLE (1 << 2) 104: #define TRACE_RPT_ENABLE (1 << 3) 105: #define TRACE_PLEVEL_ENABLE (1 << 4) 106: #define TRACE_BLEVEL_ENABLE (1 << 5) 107: #define TRACE_PARSER_ENABLE (1 << 6) 108: 109: #define LIST_ENABLE (1 << 10) /* Program options. */ 110: #define LOG_SILENT_ENABLE (1 << 11) 111: #define LOG_BRIEF_ENABLE (1 << 12) 112: #define LOG_DEF_ENABLE (1 << 13) 113: #define LOG_REF_ENABLE (1 << 14) 114: #define RPT_TEXT_ENABLE (1 << 15) 115: #define TREE_INLINE_DISABLE (1 << 16) 116: #define RPT_DEFINED_DISABLE (1 << 17) 117: #define RPT_UNDEFINED_DISABLE (1 << 18) 118: #define RPT_CALLS_DISABLE (1 << 19) 119: #define RPT_TREES_DISABLE (1 << 20) 120: #define RPT_XREFS_DISABLE (1 << 21) 121: #define RPT_BYFILE_DISABLE (1 << 22) 122: #define RPT_FILES_DISABLE (1 << 23) 123: #define RPT_SOURCE_DISABLE (1 << 24) 124: 125: /* */ 126: /* Member access routines. */ 127: /* */ 128: 129: #define gDb gGlobalDatabase /* Abbreviate name for macros. */ 130:
131: #define num_objects() (gDb.nobjects)END num_objects. Go to: Beginning of routine.
132: #define num_objbytes() (gDb.nobjbytes)END num_objbytes. Go to: Beginning of routine.
133: #define num_strings() (gDb.nstrings)END num_strings. Go to: Beginning of routine.
134: #define num_lang() (gDb.nlang)END num_lang. Go to: Beginning of routine.
135: #define num_files() (gDb.nfiles)END num_files. Go to: Beginning of routine.
136: #define num_defs() (gDb.ndefs)END num_defs. Go to: Beginning of routine.
137: #define num_refs() (gDb.nrefs)END num_refs. Go to: Beginning of routine.
138: #define product_name() (gDb.productname)END product_name. Go to: Beginning of routine.
139: #define product_description() (gDb.productdesc)END product_description. Go to: Beginning of routine.
140: #define outfile_prefix() (gDb.outprefix ? gDb.outprefix : "")END outfile_prefix. Go to: Beginning of routine.
141: #define url_prefix() (gDb.urlprefix)END url_prefix. Go to: Beginning of routine.
142: #define list_file() (gDb.listfile)END list_file. Go to: Beginning of routine.
143: #define separate_list() (gDb.separatelist)END separate_list. Go to: Beginning of routine.
144: #define list_column() (gDb.listcolumn)END list_column. Go to: Beginning of routine.
145: #define report_format() (gDb.rptformat)END report_format. Go to: Beginning of routine.
146: #define max_callers() (gDb.maxcallers)END max_callers. Go to: Beginning of routine.
147: #define max_html_byfile() (gDb.maxhtmlbyfile)END max_html_byfile. Go to: Beginning of routine.
148: #define max_html_xref() (gDb.maxhtmlxref)END max_html_xref. Go to: Beginning of routine.
149: #define max_tree_depth() (gDb.maxtreedepth)END max_tree_depth. Go to: Beginning of routine.
150: #define total_files() (list_entries(&gDb.filelist))END total_files. Go to: Beginning of routine.
151: #define total_lines() (gDb.lines)END total_lines. Go to: Beginning of routine.
152: #define total_comments() (gDb.comments)END total_comments. Go to: Beginning of routine.
153: #define total_statements() (gDb.statements)END total_statements. Go to: Beginning of routine.
154: #define total_mixed() (gDb.mixed)END total_mixed. Go to: Beginning of routine.
155: #define total_empty() (gDb.lines - gDb.mixed - gDb.comments - gDb.statements)END total_empty. Go to: Beginning of routine.
156: #define total_routines() (gDb.routines)END total_routines. Go to: Beginning of routine.
157: #define total_rlength() (gDb.rlength)END total_rlength. Go to: Beginning of routine.
158: #define total_avglen() (total_routines()==0?0:((total_rlength() * 10)/total_routines() + 5)/ 10)END total_avglen. Go to: Beginning of routine.
159: #define total_calls() (gDb.calls)END total_calls. Go to: Beginning of routine.
160: #define global_langtable() (gDb.langtable)END global_langtable. Go to: Beginning of routine.
161: #define global_langlist() (&gDb.langlist)END global_langlist. Go to: Beginning of routine.
162: #define global_filelist() (&gDb.filelist)END global_filelist. Go to: Beginning of routine.
163: #define global_deflist() (&gDb.deflist)END global_deflist. Go to: Beginning of routine.
164: #define inc_nobjects() (gDb.nobjects++)END inc_nobjects. Go to: Beginning of routine.
165: #define dec_nobjects() (gDb.nobjects--)END dec_nobjects. Go to: Beginning of routine.
166: #define inc_nobjbytes(x) (gDb.nobjbytes += x)END inc_nobjbytes. Go to: Beginning of routine.
167: #define dec_nobjbytes(x) (gDb.nobjbytes -= x)END dec_nobjbytes. Go to: Beginning of routine.
168: #define inc_nstrings() (gDb.nstrings++)END inc_nstrings. Go to: Beginning of routine.
169: #define dec_nstrings() (gDb.nstrings--)END dec_nstrings. Go to: Beginning of routine.
170: #define inc_nlang() (gDb.nlang++)END inc_nlang. Go to: Beginning of routine.
171: #define dec_nlang() (gDb.nlang--)END dec_nlang. Go to: Beginning of routine.
172: #define inc_nfiles() (gDb.nfiles++)END inc_nfiles. Go to: Beginning of routine.
173: #define dec_nfiles() (gDb.nfiles--)END dec_nfiles. Go to: Beginning of routine.
174: #define inc_ndefs() (gDb.ndefs++)END inc_ndefs. Go to: Beginning of routine.
175: #define dec_ndefs() (gDb.ndefs--)END dec_ndefs. Go to: Beginning of routine.
176: #define inc_nrefs() (gDb.nrefs++)END inc_nrefs. Go to: Beginning of routine.
177: #define dec_nrefs() (gDb.nrefs--)END dec_nrefs. Go to: Beginning of routine.
178: #define set_lang_table(n) (gDb.langtable=obj_alloc(sizeof(KEYWORD_DEFINITION)*(n+1), sizeof(KEYWORD_DEFINITION)*(n+1),"Language translation table"));END set_lang_table. Go to: Beginning of routine.
179: #define set_product_name(s) (gDb.productname = new_str(s, MAX_PRODUCT_NAME,"Product name"))END set_product_name. Go to: Beginning of routine.
180: #define set_product_description(s) (gDb.productdesc = new_str(s, MAX_FILE_NAME, "Description file"))END set_product_description. Go to: Beginning of routine.
181: #define set_url_prefix(s) (gDb.urlprefix = new_str(s, MAX_FILE_NAME, "URL prefix"))END set_url_prefix. Go to: Beginning of routine.
182: #define set_outfile_prefix(s) (gDb.outprefix = new_str(s, MAX_FILE_NAME, "Output file prefix"))END set_outfile_prefix. Go to: Beginning of routine.
183: #define set_separate_list(l) (gDb.separatelist = l)END set_separate_list. Go to: Beginning of routine.
184: #define inc_list_column() (gDb.listcolumn++)END inc_list_column. Go to: Beginning of routine.
185: #define set_list_column(x) (gDb.listcolumn = x)END set_list_column. Go to: Beginning of routine.
186: #define set_report_format(x) (gDb.rptformat = x)END set_report_format. Go to: Beginning of routine.
187: #define set_max_callers(x) (gDb.maxcallers = x)END set_max_callers. Go to: Beginning of routine.
188: #define set_max_html_byfile(x) (gDb.maxhtmlbyfile = x)END set_max_html_byfile. Go to: Beginning of routine.
189: #define set_max_html_xref(x) (gDb.maxhtmlxref = x)END set_max_html_xref. Go to: Beginning of routine.
190: #define set_max_tree_depth(x) (gDb.maxtreedepth = x)END set_max_tree_depth. Go to: Beginning of routine.
191: #define inc_total_comments(x) (gDb.lines += x, gDb.comments += x)END inc_total_comments. Go to: Beginning of routine.
192: #define inc_total_statements(x) (gDb.lines += x, gDb.statements += x)END inc_total_statements. Go to: Beginning of routine.
193: #define inc_total_mixed(x) (gDb.lines += x, gDb.mixed += x)END inc_total_mixed. Go to: Beginning of routine.
194: #define inc_total_empty(x) (gDb.lines += x)END inc_total_empty. Go to: Beginning of routine.
195: #define inc_total_routines(x) (gDb.routines += x)END inc_total_routines. Go to: Beginning of routine.
196: #define inc_total_rlength(x) (gDb.rlength += x)END inc_total_rlength. Go to: Beginning of routine.
197: #define inc_total_calls(x) (gDb.calls += x)END inc_total_calls. Go to: Beginning of routine.
198: 199: /* */ 200: /* Program trace flag access routines. */ 201: /* */ 202:
203: #define trace_mem_enabled() (gDb.flags & TRACE_MEM_ENABLE)END trace_mem_enabled. Go to: Beginning of routine.
204: #define trace_str_enabled() (gDb.flags & TRACE_STR_ENABLE)END trace_str_enabled. Go to: Beginning of routine.
205: #define trace_obj_enabled() (gDb.flags & TRACE_OBJ_ENABLE)END trace_obj_enabled. Go to: Beginning of routine.
206: #define trace_rpt_enabled() (gDb.flags & TRACE_RPT_ENABLE)END trace_rpt_enabled. Go to: Beginning of routine.
207: #define trace_plevel_enabled() (gDb.flags & TRACE_PLEVEL_ENABLE)END trace_plevel_enabled. Go to: Beginning of routine.
208: #define trace_blevel_enabled() (gDb.flags & TRACE_BLEVEL_ENABLE)END trace_blevel_enabled. Go to: Beginning of routine.
209: #define trace_parser_enabled() (gDb.flags & TRACE_PARSER_ENABLE)END trace_parser_enabled. Go to: Beginning of routine.
210: 211: /* */ 212: /* Program option flag access routines. */ 213: /* */ 214:
215: #define set_option(x) (gDb.flags |= (x))END set_option. Go to: Beginning of routine.
216: #define clear_option(x) (gDb.flags &= ~(x))END clear_option. Go to: Beginning of routine.
217: #define list_enabled() (gDb.flags & LIST_ENABLE)END list_enabled. Go to: Beginning of routine.
218: #define log_silent_enabled() (gDb.flags & LOG_SILENT_ENABLE)END log_silent_enabled. Go to: Beginning of routine.
219: #define log_brief_enabled() (gDb.flags & LOG_BRIEF_ENABLE && !log_silent_enabled())END log_brief_enabled. Go to: Beginning of routine.
220: #define log_def_enabled() (gDb.flags & LOG_DEF_ENABLE && !log_silent_enabled())END log_def_enabled. Go to: Beginning of routine.
221: #define log_ref_enabled() (gDb.flags & LOG_REF_ENABLE && !log_silent_enabled())END log_ref_enabled. Go to: Beginning of routine.
222: #define log_enabled() (!log_silent_enabled())END log_enabled. Go to: Beginning of routine.
223: #define log_full_enabled() (!log_silent_enabled() && !log_brief_enabled())END log_full_enabled. Go to: Beginning of routine.
224: #define rpt_text_enabled() (gDb.flags & RPT_TEXT_ENABLE)END rpt_text_enabled. Go to: Beginning of routine.
225: #define rpt_sdml_enabled() (gDb.rptformat == FORMAT_SDML)END rpt_sdml_enabled. Go to: Beginning of routine.
226: #define rpt_html_enabled() (gDb.rptformat == FORMAT_HTML)END rpt_html_enabled. Go to: Beginning of routine.
227: #define rpt_rtf_enabled() (gDb.rptformat == FORMAT_RTF)END rpt_rtf_enabled. Go to: Beginning of routine.
228: #define rpt_winhelp_enabled() (gDb.rptformat == FORMAT_WINHELP)END rpt_winhelp_enabled. Go to: Beginning of routine.
229: #define rpt_vmshelp_enabled() (gDb.rptformat == FORMAT_VMSHELP)END rpt_vmshelp_enabled. Go to: Beginning of routine.
230: #define tree_inline_disabled() (gDb.flags & TREE_INLINE_DISABLE)END tree_inline_disabled. Go to: Beginning of routine.
231: #define rpt_defined_enabled() !(gDb.flags & RPT_DEFINED_DISABLE)END rpt_defined_enabled. Go to: Beginning of routine.
232: #define rpt_undefined_enabled() !(gDb.flags & RPT_UNDEFINED_DISABLE)END rpt_undefined_enabled. Go to: Beginning of routine.
233: #define rpt_calls_enabled() !(gDb.flags & RPT_CALLS_DISABLE)END rpt_calls_enabled. Go to: Beginning of routine.
234: #define rpt_trees_enabled() !(gDb.flags & RPT_TREES_DISABLE)END rpt_trees_enabled. Go to: Beginning of routine.
235: #define rpt_xrefs_enabled() !(gDb.flags & RPT_XREFS_DISABLE)END rpt_xrefs_enabled. Go to: Beginning of routine.
236: #define rpt_files_enabled() !(gDb.flags & RPT_FILES_DISABLE)END rpt_files_enabled. Go to: Beginning of routine.
237: #define rpt_byfile_enabled() !(gDb.flags & RPT_BYFILE_DISABLE)END rpt_byfile_enabled. Go to: Beginning of routine.
238: #define rpt_source_enabled() !(gDb.flags & RPT_SOURCE_DISABLE)END rpt_source_enabled. Go to: Beginning of routine.
239: 240: 241: /* */ 242: /* General management routines. */ 243: /* */ 244:
245: #define open_list_file(n) (gDb.listfile = fopen(n, "w"))END open_list_file. Go to: Beginning of routine.
246: #define add_file(f) (insert_ordered_entry(&gDb.filelist, f, compare_file))END add_file. Go to: Beginning of routine.
247: #define add_def(d) (insert_ordered_entry(&gDb.deflist, d, compare_def))END add_def. Go to: Beginning of routine.
248: 249: /* */ 250: /* Global database allocation/declaration. The database resides in the main */ 251: /* module, and is external to all other modules. */ 252: /* */ 253: 254: #ifdef MAIN_MODULE 255: GLOBAL_DATABASE /* Allocate global database. */ 256: gGlobalDatabase; 257: #else 258: extern GLOBAL_DATABASE /* Declare global database. */ 259: gGlobalDatabase; 260: #endif 261: 262: #endif /* If not already included. */
END OF FILE TOTAL: 101 routines, 1 Avg Length