@Routine Analyzer Source File Analysis - rpthtml.c6

rpthtml.c Source Code

LGo to: Contents; Previous section; Beginning of section; Next file in section; Previous file in section.

Q

Routines In This File (Alphabetical)



 Line Name
----- ----1   97 assign_byfilefiles/   70 assign_xreffiles1  413 byfile_link_prefix1   28 byfile_link_suffix0  309 calls_link_prefix0   26 calls_link_suffix'  124 link_url2 1431 rpt_byfile_html_end4 1371 rpt_byfile_html_entry2 1323 rpt_byfile_html_hdr1 1013 rpt_calls_html_end3  972 rpt_calls_html_entry1  943 rpt_calls_html_hdr3  816 rpt_defined_html_end5  761 rpt_defined_html_entry3  733 rpt_defined_html_hdr0 1560 rpt_file_html_end2 1500 rpt_file_html_entry0 1465 rpt_file_html_hdr0  670 rpt_html_continue3  505 rpt_html_section_hdr3  444 rpt_html_section_nav5  482 rpt_html_section_title6  599 rpt_html_subsection_hdr2 1719 rpt_source_html_end4 1657 rpt_source_html_entry2 1592 rpt_source_html_hdr0 1294 rpt_tree_html_end2 1200 rpt_tree_html_entry0 1160 rpt_tree_html_hdr5  917 rpt_undefined_html_end7  870 rpt_undefined_html_entry5  842 rpt_undefined_html_hdr0 1138 rpt_xref_html_end2 1055 rpt_xref_html_entry0 1039 rpt_xref_html_hdr5  281 sourcefile_link_prefix*  247 source_link1  211 source_link_prefix1   29 source_link_suffix(  152 tree_link(  382 xref_link/  340 xref_link_prefix/   27 xref_link_suffix


BEGINNING OF FILE


V     1: /****************************************************************************/     2: /*									    */1     3: /*  FACILITY:	Routine Analyzer					    */     4: /*									    */=     5: /*  MODULE:	HTML Report Formatting Routines				    */     6: /*									    */O     7: /*  AUTHOR:	Steve Branam, Network Product Support Group, Digital	    */>     8: /*		Equipment Corporation, Littleton, MA, USA.		    */     9: /*									    */V    10: /*  DESCRIPTION: This module contains the routines for generating Routine   */V    11: /*  Analyzer reports in HTML format, suitable for viewing with a World-Wide */%    12: /*  Web browser.							    */    13: /*									    */*    14: /*  REVISION HISTORY:							    */    15: /*									    */7    16: /*  V0.1-00 24-AUG-1994 Steve Branam					    */    17: /*									    */(    18: /*	Original version.						    */    19: /*									    */V    20: /****************************************************************************/    21:      22: #include <stdio.h>    23: #include "ranalyzer.h"    24: #include "reports.h"    25: 

jROUTINE calls_link_suffix. Go to: mNext routine in file; Routines in this file.



N    26: #define calls_link_suffix()	(rpt_source_enabled()	? "</A>" : "")
OEND calls_link_suffix. Go to: Beginning of routine.







iROUTINE xref_link_suffix. Go to: mNext routine in file; Routines in this file.



L    27: #define xref_link_suffix()	(rpt_xrefs_enabled()	? "</A>" : "")
NEND xref_link_suffix. Go to: Beginning of routine.







kROUTINE byfile_link_suffix. Go to: mNext routine in file; Routines in this file.



O    28: #define byfile_link_suffix()	(rpt_byfile_enabled()	? "</A>" : "")
PEND byfile_link_suffix. Go to: Beginning of routine.







kROUTINE source_link_suffix. Go to: mNext routine in file; Routines in this file.



O    29: #define source_link_suffix()	(rpt_source_enabled()	? "</A>" : "")
PEND source_link_suffix. Go to: Beginning of routine.





    30: 3    31: 					/* Section navigation hyperlink	    */%    32: 					/* information.			    */+    33: static HTML_SECTION mSections[] = {F    34:     {NULL, "table_of_contents", NULL, NULL, NULL, NULL, NULL},8    35:     {HTML_SECTION_FILES, "source_files_section",$    36: 	OUTFILE_SUFFIX_FILES, NULL,%    37: 	OUTFILE_SUFFIX_BYFILE, NULL,    38: 	"file", NULL},=    39:     {HTML_SECTION_BYFILE, "routines_by_file_section",:    40: 	OUTFILE_SUFFIX_BYFILE, OUTFILE_SUFFIX_MOREBYFILE,6    41: 	OUTFILE_SUFFIX_DEFLIST, OUTFILE_SUFFIX_FILES,!    42: 	"file", "routine", "f"},>    43:     {HTML_SECTION_DEFINED, "defined_routines_section",&    44: 	OUTFILE_SUFFIX_DEFLIST, NULL,"    45: 	OUTFILE_SUFFIX_UNDEFLIST,7    46: 	OUTFILE_SUFFIX_BYFILE, "routine", NULL, NULL},B    47:     {HTML_SECTION_UNDEFINED, "undefined_routines_section",(    48: 	OUTFILE_SUFFIX_UNDEFLIST, NULL,6    49: 	OUTFILE_SUFFIX_CALLS, OUTFILE_SUFFIX_DEFLIST,     50: 	"routine", NULL, NULL},9    51:     {HTML_SECTION_CALLS, "routine_calls_section",$    52: 	OUTFILE_SUFFIX_CALLS, NULL,7    53: 	OUTFILE_SUFFIX_XREF, OUTFILE_SUFFIX_UNDEFLIST,    54: 	"routine", NULL, "c"},6    55:     {HTML_SECTION_XREF, "caller_xref_section",6    56: 	OUTFILE_SUFFIX_XREF, OUTFILE_SUFFIX_MOREXREF,8    57: 	OUTFILE_SUFFIX_CALLTREES, OUTFILE_SUFFIX_CALLS,    58: 	"routine", NULL, "x"},>    59:     {HTML_SECTION_TREES, "routine_call_trees_section",<    60: 	OUTFILE_SUFFIX_CALLTREES, OUTFILE_SUFFIX_MORETREES,$    61: 	OUTFILE_SUFFIX_FIRSTSOURCE,1    62: 	OUTFILE_SUFFIX_XREF, "tree", NULL, "t"},8    63:     {HTML_SECTION_SOURCE, "source_code_section",;    64: 	OUTFILE_SUFFIX_FIRSTSOURCE, OUTFILE_SUFFIX_SOURCE,(    65: 	NULL, OUTFILE_SUFFIX_CALLTREES,    66: 	"file", NULL, "s"}
    67: };    68: V    69: /*************************************************************************++*/

eROUTINE assign_xreffiles. Go to: mNext routine in file; Routines in this file.



    70: void assign_xreffiles(I    71: /* Assigns the Xref file numbers for routine definitions.		    */    72: )    73:     /* No arguments.							    */    74: .    75: )	/* No return value.      					    */O    76: 	/*****************************************************************--*/    77: 	    78: {A?    79:     int	    xreffile;			    /* Xref file number.	    */0C    80:     int	    lines;			    /* Number of lines of def/refs. */e@    81:     DEFINITION				    /* Current definition entry.    */    82: 	    *curdef;n
    83: 	    rM    84:     for (xreffile = lines = 0, curdef = list_first(global_deflist());t    85: 	curdef != NULL;'    86: 	curdef = next_entry(curdef)) {.,    87: 	set_def_xreffile(curdef, xreffile);F    88: 	lines += def_num_callers(curdef) + def_num_calls(curdef) + 5;*    89: 	if (lines > max_html_xref()) {    90: 	    lines = 0;4    91: 	    xreffile++;
    92: 	}
    93:     }8	    94: }r
NEND assign_xreffiles. Go to: Beginning of routine.





i    95: V    96: /*************************************************************************++*/

gROUTINE assign_byfilefiles. Go to: mNext routine in file; Routines in this file.

E

0     97: void assign_byfilefiles(L    98: /* Assigns the by-file file numbers for routine definitions.		    */    99: )   100:     /* No arguments.							    */r   101: .   102: )	/* No return value.      					    */O   103: 	/*****************************************************************--*/6   104: 	   105: {"D   106:     int	    byfilefile;			    /* By-file file number.	    */C   107:     int	    lines;			    /* Number of lines of def/refs. */=;   108:     SOURCEFILE				    /* Current file entry.	    */"   109: 	    *curfile;
   110: 	    EQ   111:     for (byfilefile = lines = 0, curfile = list_first(global_filelist());o   112: 	curfile != NULL;=)   113: 	curfile = next_entry(curfile)) {14   114: 	set_source_byfilefile(curfile, byfilefile);0   115: 	lines += source_routines(curfile) + 10;,   116: 	if (lines > max_html_byfile()) {   117: 	    lines = 0;0   118: 	    byfilefile++;
   119: 	}
   120:     }"	   121: }t
PEND assign_byfilefiles. Go to: Beginning of routine.





d   122: V   123: /*************************************************************************++*/

aROUTINE link_url. Go to: tmNext routine in file; Routines in this file.

i

i   124: char *link_url(17   125: /* Formats an HTML link URL portion.					    */c   126:    127:     char    *aFileName-   128: 	    /* (READ, BY ADDR):  					    */13   129: 	    /* Report file name portion.				    */e   130: P   131: )	/* Returns formatted string ptr.  WARNING: The returned ptr is the  */O   132: 	/* address of a statically-defined string buffer, so the string	    */ 7   133: 	/* must be read from it immediately.				    */*O   134: 	/*****************************************************************--*/t   135: 	   136: {*3   137: 					    /* Trace name string buffer.    */T3   138:     static char	strbuf[MAX_FILE_NAME + 60];	   139:    140:     if (url_prefix()) {rO   141: 	sprintf(strbuf, "%s%s%s%s", url_prefix(), outfile_prefix(), aFileName,r   142: 	    OUTFILE_EXT_HTML);/
   143:     }	   144:     else {?   145: 	sprintf(strbuf, "%s%s%s", outfile_prefix(), aFileName,n   146: 	    OUTFILE_EXT_HTML);z
   147:     }T   148:     return strbuf;	   149: }W
FEND link_url. Go to: Beginning of routine.





    150: 
   151: #if 1 

bROUTINE tree_link. Go to: mNext routine in file; Routines in this file.

*

*-   152: #define tree_link(d,f) xref_link(d,f) 
GEND tree_link. Go to: Beginning of routine.





