From: Hans-Bernhard B. <br...@us...> - 2001-07-05 17:54:17
|
Update of /cvsroot/cscope/cscope/src In directory usw-pr-cvs1:/tmp/cvs-serv6737/src Modified Files: command.c crossref.c dir.c display.c exec.c global.h input.c invlib.c invlib.h library.h logdir.c main.c mygetenv.c Log Message: Added lots of prototypes, and made lots of funcs/vars "static" Index: command.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/command.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** command.c 2001/07/05 15:08:21 1.13 --- command.c 2001/07/05 16:47:04 1.14 *************** *** 63,71 **** static char toprompt[] = "To: "; ! void atchange(void); ! BOOL changestring(void); ! void clearprompt(void); ! void mark(int i); ! void scrollbar(MOUSE *p); static void countrefs(void); --- 63,71 ---- static char toprompt[] = "To: "; ! /* Internal prototypes: */ ! static BOOL changestring(void); ! static void clearprompt(void); ! static void mark(int i); ! static void scrollbar(MOUSE *p); static void countrefs(void); *************** *** 538,542 **** /* clear the prompt line */ ! void clearprompt(void) { --- 538,542 ---- /* clear the prompt line */ ! static void clearprompt(void) { *************** *** 576,580 **** /* change one text string to another */ ! BOOL changestring(void) { --- 576,580 ---- /* change one text string to another */ ! static BOOL changestring(void) { *************** *** 777,781 **** /* mark/unmark this displayed line to be changed */ ! void mark(int i) { --- 777,781 ---- /* mark/unmark this displayed line to be changed */ ! static void mark(int i) { *************** *** 799,803 **** /* scrollbar actions */ ! void scrollbar(MOUSE *p) { --- 799,803 ---- /* scrollbar actions */ ! static void scrollbar(MOUSE *p) { Index: crossref.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/crossref.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** crossref.c 2001/07/05 14:31:00 1.9 --- crossref.c 2001/07/05 16:47:04 1.10 *************** *** 62,66 **** long dboffset; /* new database offset */ BOOL errorsfound; /* prompt before clearing messages */ - long fileindex; /* source file name index */ long lineoffset; /* source line database offset */ long npostings; /* number of postings */ --- 62,65 ---- Index: dir.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/dir.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** dir.c 2001/03/27 14:09:19 1.10 --- dir.c 2001/07/05 16:47:04 1.11 *************** *** 58,68 **** char **srcfiles; /* source files */ int nincdirs; /* number of #include directories */ - int mincdirs = DIRINC; /* maximum number of #include directories */ int nsrcdirs; /* number of source directories */ - int msrcdirs; /* maximum number of source directories */ int nsrcfiles; /* number of source files */ int msrcfiles = SRCINC; /* maximum number of source files */ static char **incnames; /* #include directory names without view pathing */ static int nvpsrcdirs; /* number of view path source directories */ --- 58,68 ---- char **srcfiles; /* source files */ int nincdirs; /* number of #include directories */ int nsrcdirs; /* number of source directories */ int nsrcfiles; /* number of source files */ int msrcfiles = SRCINC; /* maximum number of source files */ static char **incnames; /* #include directory names without view pathing */ + static int mincdirs = DIRINC; /* maximum number of #include directories */ + static int msrcdirs; /* maximum number of source directories */ static int nvpsrcdirs; /* number of view path source directories */ *************** *** 72,85 **** } *srcnames[HASHMOD]; ! BOOL issrcfile(char *file); ! void addsrcdir(char *dir); ! void addincdir(char *name, char *path); - static void scan_dir(const char *dirfile, BOOL recurse); - /* make the source file list */ /* make the view source directory list */ ! void makevpsrcdirs(void) { --- 72,86 ---- } *srcnames[HASHMOD]; ! /* Internal prototypes: */ ! static BOOL issrcfile(char *file); ! static void addsrcdir(char *dir); ! static void addincdir(char *name, char *path); ! static void scan_dir(const char *dirfile, BOOL recurse); ! static void makevpsrcdirs(void); /* make the view source directory list */ ! static void makevpsrcdirs(void) { *************** *** 148,152 **** /* add a source directory to the list */ ! void addsrcdir(char *dir) { --- 149,153 ---- /* add a source directory to the list */ ! static void addsrcdir(char *dir) { *************** *** 212,216 **** /* add a #include directory to the list */ ! void addincdir(char *name, char *path) { --- 213,217 ---- /* add a #include directory to the list */ ! static void addincdir(char *name, char *path) { *************** *** 408,412 **** /* see if this is a source file */ ! BOOL issrcfile(char *file) { --- 409,413 ---- /* see if this is a source file */ ! static BOOL issrcfile(char *file) { Index: display.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/display.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** display.c 2001/06/01 12:43:24 1.15 --- display.c 2001/07/05 16:47:04 1.16 *************** *** 76,80 **** static int fldline; /* input field line */ static jmp_buf env; /* setjmp/longjmp buffer */ ! int lastdispline; /* last displayed reference line */ static char lastmsg[MSGLEN + 1]; /* last message displayed */ static char helpstring[] = "Press the ? key for help"; --- 76,80 ---- static int fldline; /* input field line */ static jmp_buf env; /* setjmp/longjmp buffer */ ! static int lastdispline; /* last displayed reference line */ static char lastmsg[MSGLEN + 1]; /* last message displayed */ static char helpstring[] = "Press the ? key for help"; *************** *** 106,109 **** --- 106,112 ---- }; + /* Internal prototypes: */ + static RETSIGTYPE jumpback(int sig); + /* initialize display parameters */ *************** *** 390,394 **** /*ARGSUSED*/ ! RETSIGTYPE jumpback(int sig) { --- 393,397 ---- /*ARGSUSED*/ ! static RETSIGTYPE jumpback(int sig) { Index: exec.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/exec.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** exec.c 2001/07/05 14:31:00 1.6 --- exec.c 2001/07/05 16:47:04 1.7 *************** *** 52,58 **** static char const rcsid[] = "$Id$"; ! static RETSIGTYPE (*oldsigquit)(); /* old value of quit signal */ ! static RETSIGTYPE (*oldsighup)(); /* old value of hangup signal */ ! static RETSIGTYPE (*oldsigstp)(); #ifndef __MSDOS__ /* none of these is needed, there */ --- 52,58 ---- static char const rcsid[] = "$Id$"; ! static RETSIGTYPE (*oldsigquit)(int); /* old value of quit signal */ ! static RETSIGTYPE (*oldsighup)(int); /* old value of hangup signal */ ! static RETSIGTYPE (*oldsigstp)(int); /* old value of SIGTSTP */ #ifndef __MSDOS__ /* none of these is needed, there */ Index: global.h =================================================================== RCS file: /cvsroot/cscope/cscope/src/global.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** global.h 2001/07/05 14:31:00 1.16 --- global.h 2001/07/05 16:47:04 1.17 *************** *** 176,180 **** --- 176,182 ---- extern char *prependpath; /* prepend path to file names */ extern FILE *refsfound; /* references found file */ + #if 0 /* HBB 20010705: flag no longer used */ extern BOOL select_large; /* enable more than 9 select lines */ + #endif extern int symrefs; /* cross-reference file */ extern char temp1[]; /* temporary file name */ *************** *** 196,200 **** extern long dboffset; /* new database offset */ extern BOOL errorsfound; /* prompt before clearing error messages */ - extern long fileindex; extern long lineoffset; /* source line database offset */ extern long npostings; /* number of postings */ --- 198,201 ---- *************** *** 265,269 **** char *inviewpath(char *file); char *lookup(char *ident); - char *mygetenv(char *variable, char *deflt); char *pathcomponents(char *path, int components); char *readblock(void); --- 266,269 ---- *************** *** 275,278 **** --- 275,279 ---- void askforchar(void); void askforreturn(void); + void atchange(void); void atfield(void); void cannotwrite(char *file); *************** *** 295,299 **** void help(void); void incfile(char *file, char *type); ! void includedir(char *dirname); void initsymtab(void); void makefilelist(void); --- 296,300 ---- void help(void); void incfile(char *file, char *type); ! void includedir(char *_dirname); void initsymtab(void); void makefilelist(void); *************** *** 328,332 **** BOOL writerefsfound(void); - FILE *myfopen(char *path, char *mode); FINDINIT findinit(char *pattern); MOUSE *getmouseaction(char leading_char); --- 329,332 ---- *************** *** 338,342 **** int getline(char s[], unsigned size, int firstchar, BOOL iscaseless); int mygetch(void); - int myopen(char *path, int flag, int mode); int hash(char *ss); int execute(char *a, ...); --- 338,341 ---- Index: input.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/input.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** input.c 2001/06/28 15:12:35 1.8 --- input.c 2001/07/05 16:47:04 1.9 *************** *** 53,60 **** static int prevchar; /* previous, ungotten character */ /* catch the interrupt signal */ /*ARGSUSED*/ ! RETSIGTYPE catchint(int sig) { --- 53,63 ---- static int prevchar; /* previous, ungotten character */ + /* Internal prototypes: */ + static RETSIGTYPE catchint(int sig); + /* catch the interrupt signal */ /*ARGSUSED*/ ! static RETSIGTYPE catchint(int sig) { *************** *** 77,81 **** mygetch(void) { ! RETSIGTYPE (*savesig)(); /* old value of signal */ int c; --- 80,84 ---- mygetch(void) { ! RETSIGTYPE (*savesig)(int); /* old value of signal */ int c; Index: invlib.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/invlib.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** invlib.c 2001/07/05 14:31:00 1.13 --- invlib.c 2001/07/05 16:47:04 1.14 *************** *** 60,64 **** --- 60,69 ---- static char const rcsid[] = "$Id$"; + #if DEBUG + /* FIXME HBB 20010705: nowhere in the source is `invbreak' ever set to + * a value other than the (silent) initialization to zero. Pretty + * useless, that looks */ int invbreak; + #endif static int boolready(void); Index: invlib.h =================================================================== RCS file: /cvsroot/cscope/cscope/src/invlib.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** invlib.h 2001/07/05 14:31:00 1.4 --- invlib.h 2001/07/05 16:47:04 1.5 *************** *** 113,117 **** long invfind(INVCONTROL *invcntl, char *searchterm); int invforward(INVCONTROL *invcntl); ! int invopen(INVCONTROL *invcntl, char *invname, char *invpost, int stat); long invmake(char *invname, char *invpost, FILE *infile); long invterm(INVCONTROL *invcntl, char *term); --- 113,117 ---- long invfind(INVCONTROL *invcntl, char *searchterm); int invforward(INVCONTROL *invcntl); ! int invopen(INVCONTROL *invcntl, char *invname, char *invpost, int status); long invmake(char *invname, char *invpost, FILE *infile); long invterm(INVCONTROL *invcntl, char *term); Index: library.h =================================================================== RCS file: /cvsroot/cscope/cscope/src/library.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** library.h 2001/07/05 15:08:21 1.7 --- library.h 2001/07/05 16:47:04 1.8 *************** *** 39,48 **** /* private library */ - char *mybasename(char *path); char *compath(char *pathname); char *egrepinit(char *egreppat); char *logdir(char *name); void *mycalloc(int nelem, int size); void *mymalloc(int size); void *myrealloc(void *p, int size); char *stralloc(char *s); --- 39,51 ---- /* private library */ char *compath(char *pathname); char *egrepinit(char *egreppat); char *logdir(char *name); + char *mybasename(char *path); void *mycalloc(int nelem, int size); + FILE *myfopen(char *path, char *mode); + char *mygetenv(char *variable, char *deflt); void *mymalloc(int size); + int myopen(char *path, int flag, int mode); void *myrealloc(void *p, int size); char *stralloc(char *s); *************** *** 53,56 **** --- 56,62 ---- /* Programmer's Workbench library (-lPW) */ + /* FIXME HBB 20010705: these should never be here. We should just + * #include the relevant header, instead. Moreover, they don't seem + * to be used, anyway ... */ char *regcmp(), *regex(); Index: logdir.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/logdir.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** logdir.c 2000/05/03 22:02:10 1.3 --- logdir.c 2001/07/05 16:47:04 1.4 *************** *** 51,54 **** --- 51,58 ---- static char line[OURBUFSIZ+1]; + /* Internal prototypes: */ + static char *nextfield(char *p); + + static char * nextfield(char *p) Index: main.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/main.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** main.c 2001/07/05 15:08:21 1.22 --- main.c 2001/07/05 16:47:04 1.23 *************** *** 70,74 **** char dicode2[256]; /* digraph second character code */ ! char *editor, *home, *shell, *lineflag; /* environment variables */ BOOL lineflagafterfile; char *argv0; /* command name */ --- 70,74 ---- char dicode2[256]; /* digraph second character code */ ! char *editor, *shell, *lineflag; /* environment variables */ BOOL lineflagafterfile; char *argv0; /* command name */ *************** *** 99,103 **** --- 99,105 ---- char *prependpath; /* prepend path to file names */ FILE *refsfound; /* references found file */ + #if 0 /* HBB 20010705: flag no longer used */ BOOL select_large = NO; /* enable more than 9 select lines */ + #endif int symrefs = -1; /* cross-reference file */ char temp1[PATHLEN + 1]; /* temporary file name */ *************** *** 110,113 **** --- 112,116 ---- static BOOL buildonly = NO; /* only build the database */ static BOOL fileschanged; /* assume some files changed */ + static char *home; /* Home directory */ static char *invname = INVNAME; /* inverted index to the database */ static char *invpost = INVPOST; /* inverted index postings */ *************** *** 119,140 **** static BOOL unconditional; /* unconditionally build database */ ! BOOL samelist(FILE *oldrefs, char **names, int count); ! char *getoldfile(void); ! int compare(const void *s1, const void *s2); /* needed for qsort call */ ! void copydata(void); ! void copyinverted(void); ! void initcompress(void); ! void movefile(char *new, char *old); ! void opendatabase(void); ! void putheader(char *dir); ! void putinclude(char *s); ! void putlist(char **names, int count); ! void skiplist(FILE *oldrefs); static void build(void); ! static void usage(void); static void longusage(void); #ifdef HAVE_FIXKEYPAD ! void fixkeypad(); #endif --- 122,145 ---- static BOOL unconditional; /* unconditionally build database */ ! /* Internal prototypes: */ static void build(void); ! static void cannotindex(void); ! static int compare(const void *s1, const void *s2); ! static void copydata(void); ! static void copyinverted(void); ! static char *getoldfile(void); ! static void initcompress(void); static void longusage(void); + static void movefile(char *new, char *old); + static void opendatabase(void); + static void putheader(char *dir); + static void putinclude(char *s); + static void putlist(char **names, int count); + static BOOL samelist(FILE *oldrefs, char **names, int count); + static void skiplist(FILE *oldrefs); + static void usage(void); #ifdef HAVE_FIXKEYPAD ! void fixkeypad(); #endif *************** *** 297,303 **** --- 302,310 ---- } goto nextarg; + #if 0 /* HBB 20010705: unused, now! */ case 't': /* enable more than 9 select lines */ select_large = YES; break; + #endif default: (void) fprintf(stderr, "%s: unknown option: -%c\n", argv0, *************** *** 344,349 **** /* if running in the foreground */ if (signal(SIGINT, SIG_IGN) != SIG_IGN) { - void myexit(); /* needed by ctrace */ - /* cleanup on the interrupt and quit signals */ (void) signal(SIGINT, myexit); --- 351,354 ---- *************** *** 704,708 **** } ! void cannotindex(void) { --- 709,713 ---- } ! static void cannotindex(void) { *************** *** 747,751 **** /* set up the digraph character tables for text compression */ ! void initcompress(void) { --- 752,756 ---- /* set up the digraph character tables for text compression */ ! static void initcompress(void) { *************** *** 764,768 **** /* open the database */ ! void opendatabase(void) { --- 769,773 ---- /* open the database */ ! static void opendatabase(void) { *************** *** 821,824 **** --- 826,830 ---- int built = 0; /* built crossref for these files */ int copied = 0; /* copied crossref for these files */ + long fileindex; /* source file name index */ BOOL interactive = YES; /* output progress messages */ *************** *** 1094,1098 **** /* string comparison function for qsort */ ! int compare(const void *arg_s1, const void *arg_s2) { --- 1100,1104 ---- /* string comparison function for qsort */ ! static int compare(const void *arg_s1, const void *arg_s2) { *************** *** 1105,1109 **** /* get the next file name in the old cross-reference */ ! char * getoldfile(void) { --- 1111,1115 ---- /* get the next file name in the old cross-reference */ ! static char * getoldfile(void) { *************** *** 1128,1132 **** the database trailer offset */ ! void putheader(char *dir) { --- 1134,1138 ---- the database trailer offset */ ! static void putheader(char *dir) { *************** *** 1155,1159 **** /* put the name list into the cross-reference file */ ! void putlist(char **names, int count) { --- 1161,1165 ---- /* put the name list into the cross-reference file */ ! static void putlist(char **names, int count) { *************** *** 1180,1184 **** /* see if the name list is the same in the cross-reference file */ ! BOOL samelist(FILE *oldrefs, char **names, int count) { --- 1186,1190 ---- /* see if the name list is the same in the cross-reference file */ ! static BOOL samelist(FILE *oldrefs, char **names, int count) { *************** *** 1204,1208 **** /* skip the list in the cross-reference file */ ! void skiplist(FILE *oldrefs) { --- 1210,1214 ---- /* skip the list in the cross-reference file */ ! static void skiplist(FILE *oldrefs) { *************** *** 1223,1227 **** /* copy this file's symbol data */ ! void copydata(void) { --- 1229,1233 ---- /* copy this file's symbol data */ ! static void copydata(void) { *************** *** 1262,1266 **** /* copy this file's symbol data and output the inverted index postings */ ! void copyinverted(void) { --- 1268,1272 ---- /* copy this file's symbol data and output the inverted index postings */ ! static void copyinverted(void) { *************** *** 1334,1338 **** /* process the #included file in the old database */ ! void putinclude(char *s) { --- 1340,1344 ---- /* process the #included file in the old database */ ! static void putinclude(char *s) { *************** *** 1345,1349 **** /* replace the old file with the new file */ ! void movefile(char *new, char *old) { --- 1351,1355 ---- /* replace the old file with the new file */ ! static void movefile(char *new, char *old) { Index: mygetenv.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/mygetenv.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** mygetenv.c 2000/05/03 22:02:10 1.2 --- mygetenv.c 2001/07/05 16:47:04 1.3 *************** *** 33,36 **** --- 33,38 ---- static char const rcsid[] = "$Id$"; + #include "library.h" + #include <stdlib.h> |