@Routine Analyzer Source File Analysis - rptsdml.c6

rptsdml.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
----- ----2  537 rpt_byfile_sdml_end4  515 rpt_byfile_sdml_entry2  491 rpt_byfile_sdml_hdr1  226 rpt_calls_sdml_end3  185 rpt_calls_sdml_entry1  159 rpt_calls_sdml_hdr3   71 rpt_defined_sdml_end5   49 rpt_defined_sdml_entry3   29 rpt_defined_sdml_hdr0  607 rpt_file_sdml_end2  582 rpt_file_sdml_entry0  562 rpt_file_sdml_hdr2  768 rpt_source_sdml_end4  696 rpt_source_sdml_entry2  643 rpt_source_sdml_hdr0  469 rpt_tree_sdml_end2  397 rpt_tree_sdml_entry0  378 rpt_tree_sdml_hdr5  137 rpt_undefined_sdml_end7  116 rpt_undefined_sdml_entry5   98 rpt_undefined_sdml_hdr0  360 rpt_xref_sdml_end2  266 rpt_xref_sdml_entry0  252 rpt_xref_sdml_hdr


BEGINNING OF FILE


V     1: /****************************************************************************/     2: /*									    */1     3: /*  FACILITY:	Routine Analyzer					    */     4: /*									    */=     5: /*  MODULE:	SDML 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 SDML format, suitable for input to VAX DOCUMENT.    */    12: /*									    */*    13: /*  REVISION HISTORY:							    */    14: /*									    */7    15: /*  V0.1-00 24-AUG-1994 Steve Branam					    */    16: /*									    */(    17: /*	Original version.						    */    18: /*									    */V    19: /****************************************************************************/    20:      21: #include <stdio.h>    22: #include "ranalyzer.h"    23: G    24: #define MAX_VALID_BREAK	    60			/* Lines between breaks.    */    25: D    26: static int mLastValidBreak;			/* Last source break line.  */    27: V    28: /*************************************************************************++*/

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



"    29: void rpt_defined_sdml_hdr(L    30: /* Writes SDML-formatted report header for defined routines.		    */    31:     32:     FILE    *aRptFile,    33: 	    /* (READ, BY ADDR):						    */E    34: 	    /* Report output file. Must be opened by caller.		    */    35: )    36: )	/* No return value.						    */O    37: 	/*****************************************************************--*/    38: 	    39: {f    40:     fputs("<TABLE>(Defined Routines Alphabetical\\defined_routines_table)\n", aRptFile);K    41:     fputs("<TABLE_ATTRIBUTES>(MULTIPAGE\\WIDE)\n", aRptFile);I    42:     fputs("<TABLE_SETUP>(6\\20\\20\\7\\5\\5)\n", aRptFile);    43:     fputs(_    44: "<TABLE_HEADS>(Routine\\Defined In File\\Line\\Length\\# Calls\\Times Called)\n",    45: 	aRptFile);	    46: }
REND rpt_defined_sdml_hdr. Go to: Beginning of routine.





    47: V    48: /*************************************************************************++*/

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



$    49: void rpt_defined_sdml_entry(M    50: /* Writes SDML-formatted routine entry for a defined routine.		    */    51:     52:     FILE    *aRptFile,,    53: 	    /* (READ, BY ADDR):						    */E    54: 	    /* Report output file. Must be opened by caller.		    */    55:     56:     DEFINITION    57: 	    *aDef,    58: 	    /* (READ, BY ADDR):						    */<    59: 	    /* Routine definition entry to report.			    */    60:     )    61: )	/* No return value.						    */O    62: 	/*****************************************************************--*/    63: 	    64: {P    65:     fprintf(aRptFile, "<TABLE_ROW>(%s\\%s\\%ld\\%ld\\%ld\\%ld)\n",H    66: 	def_name(aDef), source_name(def_source(aDef)), def_begin(aDef),G    67: 	def_length(aDef), def_num_calls(aDef), def_num_callers(aDef));	    68: }
TEND rpt_defined_sdml_entry. Go to: Beginning of routine.





    69: V    70: /*************************************************************************++*/

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



"    71: void rpt_defined_sdml_end(I    72: /* Writes SDML-formatted report end for defined routines.		    */    73:     74:     FILE    *aRptFile,,    75: 	    /* (READ, BY ADDR):						    */E    76: 	    /* Report output file. Must be opened by caller.		    */    77:     78:     long    vTotalDef+    79: 	    /* (READ, BY VAL):						    */:    80: 	    /* Total number of defined routines.			    */    81: )    82: )	/* No return value.						    */O    83: 	/*****************************************************************--*/    84: 	    85: {P    86:     fputs("<TABLE_ROW>(<SPAN>(6)<RULE>)\n", aRptFile);b    87:     fprintf(aRptFile, "<TABLE_ROW>(<EMPHASIS>(TOTAL ROUTINES: %ld\\BOLD)\\\n",    88: 	vTotalDef);]    89:     fprintf(aRptFile, "            <EMPHASIS>(TOTAL DEF LINES: %ld\\BOLD)\\\n",    90: 	total_rlength());R    91:     fprintf(aRptFile, "            <EMPHASIS>(AVG LEN:\\BOLD)\\\n");O    92:     fprintf(aRptFile, "            <EMPHASIS>(%ld\\BOLD)\\\\)\n",    93: 	total_avglen());2    94:     fputs("<ENDTABLE>\n", aRptFile);	    95: }
REND rpt_defined_sdml_end. Go to: Beginning of routine.





    96: V    97: /*************************************************************************++*/

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



$    98: void rpt_undefined_sdml_hdr(N    99: /* Writes SDML-formatted report header for undefined routines.		    */   100:    101:     FILE    *aRptFile,   102: 	    /* (READ, BY ADDR):						    */E   103: 	    /* Report output file. Must be opened by caller.		    */   104: )   105: )	/* No return value.						    */O   106: 	/*****************************************************************--*/   107: 	   108: {h   109:     fputs("<TABLE>(External Routines Alphabetical\\external_routines_table)\n", aRptFile);E   110:     fputs("<TABLE_ATTRIBUTES>(MULTIPAGE)\n", aRptFile);s<   111:     fputs("<TABLE_SETUP>(2\\20)\n", aRptFile);L   112:     fputs("<TABLE_HEADS>(Routine\\Times Called)\n", aRptFile);	   113: }o
TEND rpt_undefined_sdml_hdr. Go to: Beginning of routine.