o
   153: #else V   154: /*************************************************************************++*/   155: char *tree_link(N   156: /* Formats a hyperlink to a routine's call tree if one exists.		    */   157:    158:     DEFINITION   159: 	    *aDef, ,   160: 	    /* (READ, BY ADDR):						    */=   161: 	    /* Routine definition entry to link to.			    */    162:    163:     int	    vSameFile<,   164: 	    /* (READ, BY VAL):  					    */O   165: 	    /* Flag indicating whether this is link within same HTML file.  */x   166: P   167: )	/* Returns formatted string ptr.  WARNING: The returned ptr is the  */O   168: 	/* address of a statically-defined string buffer, so the string	    */p7   169: 	/* must be read from it immediately.				    */lO   170: 	/*****************************************************************--*/   171: 	   172: {=Q   173:     static char	link[MAX_FILE_NAME + 64];   /* Link string buffer.	    */fV   174:     char    outputname[MAX_FILE_NAME + 1];  /* Report file name buffer.	    */   175: O   176:     if (!rpt_trees_enabled()) {		    /* Linking is valid only if	    */_5   177: 	return "";			    /* report generated.	    */i
   178:     }    179:     else {   180: 	if (!vSameFile) {&   181: 	    if (def_treefile(aDef)) {7   182: 		sprintf(outputname, OUTFILE_SUFFIX_MORETREES,t"   183: 		    def_treefile(aDef));   184: 	    }   185: 	    else { 7   186: 		strcpy(outputname, OUTFILE_SUFFIX_CALLTREES);t   187: 	    }
   188: 	}7   189:     					    /* If routine needs a separate  */e3   190: 					    /* tree or is expanded within   */n3   191: 					    /* some other tree, make link.  */u:   192: 	if (needs_tree(aDef) || def_root(aDef) != NULL) {D   193: 	    sprintf(link, "<A HREF=\"%s#t%lx\">%s</A>",2   194: 		(vSameFile ? "" : link_url(outputname)),   195: #if 0	    5   196: 		(needs_tree(aDef) ? aDef : def_root(aDef)), 0   197: 		(needs_tree(aDef) ? "Tree" : "Root"));
   198: #elseE   199: 		aDef, "Tree");   200: #endif   201: 	    return link; 
   202: 	}9   203: 	else {				    /* Otherwise, no tree exists.   */e   204: 	    return "No tree";
   205: 	}
   206:     }R	   207: }    208: #endif   209: V   210: /*************************************************************************++*/

kROUTINE source_link_prefix. Go to: 6mNext routine in file; Routines in this file.

c

!   211: char *source_link_prefix(NP   212: /* Formats the prefix for a hyperlink to a routine's source code.	    */   213:    214:     DEFINITION   215: 	    *aDef,_,   216: 	    /* (READ, BY ADDR):						    */=   217: 	    /* Routine definition entry to link to.			    */T   218:    219:     int	    vSameFile ,   220: 	    /* (READ, BY VAL):  					    */O   221: 	    /* Flag indicating whether this is link within same HTML file.  */F   222: P   223: )	/* Returns formatted string ptr.  WARNING: The returned ptr is the  */O   224: 	/* address of a statically-defined string buffer, so the string	    */T7   225: 	/* must be read from it immediately.				    */CO   226: 	/*****************************************************************--*/_   227: 	   228: {sQ   229:     static char	link[MAX_FILE_NAME + 64];   /* Link string buffer.	    */LO   230:     char    linkname[MAX_FILE_NAME + 1];    /* Source file name.	    */   231: O   232:     if (!rpt_source_enabled()) {	    /* Linking is valid only if	    */R5   233: 	return "";			    /* report generated.	    */z
   234:     }0   235:     else {   236: 	if (!vSameFile) {5   237: 	    sprintf(linkname, OUTFILE_SUFFIX_SOURCE,e(   238: 		source_seq(def_source(aDef)));
   239: 	}4   240: 	sprintf(link, "<A HREF=\"%s#d%lx\">",:   241: 	    (vSameFile ? "" : link_url(linkname)), aDef);   242: 	return link; 
   243:     }		   244: } 
PEND source_link_prefix. Go to: Beginning of routine.





*   245: V   246: /*************************************************************************++*/

dROUTINE source_link. Go to: mNext routine in file; Routines in this file.



    247: char *source_link(C   248: /* Formats a hyperlink to a routine's source code.			    */t   249:    250:     DEFINITION   251: 	    *aDef,i,   252: 	    /* (READ, BY ADDR):						    */=   253: 	    /* Routine definition entry to link to.			    */l   254:    255:     int	    vSameFile ,   256: 	    /* (READ, BY VAL):  					    */O   257: 	    /* Flag indicating whether this is link within same HTML file.  */n   258: P   259: )	/* Returns formatted string ptr.  WARNING: The returned ptr is the  */O   260: 	/* address of a statically-defined string buffer, so the string	    */<7   261: 	/* must be read from it immediately.				    */fO   262: 	/*****************************************************************--*/i   263: 	   264: {tQ   265:     static char	link[MAX_FILE_NAME + 64];   /* Link string buffer.	    */s   266: O   267:     if (!rpt_source_enabled()) {	    /* Linking is valid only if	    */ 5   268: 	return "";			    /* report generated.	    */u
   269:     }	/   270:     else if (isdefined_routine(aDef)) {*I   271: 	sprintf(link, "%sSource%s", source_link_prefix(aDef, vSameFile), #   272: 	    source_link_suffix());e   273: 	return link; 
   274:     }    275:     else {   276: 	return "No source";
   277:     }O	   278: }	
IEND source_link. Go to: Beginning of routine.





l   279: V   280: /*************************************************************************++*/

oROUTINE sourcefile_link_prefix. Go to: umNext routine in file; Routines in this file.

;

9%   281: char *sourcefile_link_prefix(>N   282: /* Formats the prefix for a hyperlink to a file's source code.		    */   283:    284:     SOURCEFILE   285: 	    *aSourceFile*,   286: 	    /* (READ, BY ADDR):						    */7   287: 	    /* Source file entry to link to.				    */E   288: P   289: )	/* Returns formatted string ptr.  WARNING: The returned ptr is the  */O   290: 	/* address of a statically-defined string buffer, so the string	    */7   291: 	/* must be read from it immediately.				    */TO   292: 	/*****************************************************************--*/8   293: 	   294: {DQ   295:     static char	link[MAX_FILE_NAME + 64];   /* Link string buffer.	    */O   296:     char    linkname[MAX_FILE_NAME + 1];    /* Source file name.	    */   297: O   298:     if (!rpt_source_enabled()) {	    /* Linking is valid only if	    *//5   299: 	return "";			    /* report generated.	    */ 
   300:     }*   301:     else {K   302: 	sprintf(linkname, OUTFILE_SUFFIX_SOURCE, source_seq(aSourceFile));/Q   303: 	sprintf(link, "<A HREF=\"%s\">", link_url(linkname), aSourceFile);6   304: 	return link; 
   305:     }f	   306: } 
TEND sourcefile_link_prefix. Go to: Beginning of routine.





M   307: V   308: /*************************************************************************++*/

jROUTINE calls_link_prefix. Go to: mNext routine in file; Routines in this file.



=    309: char *calls_link_prefix(R   310: /* Formats the prefix for a hyperlink to a routine's calls/callers.	    */   311:    312:     DEFINITION   313: 	    *aDef,o,   314: 	    /* (READ, BY ADDR):						    */=   315: 	    /* Routine definition entry to link to.			    */G   316:    317:     int	    vSameFileo,   318: 	    /* (READ, BY VAL):  					    */O   319: 	    /* Flag indicating whether this is link within same HTML file.  */*   320: P   321: )	/* Returns formatted string ptr.  WARNING: The returned ptr is the  */O   322: 	/* address of a statically-defined string buffer, so the string	    */07   323: 	/* must be read from it immediately.				    */oO   324: 	/*****************************************************************--*/F   325: 	   326: { Q   327:     static char	link[MAX_FILE_NAME + 64];   /* Link string buffer.	    */w   328: O   329:     if (!rpt_calls_enabled()) {		    /* Linking is valid only if	    */T5   330: 	return "";			    /* report generated.	    */a
   331:     }    332:     else {4   333: 	sprintf(link, "<A HREF=\"%s#c%lx\">",F   334: 	    (vSameFile ? "" : link_url(OUTFILE_SUFFIX_CALLS)), aDef);   335: 	return link;*
   336:     } 	   337: }=
OEND calls_link_prefix. Go to: Beginning of routine.

1



    338: V   339: /*************************************************************************++*/

iROUTINE xref_link_prefix. Go to: mNext routine in file; Routines in this file.



t   340: char *xref_link_prefix(TK   341: /* Formats the prefix for a hyperlink to a routine's caller		    */ )   342: /* cross-references.							    */F   343:    344:     DEFINITION   345: 	    *aDef, ,   346: 	    /* (READ, BY ADDR):						    */=   347: 	    /* Routine definition entry to link to.			    */    348:    349:     int	    vSameFile*,   350: 	    /* (READ, BY VAL):  					    */O   351: 	    /* Flag indicating whether this is link within same HTML file.  */g   352: P   353: )	/* Returns formatted string ptr.  WARNING: The returned ptr is the  */O   354: 	/* address of a statically-defined string buffer, so the string	    */"7   355: 	/* must be read from it immediately.				    */0O   356: 	/*****************************************************************--*/w   357: 	   358: { Q   359:     static char	link[MAX_FILE_NAME + 64];   /* Link string buffer.	    */8V   360:     char    outputname[MAX_FILE_NAME + 1];  /* Report file name buffer.	    */   361: O   362:     if (!rpt_xrefs_enabled()) {		    /* Linking is valid only if	    */.5   363: 	return "";			    /* report generated.	    */E
   364:     }N   365:     else {   366: 	if (!vSameFile) {&   367: 	    if (def_xreffile(aDef)) {6   368: 		sprintf(outputname, OUTFILE_SUFFIX_MOREXREF,"   369: 		    def_xreffile(aDef));   370: 	    }   371: 	    else { 2   372: 		strcpy(outputname, OUTFILE_SUFFIX_XREF);   373: 	    }
   374: 	}4   375: 	sprintf(link, "<A HREF=\"%s#x%lx\">",<   376: 	    (vSameFile ? "" : link_url(outputname)), aDef);   377: 	return link;/
   378:     })	   379: } 
NEND xref_link_prefix. Go to: Beginning of routine.





3   380: V   381: /*************************************************************************++*/

bROUTINE xref_link. Go to: mNext routine in file; Routines in this file.



    382: char *xref_link(N   383: /* Formats a hyperlink to a routine's caller cross-references.		    */   384:    385:     DEFINITION   386: 	    *aDef,1,   387: 	    /* (READ, BY ADDR):						    */=   388: 	    /* Routine definition entry to link to.			    */    389:    390:     int	    vSameFile ,   391: 	    /* (READ, BY VAL):  					    */O   392: 	    /* Flag indicating whether this is link within same HTML file.  */s   393: P   394: )	/* Returns formatted string ptr.  WARNING: The returned ptr is the  */O   395: 	/* address of a statically-defined string buffer, so the string	    */7   396: 	/* must be read from it immediately.				    */xO   397: 	/*****************************************************************--*/    398: 	   399: {*Q   400:     static char	link[MAX_FILE_NAME + 64];   /* Link string buffer.	    */N   401: O   402:     if (!rpt_xrefs_enabled()) {		    /* Linking is valid only if	    */ 5   403: 	return "";			    /* report generated.	    */ 
   404:     }_   405:     else {E   406: 	sprintf(link, "%sGoto%s", xref_link_prefix(aDef, vSameFile),*!   407: 	    xref_link_suffix());    408: 	return link;
   409:     }0	   410: }I
GEND xref_link. Go to: Beginning of routine.





n   411: V   412: /*************************************************************************++*/

kROUTINE byfile_link_prefix. Go to: mNext routine in file; Routines in this file.

a

-!   413: char *byfile_link_prefix(gQ   414: /* Formats the prefix for a hyperlink to a file's routine listing.	    */*   415:    416:     SOURCEFILE   417: 	    *aSourceFile,,   418: 	    /* (READ, BY ADDR):						    */1   419: 	    /* File entry to link to.					    */e   420:    421:     int	    vSameFilet,   422: 	    /* (READ, BY VAL):  					    */O   423: 	    /* Flag indicating whether this is link within same HTML file.  */    424: P   425: )	/* Returns formatted string ptr.  WARNING: The returned ptr is the  */O   426: 	/* address of a statically-defined string buffer, so the string	    */27   427: 	/* must be read from it immediately.				    */ O   428: 	/*****************************************************************--*/G   429: 	   430: {0Q   431:     static char	link[MAX_FILE_NAME + 64];   /* Link string buffer.	    */*   432: O   433:     if (!rpt_byfile_enabled()) {	    /* Linking is valid only if	    */e5   434: 	return "";			    /* report generated.	    */e
   435:     }l   436:     else {4   437: 	sprintf(link, "<A HREF=\"%s#f%lx\">",N   438: 	    (vSameFile ? "" : link_url(OUTFILE_SUFFIX_BYFILE)), aSourceFile);   439: 	return link;r
   440:     } 	   441: }t
PEND byfile_link_prefix. Go to: Beginning of routine.





    442: V   443: /*************************************************************************++*/

mROUTINE rpt_html_section_nav. Go to: mNext routine in file; Routines in this file.

d

	"   444: void rpt_html_section_nav(V   445: /* Writes a set of common HTML section navigation links to the report file. */T   446: /* These links go to the table of contents, and the next and previous	    */"   447: /* sections.								    */   448:    449:     FILE    *aRptFile,,   450: 	    /* (READ, BY ADDR):						    */E   451: 	    /* Report output file. Must be opened by caller.		    */p   452:    453:     HTML_SECTION_TYPE    454: 	    vSection,,   455: 	    /* (READ, BY VAL):  					    */3   456: 	    /* Section number to write.					    */;   457:    458:     int	    vLast)+   459: 	    /* (READ, BY VAL):						    */3F   460: 	    /* Flag indicating this is last entry in section.		    */   461: .   462: )	/* No return value.      					    */O   463: 	/*****************************************************************--*/*   464: 	   465: {RM   466:     char    fname[MAX_FILE_NAME + 1];	    /* File name buffer.	    */f   467: R   468:     fprintf(aRptFile, "Go to: <A HREF=\"%s#%s\">Contents</a>",(   469: 	link_url(OUTFILE_SUFFIX_FILES),2   470: 	section_anchor(mSections, MAIN_SECTION));B   471:     if (section_nextsuffix(mSections, vSection) != NULL) {K   472: 	fprintf(aRptFile, "; <A HREF=\"%s\">Next section</a>",3@   473: 	    link_url(section_nextsuffix(mSections, vSection)));
   474:     }yB   475:     if (section_prevsuffix(mSections, vSection) != NULL) {O   476: 	fprintf(aRptFile, "; <A HREF=\"%s\">Previous section</a>",e@   477: 	    link_url(section_prevsuffix(mSections, vSection)));
   478:     }t	   479: }t
REND rpt_html_section_nav. Go to: Beginning of routine.





h   480: V   481: /*************************************************************************++*/

oROUTINE rpt_html_section_title. Go to: +mNext routine in file; Routines in this file.

l

 $   482: void rpt_html_section_title(C   483: /* Writes a common HTML section title report file.			    */3   484:    485:     FILE    *aRptFile,,   486: 	    /* (READ, BY ADDR):						    */E   487: 	    /* Report output file. Must be opened by caller.		    */    488:    489:     char    *aSubTitle-   490: 	    /* (READ, BY ADDR):  					    */tO   491: 	    /* Optional subtitle string to add to title. If NULL is passed, */*:   492: 	    /* only main title will be written.				    */   493: .   494: )	/* No return value.      					    */O   495: 	/*****************************************************************--*/n   496: 	   497: {r   498:     fprintf(aRptFile,iT   499: 	"<TITLE>%s Source File Analysis%s%s</TITLE>\n", product_name(),*   500: 	(aSubTitle == NULL ? "" : " - "),/   501: 	(aSubTitle == NULL ? "" : aSubTitle)); 
   502: }	
TEND rpt_html_section_title. Go to: Beginning of routine.





    503: V   504: /*************************************************************************++*/

mROUTINE rpt_html_section_hdr. Go to: mNext routine in file; Routines in this file.



a"   505: void rpt_html_section_hdr(V   506: /* Writes a common HTML section header to the report file. This includes a  */U   507: /* title, a level-one header, and optionally navigation links to other	    */ "   508: /* sections.								    */   509:    510:     FILE    *aRptFile,,   511: 	    /* (READ, BY ADDR):						    */E   512: 	    /* Report output file. Must be opened by caller.		    */    513:    514:     HTML_SECTION_TYPEk   515: 	    vSection ,   516: 	    /* (READ, BY VAL):  					    */3   517: 	    /* Section number to write.					    */    518: .   519: )	/* No return value.      					    */O   520: 	/*****************************************************************--*/_   521: 	   522: {3?   523:     FILE    *dscfile;			    /* Description file.	    */TE   524:     char    dscbuf[256];		    /* Description file line	    */"$   525: 					    /* buffer.			    */   526:     -   527:     rpt_html_section_title(aRptFile,  P   528: 	(ismain_section(vSection) ? NULL : section_name(mSections, vSection)));   529: L   530:     if (ismain_section(vSection)) {	    /* Write main header.	    */L   531: 	fprintf(aRptFile, "<H1>%s Source File Analysis</H1>\n",   532: 	    product_name());T   533: -   534: 	if (product_description() != NULL) {lI   535: 	    if ((dscfile = fopen(product_description(), "r")) != NULL) {rB   536: 		while (fgets(dscbuf, sizeof(dscbuf), dscfile) != NULL) {&   537: 		    fputs(dscbuf, aRptFile);   538: 		}    539: 		fclose(dscfile);   540: 	    }   541: 	    else {    542: 		printf(6H   543: 		    "WARNING: Unable to open description file %s for input\n",%   544: 		    product_description());.   545: 	    }
   546: 	}   547: C   548: 	fputs("<A NAME=\"table_of_contents\">\n", aRptFile); F   549: 	fputs("<H2>Contents</H2></A>\n", aRptFile);G   550: 	fputs("The following sections contain information that was\n",r   551: 	    aRptFile);5E   552: 	fputs("generated by automated analysis of the\n", aRptFile);*J   553: 	fprintf(aRptFile, "%s source files.<P>\n", product_name());   554: )   555: 	fputs("<UL>\n", aRptFile);*!   556: 	if (rpt_files_enabled())a   557: 	    fputs("<LI> <A HREF=\"#source_files_section\">Source Files</A>\n",2   558: 		aRptFile);"   559: 	if (rpt_byfile_enabled())f   560: 	    fprintf(aRptFile, "<LI> <A HREF=\"%s\">Defined Routines By File</A>\n",+   561: 		link_url(OUTFILE_SUFFIX_BYFILE));_#   562: 	if (rpt_defined_enabled())7k   563: 	    fprintf(aRptFile, "<LI> <A HREF=\"%s\">Defined Routines Alphabetical</A>\n",o,   564: 		link_url(OUTFILE_SUFFIX_DEFLIST));%   565: 	if (rpt_undefined_enabled()) l   566: 	    fprintf(aRptFile, "<LI> <A HREF=\"%s\">External Routines Alphabetical</A>\n",.   567: 		link_url(OUTFILE_SUFFIX_UNDEFLIST));!   568: 	if (rpt_calls_enabled())ol   569: 	    fprintf(aRptFile, "<LI> <A HREF=\"%s\">Defined Routines Calls/Callers</A>\n",*   570: 		link_url(OUTFILE_SUFFIX_CALLS));!   571: 	if (rpt_xrefs_enabled())ed   572: 	    fprintf(aRptFile, "<LI> <A HREF=\"%s\">Caller Cross Reference</A>\n",)   573: 		link_url(OUTFILE_SUFFIX_XREF)); !   574: 	if (rpt_trees_enabled()) `   575: 	    fprintf(aRptFile, "<LI> <A HREF=\"%s\">Routine Call Trees</A>\n",.   576: 		link_url(OUTFILE_SUFFIX_CALLTREES));"   577: 	if (rpt_source_enabled())Y   578: 	    fprintf(aRptFile, "<LI> <A HREF=\"%s\">Source Code</A>\n",r0   579: 		link_url(OUTFILE_SUFFIX_FIRSTSOURCE));*   580: 	fputs("</UL>\n", aRptFile);   581: T   582: 	fputs("For information on the software used to generate this\n", aRptFile);O   583: 	fputs("analysis, contact Steve Branam, Network Products\n", aRptFile);4L   584: 	fputs("Support Group, Digital Equipment Corporation,\n", aRptFile);;   585: 	fputs("Littleton, MA, USA.<P>\n", aRptFile);i9   586: 	fputs("\n<HR>\n<HR>\n\n", aRptFile);*
   587:     }e9   588:     else {				    /* Write section header.	    */r5   589: 	fprintf(aRptFile, "<A NAME=\"%s\">\n",(2   590: 	    section_anchor(mSections, vSection));A   591: 	fprintf(aRptFile, "<H1>%s</H1></a>\n",/0   592: 	    section_name(mSections, vSection));5   593: 	rpt_html_section_nav(aRptFile, vSection, 0);43   594: 	fputs("</A>.<P>\n", aRptFile);*
   595:     }*	   596: }*
