Download C User's Guide

Transcript
cscope Function: Correcting the Problem:
void
dispinit()
{
/* calculate the maximum displayed reference lines */
lastdispline = FLDLINE - 4;
mdisprefs = lastdispline - REFLINE + 1;
if (mdisprefs > 9) {
mdisprefs = 9;
}
/* allocate the displayed line array */
displine = (int *) mymalloc(mdisprefs * sizeof(int));
}
^L/* display a page of the references */
void
display()
{
char file[PATHLEN + 1]; /* file name */
char function[PATLEN + 1];/* function name */
char linenum[NUMLEN + 1]; /* line number */
int screenline; /* screen line number */
int width; /* source line display width */
register int i, j;
"display.c" 622 lines, 14326 characters
You have fixed the problem we began investigating at the beginning of this section.
Now if prog is run in a window with too few lines, it does not simply fail with the
unedifying error message out of storage. Instead, it checks the window size and
generates a more meaningful error message before exiting.
8.2.5
Command-Line Options
As noted, cscope builds a symbol cross-reference table for the C, lex, and source
files in the current directory by default. That is,
% cscope
is equivalent to:
% cscope *.[chly]
Chapter 8
cscope: Interactively Examining a C Program
8-11