l   114: V   115: /*************************************************************************++*/

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



A&   116: void rpt_undefined_sdml_entry(O   117: /* Writes SDML-formatted routine entry for a undefined routine.		    */"   118:    119:     FILE    *aRptFile,,   120: 	    /* (READ, BY ADDR):						    */E   121: 	    /* Report output file. Must be opened by caller.		    */"   122:    123:     DEFINITION   124: 	    *aDef,   125: 	    /* (READ, BY ADDR):						    */<   126: 	    /* Routine definition entry to report.			    */   127:     )   128: )	/* No return value.						    */lO   129: 	/*****************************************************************--*/=   130: 	   131: {c=   132:     fprintf(aRptFile, "<TABLE_ROW>(%s\\%ld)\n",r0   133: 	def_name(aDef), def_num_callers(aDef));	   134: } 
VEND rpt_undefined_sdml_entry. Go to: Beginning of routine.





=   135: V   136: /*************************************************************************++*/

oROUTINE rpt_undefined_sdml_end. Go to: 1mNext routine in file; Routines in this file.

G

E$   137: void rpt_undefined_sdml_end(K   138: /* Writes SDML-formatted report end for undefined routines.		    */    139:    140:     FILE    *aRptFile,,   141: 	    /* (READ, BY ADDR):						    */E   142: 	    /* Report output file. Must be opened by caller.		    */    143:    144:     long    vTotalUndef +   145: 	    /* (READ, BY VAL):						    */p<   146: 	    /* Total number of undefined routines.			    */   147: )   148: )	/* No return value.						    */*O   149: 	/*****************************************************************--*/t   150: 	   151: { P   152:     fputs("<TABLE_ROW>(<SPAN>(2)<RULE>)\n", aRptFile);c   153:     fprintf(aRptFile, "<TABLE_ROW>(<EMPHASIS>(TOTAL ROUTINES: %ld\\BOLD)\\)\n",    154: 	vTotalUndef);2   155:     fputs("<ENDTABLE>\n", aRptFile);	   156: }*
TEND rpt_undefined_sdml_end. Go to: Beginning of routine.





*   157: V   158: /*************************************************************************++*/

kROUTINE rpt_calls_sdml_hdr. Go to: tmNext routine in file; Routines in this file.

*

*    159: void rpt_calls_sdml_hdr(V   160: /* Writes SDML-formatted report header for defined routine calls/callers    */   161: /* table.								    */t   162:    163:     FILE    *aRptFile,,   164: 	    /* (READ, BY ADDR):						    */E   165: 	    /* Report output file. Must be opened by caller.		    */(   166:    167:     DEFINITION   168: 	    *aDef,   169: 	    /* (READ, BY ADDR):						    */<   170: 	    /* Routine definition entry to report.			    */   171:     )   172: )	/* No return value.						    */bO   173: 	/*****************************************************************--*/    174: 	   175: {*   176:     fprintf(aRptFile,*J   177:     "<TABLE>(%s Calls/Caller Routines)\n", def_ident(aDef));E   178:     fputs("<TABLE_ATTRIBUTES>(MULTIPAGE)\n", aRptFile); C   179:     fputs("<TABLE_SETUP>(4\\20\\5\\20)\n", aRptFile);lU   180:     fputs("<TABLE_HEADS>(Calls Routine\\Line\\Caller Routine\\Line)\n",3   181: 	aRptFile); 	   182: }H
PEND rpt_calls_sdml_hdr. Go to: Beginning of routine.





    183: V   184: /*************************************************************************++*/

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

:

