home *** CD-ROM | disk | FTP | other *** search
- /*
- LISTING 4
- */
- #include <malloc.h>
- #include <conio.h>
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
-
- #define MAXFNCTS 4000 /* maximum number of functions */
- #define MAXMODULES 500 /* number of different files */
-
- struct Func_list /* function statistics */
- {
- char *name; /* function name */
- int used; /* times used in function */
- };
-
- struct Pages /* linked list of pages */
- {
- int pg; /* page number */
- struct Pages *next; /* pointer to next page */
- };
-
- struct Module /* module statistics */
- {
- char *name; /* pointer to the module name */
- char *cmt; /* module comment/description */
- unsigned int length; /* lines in the module */
- long size; /* bytes in the module */
- };
-
- struct Mod_list /* module control stucture */
- {
- struct Module *name; /* pointer to module file name */
- char *function; /* name of function in file */
- struct Func_list *ptr; /* pointer to the first function */
- int qty; /* different functions called */
- struct Pages *pg; /* point to the page list */
- int used; /* times the function is used */
- };
-
- #if MAINMODULE != 0
-
- struct Module Mnames[MAXMODULES], *pMnames;
- struct Mod_list Mlist[MAXMODULES], *pMlist, *pm[MAXMODULES];
- struct Func_list Flist[MAXFNCTS], *pFlist;
- char *rlist[50]; /* recursion function list */
- int Mqty = 0, Fqty = 0, Mcnt = 0;
- int page=1, line=0, depth=0;
- int fline;
- int firstcmt;
- char bfr[300];
- char tline[] = {"+-------------------------+"};
- char dbl[] = {" "};
- char vbar[] = {"| "};
- char hbar[] = {"+-"};
- FILE *output;
- char pc[1000] = {0,0,0,0,0,0,0,0,0,0};
- char *pp;
- char filecmt[300];
- int pw = 80; /* page width */
- int pl = 66; /* page length */
- int lm = 8; /* left margin */
- int rm = 8; /* right margin */
- int width; /* the printable page width */
- char target[40] = "main"; /* target function */
- int stats = 0;
-
- #else
-
- extern struct Module Mnames[MAXMODULES], *pMnames;
- extern struct Mod_list Mlist[MAXMODULES], *pMlist;
- extern struct Mod_list *pm[MAXMODULES];
- extern struct Func_list Flist[MAXFNCTS], *pFlist;
- extern char *rlist[]; /* recursion function list */
- extern int Mqty, Fqty, Mcnt;
- extern int page, line, depth;
- extern int fline;
- extern int firstcmt;
- extern char bfr[];
- extern char tline[];
- extern char dbl[];
- extern char vbar[];
- extern char hbar[];
- extern FILE *output;
- extern char pc[];
- extern char *pp;
- extern char filecmt[];
- extern int pw; /* page width */
- extern int pl; /* page length */
- extern int lm; /* left margin */
- extern int rm; /* right margin */
- extern int width; /* the printable page width */
- extern char target[]; /* target function */
- extern int stats;
-
- #endif