REND rpt_html_section_hdr. Go to: Beginning of routine.





t   597: V   598: /*************************************************************************++*/

pROUTINE rpt_html_subsection_hdr. Go to: mNext routine in file; Routines in this file.

e

p%   599: void rpt_html_subsection_hdr(	R   600: /* Writes a common HTML subsection header to the report file.  This	    */O   601: /* includes navigation links to other sections and subsections.		    */    602:    603:     FILE    *aRptFile,,   604: 	    /* (READ, BY ADDR):						    */E   605: 	    /* Report output file. Must be opened by caller.		    */	   606:    607:     HTML_SECTION_TYPE    608: 	    vSection,,   609: 	    /* (READ, BY VAL):  					    */3   610: 	    /* Section number to write.					    *//   611:    612:     void    *aNext,e,   613: 	    /* (READ, BY ADDR):						    */>   614: 	    /* Next subsection object (of any type).			    */   615:    616:     void    *aPrev,[,   617: 	    /* (READ, BY ADDR):						    */A   618: 	    /* Previous subsection object (of any type).		    */\   619: !   620:     char    *aFileSuffix,n,   621: 	    /* (READ, BY ADDR):						    */O   622: 	    /* Optional filename suffix for linking across continuation	    */ O   623: 	    /* files. If NULL is passed, next/prev links will be within	    */tO   624: 	    /* current file. Otherwise, next or prev link (whichever one is */;:   625: 	    /* NULL) is within a different file.			    */   626:    627:     int	    vFileNumbera+   628: 	    /* (READ, BY VAL):						    */tI   629: 	    /* File number for linking across continuation files.	    */iO   630: 	    /* If this is zero and aFileSuffix is non-NULL, the file name   */RO   631: 	    /* will come from the mSections table. If it is non-zero and    */*O   632: 	    /* aFileSuffix is non-NULL, aFileSuffix will be used with the   */>3   633: 	    /* number to form the name.					    */z   634: .   635: )	/* No return value.      					    */O   636: 	/*****************************************************************--*/_   637: 	   638: {sM   639:     char    fname[MAX_FILE_NAME + 1];	    /* File name buffer.	    */    640: F   641:     rpt_html_section_nav(aRptFile, vSection, (aNext == NULL));&   642:     if (aFileSuffix != NULL) {   643: 	if (vFileNumber) { 6   644: 	    sprintf(fname, aFileSuffix, vFileNumber);
   645: 	}   646: 	else {r@   647: 	    strcpy(fname, section_suffix(mSections, vSection));
   648: 	}
   649:     }iV   650:     fprintf(aRptFile, "; <A HREF=\"%s\">Beginning of section</a>",8   651: 	link_url(section_suffix(mSections, vSection)));   652:     653:     if (aNext != NULL) {W   654: 	fprintf(aRptFile, "; <A HREF=\"%s#%s%lx\">Next %s in section</a>",8:   655: 	    (aFileSuffix != NULL ? link_url(fname) : ""),;   656: 	    section_subanchor(mSections, vSection), aNext,(2   657: 	    section_objstr(mSections, vSection));
   658:     }:   659:     660:     if (aPrev != NULL) {[   661: 	fprintf(aRptFile, "; <A HREF=\"%s#%s%lx\">Previous %s in section</a>", :   662: 	    (aFileSuffix != NULL ? link_url(fname) : ""),;   663: 	    section_subanchor(mSections, vSection), aPrev,42   664: 	    section_objstr(mSections, vSection));
   665:     }t,   666:     fputs(".<P>\n", aRptFile);	   667: }o
UEND rpt_html_subsection_hdr. Go to: Beginning of routine.

5



h   668: V   669: /*************************************************************************++*/

jROUTINE rpt_html_continue. Go to: mNext routine in file; Routines in this file.



o   670: int rpt_html_continue(V   671: /* Continues an HTML report in a new output file, adding links between the  */V   672: /* files.                                                                   */   673:    674:     FILE    **aRptFile,v/   675: 	    /* (MODIFY, BY ADDR):  					    */*O   676: 	    /* Report file ptr. The current file will be linked and closed  */5O   677: 	    /* through this ptr, and the new file will be opened through    */ G   678: 	    /* it, leaving it set to the new file information.		    */u   679:        680:     HTML_SECTION_TYPE_   681: 	    vSection,,   682: 	    /* (READ, BY VAL):  					    */8   683: 	    /* Section number being reported.				    */   684:    685:     void    *aCurrent,,   686: 	    /* (READ, BY ADDR):						    */N   687: 	    /* Current subsection object (of any type) to be reported.	    */   688: #   689:     int	    vCurFileNumber,d+   690: 	    /* (READ, BY VAL):						    */s:   691: 	    /* Current file number being ended.				    */   692:     #   693:     int	    vNextFileNumber +   694: 	    /* (READ, BY VAL):						    */i9   695: 	    /* Next file number to be started.				    */    696: P   697: )	/* Returns vNextFileNumber, next file number started if successful, */3   698: 	/* or 0 if continuation failed.					    */cO   699: 	/*****************************************************************--*/t   700: 	   701: {;V   702:     char    rptname[MAX_FILE_NAME + 1];	    /* Report file name prefix.	    */V   703:     char    outputname[MAX_FILE_NAME + 1];  /* Report file name buffer.	    */   704: 3   705: 					    /* Write ending link to next    */f1   706: 					    /* object and close file.	    */sH   707:     rpt_html_subsection_hdr(*aRptFile, vSection, aCurrent, NULL,C   708: 	section_moresuffix(mSections, vSection), vNextFileNumber);    709:     fclose(*aRptFile);   710: +   711: 					    /* Open next file.		    */"W   712:     sprintf(rptname, section_moresuffix(mSections, vSection), vNextFileNumber);lK   713:     if ((*aRptFile = fopen(make_filename(outfile_prefix(), rptname, 7   714: 	report_filext(), outputname), "w")) == NULL) {rI   715: 	printf("ERROR: Unable to open %s for report output\n", rptname);E   716: 	return 0;
   717:     }e   718:     else {   719: 	if (log_enabled()) {FQ   720: 	    printf("       Continuing report section in file %s\n", outputname);l
   721: 	}3   722: 					    /* Write HTML title, starting   */l3   723: 					    /* link to previous object.	    */EN   724: 	rpt_html_section_title(*aRptFile, section_name(mSections, vSection));;   725: 	rpt_html_subsection_hdr(*aRptFile, vSection, NULL,l6   726: 	    entry_blink((LIST_ENTRY_HDR *) aCurrent),F   727: 	    section_moresuffix(mSections, vSection), vCurFileNumber);    728: 	return vNextFileNumber;
   729:     }n	   730: };
OEND rpt_html_continue. Go to: Beginning of routine.

5



n   731: V   732: /*************************************************************************++*/

mROUTINE rpt_defined_html_hdr. Go to: smNext routine in file; Routines in this file.

\

t"   733: void rpt_defined_html_hdr(L   734: /* Writes HTML-formatted report header for defined routines.		    */   735:    736:     FILE    *aRptFilew,   737: 	    /* (READ, BY ADDR):						    */E   738: 	    /* Report output file. Must be opened by caller.		    */f   739: )   740: )	/* No return value.						    */ O   741: 	/*****************************************************************--*/    742: 	   743: {WE   744:     rpt_html_section_hdr(aRptFile, DEFINED_ROUTINES_SECTION);%-   745:     fputs("<PRE>\n", aRptFile);i   746:     fputs(U   747: "========================================================================\n",n   748: 	aRptFile);o   749:     fputs(T   750: "                                                           #      Times\n",   751: 	aRptFile);    752:     fputs(U   753: "Routine                                     Line  Length   Calls  Called\n",   754: 	aRptFile);    755:     fputs(U   756: "------------------------------------------------------------------------\n",M   757: 	aRptFile);<	   758: }=
REND rpt_defined_html_hdr. Go to: Beginning of routine.





n   759: V   760: /*************************************************************************++*/

oROUTINE rpt_defined_html_entry. Go to: imNext routine in file; Routines in this file.



 $   761: void rpt_defined_html_entry(M   762: /* Writes HTML-formatted routine entry for a defined routine.		    */    763:    764:     FILE    *aRptFile,,   765: 	    /* (READ, BY ADDR):						    */E   766: 	    /* Report output file. Must be opened by caller.		    */    767:    768:     DEFINITION   769: 	    *aDef,R,   770: 	    /* (READ, BY ADDR):						    */<   771: 	    /* Routine definition entry to report.			    */   772:        773:     int	    vFirst,A+   774: 	    /* (READ, BY VAL):						    */vL   775: 	    /* Flag indicating whether this is first entry in table.	    */   776:    777:     int	    vLast,+   778: 	    /* (READ, BY VAL):						    */nK   779: 	    /* Flag indicating whether this is last entry in table.	    */i   780:     )   781: )	/* No return value.						    */ O   782: 	/*****************************************************************--*/s   783: 	   784: { V   785:     char    fullname[MAX_ROUTINE_IDENT + 1];/* Routine fullname buffer.	    */3   786: 					    /* Routine name folding buffer. */ <   787:     char    rname[RPT_HTML_ROUTINE_MEDIUM_LEN + 1]; ?   788:     int	    pos;			    /* Pos in routine name to	    */,#   789: 					    /* print.			    */    790: .   791:     strcpy(fullname, def_ident(aDef));3   792: 					    /* Get first part of rout name. */eU   793:     pos = fold_string(fullname, 0, NULL, rname, RPT_HTML_ROUTINE_MEDIUM_LEN);z   794: 					     /   795:     fprintf(aRptFile, "%-40s ", rname);/
   796: #if 0*.   797:     fprintf(aRptFile,"%s%7ld%s %7ld ",L   798: 	source_link_prefix(aDef, 0), def_begin(aDef), source_link_suffix(),   799: 	def_length(aDef)); 
   800: #else6N   801:     fprintf(aRptFile,"%7ld %7ld ", def_begin(aDef), def_length(aDef));   802: #endif3   803:     fprintf(aRptFile,"%s%7ld%s %s%7ld%s\n", K   804: 	(vLast ? "<A NAME=\"defined_routines_section_last\">" : ""),6U   805: 	def_num_calls(aDef), (vLast ? "</A>" : ""), xref_link_prefix(aDef, 0),i4   806: 	def_num_callers(aDef), xref_link_suffix());	   807: 	 /   808:     while (pos < strlen(fullname)) {_6   809: 	pos = fold_string(fullname, pos, "  ", rname,*   810: 	    RPT_HTML_ROUTINE_MEDIUM_LEN);*   811: 	fprintf(aRptFile, "%s\n", rname);
   812:     }t	   813: }5