H"   185: void rpt_calls_sdml_entry(Q   186: /* Writes SDML-formatted calls/caller entry for a defined routine.	    */    187:    188:     FILE    *aRptFile,,   189: 	    /* (READ, BY ADDR):						    */E   190: 	    /* Report output file. Must be opened by caller.		    */    191:    192:     REFERENCE	   193: 	    *aCalled,,   194: 	    /* (READ, BY ADDR):						    */O   195: 	    /* Called routine reference entry to report. If NULL is passed, */R:   196: 	    /* only a caller is being reported.				    */   197:        198:     REFERENCE    199: 	    *aCallere,   200: 	    /* (READ, BY ADDR):						    */O   201: 	    /* Caller routine reference entry to report. If NULL is passed, */A   202: 	    /* only a called routine is being reported.			    */\   203:     )   204: )	/* No return value.						    */sO   205: 	/*****************************************************************--*/e   206: 	   207: {4   208:     fprintf(aRptFile, "<TABLE_ROW>(");"   209:     if (aCalled == NULL) {#   210: 	fprintf(aRptFile, "\\\\");9
   211:     }*   212:     else {J   213: 	fprintf(aRptFile, "%s\\%ld\\", def_name(ref_definition(aCalled)),"   214: 	    ref_offset(aCalled));
   215:     }."   216:     if (aCaller == NULL) {$   217: 	fprintf(aRptFile, "\\)\n");
   218:     }f   219:     else {G   220: 	fprintf(aRptFile, "%s\\%ld)\n", def_name(ref_caller(aCaller)),d"   221: 	    ref_offset(aCaller));
   222:     }a	   223: } 
REND rpt_calls_sdml_entry. Go to: Beginning of routine.





D   224: V   225: /*************************************************************************++*/

kROUTINE rpt_calls_sdml_end. Go to: omNext routine in file; Routines in this file.

*

*    226: void rpt_calls_sdml_end(S   227: /* Writes SDML-formatted report end for defined routine calls/caller	    */;   228: /* table.								    */i   229:    230:     FILE    *aRptFile,,   231: 	    /* (READ, BY ADDR):						    */E   232: 	    /* Report output file. Must be opened by caller.		    */I   233:    234:     DEFINITION   235: 	    *aDef,   236: 	    /* (READ, BY ADDR):						    */<   237: 	    /* Routine definition entry to report.			    */   238:     )   239: )	/* No return value.						    */BO   240: 	/*****************************************************************--*/"   241: 	   242: { P   243:     fputs("<TABLE_ROW>(<SPAN>(4)<RULE>)\n", aRptFile);a   244:     fprintf(aRptFile, "<TABLE_ROW>(<EMPHASIS>(TOTAL CALLS: %ld\\BOLD)\\\\\n",*   245: 	def_num_calls(aDef));\   246:     fprintf(aRptFile, "            <EMPHASIS>(TOTAL CALLERS: %ld\\BOLD)\\)\n",    247: 	def_num_callers(aDef));4   248:     fputs("<ENDTABLE>\n\n", aRptFile);	   249: }_
PEND rpt_calls_sdml_end. Go to: Beginning of routine.





D   250: V   251: /*************************************************************************++*/

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

*

*   252: void rpt_xref_sdml_hdr(8K   253: /* Writes SDML-formatted report header for cross reference.		    */a   254:    255:     FILE    *aRptFile ,   256: 	    /* (READ, BY ADDR):						    */E   257: 	    /* Report output file. Must be opened by caller.		    */t   258: )   259: )	/* No return value.						    */eO   260: 	/*****************************************************************--*/o   261: 	   262: {1	   263: }n
OEND rpt_xref_sdml_hdr. Go to: Beginning of routine.

*



*   264: V   265: /*************************************************************************++*/

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

i

