home *** CD-ROM | disk | FTP | other *** search
- /*
- CPRINT, Print a (fairly) neat listing of a c program
-
- Programmed by Andrew L. Bender, M. D.
-
- June 24, 1984 - Version 1.0
- June 26, 1984 - Version 1.1
- Fix some bugs in string processing
- July 3, 1984 - Version 1.2
- Allow for printer file device.
- Count source statements
-
- The following modifications were made by Bud Curtis
-
- Nov 2, 1986 - version 1.3
- Modified CPRINT for Datalight C compiler
-
- Jan 15, 1987 - version 1.4
- Added X-reference and listing highlight features
-
- Permission is hereby given to freely distribute this
- program but it may not be sold. This program may be
- modified by anyone as long as this notice remains.
-
- The listing contains three columns on the left:
-
- column 1 is an indicator that a qoute or comment is continuing
- to the next print line (* -> comment, " -> quote)
-
- column 2 is the "nesting level" of compound statements
-
- column 3 is a rough idea of what the line number will be.
- It is actually a count of "\n" characters.
-
- The heading on each page gives the name of the file being
- printed and the date the listing was created.
-
- If braces, brackets or parenthesis are unbalanced
- this will be reported at the end of the listing.
- A complete syntactical analysis of the program
- would require more effort but would be worth it as
- an exercise of much value in learning the c language
- because of the facility and fluency needed to write
- such a checker.
-
- A program checker "lint" is quite thorough in its
- analysis of c programs and is available on most
- UNIX systems.
- */
- #include <stdio.h>
- #include <time.h>
- #include <ctype.h>
- #include <memory.h>
- #include <proto.h>
- #define LPP 58 /* Lines per page printed */
- #define TAB 3 /* Number of spaces per TAB charactes */
- #define CHPL 68 /* Characters per line printed */
- #define FALSE 0
- #define TRUE 1 == 1
- #define LMAX 500 /* maximum line number entries in table */
- #define DKW 12 /* total number of data definition key words */
- #define KW 21 /* total number of reserved key words */
- #define NREF 9 /* number of reference entries per refno structure */
- #define NFCN 3 * 57 /* number of separate functions possible */
-
- int pagect, level, tabct, lines, stmnt, linect, fline;
-
- time_t timer;
- struct tm time_stamp;
-
- typedef int boolean;
- boolean overflow = FALSE;
- boolean pre_def = TRUE; /* flag to indicate past first function */
- boolean p_func = FALSE; /* potential function name flag */
- boolean listing = TRUE; /* generate source listing */
- boolean gen_xref = TRUE; /* generate X Reference list */
- boolean gen_qxref = TRUE; /* generate quotes in X Reference list */
- boolean gen_dir = TRUE; /* generate Function directory */
- boolean fst_tbl = TRUE;
- boolean comment, quote, squote, instrng, found_it, define;
-
- int lcol;
- unsigned char buf[600], lineimage[520], title[60], heading[26];
- unsigned char fmt[] =
- {"\fListing of file: %s Catalogued on %s Page: %d\n\n\0"};
- unsigned char xhead[] =
- {"\fX-Ref of file: %s Catalogued on %s Page: %d\n\n\0"};
- unsigned char dhead[] =
- {"\fFunction Dir. for: %s Catalogued on %s Page: %d\n\n\0"};
- unsigned char *msg[3] =
- {"overflowed quote storage area at line %d\n",
- "Exceeded NFCN functions with %s\n",
- "No memory available to store reference %s in %s\n"};
-
- extern FILE *fclose();
- FILE *prn, *fd;
- unsigned char output[60]={"PRN"};
-
- char *def_keys[DKW] = {"char", "double", "enum", "float", "int", "long",
- "signed", "short", "struct", "typedef", "unsigned",
- "void"};
- char *keyword[KW] = {"auto", "break", "case", "const", "continue", "default",
- "do", "else", "entry", "extern", "for", "goto",
- "if", "register", "return", "sizeof","static",
- "switch", "union", "volatile", "while" };
-
- int s = 0;
- char symbol[256] = "\0";
- char global[7] = "Global";
- char func_name[33];
-
- struct refno {
- struct refno *nxt; /* pointer to next NREF entries */
- int ref_num[NREF + 1]; /* line number symbol found on */
- };
-
- struct ref {
- char *name; /* pointer to symbol name */
- struct ref *nxt;
- struct refno *fst_no;
- };
-
- int dcnt = 0; /* count of entries in Directory Table */
- struct fdir {
- char *source; /* pointer to function name of line number */
- int org_no; /* first statement of function */
- } dirtbl[NFCN];
-
-
- typedef struct ref reference, *refptr;
- typedef struct refno ref_line, *noptr;
-
-
- refptr xref_top, xref_null, add_sym(), find_sym();
-
- /* top of page routine */
-
- void toppage(pr)
- FILE *pr;
-
- {
- if (listing) fprintf(pr,fmt,title,heading,pagect);
- linect=1;
- pagect++;
- }
-
- /* tabbing Modul Calculation */
-
- int mod(no,k)
- int no,k;
-
- {
- int l;
-
- l = no / k;
- l = l * k;
- return (no - l);
- }
-
- /* main program */
-
- main(argc,argv)
- int argc;
- unsigned char *argv[];
-
- {
-
- void process_sym(unsigned char), collect_sym(unsigned char);
- void dir_prt(void), xref_prt(void);
- int i, j, l, ltab, q, kk, jj, n;
- unsigned char k, lt[2], file_name[254];
- int *pb, lbrace, rbrace, dbrace, lparen, rparen, lbrack, rbrack;
- boolean cont_line, bold;
-
- /* set up heading containg date and time of listing */
-
- xref_null = (refptr) NULL;
- xref_top = xref_null; /* initialize xref_top for Add_Sym rtn */
-
- time(&timer); /* set up date in header */
- memcpy(&time_stamp,localtime(&timer),18);
- strcpy(heading,asctime(&time_stamp));
- i = 11;
- for (j = 20; j < 24; i++, j++) heading[i] = heading[j];
- heading[i] = '\0';
- fprintf(stderr,"C Program Listing Version 1.3\n");
-
- lt[1] = '\0';
-
- file_name[0] = '\0';
- for(i = 1; i < argc; i++)
- {
- strcpy(buf, strupr(argv[i]));
- if (buf[0] == '/')
- {
- kk = buf[1];
- switch (kk)
- {
- case 'L':
- listing = FALSE;
- printf("No listing will be generated\n");
- break;
- case 'Q':
- gen_qxref = FALSE;
- printf("No quotes in X-Reference will be generated\n");
- break;
- case 'X':
- gen_xref = gen_qxref = FALSE;
- printf("No X-Reference will be generated\n");
- break;
- case 'D':
- gen_dir = FALSE;
- printf("No directory of functions will be generated\n");
- break;
- case 'P':
- for (j = 2, q = 0 ; buf[j] != '\0'; j++, q++) output[q] = buf[j];
- output[++q] = '\0';
- printf("Print file: %s requested\n", output);
- break;
- default:
- printf("Unknow option: %s\n", argv[i]);
- }
- }
- else
- {
- if (file_name[0] == '\0')
- strcpy(file_name, buf);
- else
- {
- printf("More than one input file name: %s and %s\n", file_name, buf);
- exit(1);
- }
- }
- }
-
- if (file_name[0] == '\0') /*get user file name from terminal*/
- {
- printf("Key-In input filename: ");
- gets(file_name);
- printf("\n");
- }
- else
- printf("Listing Of File: %s \n",file_name);
-
- /*convert file name to filename.c*/
-
- if (index(buf, '.') == NULL) strcat(file_name,".c");
-
- prn = fopen(output,"w"); /*open printer*/
- if(prn == NULL)
- {
- fprintf(stderr,"Assignment of print device: %s failed.",output);
- exit(1);
- }
- fd=fopen(file_name,"r"); /*open file to list*/
- if (fd==NULL)
- {
- fprintf(stderr,"Cannot Open Input File: %s \n",file_name);
- exit(1);
- }
- strcpy(title,file_name);
-
- linect = pagect = 1; /*set page & line count to one*/
- toppage(prn); /*take top of page action*/
-
- /*initialize balanced counters*/
-
- stmnt = j = lcol = rbrack = lbrack = 0;
- rbrace = lbrace = dbrace = rparen = lparen = 0;
- comment=squote=instrng=quote=cont_line=define=FALSE;
-
- /* START ANALYSIS OF SOURCE */
-
- while(fgets(lineimage,519,fd) != NULL)
- {
- jj = strlen(lineimage);
- for(i=0; k=lineimage[i], (k!='\0' && i<jj); i++)
- {
- kk = k;
- if (kk == '\n')
- {
- process_sym(k);
- lines++;
- }
- if (comment == FALSE && instrng == FALSE)
- {
- /*
- switch is entered when processing outside a comment
- or string. If in a comment or string (either " or ') then
- the if statement drops thru to the else at the
- conclusion of the loop to turn processing back on
- In the case of alphanumerics the loop is totally ignored.
- */
-
- if (isspace(k))
- process_sym(k);
- else
- {
- if (isalnum(k))
- collect_sym(k);
- else
- {
- switch (kk)
- {
- case '{':
- if((level == 0) && !pre_def) define = FALSE;
- level++;
- process_sym(k);
- lbrace++;
- if (define) dbrace++;
- break;
- case '}':
- rbrace++;
- level--;
- process_sym(k);
- if (define) dbrace--;
- break;
- case '(':
- lparen++;
- process_sym(k);
- break;
- case ')':
- rparen++;
- process_sym(k);
- break;
- case '[':
- lbrack++;
- process_sym(k);
- break;
- case ']':
- rbrack++;
- process_sym(k);
- break;
- case '/':
- process_sym(k);
- comment = (lineimage[i+1] == '*');
- break;
- case ';':
- if ((dbrace == 0) || !pre_def) define = FALSE;
- process_sym(k);
- stmnt++;
- break;
- case '\'':
- quote =! squote;
- if (gen_qxref && quote)
- {
- symbol[0] = k;
- s = 1;
- }
- instrng = quote|squote;
- break;
- case '"':
- process_sym(k);
- squote = !quote;
- if (gen_qxref && squote)
- {
- symbol[0] = k;
- s = 1;
- }
- instrng = squote|quote;
- break;
- case ',':
- process_sym(k);
- break;
- case '+':
- process_sym(k);
- break;
- case '=':
- process_sym(k);
- break;
- case '-':
- process_sym(k);
- break;
- case '*':
- process_sym(k);
- break;
- case '.':
- if (pre_def)
- collect_sym(k);
- else
- process_sym(k);
- break;
- case '<':
- process_sym(k);
- break;
- case '>':
- process_sym(k);
- break;
- case '&':
- process_sym(k);
- break;
- case '|':
- process_sym(k);
- break;
- case ':':
- process_sym(k);
- break;
- case '!':
- process_sym(k);
- break;
- default:
- collect_sym(k);
- }
- }
- }
- }
- else /*if comment or instrng == TRUE*/
- {
- if (comment && k=='*' && lineimage[i+1]=='/') comment = FALSE;
- if (quote)
- if ((k == '\'') && (lineimage[i-1] != '\\'
- || (lineimage[i-2]=='\\' && lineimage[i-1]=='\\')))
- {
- quote = FALSE;
- if (gen_qxref)
- {
- symbol[s++] = k;
- process_sym(k);
- }
- }
- else
- {
- if ((s > 253) && !overflow)
- {
- printf(msg[0], lines);
- overflow = TRUE;
- }
- else
- if (gen_qxref) symbol[s++] = k;
- }
-
- if (squote)
- {
- if (k == '"')
- {
- squote=FALSE;
- if (gen_qxref)
- {
- symbol[s++] = k;
- process_sym(k);
- }
- }
- else
- {
- if ((s > 253) && !overflow)
- {
- printf(msg[0], lines);
- overflow = TRUE;
- }
- else
- if (gen_qxref) symbol[s++] = k;
- }
- }
- instrng = quote | squote;
- }
- if (k=='\t')
- {
- ltab = j + (TAB-mod(j,TAB));
- while (j < ltab)
- {
- j++;
- buf[lcol++] = ' ';
- }
- }
- else
- {
- j++;
- buf[lcol++] = k;
- }
- if (j > CHPL || k == '\n') /* Check for end of line */
- {
- if (k != '\n') buf[lcol++]='\n';
- buf[lcol]='\0';
- if (listing)
- {
- if (cont_line)
- fprintf(prn," : %s", buf);
- else
- {
- lt[0] = ' ';
- if (comment) lt[0] = '*';
- if (quote) lt[0] = '\'';
- if (squote) lt[0] = '"';
- if (k == '\n')
- fprintf(prn,"%s%2d%6d: %s",lt, level, lines, buf);
- else
- fprintf(prn,"%s%2d%6d: %s",lt, level, lines + 1, buf);
- }
- }
- if (k == '\n')
- cont_line = FALSE;
- else
- cont_line = TRUE;
- j = lcol = 0;
- if (linect++>LPP) toppage(prn);
- }
- }
- }
- if(lcol > 0) /* Sometimes the last line doesn't have a CR */
- {
- process_sym('\n');
- lt[0] = ' ';
- if (comment) lt[0] = '*';
- if (quote) lt[0] = '\'';
- if (squote) lt[0] = '"';
- buf[lcol++]='\n';
- buf[lcol]='\0';
- fprintf(prn,"%s%2d%6d: %s",lt, level, ++lines, buf);
- }
- fclose(fd);
- if (level==0 && rbrack==lbrack && rparen==lparen)
- fprintf(prn,"\n%d Statements in source code. Braces, brackets and parenthesis are balanced.\n",stmnt);
- else
- {
- fprintf(prn,"\nUnbalanced pairs { %d, } %d, [ %d, ] %d, ( %d, ) %d\n",
- lbrace,rbrace,lbrack,rbrack,lparen,rparen);
- }
- listing = TRUE;
- if (gen_dir && (dcnt > 0)) dir_prt();
- if (gen_xref) xref_prt();
- fclose(prn);
-
- }/* end main */
-
- void collect_sym(c)
- unsigned char c; /* This routine collects each symbol which
- will be added to the X-Ref list.
- It will check for symbols exceeding
- 32 characters */
- {
- if (! overflow)
- {
- if (s > 31)
- {
- symbol[32] = '\0';
- printf("Symbol %s greater than 32 characters at line %d\n", symbol, lines);
- overflow = TRUE;
- }
- else
- symbol[s++] = c;
- }
-
- } /* end collect_sym */
-
- void process_sym(token)
- unsigned char token; /* Upon each break character this routine
- will check for a proceeding symbol. If
- there is it will determine if the symbol
- belongs in the X-Ref table. It will
- check for it already in the X-Ref and
- simply add the line reference or it will
- add the symbol name in sort order */
-
- {
- void bold_symbol(void);
- boolean all_numeric();
- refptr scurr, swrk, sprev, sref;
- noptr lcurr, lwrk, lprev;
- int i;
-
- if (s == 0) return; /* check for null */
- symbol[s] = '\0'; /* end the colection of symbol characters */
- s = 0; /* reset collection pointer for next symbol*/
- overflow = FALSE; /* reset any symbol collection overflow */
-
- if (symbol[0] == '#') /* ignore compiler commands */
- {
- if (listing) bold_symbol();
- return;
- }
- if (all_numeric(symbol)) return; /* ignore all numbers */
-
- for (i = 0; (i < DKW); i++) /* drop C keywords */
- if (strcmp(symbol, def_keys[i]) == 0)
- {
- define = TRUE; /* this is a data definition */
- if (listing) bold_symbol();
- return;
- }
-
- for (i = 0; (i < KW); i++) /* drop C keywords */
- if (strcmp(symbol, keyword[i]) == 0)
- {
- if (listing) bold_symbol();
- return;
- }
-
- if ((level == 0) && (token == '(')) /* check for function definition */
- {
- p_func = TRUE;
- strcpy(func_name, symbol);
- fline = lines + 1;
- }
-
- if (gen_xref)
- {
- swrk = find_sym(symbol);
- if (! found_it) swrk = add_sym(symbol);
- lcurr = swrk->fst_no;
- while (lcurr->nxt != (noptr) NULL) lcurr = lcurr->nxt;
- for (i = 0; ((lcurr->ref_num[i] != 0)&&(i <= NREF)); i++);
- if (i > NREF)
- {
- lwrk = (noptr) malloc(sizeof(ref_line)); /* New Entry */
- if (lwrk == (noptr) NULL)
- {
- printf("No memory available to line references for %s in %s\n", symbol, func_name);
- exit(1);
- }
- lcurr->nxt = lwrk; /* link it in */
- lwrk->nxt = (noptr) NULL;
- lwrk->ref_num[0] = lines + 1;
- for (i = 1; i <= NREF; i++) lwrk->ref_num[i] = 0;
- }
- else
- lcurr->ref_num[i] = lines + 1; /* store in old entry spare */
- }
-
- if (!define && p_func && (level > 0)) /* store confirmed function names */
- {
- printf("Processing Function: %s\n", func_name);
- pre_def = FALSE;
- p_func = FALSE;
- if (gen_dir && gen_xref)
- {
- swrk = find_sym(func_name);
- if (! found_it)
- printf("Function name: %s not found in ref. table\n", func_name);
- else
- {
- dirtbl[dcnt].source = swrk->name;
- dirtbl[dcnt++].org_no = fline;
- if (dcnt >= NFCN)
- {
- printf(msg[1], func_name);
- exit(1);
- }
- }
- }
- else
- {
- if (gen_dir)
- {
- dirtbl[dcnt].source = strdup(func_name);
- dirtbl[dcnt++].org_no = fline;
- if (dcnt >= NFCN)
- {
- printf(msg[1], func_name);
- exit(1);
- }
- }
- }
-
- }
- return;
-
- } /* end of process_sym */
-
- void bold_symbol() /* This routine will add Esc E and Esc F
- around symbols which are requested to
- be made BOLD in the printer listing */
-
- {
- int l, i;
-
- l = lcol - strlen(symbol);
- buf[l++] = '\x1b';
- buf[l++] = 'E';
- for(i = 0; symbol[i] != '\0'; i++, l++) buf[l] = symbol[i];
- buf[l++] = '\x1b';
- buf[l++] = 'F';
- lcol = l;
- return;
-
- } /* end of bold_symbol */
-
- boolean all_numeric(f)
- char f[];
-
- {
-
- int i;
-
- i = 0;
- if (f[i] == '\0') return(FALSE);
- while ( f[i] != '\0')
- {
- if (f[i] != '.')
- {
- if (f[i] < '0') return(FALSE);
- if (f[i++] > '9') return(FALSE);
- }
- else
- i++;
- }
- return (TRUE);
-
- } /* end of all_numeric */
-
- refptr add_sym(sym)
- char sym[33]; /* This routine will add a symbol to the X-Ref
- list in sort order. It gets the memory
- space from MALLOC to add the X-Ref entries */
-
- {
- char *smem, *fptr;
- int i;
- refptr curr, wrk, prev;
- noptr lwrk;
-
- curr = (refptr) malloc(sizeof(reference));
- if (curr == xref_null)
- {
- printf(msg[2], sym, func_name);
- exit(1);
- }
- smem = malloc(strlen(sym) + 1);
- if (smem == (char*) NULL)
- {
- printf(msg[2], sym, func_name);
- exit(1);
- }
- curr->name = smem;
- strcpy(curr->name, sym);
- if (xref_top == xref_null) /* link new entry into sort order */
- {
- curr->nxt = xref_null; /* end list for this table */
- xref_top = curr; /* first time so set top of list */
- }
- else
- {
- wrk = find_sym(sym);
- if (wrk == xref_null)
- {
- curr->nxt = xref_top; /* top is this one's next */
- xref_top = curr; /* insert into top of list */
- }
- else
- {
- curr->nxt = wrk->nxt; /* insert after item => */
- wrk->nxt = curr;
- }
- }
- lwrk = (noptr) malloc(sizeof(ref_line));
- if (lwrk == (noptr) NULL)
- {
- printf("No memory available to line references for %s in %s\n", sym, func_name);
- exit(1);
- }
- curr->fst_no = lwrk; /* set first linkt to reference number */
- lwrk->nxt = (noptr) NULL;
- for (i = 0; i <= NREF; i++) lwrk->ref_num[i] = 0;
- return(curr);
-
- } /* end of add_sym */
-
- refptr find_sym(sym) /* Find a symbol reference in table */
- char sym[33]; /*
- This routine will return a pointer that
- will indicate where the item is or should
- be linked in to the list. A boolean indicator
- will specify whether the routine found the
- symbol or not.
-
- Returned pointer is reference point of symbol
- if the boolean found_it is TRUE.
-
- If the boolean found-it is FALSE the returned
- pointer can have two meanings:
-
- NULL - Indicates link in from the
- top pointer
- !NULL - Indicates the new item should
- be linked after the item pointed
- to
- */
-
- {
-
- refptr wrk, prev;
-
- prev = xref_null;
- wrk = xref_top;
- while ((wrk != xref_null)&&(strcmp(wrk->name, sym) < 0))
- {
-
- /* Debug stepping through reference list
- printf("stepping: o=%x n=%x oldname=%s\n", wrk, wrk->nxt, wrk->name); */
-
- prev = wrk;
- wrk = wrk->nxt;
- }
- found_it = FALSE;
- if (wrk != xref_null)
- {
- found_it = (strcmp(wrk->name, sym) == 0);
- if (found_it) prev = wrk;
- }
-
- /* DEBUG DUMP OF XREF TABLE
- if (found_it)
- printf(" - found symbol position at %x\n", prev);
- else
- printf(" - not found - link from %x\n", prev);*/
-
- return(prev);
-
- } /* end of find_sym */
-
- void dir_prt() /* This routine will print out the list of
- detected functions. The format is set
- up to be a three column per page listing */
-
- {
-
- char col1[27], col2[27], col3[27];
- int i, j, k, c1, c2, oc2, c3, oc3, cend;
-
- pagect = 1;
- strcpy(fmt, dhead);
- toppage(prn);
- j = min(dcnt/3, 50);
- dcnt = dcnt - 1;
- c1 = cend = 0;
- if (dcnt < 50)
- oc2 = c3 = c2 = oc3 = dcnt +1;
- else
- if (dcnt < 100)
- {
- c2 = oc2 = 50;
- c3 = oc3 = dcnt + 1;
- }
- else
- {
- c2 = oc2 =j;
- c3 = oc3 = c2 + j;
- }
- while (cend <= dcnt)
- {
- col1[0]=col2[0]=col3[0]='\0';
- if (c1 < oc2)
- {
- sprintf(col1, "%6d %-20s", dirtbl[c1].org_no, dirtbl[c1].source);
- cend = max(cend, ++c1);
- }
- if (c2 < oc3)
- {
- cend = max(cend, c2);
- sprintf(col2, "%6d %-20s", dirtbl[c2].org_no, dirtbl[c2].source);
- c2++;
- }
- if (c3 <= dcnt)
- {
- cend = max(cend, c3);
- sprintf(col3, "%6d %-20s", dirtbl[c3].org_no, dirtbl[c3].source);
- c3++;
- }
- fprintf(prn,"%-27s%-27s%-27s\n",col1, col2, col3);
- linect++;
- if (linect > 50)
- {
- toppage(prn);
- c1 = cend + 1;
- c2 = oc2 = c1 + 50;
- c3 = oc3 = c2 + 50;
- }
- }
- }
-
- void xref_prt() /* This routine will print out a cross-reference
- listing of all symbols stored in the X-Ref
- table. Symbols are given at least 12
- characters before the line number are printed. */
-
- {
- char psym[65];
- int i, p, t;
- refptr curr, next;
- noptr lc;
-
- pagect = 1; /* initialize page number */
- strcpy(fmt, xhead); /* set up new header */
- linect = 55; /* force top of page */
- next = xref_top; /* get first X-Ref entry */
- while (next != xref_null)
- {
- if (linect > 50) toppage(prn);
- curr = next; /* get next Xref Entry */
- next = curr->nxt;
- lc = curr->fst_no; /* get first line number table */
- i = 0;
- fprintf(prn,"%s", curr->name);
- p = strlen(curr->name);
- if (p < 12) /* start line numbers a column 12 */
- while (p <= 11)
- {
- fprintf(prn, " ");
- p++;
- }
- else
- { /* or on the even 6th character past column 12 */
- t = mod(p, 6);
- if (t != 6)
- for (t = 6 - t; t > 0; t-- , p++) fprintf(prn, " ");
- }
- while ((lc != (noptr) NULL) && (lc->ref_num[i] > 0))
- {
- fprintf(prn, "%6d", lc->ref_num[i]); /* print a line number */
- i = i + 1;
- if (i > NREF)
- { /* Exhausted this table set */
- lc = lc->nxt; /* Get next set of NREF entries */
- i = 0;
- }
- p = p + 6; /* Bump printed columns */
- if (p >= 74)
- {
- xref_pager();
- fprintf(prn, " "); /* put in leading spaces */
- p = 12;
- }
- }
- if (p > 0) xref_pager();
- }
-
-
- }
-
- xref_pager()
-
- {
- linect++; /* End of print line */
- if (linect > 57)
- toppage(prn); /* Bump the page */
- else
- fprintf(prn, "\n"); /* Just print a CR */
- }