TEND rpt_defined_html_entry. Go to: Beginning of routine.





a   814: V   815: /*************************************************************************++*/

mROUTINE rpt_defined_html_end. Go to: mNext routine in file; Routines in this file.

4

4"   816: void rpt_defined_html_end(I   817: /* Writes HTML-formatted report end for defined routines.		    */6   818:    819:     FILE    *aRptFile,,   820: 	    /* (READ, BY ADDR):						    */E   821: 	    /* Report output file. Must be opened by caller.		    */*   822:    823:     long    vTotalDef*+   824: 	    /* (READ, BY VAL):						    */>:   825: 	    /* Total number of defined routines.			    */   826: )   827: )	/* No return value.						    */ O   828: 	/*****************************************************************--*/P   829: 	   830: {n   831:     fputs(V   832: "-------------------------------------------------------------------------\n",   833: 	aRptFile); B   834:     fprintf(aRptFile, "TOTAL: %ld routines\n", vTotalDef);   835:     fputs(V   836: "=========================================================================\n",   837: 	aRptFile);eF   838:     fputs("</PRE>\n<HR>\n<HR>\n", aRptFile);	   839: } 
REND rpt_defined_html_end. Go to: Beginning of routine.





n   840: V   841: /*************************************************************************++*/

oROUTINE rpt_undefined_html_hdr. Go to: nmNext routine in file; Routines in this file.



d$   842: void rpt_undefined_html_hdr(N   843: /* Writes HTML-formatted report header for undefined routines.		    */   844:    845:     FILE    *aRptFile ,   846: 	    /* (READ, BY ADDR):						    */E   847: 	    /* Report output file. Must be opened by caller.		    */    848: )   849: )	/* No return value.						    */O   850: 	/*****************************************************************--*/   851: 	   852: {oG   853:     rpt_html_section_hdr(aRptFile, UNDEFINED_ROUTINES_SECTION);*-   854:     fputs("<PRE>\n", aRptFile);    855:     fputs(=   856: "================================================\n",m   857: 	aRptFile);7   858:     fputs(<   859: "                                          Times\n",   860: 	aRptFile);	   861:     fputs(=   862: "Routine                                   Called\n",l   863: 	aRptFile);    864:     fputs(=   865: "------------------------------------------------\n",r   866: 	aRptFile);e	   867: }x
TEND rpt_undefined_html_hdr. Go to: Beginning of routine.





7   868: V   869: /*************************************************************************++*/

qROUTINE rpt_undefined_html_entry. Go to: 7mNext routine in file; Routines in this file.