L!   266: void rpt_xref_sdml_entry(fO   267: /* Writes SDML-formatted cross-reference sections for a routine.	    */    268:    269:     FILE    *aRptFile,,   270: 	    /* (READ, BY ADDR):						    */E   271: 	    /* Report output file. Must be opened by caller.		    */1   272:    273:     DEFINITION   274: 	    *aDef,/,   275: 	    /* (READ, BY ADDR):						    */<   276: 	    /* Routine definition entry to report.			    */   277:    278:     int	    vFirst+   279: 	    /* (READ, BY VAL):						    */1J   280: 	    /* Flag indicating this is first entry being reported.	    */   281:     )   282: )	/* No return value.						    */ O   283: 	/*****************************************************************--*/n   284: 	   285: {>:   286:     REFERENCE				    /* Current caller ref.	    */   287: 	    *caller;*V   288:     char    fullname[MAX_ROUTINE_IDENT + 1];/* Routine fullname buffer.	    */3   289: 					    /* Routine name folding buffer. *//:   290:     char    rname[RPT_HTML_ROUTINE_WIDE_LEN + 1]; B   291:     int	    rpos;			    /* Pos in routine name to print.*/   292: W   293:     fprintf(aRptFile, "<FIGURE>(%s Cross Reference)\n", def_ident(aDef));e
   294: #if 0 G   295:     fputs("<FIGURE_ATTRIBUTES>(KEEP\\WIDE)\n", aRptFile);    296: #endif    D   297:     fputs("<FIGURE_ATTRIBUTES>(MULTIPAGE)", aRptFile);8   298:     fputs("<LINE_ART>(WIDE)\n", aRptFile);(   299:     fputs("CALLERS:", aRptFile);-   300:     if (def_num_callers(aDef) == 0) { *   301: 	fputs(" No callers\n", aRptFile);
   302:     }   303:     else {8   304: 	fprintf(aRptFile, "\n\n%3c%ld caller%s\n", ' ',M   305: 	    def_num_callers(aDef), (def_num_callers(aDef) == 1 ? "" : "s"));l   306: 3   307: 					    /* Write entry for each caller. */T5   308: 	for (caller = list_first(def_callers(aDef));)   309: 	    caller != NULL;+   310: 	    caller = next_entry(caller)) {R=   311: 	    strcpy(fullname, def_ident(ref_caller(caller)));:
   312: 	    53   313: 					    /* Get first part of rout name. */19   314: 	    rpos = fold_string(fullname, 0, NULL, rname,*%   315: 		RPT_HTML_ROUTINE_WIDE_LEN);>;   316: 	    fprintf(aRptFile, "%8c+ %-48s\n", ' ', rname);0S   317: 	    while (rpos < strlen(fullname)) {/* Write rest of routine name.  */n;   318: 		rpos = fold_string(fullname, rpos, "    ", rname,h)   319: 		    RPT_HTML_ROUTINE_WIDE_LEN);c3   320: 		fprintf(aRptFile, "%8c%s\n", ' ', rname);r   321: 	    }
   322: 	}
   323:     } *   324:     if (isdefined_routine(aDef)) {)   325: 	fputs("\nCALL TREE:", aRptFile);4(   326: 	if (def_num_calls(aDef) == 0) {,   327: 	    fputs(" No calls\n", aRptFile);
   328: 	}   329: 	else {6%   330: 	    fputs("\n\n", aRptFile); 
   331: 	}
   332:     }A+   333:     if (def_num_calls(aDef) == 0) {t2   334: 	fputs("<ENDLINE_ART>\n", aRptFile);2   335: 	fputs("<ENDFIGURE>\n\n", aRptFile);
   336:     }*   337:         5   338: #if 0					    /* Write section header.	    */ T   339:     fprintf(aRptFile, "<TABLE>(%s Callers\\WIDE)\n", def_ident(aDef));<   340:     fputs("<TABLE_SETUP>(2\\20)\n", aRptFile);G   341:     fputs("<TABLE_HEADS>(Routine\\Callers)\n", aRptFile);T-   342:     if (def_num_callers(aDef) == 0) { U   343: 	fprintf(aRptFile, "<TABLE_ROW>(%s\\- No callers)\n", def_ident(aDef));a
   344:     }1<   345:     else {				    /* Write entry for each caller. */N   346: 	fprintf(aRptFile, "<TABLE_ROW>(%s\\<LIST>(UNNUMBERED)\n",   347: 	    def_ident(aDef));5   348: 	for (caller = list_first(def_callers(aDef));=   349: 	    caller != NULL;+   350: 	    caller = next_entry(caller)) {lP   351: 	    fprintf(aRptFile, "<LE>%s\n", def_ident(ref_caller(caller)));
   352: 	}/   353: 	fputs("<ENDLIST>)\n", aRptFile);E
   354:     }d2   355:     fputs("<ENDTABLE>\n", aRptFile);   356: #endif	   357: } 
QEND rpt_xref_sdml_entry. Go to: Beginning of routine.

,



	   358: V   359: /*************************************************************************++*/

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



    360: void rpt_xref_sdml_end(9O   361: /* Writes SDML-formatted report end for caller cross-reference.		    */a   362:    363:     FILE    *aRptFile,,   364: 	    /* (READ, BY ADDR):						    */E   365: 	    /* Report output file. Must be opened by caller.		    */N   366:    367:     long    vTotalDef*+   368: 	    /* (READ, BY VAL):						    */*3   369: 	    /* Total number of routines.				    */    370: )   371: )	/* No return value.						    */ O   372: 	/*****************************************************************--*/   373: 	   374: { 	   375: }n
OEND rpt_xref_sdml_end. Go to: Beginning of routine.

l



5   376: V   377: /*************************************************************************++*/

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



i   378: void rpt_tree_sdml_hdr( T   379: /* Writes SDML-formatted report header for defined routine call tree.	    */   380:    381:     FILE    *aRptFile,,   382: 	    /* (READ, BY ADDR):						    */E   383: 	    /* Report output file. Must be opened by caller.		    */    384:    385:     DEFINITION   386: 	    *aDef,   387: 	    /* (READ, BY ADDR):						    */<   388: 	    /* Routine definition entry to report.			    */   389:     )   390: )	/* No return value.						    */bO   391: 	/*****************************************************************--*/A   392: 	   393: { 	   394: } 
OEND rpt_tree_sdml_hdr. Go to: Beginning of routine.

I



5   395: V   396: /*************************************************************************++*/

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

t

;!   397: void rpt_tree_sdml_entry( N   398: /* Writes SDML-formatted call tree line for a defined routine.		    */   399:    400:     FILE    *aRptFile,,   401: 	    /* (READ, BY ADDR):						    */E   402: 	    /* Report output file. Must be opened by caller.		    */s   403:    404:     REFERENCEE   405: 	    *aRef,t,   406: 	    /* (READ, BY ADDR):						    */N   407: 	    /* Reference to routine definition entry to report.       	    */   408:    409:     int	    vLevel,*+   410: 	    /* (READ, BY VAL):						    */*A   411: 	    /* Nesting level, used to space indentation.		    */l   412:    413:     int	    vExpanded,+   414: 	    /* (READ, BY VAL):						    */ N   415: 	    /* Flag indicating whether or not routine has already been	    */5   416: 	    /* expanded in this call tree.				    */    417:    418:     int	    vRecursive+   419: 	    /* (READ, BY VAL):						    */ H   420: 	    /* Flag indicating whether or not routine is called		    */(   421: 	    /* recursively.						    */   422: )   423: )	/* No return value.						    */eO   424: 	/*****************************************************************--*/*   425: 	   426: {*>   427:     int	    lcount;			    /* Level print count.	    */   428: #   429:     fputs("   ", aRptFile);o<   430:     for (lcount = vLevel; lcount > 1; lcount--) {!   431: 	fputs("|   ", aRptFile);*
   432:     }*    433:     if (lcount > 0) {#   434: 	if (isend_of_list(aRef)) {l%   435: 	    fputs("+   ", aRptFile);s
   436: 	}   437: 	else {E%   438: 	    fputs("|   ", aRptFile);;
   439: 	}
   440:     }_   441:     if (vLevel == 0) {C   442: 	fprintf(aRptFile, "%s\n", def_name(ref_definition(aRef)));D
   443:     }o3   444: 					    /* If routine is not going to   */ 3   445: 					    /* be expanded here, format it  */A0   446: 					    /* in italics and add an	    */O   447:     else if (vExpanded || vRecursive ||	    /* explanation code.	    */Q   448: 	(needs_tree(ref_definition(aRef)) && !tree_inline_disabled()) || 4   449: 	!isdefined_routine(ref_definition(aRef))) {G   450: 	fprintf(aRptFile, "<EMPHASIS>(%s\\italic) (%s%s%s%s)\n",1,   451: 	    def_name(ref_definition(aRef)),,   452: 	    (vExpanded ? "Duplicate" : ""),-   453: 	    (vRecursive ? "Recursive" : ""),2[   454: 	    (needs_tree(ref_definition(aRef)) && !vRecursive && !vExpanded5@   455: 		&& !tree_inline_disabled() ? "Separate" : ""),K   456: 	    (!isdefined_routine(ref_definition(aRef)) ? "External" : ""));*
   457:     }mV   458:     else if (vLevel == max_tree_depth()	    /* Reached expansion limit?	    */A   459: 	&& def_num_calls(ref_definition(aRef)) > 0) {sG   460: 	fprintf(aRptFile, "<EMPHASIS>(%s\\italic) (Separate)\n",(-   461: 	    def_name(ref_definition(aRef)));"
   462:     }f<   463:     else {				    /* Otherwise, format plain.	    */C   464: 	fprintf(aRptFile, "%s\n", def_name(ref_definition(aRef)));t
   465:     }T	   466: };
QEND rpt_tree_sdml_entry. Go to: Beginning of routine.





L   467: V   468: /*************************************************************************++*/

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

o

c   469: void rpt_tree_sdml_end(=R   470: /* Writes SDML-formatted section end for defined routine call tree.	    */   471:    472:     FILE    *aRptFile,,   473: 	    /* (READ, BY ADDR):						    */E   474: 	    /* Report output file. Must be opened by caller.		    */   475:    476:     DEFINITION   477: 	    *aDef,   478: 	    /* (READ, BY ADDR):						    */<   479: 	    /* Routine definition entry to report.			    */   480:     )   481: )	/* No return value.						    */ O   482: 	/*****************************************************************--*/r   483: 	   484: { 0   485:     fputs("   END OF TREE\n", aRptFile);5   486:     fputs("<ENDLINE_ART>\n", aRptFile);25   487:     fputs("<ENDFIGURE>\n\n", aRptFile);(	   488: } 
OEND rpt_tree_sdml_end. Go to: Beginning of routine.

7



"   489: V   490: /*************************************************************************++*/

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

*

s!   491: void rpt_byfile_sdml_hdr( V   492: /* Writes SDML-formatted report header for defined routines by file table.  */   493:    494:     FILE    *aRptFile,,   495: 	    /* (READ, BY ADDR):						    */E   496: 	    /* Report output file. Must be opened by caller.		    */    497:    498:     SOURCEFILE   499: 	    *aSourceFile ,   500: 	    /* (READ, BY ADDR):						    */6   501: 	    /* Source file entry to report.				    */   502:     )   503: )	/* No return value.						    */(O   504: 	/*****************************************************************--*/a   505: 	   506: {_X   507:     fprintf(aRptFile, "<TABLE>(%s Routines)\n", source_name(aSourceFile));E   508:     fputs("<TABLE_ATTRIBUTES>(MULTIPAGE)\n", aRptFile);eE   509:     fputs("<TABLE_SETUP>(5\\20\\7\\5\\5)\n", aRptFile);)X   510:     fputs("<TABLE_HEADS>(Routine\\Line\\Length\\# Calls\\Times Called)\n",   511: 	aRptFile); 	   512: }m
QEND rpt_byfile_sdml_hdr. Go to: Beginning of routine.