7

 &   870: void rpt_undefined_html_entry(O   871: /* Writes HTML-formatted routine entry for a undefined routine.		    */l   872:    873:     FILE    *aRptFile,,   874: 	    /* (READ, BY ADDR):						    */E   875: 	    /* Report output file. Must be opened by caller.		    */F   876:    877:     DEFINITION   878: 	    *aDef,h,   879: 	    /* (READ, BY ADDR):						    */<   880: 	    /* Routine definition entry to report.			    */   881:        882:     int	    vFirst,t+   883: 	    /* (READ, BY VAL):						    */FL   884: 	    /* Flag indicating whether this is first entry in table.	    */   885:    886:     int	    vLastt+   887: 	    /* (READ, BY VAL):						    */ K   888: 	    /* Flag indicating whether this is last entry in table.	    *//   889: )   890: )	/* No return value.						    */=O   891: 	/*****************************************************************--*/#   892: 	   893: {nV   894:     char    fullname[MAX_ROUTINE_IDENT + 1];/* Routine fullname buffer.	    */3   895: 					    /* Routine name folding buffer. */ <   896:     char    rname[RPT_HTML_ROUTINE_MEDIUM_LEN + 1]; ?   897:     int	    pos;			    /* Pos in routine name to	    */ #   898: 					    /* print.			    */e   899: -   900:     strcpy(fullname, def_name(aDef));73   901: 					    /* Get first part of rout name. */7U   902:     pos = fold_string(fullname, 0, NULL, rname, RPT_HTML_ROUTINE_MEDIUM_LEN);   903: 					     4   904:     fprintf(aRptFile,"%s%-40s%s %s%7ld%s\n",M   905: 	(vLast ? "<A NAME=\"undefined_routines_section_last\">" : ""), G   906: 	rname, (vLast ? "</A>" : ""), xref_link_prefix(aDef, 0),=4   907: 	def_num_callers(aDef), xref_link_suffix());	   908: 	 /   909:     while (pos < strlen(fullname)) { 6   910: 	pos = fold_string(fullname, pos, "  ", rname,*   911: 	    RPT_HTML_ROUTINE_MEDIUM_LEN);*   912: 	fprintf(aRptFile, "%s\n", rname);
   913:     }4	   914: })
VEND rpt_undefined_html_entry. Go to: Beginning of routine.





M   915: V   916: /*************************************************************************++*/

oROUTINE rpt_undefined_html_end. Go to: *mNext routine in file; Routines in this file.

i

l$   917: void rpt_undefined_html_end(K   918: /* Writes HTML-formatted report end for undefined routines.		    */h   919:    920:     FILE    *aRptFile,,   921: 	    /* (READ, BY ADDR):						    */E   922: 	    /* Report output file. Must be opened by caller.		    */4   923:    924:     long    vTotalUndefR+   925: 	    /* (READ, BY VAL):						    */e<   926: 	    /* Total number of undefined routines.			    */   927: )   928: )	/* No return value.						    */0O   929: 	/*****************************************************************--*/t   930: 	   931: {    932:     fputs(=   933: "------------------------------------------------\n",*   934: 	aRptFile);lD   935:     fprintf(aRptFile, "TOTAL: %ld routines\n", vTotalUndef);   936:     fputs(=   937: "================================================\n",    938: 	aRptFile); F   939:     fputs("</PRE>\n<HR>\n<HR>\n", aRptFile);	   940: }v
TEND rpt_undefined_html_end. Go to: Beginning of routine.





3   941: V   942: /*************************************************************************++*/

kROUTINE rpt_calls_html_hdr. Go to: mNext routine in file; Routines in this file.



1    943: void rpt_calls_html_hdr(V   944: /* Writes HTML-formatted report header for defined routine calls/callers    */   945: /* table.								    */_   946:    947:     FILE    *aRptFile,,   948: 	    /* (READ, BY ADDR):						    */E   949: 	    /* Report output file. Must be opened by caller.		    */,   950:    951:     DEFINITION   952: 	    *aDef,   953: 	    /* (READ, BY ADDR):						    */<   954: 	    /* Routine definition entry to report.			    */   955:     )   956: )	/* No return value.						    */fO   957: 	/*****************************************************************--*/N   958: 	   959: {sB   960:     rpt_html_section_hdr(aRptFile, CALLS_CALLERS_SECTION);.   961:     fputs("<HR>\n\n", aRptFile);   962:    963:     fprintf(aRptFile,nJ   964:     "<TABLE>(%s Calls/Caller Routines)\n", def_ident(aDef));E   965:     fputs("<TABLE_ATTRIBUTES>(MULTIPAGE)\n", aRptFile);TC   966:     fputs("<TABLE_SETUP>(4\\20\\5\\20)\n", aRptFile);;U   967:     fputs("<TABLE_HEADS>(Calls Routine\\Line\\Caller Routine\\Line)\n",4   968: 	aRptFile);u	   969: }>
PEND rpt_calls_html_hdr. Go to: Beginning of routine.





*   970: V   971: /*************************************************************************++*/

mROUTINE rpt_calls_html_entry. Go to: smNext routine in file; Routines in this file.



i"   972: void rpt_calls_html_entry(Q   973: /* Writes HTML-formatted calls/caller entry for a defined routine.	    */    974:    975:     FILE    *aRptFile,,   976: 	    /* (READ, BY ADDR):						    */E   977: 	    /* Report output file. Must be opened by caller.		    */    978:    979:     REFERENCEo   980: 	    *aCalled,,   981: 	    /* (READ, BY ADDR):						    */O   982: 	    /* Called routine reference entry to report. If NULL is passed, */P:   983: 	    /* only a caller is being reported.				    */   984:        985:     REFERENCE-   986: 	    *aCaller-,   987: 	    /* (READ, BY ADDR):						    */O   988: 	    /* Caller routine reference entry to report. If NULL is passed, */ A   989: 	    /* only a called routine is being reported.			    */=   990:     )   991: )	/* No return value.						    *//O   992: 	/*****************************************************************--*/e   993: 	   994: { 4   995:     fprintf(aRptFile, "<TABLE_ROW>(");"   996:     if (aCalled == NULL) {#   997: 	fprintf(aRptFile, "\\\\");*
   998:     }*   999:     else {J  1000: 	fprintf(aRptFile, "%s\\%ld\\", def_name(ref_definition(aCalled)),"  1001: 	    ref_offset(aCalled));
  1002:     }E"  1003:     if (aCaller == NULL) {$  1004: 	fprintf(aRptFile, "\\)\n");
  1005:     }s  1006:     else {G  1007: 	fprintf(aRptFile, "%s\\%ld)\n", def_name(ref_caller(aCaller)),d"  1008: 	    ref_offset(aCaller));
  1009:     }8	  1010: }5
REND rpt_calls_html_entry. Go to: Beginning of routine.





e  1011: V  1012: /*************************************************************************++*/

kROUTINE rpt_calls_html_end. Go to: cmNext routine in file; Routines in this file.

p

    1013: void rpt_calls_html_end(S  1014: /* Writes HTML-formatted report end for defined routine calls/caller	    */   1015: /* table.								    */   1016:   1017:     FILE    *aRptFile,,  1018: 	    /* (READ, BY ADDR):						    */E  1019: 	    /* Report output file. Must be opened by caller.		    */  1020:   1021:     DEFINITION  1022: 	    *aDef,  1023: 	    /* (READ, BY ADDR):						    */<  1024: 	    /* Routine definition entry to report.			    */  1025:     )  1026: )	/* No return value.						    */8O  1027: 	/*****************************************************************--*//  1028: 	  1029: {=P  1030:     fputs("<TABLE_ROW>(<SPAN>(4)<RULE>)\n", aRptFile);a  1031:     fprintf(aRptFile, "<TABLE_ROW>(<EMPHASIS>(TOTAL CALLS: %ld\\BOLD)\\\\\n",_  1032: 	def_num_calls(aDef));\  1033:     fprintf(aRptFile, "            <EMPHASIS>(TOTAL CALLERS: %ld\\BOLD)\\)\n",   1034: 	def_num_callers(aDef));4  1035:     fputs("<ENDTABLE>\n\n", aRptFile);	  1036: } 
PEND rpt_calls_html_end. Go to: Beginning of routine.





   1037: V  1038: /*************************************************************************++*/

jROUTINE rpt_xref_html_hdr. Go to: mNext routine in file; Routines in this file.



   1039: void rpt_xref_html_hdr(8K  1040: /* Writes HTML-formatted report header for cross reference.		    */t  1041:   1042:     FILE    *aRptFile,  1043: 	    /* (READ, BY ADDR):						    */E  1044: 	    /* Report output file. Must be opened by caller.		    */*  1045: )  1046: )	/* No return value.						    */hO  1047: 	/*****************************************************************--*/   1048: 	  1049: {a@  1050:     rpt_html_section_hdr(aRptFile, CALLER_XREF_SECTION);.  1051:     fputs("<HR>\n\n", aRptFile);	  1052: }n
OEND rpt_xref_html_hdr. Go to: Beginning of routine.

c



d  1053: V  1054: /*************************************************************************++*/

lROUTINE rpt_xref_html_entry. Go to: mNext routine in file; Routines in this file.

v

"!  1055: void rpt_xref_html_entry((O  1056: /* Writes HTML-formatted cross-reference sections for a routine.	    */9  1057:   1058:     FILE    *aRptFile,,  1059: 	    /* (READ, BY ADDR):						    */E  1060: 	    /* Report output file. Must be opened by caller.		    */n  1061:   1062:     DEFINITION  1063: 	    *aDef,),  1064: 	    /* (READ, BY ADDR):						    */<  1065: 	    /* Routine definition entry to report.			    */  1066:   1067:     int	    vFirst,*+  1068: 	    /* (READ, BY VAL):						    */*J  1069: 	    /* Flag indicating this is first entry being reported.	    */  1070:   1071:     int	    vLasti+  1072: 	    /* (READ, BY VAL):						    */8I  1073: 	    /* Flag indicating this is last entry being reported.	    */h  1074:     )  1075: )	/* No return value.						    */_O  1076: 	/*****************************************************************--*/h  1077: 	  1078: { :  1079:     REFERENCE				    /* Current caller ref.	    */  1080: 	    *caller; V  1081:     char    fullname[MAX_ROUTINE_IDENT + 1];/* Routine fullname buffer.	    */3  1082: 					    /* Routine name folding buffer. */*:  1083:     char    rname[RPT_HTML_ROUTINE_WIDE_LEN + 1]; B  1084:     int	    rpos;			    /* Pos in routine name to print.*/  1085: h  1086:     fprintf(aRptFile, "<H2><A NAME=\"x%lx\">%s</A> - ", aDef, def_name(aDef));*  1087:     if (isdefined_routine(aDef)) {A  1088: 	fprintf(aRptFile, "%s%s%s", source_link_prefix(aDef, 0),iB  1089: 	    source_name(def_source(aDef)), source_link_suffix());
  1090:     }=  1091:     else {%  1092: 	fputs("External", aRptFile);l
  1093:     } <  1094:     fputs("</H2><H3>Callers", aRptFile);-  1095:     if (def_num_callers(aDef) == 0) { C  1096: 	fputs(": No callers</H3>\n<PRE>\n", aRptFile);3
  1097:     }9  1098:     else {7  1099: 	fputs("</H3>\n<PRE>\n", aRptFile);*,  1100: 	fprintf(aRptFile, "%ld caller%s\n",M  1101: 	    def_num_callers(aDef), (def_num_callers(aDef) == 1 ? "" : "s"));  1102: 3  1103: 					    /* Write entry for each caller. */i5  1104: 	for (caller = list_first(def_callers(aDef));1  1105: 	    caller != NULL;+  1106: 	    caller = next_entry(caller)) { =  1107: 	    strcpy(fullname, def_ident(ref_caller(caller)));e
  1108: 	    _0  1109: 						/* Get first part of rout name. */9  1110: 	    rpos = fold_string(fullname, 0, NULL, rname,o%  1111: 		RPT_HTML_ROUTINE_WIDE_LEN);r=  1112: 	    fprintf(aRptFile, "%5c+ %-48s %s\n", ' ', rname,f'  1113: 		xref_link(ref_caller(caller), I  1114: 		    (def_xreffile(aDef) == def_xreffile(ref_caller(caller))))); V  1115: 	    while (rpos < strlen(fullname)) {   /* Write rest of routine name.  */;  1116: 		rpos = fold_string(fullname, rpos, "    ", rname, )  1117: 		    RPT_HTML_ROUTINE_WIDE_LEN);l3  1118: 		fprintf(aRptFile, "%5c%s\n", ' ', rname);&  1119: 	    }
  1120: 	}
  1121:     } *  1122:     if (isdefined_routine(aDef)) {<  1123: 	fputs("</PRE><H3>Call Tree", aRptFile);(  1124: 	if (def_num_calls(aDef) == 0) {+  1125: 	    fputs(": No calls", aRptFile);B
  1126: 	}*  1127: 	fputs("</H3>\n", aRptFile);
  1128:     }E+  1129:     if (def_num_calls(aDef) != 0) {e*  1130: 	fputs("<PRE>\n", aRptFile);
  1131:     }   1132:     else {)  1133: 	fputs("<HR>\n", aRptFile);u
  1134:     }H	  1135: }