*   513: V   514: /*************************************************************************++*/

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

e

e#   515: void rpt_byfile_sdml_entry(dM   516: /* Writes SDML-formatted entry for a defined routine by file.		    */    517:    518:     FILE    *aRptFile,,   519: 	    /* (READ, BY ADDR):						    */E   520: 	    /* Report output file. Must be opened by caller.		    */    521:    522:     DEFINITION   523: 	    *aDef,   524: 	    /* (READ, BY ADDR):						    */<   525: 	    /* Routine definition entry to report.			    */   526:     )   527: )	/* No return value.						    */*O   528: 	/*****************************************************************--*/f   529: 	   530: {H\   531:     fprintf(aRptFile, "<TABLE_ROW>(%s\\%ld\\%ld\\%ld\\%ld)\n", def_name(aDef),@   532: 	def_begin(aDef), def_length(aDef), def_num_calls(aDef),    533: 	def_num_callers(aDef));	   534: }A
SEND rpt_byfile_sdml_entry. Go to: Beginning of routine.

"



    535: V   536: /*************************************************************************++*/

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

u

p!   537: void rpt_byfile_sdml_end(U   538: /* Writes SDML-formatted report end for defined routine by file table.	    *//   539:    540:     FILE    *aRptFile,,   541: 	    /* (READ, BY ADDR):						    */E   542: 	    /* Report output file. Must be opened by caller.		    */*   543:    544:     SOURCEFILE   545: 	    *aSourceFile ,   546: 	    /* (READ, BY ADDR):						    */6   547: 	    /* Source file entry to report.				    */   548:     )   549: )	/* No return value.						    */*O   550: 	/*****************************************************************--*/0   551: 	   552: {AP   553:     fputs("<TABLE_ROW>(<SPAN>(5)<RULE>)\n", aRptFile);d   554:     fprintf(aRptFile, "<TABLE_ROW>(<EMPHASIS>(TOTAL: %ld ROUTINES\\BOLD)\\\\\n",'   555: 	source_routines(aSourceFile));tS   556:     fprintf(aRptFile, "            <EMPHASIS>(%ld AVG\\BOLD)\\\\)\n",%   557: 	source_avglen(aSourceFile));,4   558:     fputs("<ENDTABLE>\n\n", aRptFile);	   559: }e
QEND rpt_byfile_sdml_end. Go to: Beginning of routine.

4



f   560: V   561: /*************************************************************************++*/

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

4

    562: void rpt_file_sdml_hdr(H   563: /* Writes SDML-formatted report header for source files.		    */   564:    565:     FILE    *aRptFilel,   566: 	    /* (READ, BY ADDR):						    */E   567: 	    /* Report output file. Must be opened by caller.		    */    568: )   569: )	/* No return value.						    */dO   570: 	/*****************************************************************--*/u   571: 	   572: {e^   573:     fputs("<TABLE>(Source Files Alphabetical\\source_files_table)\n", aRptFile);K   574:     fputs("<TABLE_ATTRIBUTES>(MULTIPAGE\\WIDE)\n", aRptFile);4N   575:     fputs("<TABLE_SETUP>(8\\20\\6\\5\\6\\4\\6\\4)\n", aRptFile);   576:     fputs(m   577: "<TABLE_HEADS>(File\\Lines\\Com- mented\\State- ment\\Rou- tines\\Length\\Avg Len\\# Calls)\n",o   578: 	aRptFile);4	   579: }u
OEND rpt_file_sdml_hdr. Go to: Beginning of routine.

)



}   580: V   581: /*************************************************************************++*/

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

c

|!   582: void rpt_file_sdml_entry(=   583: /* Writes SDML-formatted source file entry.				    */i   584:    585:     FILE    *aRptFile,,   586: 	    /* (READ, BY ADDR):						    */E   587: 	    /* Report output file. Must be opened by caller.		    */    588:    589:     SOURCEFILE   590: 	    *aSourceFileD,   591: 	    /* (READ, BY ADDR):						    */6   592: 	    /* Source file entry to report.				    */   593:     )   594: )	/* No return value.						    */O   595: 	/*****************************************************************--*/i   596: 	   597: {d[   598:     fprintf(aRptFile, "<TABLE_ROW>(%s\\%ld\\%ld\\%ld\\%ld\\%ld\\%ld\\%ld)\n",e=   599: 	source_name(aSourceFile), source_lines(aSourceFile),;B   600: 	source_comments(aSourceFile) + source_mixed(aSourceFile),D   601: 	source_statements(aSourceFile) + source_mixed(aSourceFile),C   602: 	source_routines(aSourceFile), source_rlength(aSourceFile),e@   603: 	source_avglen(aSourceFile), source_calls(aSourceFile));	   604: }n
QEND rpt_file_sdml_entry. Go to: Beginning of routine.

_



    605: V   606: /*************************************************************************++*/

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

;

F   607: void rpt_file_sdml_end(sF   608: /* Writes SDML-formatted report end for source files.			    */   609:    610:     FILE    *aRptFile,,   611: 	    /* (READ, BY ADDR):						    */E   612: 	    /* Report output file. Must be opened by caller.		    */    613:    614:     long    vTotalFilesu+   615: 	    /* (READ, BY VAL):						    */ 7   616: 	    /* Total number of source files.				    */    617: )   618: )	/* No return value.						    */ O   619: 	/*****************************************************************--*/	   620: 	   621: { P   622:     fputs("<TABLE_ROW>(<SPAN>(8)<RULE>)\n", aRptFile);_   623:     fprintf(aRptFile, "<TABLE_ROW>(<EMPHASIS>(TOTAL: %ld files\\BOLD)\\\n",T   624: 	vTotalFiles);L   625:     fprintf(aRptFile, "            <EMPHASIS>(%ld\\BOLD)\\\n",   626: 	total_lines());L   627:     fprintf(aRptFile, "            <EMPHASIS>(%ld\\BOLD)\\\n",+   628: 	total_comments() + total_mixed());*L   629:     fprintf(aRptFile, "            <EMPHASIS>(%ld\\BOLD)\\\n",-   630: 	total_statements() + total_mixed());0L   631:     fprintf(aRptFile, "            <EMPHASIS>(%ld\\BOLD)\\\n",   632: 	total_routines());iL   633:     fprintf(aRptFile, "            <EMPHASIS>(%ld\\BOLD)\\\n",   634: 	total_rlength());L   635:     fprintf(aRptFile, "            <EMPHASIS>(%ld\\BOLD)\\\n",   636: 	total_avglen());,K   637:     fprintf(aRptFile, "            <EMPHASIS>(%ld\\BOLD))\n",    638: 	total_calls());2   639:     fputs("<ENDTABLE>\n", aRptFile);	   640: }*
OEND rpt_file_sdml_end. Go to: Beginning of routine.

n



.   641: V   642: /*************************************************************************++*/

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

)

5!   643: void rpt_source_sdml_hdr(5P   644: /* Writes SDML-formatted report header for annotated source file.	    */   645:    646:     FILE    *aRptFile,,   647: 	    /* (READ, BY ADDR):						    */E   648: 	    /* Report output file. Must be opened by caller.		    */.   649:    650:     SOURCEFILE   651: 	    *aSourceFile,,   652: 	    /* (READ, BY ADDR):						    */6   653: 	    /* Source file entry to report.				    */   654:    655:     int	    vFirst,0+   656: 	    /* (READ, BY VAL):						    */=D   657: 	    /* Flag indicating whether this is first table.		    */   658:    659:     int	    vLastE+   660: 	    /* (READ, BY VAL):						    */5C   661: 	    /* Flag indicating whether this is last table.		    */    662:     )   663: )	/* No return value.						    */ O   664: 	/*****************************************************************--*/p   665: 	   666: {*?   667:     REFERENCE				    /* Current routine reference.   */    668: 	    *curref;:   669:     670:     mLastValidBreak = 0;L   671:     fprintf(aRptFile, "<DEFINE_SYMBOL>(source_%d_name\\%s)\n",<   672: 	source_seq(aSourceFile), source_name(aSourceFile));S   673:     fprintf(aRptFile, "<FIGURE>(%s Source Code\\source_%d_figure)\n",&<   674: 	source_name(aSourceFile), source_seq(aSourceFile));L   675:     fputs("<FIGURE_ATTRIBUTES>(MULTIPAGE\\WIDE)\n", aRptFile);8   676:     fputs("<LINE_ART>(WIDE)\n", aRptFile);H   677:     fputs("ROUTINES IN THIS FILE (Alphabetical)\n\n", aRptFile);4   678:     if (source_routines(aSourceFile) == 0) {'   679: 	fputs("   None.\n", aRptFile);*
   680:     }R   681:     else {5   682: 	fputs(" Line Name\n----- ----\n", aRptFile);0?   683: 	for (curref = list_first(source_reflist(aSourceFile));x   684: 	    curref != NULL;+   685: 	    curref = next_entry(curref)) {l*   686: 	    fprintf(aRptFile, "%5d %s\n",,   687: 		def_begin(ref_definition(curref)),,   688: 		def_name(ref_definition(curref)));
   689: 	}
   690:     }    691:     7   692:     fputs("\nBEGINNING OF FILE\n\n", aRptFile);5	   693: } 