QEND rpt_xref_html_entry. Go to: Beginning of routine.

*



H  1136: V  1137: /*************************************************************************++*/

jROUTINE rpt_xref_html_end. Go to: mNext routine in file; Routines in this file.



   1138: void rpt_xref_html_end(5O  1139: /* Writes HTML-formatted report end for caller cross-reference.		    */   1140:   1141:     FILE    *aRptFile,,  1142: 	    /* (READ, BY ADDR):						    */E  1143: 	    /* Report output file. Must be opened by caller.		    */   1144:   1145:     long    vTotalDefr+  1146: 	    /* (READ, BY VAL):						    */3  1147: 	    /* Total number of routines.				    */   1148: )  1149: )	/* No return value.						    */ O  1150: 	/*****************************************************************--*/r  1151: 	  1152: {tV  1153:     fputs("----------------------------------------------------\n", aRptFile);B  1154:     fprintf(aRptFile, "TOTAL: %ld routines\n", vTotalDef);V  1155:     fputs("====================================================\n", aRptFile);F  1156:     fputs("</PRE>\n<HR>\n<HR>\n", aRptFile);	  1157: }6
OEND rpt_xref_html_end. Go to: Beginning of routine.

9



  1158: V  1159: /*************************************************************************++*/

jROUTINE rpt_tree_html_hdr. Go to: mNext routine in file; Routines in this file.

o

C  1160: void rpt_tree_html_hdr( T  1161: /* Writes HTML-formatted report header for defined routine call tree.	    */  1162:   1163:     FILE    *aRptFile,,  1164: 	    /* (READ, BY ADDR):						    */E  1165: 	    /* Report output file. Must be opened by caller.		    */N  1166:   1167:     DEFINITION  1168: 	    *aDef,a,  1169: 	    /* (READ, BY ADDR):						    */<  1170: 	    /* Routine definition entry to report.			    */  1171:       1172:     int	    vFirst,0+  1173: 	    /* (READ, BY VAL):						    */eC  1174: 	    /* Flag indicating whether this is first tree.		    */  1175:   1176:     int	    vLast0+  1177: 	    /* (READ, BY VAL):						    */ B  1178: 	    /* Flag indicating whether this is last tree.		    */  1179:     )  1180: )	/* No return value.						    */1O  1181: 	/*****************************************************************--*//  1182: 	  1183: {t  1184:     if (vFirst) {o<  1185: 	rpt_html_section_hdr(aRptFile, CALL_TREES_SECTION);+  1186: 	fputs("<HR>\n\n", aRptFile);*
  1187:     }*  1188: i  1189:     fprintf(aRptFile, "<H2><A NAME=\"t%lx\">%s</a> %sCall Tree%s</H2>\n",\  1190: 	aDef, def_ident(aDef),tM  1191: 	(vLast ? "<A NAME=\"routine_call_trees_section_last\">" : ""),_&  1192: 	(vLast ? "</A>" : ""));A  1193:     rpt_html_subsection_hdr(aRptFile, CALL_TREES_SECTION,:*  1194: 	(vLast ? NULL : next_tree(aDef)),5  1195: 	(vFirst ? NULL : prev_tree(aDef)), NULL, 0);t-  1196:     fputs("<PRE>\n", aRptFile);e	  1197: }<
OEND rpt_tree_html_hdr. Go to: Beginning of routine.

*



*  1198: V  1199: /*************************************************************************++*/

lROUTINE rpt_tree_html_entry. Go to: mNext routine in file; Routines in this file.



 !  1200: void rpt_tree_html_entry(dN  1201: /* Writes HTML-formatted call tree line for a defined routine.		    */  1202:   1203:     FILE    *aRptFile,,  1204: 	    /* (READ, BY ADDR):						    */E  1205: 	    /* Report output file. Must be opened by caller.		    */   1206:   1207:     REFERENCE*  1208: 	    *aRef,*,  1209: 	    /* (READ, BY ADDR):						    */N  1210: 	    /* Reference to routine definition entry to report.       	    */  1211:   1212:     int	    vLevel,e+  1213: 	    /* (READ, BY VAL):						    */.A  1214: 	    /* Nesting level, used to space indentation.		    */P  1215:   1216:     int	    vExpanded,+  1217: 	    /* (READ, BY VAL):						    */*N  1218: 	    /* Flag indicating whether or not routine has already been	    */5  1219: 	    /* expanded in this call tree.				    */   1220:   1221:     int	    vRecursive+  1222: 	    /* (READ, BY VAL):						    */nH  1223: 	    /* Flag indicating whether or not routine is called		    */(  1224: 	    /* recursively.						    */  1225: )  1226: )	/* No return value.						    */ O  1227: 	/*****************************************************************--*/   1228: 	  1229: {e>  1230:     int	    lcount;			    /* Level print count.	    */  1231: <  1232:     for (lcount = vLevel; lcount > 1; lcount--) {!  1233: 	fputs("|   ", aRptFile);i
  1234:     }o   1235:     if (lcount > 0) {G  1236: 	fprintf(aRptFile, "%c   ", (isend_of_list(aRef) ? '+' : '|')); 
  1237:     }d  1238:     if (vLevel == 0) {
  1239: #if 0 %  1240: 	fprintf(aRptFile,"%s%s%s: ",i9  1241: 	    source_link_prefix(ref_definition(aRef), 0), C  1242: 	    def_name(ref_definition(aRef)), source_link_suffix());40  1243: 	fprintf(aRptFile, "%s%ld caller%s%s\n",7  1244: 	    xref_link_prefix(ref_definition(aRef), 0),*3  1245: 	    def_num_callers(ref_definition(aRef)),9E  1246: 	    (def_num_callers(ref_definition(aRef)) == 1 ? "" : "s"),l!  1247: 	    xref_link_suffix());M
  1248: #elseTB  1249: 	fprintf(aRptFile,"%s\n", def_name(ref_definition(aRef)));  1250: #endif
  1251:     }03  1252: 					    /* If routine is not going to   */ 3  1253: 					    /* be expanded here, add an	    */aO  1254:     else if (vExpanded || vRecursive ||	    /* explanation code.	    */%4  1255: 	!isdefined_routine(ref_definition(aRef))) {)  1256: 	fprintf(aRptFile, "%s (%s%s%s)",0,  1257: 	    def_name(ref_definition(aRef)),,  1258: 	    (vExpanded ? "Duplicate" : ""),-  1259: 	    (vRecursive ? "Recursive" : ""), K  1260: 	    (!isdefined_routine(ref_definition(aRef)) ? "External" : "")); 
  1261:     } 
  1262: #if 023  1263: 					    /* Separate tree gets link.	    */e[  1264:     else if (needs_tree(ref_definition(aRef)) && !tree_inline_disabled()) {l1  1265: 	fprintf(aRptFile, "%s %s(Separate)%s\n",f,  1266: 	    def_name(ref_definition(aRef)),L  1267: 	    xref_link_prefix(ref_definition(aRef), 0), xref_link_suffix());
  1268:     }c
  1269: #else X  1270:     else if (needs_tree(ref_definition(aRef)) && !tree_inline_disabled()&  1271: 	|| vLevel == max_tree_depth()E  1272: 	    && def_num_calls(ref_definition(aRef)) > 0) {cL  1273: 	fprintf(aRptFile, "%s (Separate)", def_name(ref_definition(aRef)));
  1274:     }   1275: #endif
  1276: #if 0f>  1277:     else if (def_root(ref_definition(aRef)) == NULL) {3  1278: 					    /* This is the first inline	    */ 3  1279: 					    /* expansion of a routine, make */r)  1280: 					    /* it an anchor.		    */eW  1281: 	fprintf(aRptFile, "<A NAME=\"t%lx\">%s</a>", ref_definition(aRef), -  1282: 	    def_name(ref_definition(aRef)));W
  1283:     }u  1284: #endif<  1285:     else {				    /* Otherwise, format plain.	    */A  1286: 	fprintf(aRptFile, "%s", def_name(ref_definition(aRef)));i
  1287:     }'   1288:     if (vLevel > 0) {H  1289: 	fprintf(aRptFile, " %s\n", xref_link(ref_definition(aRef), 0));
  1290:     }P	  1291: }3
QEND rpt_tree_html_entry. Go to: Beginning of routine.





p  1292: V  1293: /*************************************************************************++*/

jROUTINE rpt_tree_html_end. Go to: mNext routine in file; Routines in this file.

#

8  1294: void rpt_tree_html_end(R  1295: /* Writes HTML-formatted section end for defined routine call tree.	    */  1296:   1297:     FILE    *aRptFile,,  1298: 	    /* (READ, BY ADDR):						    */E  1299: 	    /* Report output file. Must be opened by caller.		    */1  1300:   1301:     DEFINITION  1302: 	    *aDef,n,  1303: 	    /* (READ, BY ADDR):						    */<  1304: 	    /* Routine definition entry to report.			    */  1305:   1306:     int	    vFirst,r+  1307: 	    /* (READ, BY VAL):						    */EC  1308: 	    /* Flag indicating whether this is first tree.		    */   1309:   1310:     int	    vLastp+  1311: 	    /* (READ, BY VAL):						    */ B  1312: 	    /* Flag indicating whether this is last tree.		    */  1313:     )  1314: )	/* No return value.						    */1O  1315: 	/*****************************************************************--*/*  1316: 	  1317: {*-  1318:     fputs("END OF TREE\n", aRptFile);t<  1319:     fputs("</PRE>\n<HR>\n\n", aRptFile);	  1320: }\
OEND rpt_tree_html_end. Go to: Beginning of routine.