QEND rpt_source_sdml_hdr. Go to: Beginning of routine.





S   694: V   695: /*************************************************************************++*/

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

U

\#   696: void rpt_source_sdml_entry(RL   697: /* Writes SDML-formatted entry for an annotated source line.		    */   698:    699:     FILE    *aRptFile,,   700: 	    /* (READ, BY ADDR):						    */E   701: 	    /* Report output file. Must be opened by caller.		    */e   702:    703:     DEFINITION   704: 	    *aDef,t,   705: 	    /* (READ, BY ADDR):						    */<   706: 	    /* Routine definition entry to report.			    */   707:    708:     char    *aSrcLine,,   709: 	    /* (READ, BY ADDR):						    */4   710: 	    /* Source file line contents.				    */   711:    712:     int	    vLine,+   713: 	    /* (READ, BY VAL):						    */.3   714: 	    /* Source file line number.					    */A   715:        716:     int	    vTabSize+   717: 	    /* (READ, BY VAL):						    */r0   718: 	    /* Source text tab size.					    */   719:     )   720: )	/* No return value.						    */5O   721: 	/*****************************************************************--*/    722: 	   723: { @   724:     DEFINITION				    /* Next definition in file.	    */   725: 	    *nextdef;;   726:     int	    column;			    /* Output column.		    */*A   727:     int	    count;			    /* Tab expansion counter.	    */&
   728: 	    uC   729:     if (aDef != NULL && def_begin(aDef) == vLine) { 2   730: 	fputs("<VALID_BREAK>\n", aRptFile);!   731: 	mLastValidBreak = vLine;&F   732: 	fprintf(aRptFile, "\nBEGIN ROUTINE %s.\n\n", def_name(aDef));
   733:     } .   734:     fprintf(aRptFile, "%6d: ", vLine);3   735: 					    /* Expand tabs on output since  */o3   736: 					    /* SDML treats TAB as a space.  */i=   737:     for (column = 0; *aSrcLine != '\0'; aSrcLine++) {A!   738: 	if (*aSrcLine == '\t') {57   739: 	    for (count = vTabSize - column % vTabSize;*   740: 		count > 0;   741: 		count--, column++) {   742: 		fputc(' ', aRptFile);f   743: 	    }
   744: 	}&   745: 	else if (*aSrcLine == '\f') {6   746: 	    fputs("\n<VALID_BREAK>", aRptFile);%   747: 	    mLastValidBreak = vLine;P
   748: 	}   749: 	else {f!   750: 	    switch (*aSrcLine) { J   751: 	    case '>': fputs("<LITERAL>(>)", aRptFile); break;J   752: 	    case '<': fputs("<LITERAL>(<)", aRptFile); break;1   753: 	    default: fputc(*aSrcLine, aRptFile);    754: 	    }   755: 	    column++;
   756: 	}
   757:     }5A   758:     if (aDef != NULL && def_end(aDef) == vLine) {l<   759: 	fprintf(aRptFile, "\nEND %s.\n\n", def_name(aDef));
   760:     }	D   761:     else if (vLine - mLastValidBreak > MAX_VALID_BREAK) {2   762: 	fputs("<VALID_BREAK>\n", aRptFile);!   763: 	mLastValidBreak = vLine;W
   764:     }l	   765: }\
SEND rpt_source_sdml_entry. Go to: Beginning of routine.





n   766: V   767: /*************************************************************************++*/

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

i

o!   768: void rpt_source_sdml_end(5N   769: /* Writes SDML-formatted report end for annotated source file.		    */   770:    771:     FILE    *aRptFile,,   772: 	    /* (READ, BY ADDR):						    */E   773: 	    /* Report output file. Must be opened by caller.		    */o   774:    775:     SOURCEFILE   776: 	    *aSourceFile,,   777: 	    /* (READ, BY ADDR):						    */6   778: 	    /* Source file entry to report.				    */   779:        780:     int	    vFirst,+   781: 	    /* (READ, BY VAL):						    *//D   782: 	    /* Flag indicating whether this is first table.		    */   783:    784:     int	    vLast6+   785: 	    /* (READ, BY VAL):						    */5C   786: 	    /* Flag indicating whether this is last table.		    */o   787:     )   788: )	/* No return value.						    */uO   789: 	/*****************************************************************--*/*   790: 	   791: {	1   792:     fputs("\nEND OF FILE\n\n", aRptFile);EF   793:     fprintf(aRptFile, "TOTAL: %ld routines, %ld Avg Length\n",C   794: 	source_routines(aSourceFile), source_avglen(aSourceFile));D5   795:     fputs("<ENDLINE_ART>\n", aRptFile);R5   796:     fputs("<ENDFIGURE>\n\n", aRptFile);	   797: }t
QEND rpt_source_sdml_end. Go to: Beginning of routine.





l   798: 
END OF FILE*!TOTAL: 24 routines, 30 Avg Length 

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