5



=  1321: V  1322: /*************************************************************************++*/

lROUTINE rpt_byfile_html_hdr. Go to: mNext routine in file; Routines in this file.

*

*!  1323: void rpt_byfile_html_hdr(dV  1324: /* Writes HTML-formatted report header for defined routines by file table.  */  1325:   1326:     FILE    *aRptFile,,  1327: 	    /* (READ, BY ADDR):						    */E  1328: 	    /* Report output file. Must be opened by caller.		    */r  1329:   1330:     SOURCEFILE  1331: 	    *aSourceFile,,  1332: 	    /* (READ, BY ADDR):						    */6  1333: 	    /* Source file entry to report.				    */  1334:   1335:     int	    vFirst,t+  1336: 	    /* (READ, BY VAL):						    */D  1337: 	    /* Flag indicating whether this is first table.		    */  1338:   1339:     int	    vLast0+  1340: 	    /* (READ, BY VAL):						    */	C  1341: 	    /* Flag indicating whether this is last table.		    */   1342:     )  1343: )	/* No return value.						    */tO  1344: 	/*****************************************************************--*/   1345: 	  1346: {B  1347:     if (vFirst) {8B  1348: 	rpt_html_section_hdr(aRptFile, ROUTINES_BY_FILE_SECTION);+  1349: 	fputs("<HR>\n\n", aRptFile); 
  1350:     }/  1351: h  1352:     fprintf(aRptFile, "<H2><A NAME=\"f%lx\">%s</a> %sRoutines%s</H2>\n",/  1353: 	aSourceFile, source_name(aSourceFile),LK  1354: 	(vLast ? "<A NAME=\"routines_by_file_section_last\">" : ""),*&  1355: 	(vLast ? "</A>" : ""));G  1356:     rpt_html_subsection_hdr(aRptFile, ROUTINES_BY_FILE_SECTION,\:  1357: 	(vLast ? NULL : next_defining_file(aSourceFile)),E  1358: 	(vFirst ? NULL : prev_defining_file(aSourceFile)), NULL, 0);L-  1359:     fputs("<PRE>\n", aRptFile);lN  1360:     fputs("=======================================================\n",  1361: 	aRptFile);(M  1362:     fputs("                                          #      Times\n",,  1363: 	aRptFile); N  1364:     fputs("Routine                    Line  Length   Calls  Called\n",  1365: 	aRptFile);PN  1366:     fputs("-------------------------------------------------------\n",  1367: 	aRptFile);/	  1368: }>
QEND rpt_byfile_html_hdr. Go to: Beginning of routine.

_



   1369: V  1370: /*************************************************************************++*/

nROUTINE rpt_byfile_html_entry. Go to: mNext routine in file; Routines in this file.

2

 #  1371: void rpt_byfile_html_entry(dM  1372: /* Writes HTML-formatted entry for a defined routine by file.		    */   1373:   1374:     FILE    *aRptFile,,  1375: 	    /* (READ, BY ADDR):						    */E  1376: 	    /* Report output file. Must be opened by caller.		    */l  1377:   1378:     DEFINITION  1379: 	    *aDef,4,  1380: 	    /* (READ, BY ADDR):						    */<  1381: 	    /* Routine definition entry to report.			    */  1382:   1383:     int	    vFirst,*+  1384: 	    /* (READ, BY VAL):						    */nL  1385: 	    /* Flag indicating whether this is first entry in table.	    */  1386:   1387:     int	    vLastn+  1388: 	    /* (READ, BY VAL):						    */AK  1389: 	    /* Flag indicating whether this is last entry in table.	    */a  1390:     )  1391: )	/* No return value.						    */ O  1392: 	/*****************************************************************--*/*  1393: 	  1394: {*C  1395:     char    anchor[32]; 		    /* Anchor name buffer.	    */ 3  1396: 					    /* Routine name folding buffer. */ 8  1397:     char    rname[RPT_HTML_FILE_FIELD_LEN + 1]; ?  1398:     int	    pos;			    /* Pos in routine name to	    */ #  1399: 					    /* print.			    */r  1400: :  1401:     if (vLast) {			    /* Form anchor name.	    */K  1402: 	sprintf(anchor, "<A NAME=\"f%lx_last\">", def_source(aDef));F
  1403:     }i3  1404: 					    /* Get first part of rout name. */)=  1405:     pos = fold_string(def_name(aDef), 0, NULL, rname,k%  1406: 	RPT_HTML_ROUTINE_FIELD_LEN);,  1407: #if 0					    .  1408:     fprintf(aRptFile, "%s%-23s%s %s ",C  1409: 	(vLast ? anchor : ""), rname, (vLast ? "</A>" : ""),6  1410: 	tree_link(aDef, 0));i
  1411: #else=+  1412:     fprintf(aRptFile, "%s%-23s%s ",iD  1413: 	(vLast ? anchor : ""), rname, (vLast ? "</A>" : ""));  1414: #endif.  1415:     fprintf(aRptFile,"%s%7ld%s %7ld ",L  1416: 	source_link_prefix(aDef, 0), def_begin(aDef), source_link_suffix(),  1417: 	def_length(aDef)); )  1418:     fprintf(aRptFile,"%s%7ld%s ",*O  1419: 	calls_link_prefix(aDef, 0), def_num_calls(aDef), calls_link_suffix());*  1420:     fprintf(aRptFile,"%s%7ld%s\n",O  1421: 	xref_link_prefix(aDef, 0), def_num_callers(aDef), xref_link_suffix());e	  1422: 	 5  1423:     while (pos < strlen(def_name(aDef))) { <  1424: 	pos = fold_string(def_name(aDef), pos, "  ", rname,)  1425: 	    RPT_HTML_ROUTINE_FIELD_LEN);3*  1426: 	fprintf(aRptFile, "%s\n", rname);
  1427:     } 	  1428: }e
SEND rpt_byfile_html_entry. Go to: Beginning of routine.

l



a  1429: V  1430: /*************************************************************************++*/

lROUTINE rpt_byfile_html_end. Go to: mNext routine in file; Routines in this file.

_

e!  1431: void rpt_byfile_html_end(2U  1432: /* Writes HTML-formatted report end for defined routine by file table.	    */   1433:   1434:     FILE    *aRptFile,,  1435: 	    /* (READ, BY ADDR):						    */E  1436: 	    /* Report output file. Must be opened by caller.		    */   1437:   1438:     SOURCEFILE  1439: 	    *aSourceFile,,  1440: 	    /* (READ, BY ADDR):						    */6  1441: 	    /* Source file entry to report.				    */  1442:       1443:     int	    vFirst,e+  1444: 	    /* (READ, BY VAL):						    */eD  1445: 	    /* Flag indicating whether this is first table.		    */  1446:   1447:     int	    vLastm+  1448: 	    /* (READ, BY VAL):						    */ C  1449: 	    /* Flag indicating whether this is last table.		    */r  1450:     )  1451: )	/* No return value.						    */1O  1452: 	/*****************************************************************--*/o  1453: 	  1454: {N  1455:     fputs("-------------------------------------------------------\n",  1456: 	aRptFile);+J  1457:     fprintf(aRptFile, "TOTAL: %5ld ROUTINES           %7ld AVG\n",C  1458: 	source_routines(aSourceFile), source_avglen(aSourceFile));NN  1459:     fputs("=======================================================\n",  1460: 	aRptFile);2_  1461:     fprintf(aRptFile, "</PRE>\n<HR>\n%s\n", (vLast ? "<HR>\n" : ""));l	  1462: } 
QEND rpt_byfile_html_end. Go to: Beginning of routine.





/  1463: V  1464: /*************************************************************************++*/

jROUTINE rpt_file_html_hdr. Go to: mNext routine in file; Routines in this file.

i

n  1465: void rpt_file_html_hdr( H  1466: /* Writes HTML-formatted report header for source files.		    */  1467:   1468:     FILE    *aRptFilec,  1469: 	    /* (READ, BY ADDR):						    */E  1470: 	    /* Report output file. Must be opened by caller.		    */*  1471: )  1472: )	/* No return value.						    */*O  1473: 	/*****************************************************************--*/   1474: 	  1475: {/  1476:     /*+									    */U  1477:     /*	This file is the main analysis HTML file, so first write the main   */oA  1478:     /*	document header, then the section header.			    */*  1479:     /*-									    */  1480: =  1481:     rpt_html_section_hdr(aRptFile, MAIN_SECTION);    AE  1482:     rpt_html_section_hdr(aRptFile, SOURCE_FILES_SECTION);    G  1483:     -  1484:     fputs("<PRE>\n", aRptFile);F  1485:     fputs(\  1486: "===============================================================================\n",  1487: 	aRptFile);r  1488:     fputs(X  1489: "                                 Com-    State-   Rou-              Avg   #\n",  1490: 	aRptFile);	  1491:     fputs(\  1492: "File                      Lines  mented    ment   tines  Length     Len   Calls\n",  1493: 	aRptFile);c  1494:     fputs(\  1495: "-------------------------------------------------------------------------------\n",  1496: 	aRptFile);		  1497: }t
OEND rpt_file_html_hdr. Go to: Beginning of routine.

h



a  1498: V  1499: /*************************************************************************++*/

lROUTINE rpt_file_html_entry. Go to: mNext routine in file; Routines in this file.



 !  1500: void rpt_file_html_entry(_=  1501: /* Writes HTML-formatted source file entry.				    */s  1502:   1503:     FILE    *aRptFile,,  1504: 	    /* (READ, BY ADDR):						    */E  1505: 	    /* Report output file. Must be opened by caller.		    */n  1506:   1507:     SOURCEFILE  1508: 	    *aSourceFile,,  1509: 	    /* (READ, BY ADDR):						    */6  1510: 	    /* Source file entry to report.				    */  1511:   1512:     int	    vFirst,_+  1513: 	    /* (READ, BY VAL):						    */3L  1514: 	    /* Flag indicating whether this is first entry in table.	    */  1515:   1516:     int	    vLast +  1517: 	    /* (READ, BY VAL):						    */,K  1518: 	    /* Flag indicating whether this is last entry in table.	    */=  1519:     )  1520: )	/* No return value.						    */ O  1521: 	/*****************************************************************--*/  1522: 	  1523: {u3  1524: 					    /* File name folding buffer.    */n8  1525:     char    fname[RPT_HTML_FILE_FIELD_LEN + 1]; A  1526:     int	    pos;			    /* Pos in file name to print.   *//  1527:   1528:     /*+									    */U  1529:     /*	The file name may have to be folded over multiple lines. Embed a    */U  1530:     /*	hyperlink to the routines table for this file, and an anchor to the */C  1531:     /*	line if it is the last entry in this table.			    */2  1532:     /*-									    */  1533: 3  1534: 					    /* Get first part of file name. */  1538:     fprintf(aRptFile, "%s%-23s%s %s%7ld%s %7ld %7ld ",G  1539: 	(vLast ? "<A NAME=\"source_files_section_last\">" : ""),AQ  1540: 	fname, (vLast ? "</A>" : ""), sourcefile_link_prefix(aSourceFile),l9  1541: 	source_lines(aSourceFile), source_link_suffix(), B  1542: 	source_comments(aSourceFile) + source_mixed(aSourceFile),E  1543: 	source_statements(aSourceFile) + source_mixed(aSourceFile)); :  1544:     fprintf(aRptFile, "%s%7ld%s %7ld %7ld %7ld\n",R  1545: 	(source_routines(aSourceFile) > 0 ? byfile_link_prefix(aSourceFile, 0)  1546: 	    : ""),n&  1547: 	source_routines(aSourceFile),K  1548: 	(source_routines(aSourceFile) > 0 ? byfile_link_suffix() : ""),y%  1549: 	source_rlength(aSourceFile),1@  1550: 	source_avglen(aSourceFile), source_calls(aSourceFile));  1551: ?  1552:     while (pos < strlen(source_name(aSourceFile))) {F  1553: 	pos = fold_string(source_name(aSourceFile), pos, "  ", fname,&  1554: 	    RPT_HTML_FILE_FIELD_LEN);*  1555: 	fprintf(aRptFile, "%s\n", fname);
  1556:     }E	  1557: } 
QEND rpt_file_html_entry. Go to: Beginning of routine.





4  1558: V  1559: /*************************************************************************++*/

jROUTINE rpt_file_html_end. Go to: mNext routine in file; Routines in this file.



   1560: void rpt_file_html_end( F  1561: /* Writes HTML-formatted report end for source files.			    */  1562:   1563:     FILE    *aRptFile,,  1564: 	    /* (READ, BY ADDR):						    */E  1565: 	    /* Report output file. Must be opened by caller.		    */&  1566:   1567:     long    vTotalFiles +  1568: 	    /* (READ, BY VAL):						    */67  1569: 	    /* Total number of source files.				    */i  1570: )  1571: )	/* No return value.						    */ O  1572: 	/*****************************************************************--*/l  1573: 	  1574: {s  1575:     fputs(\  1576: "-------------------------------------------------------------------------------\n",  1577: 	aRptFile);e	  1578: 	   1579:     fprintf(aRptFile,tH  1580:     "TOTAL: %7ld files    %7ld %7ld %7ld %7ld %7ld %7ld %7ld\n",%  1581: 	vTotalFiles, total_lines(), TN  1582: 	total_comments() + total_mixed(), total_statements() + total_mixed(),K  1583: 	total_routines(), total_rlength(), total_avglen(), total_calls());n	  1584: 	t  1585:     fputs(\  1586: "===============================================================================\n",  1587: 	aRptFile);>H  1588:     fputs("</PRE>\n<HR>\n<HR>\n\n", aRptFile);	  1589: }i
OEND rpt_file_html_end. Go to: Beginning of routine.

e



e  1590: V  1591: /*************************************************************************++*/

lROUTINE rpt_source_html_hdr. Go to: mNext routine in file; Routines in this file.

7

4!  1592: void rpt_source_html_hdr(SP  1593: /* Writes HTML-formatted report header for annotated source file.	    */  1594:   1595:     FILE    *aRptFile,,  1596: 	    /* (READ, BY ADDR):						    */E  1597: 	    /* Report output file. Must be opened by caller.		    */e  1598:   1599:     SOURCEFILE  1600: 	    *aSourceFile,,  1601: 	    /* (READ, BY ADDR):						    */6  1602: 	    /* Source file entry to report.				    */  1603:   1604:     int	    vFirst,4+  1605: 	    /* (READ, BY VAL):						    */2D  1606: 	    /* Flag indicating whether this is first table.		    */  1607:   1608:     int	    vLast +  1609: 	    /* (READ, BY VAL):						    */-C  1610: 	    /* Flag indicating whether this is last table.		    */t  1611:     )  1612: )	/* No return value.						    */8O  1613: 	/*****************************************************************--*/(  1614: 	  1615: {=?  1616:     REFERENCE				    /* Current routine reference.   */4  1617: 	    *curref;e  1618:   1619:     if (vFirst) {v=  1620: 	rpt_html_section_hdr(aRptFile, SOURCE_CODE_SECTION);i+  1621: 	fputs("<HR>\n\n", aRptFile);n
  1622:     }<  1623: G  1624:     rpt_html_section_title(aRptFile, source_name(aSourceFile));*g  1625:     fprintf(aRptFile, "<H2><A NAME=\"s%lx\">%s</a> Source Code</H2>\n",00  1626: 	aSourceFile, source_name(aSourceFile));B  1627:     rpt_html_subsection_hdr(aRptFile, SOURCE_CODE_SECTION,2  1628: 	(vLast ? NULL : next_entry(aSourceFile)),J  1629: 	(vFirst ? NULL : prev_entry(aSourceFile)), OUTFILE_SUFFIX_SOURCE,"  1630: 	source_seq(aSourceFile));  1631:     fputs(x  1632: "<H3><A NAME=\"routines_in_this_file\">Routines In This File (Alphabetical)</a></H3>\n",  1633: 	aRptFile);1  1634:     -  1635:     fputs("<PRE>\n", aRptFile);*4  1636:     if (source_routines(aSourceFile) == 0) {'  1637: 	fputs("   None.\n", aRptFile);6
  1638:     }	  1639:     else {5  1640: 	fputs(" Line Name\n----- ----\n", aRptFile); ?  1641: 	for (curref = list_first(source_reflist(aSourceFile));c  1642: 	    curref != NULL;+  1643: 	    curref = next_entry(curref)) { .  1644: 	    fprintf(aRptFile, "%5d %s%s%s\n",,  1645: 		def_begin(ref_definition(curref)),8  1646: 		source_link_prefix(ref_definition(curref), 1),B  1647: 		def_name(ref_definition(curref)), source_link_suffix());
  1648: 	}+  1649: 	fputs("</PRE>\n", aRptFile);=
  1650:     }=  1651:     d  1652:     fputs("<HR>\n<PRE>BEGINNING OF FILE\n</PRE>\n<HR>\n", aRptFile);-  1653:     fputs("<PRE>\n", aRptFile); 	  1654: }p
QEND rpt_source_html_hdr. Go to: Beginning of routine.

l



3  1655: V  1656: /*************************************************************************++*/

nROUTINE rpt_source_html_entry. Go to: mNext routine in file; Routines in this file.

*

*#  1657: void rpt_source_html_entry(AL  1658: /* Writes HTML-formatted entry for an annotated source line.		    */  1659:   1660:     FILE    *aRptFile,,  1661: 	    /* (READ, BY ADDR):						    */E  1662: 	    /* Report output file. Must be opened by caller.		    */o  1663:   1664:     DEFINITION  1665: 	    *aDef,t,  1666: 	    /* (READ, BY ADDR):						    */<  1667: 	    /* Routine definition entry to report.			    */  1668:   1669:     char    *aSrcLine,,  1670: 	    /* (READ, BY ADDR):						    */4  1671: 	    /* Source file line contents.				    */  1672:   1673:     int	    vLine:+  1674: 	    /* (READ, BY VAL):						    */r3  1675: 	    /* Source file line number.					    */   1676:     )  1677: )	/* No return value.						    */ O  1678: 	/*****************************************************************--*/5  1679: 	  1680: { @  1681:     DEFINITION				    /* Next definition in file.	    */  1682: 	    *nextdef;
  1683: 	    aC  1684:     if (aDef != NULL && def_begin(aDef) == vLine) {ef  1685: 	fprintf(aRptFile, "</PRE><HR>\n<A NAME=\"d%lx\">ROUTINE</A> ", aDef);/  1686: 	fprintf(aRptFile, "%s%s%s. Go to: \n",dL  1687: 	    xref_link_prefix(aDef, 0), def_name(aDef), xref_link_suffix());4  1688: 	if ((nextdef = next_entry(aDef)) != NULL) {<  1689: 	    fprintf(aRptFile, "%sNext routine in file%s; ",@  1690: 		source_link_prefix(nextdef, 1), source_link_suffix());
  1691: 	}
  1692: #if 0   1693: 	fprintf(aRptFile,t  1694: "%s; %s; <A HREF=\"#routines_in_this_file\">Routines in this file</A>.<P>\n<PRE>\n",5  1695: 	    xref_link(aDef, 0), tree_link(aDef, 0)); 
  1696: #else   1697: 	fputs(.l  1698: "<A HREF=\"#routines_in_this_file\">Routines in this file</A>.<P>\n<PRE>\n",  1699: 	    aRptFile);   1700: #endif
  1701:     }%.  1702:     fprintf(aRptFile, "%6d: ", vLine);3  1703:     for (; *aSrcLine != '\0'; aSrcLine++) {0  1704: 	switch (*aSrcLine) { 9  1705: 	case '>': fputs("&gt;", aRptFile); break;c9  1706: 	case '<': fputs("&lt;", aRptFile); break;c;  1707: 	case '&': fputs("&amp;", aRptFile); break; -  1708: 	default: fputc(*aSrcLine, aRptFile);a
  1709: 	}
  1710:     } A  1711:     if (aDef != NULL && def_end(aDef) == vLine) {u  1712: 	fprintf(aRptFile,f  1713: 	"</PRE>\nEND %s. Go to: %sBeginning of routine%s.<P>\n<HR>\n<PRE>\n",P  1714: 	    def_name(aDef), source_link_prefix(aDef, 1), source_link_suffix());
  1715:     }S	  1716: }1
SEND rpt_source_html_entry. Go to: Beginning of routine.

l



t  1717: V  1718: /*************************************************************************++*/

lROUTINE rpt_source_html_end. Go to: mNext routine in file; Routines in this file.

8

5!  1719: void rpt_source_html_end(*N  1720: /* Writes HTML-formatted report end for annotated source file.		    */  1721:   1722:     FILE    *aRptFile,,  1723: 	    /* (READ, BY ADDR):						    */E  1724: 	    /* Report output file. Must be opened by caller.		    */i  1725:   1726:     SOURCEFILE  1727: 	    *aSourceFile,,  1728: 	    /* (READ, BY ADDR):						    */6  1729: 	    /* Source file entry to report.				    */  1730:       1731:     int	    vFirst, +  1732: 	    /* (READ, BY VAL):						    */ D  1733: 	    /* Flag indicating whether this is first table.		    */  1734:   1735:     int	    vLast5+  1736: 	    /* (READ, BY VAL):						    */5C  1737: 	    /* Flag indicating whether this is last table.		    */1  1738:     )  1739: )	/* No return value.						    */*O  1740: 	/*****************************************************************--*/s  1741: 	  1742: {;  1743:     fputs("<HR>\nEND OF FILE\n\n", aRptFile);-F  1744:     fprintf(aRptFile, "TOTAL: %ld routines, %ld Avg Length\n",C  1745: 	source_routines(aSourceFile), source_avglen(aSourceFile)); _  1746:     fprintf(aRptFile, "</PRE>\n<HR>\n%s\n", (vLast ? "<HR>\n" : "")); B  1747:     rpt_html_subsection_hdr(aRptFile, SOURCE_CODE_SECTION,2  1748: 	(vLast ? NULL : next_entry(aSourceFile)),J  1749: 	(vFirst ? NULL : prev_entry(aSourceFile)), OUTFILE_SUFFIX_SOURCE,"  1750: 	source_seq(aSourceFile));	  1751: }=
QEND rpt_source_html_end. Go to: Beginning of routine.

\



;  1752: 
END OF FILE_!TOTAL: 44 routines, 35 Avg Lengtha

LGo to: Contents; Previous section; Beginning of section; Next file in section; Previous file in section.