formatting cont.

Removes all leading whitespace
Converts the tabs in headers
This commit is contained in:
Emil 2023-08-04 12:34:51 -06:00
parent ff21fa6438
commit e672fc4f57
37 changed files with 651 additions and 652 deletions

View File

@ -735,4 +735,3 @@ fetch_include_from_dbase(char *s, size_t length)
fetch_string_from_dbase(s, length); fetch_string_from_dbase(s, length);
incfile(s + 1, s); incfile(s + 1, s);
} }

View File

@ -33,30 +33,30 @@
#ifndef CSCOPE_BUILD_H #ifndef CSCOPE_BUILD_H
#define CSCOPE_BUILD_H #define CSCOPE_BUILD_H
#include "global.h" /* FIXME: temp. only */ #include "global.h" /* FIXME: temp. only */
#include "invlib.h" #include "invlib.h"
/* types and macros of build.c to be used by other modules */ /* types and macros of build.c to be used by other modules */
/* database output macros that update its offset */ /* database output macros that update its offset */
#define dbputc(c) (++dboffset, (void) putc(c, newrefs)) #define dbputc(c) (++dboffset, (void) putc(c, newrefs))
#define dbfputs(s) (dboffset += strlen(s), fputs(s, newrefs)) #define dbfputs(s) (dboffset += strlen(s), fputs(s, newrefs))
/* declarations for globals defined in build.c */ /* declarations for globals defined in build.c */
extern BOOL buildonly; /* only build the database */ extern BOOL buildonly; /* only build the database */
extern BOOL unconditional; /* unconditionally build database */ extern BOOL unconditional; /* unconditionally build database */
extern BOOL fileschanged; /* assume some files changed */ extern BOOL fileschanged; /* assume some files changed */
extern char *reffile; /* cross-reference file path name */ extern char *reffile; /* cross-reference file path name */
extern char *invname; /* inverted index to the database */ extern char *invname; /* inverted index to the database */
extern char *invpost; /* inverted index postings */ extern char *invpost; /* inverted index postings */
extern char *newreffile; /* new cross-reference file name */ extern char *newreffile; /* new cross-reference file name */
extern FILE *newrefs; /* new cross-reference */ extern FILE *newrefs; /* new cross-reference */
extern FILE *postings; /* new inverted index postings */ extern FILE *postings; /* new inverted index postings */
extern int symrefs; /* cross-reference file */ extern int symrefs; /* cross-reference file */
extern INVCONTROL invcontrol; /* inverted file control structure */ extern INVCONTROL invcontrol; /* inverted file control structure */
/* Prototypes of external functions defined by build.c */ /* Prototypes of external functions defined by build.c */

View File

@ -38,43 +38,43 @@
#ifndef CSCOPE_CONSTANTS_H #ifndef CSCOPE_CONSTANTS_H
#define CSCOPE_CONSTANTS_H #define CSCOPE_CONSTANTS_H
#define ctrl(x) (x & 037) /* control character macro */ #define ctrl(x) (x & 037) /* control character macro */
/* fast string equality tests (avoids most strcmp() calls) */ /* fast string equality tests (avoids most strcmp() calls) */
#define strequal(s1, s2) (*(s1) == *(s2) && strcmp(s1, s2) == 0) #define strequal(s1, s2) (*(s1) == *(s2) && strcmp(s1, s2) == 0)
#define strnotequal(s1, s2) (*(s1) != *(s2) || strcmp(s1, s2) != 0) #define strnotequal(s1, s2) (*(s1) != *(s2) || strcmp(s1, s2) != 0)
/* set the mark character for searching the cross-reference file */ /* set the mark character for searching the cross-reference file */
#define setmark(c) (blockmark = c, block[blocklen] = blockmark) #define setmark(c) (blockmark = c, block[blocklen] = blockmark)
/* get the next character in the cross-reference */ /* get the next character in the cross-reference */
/* note that blockp is assumed not to be null */ /* note that blockp is assumed not to be null */
#define getrefchar() (*(++blockp + 1) != '\0' ? *blockp : \ #define getrefchar() (*(++blockp + 1) != '\0' ? *blockp : \
(read_block() != NULL ? *blockp : '\0')) (read_block() != NULL ? *blockp : '\0'))
/* skip the next character in the cross-reference */ /* skip the next character in the cross-reference */
/* note that blockp is assumed not to be null and that /* note that blockp is assumed not to be null and that
this macro will always be in a statement by itself */ this macro will always be in a statement by itself */
#define skiprefchar() if (*(++blockp + 1) == '\0') (void) read_block() #define skiprefchar() if (*(++blockp + 1) == '\0') (void) read_block()
#ifndef ESC #ifndef ESC
# define ESC '\033' /* escape character */ # define ESC '\033' /* escape character */
#endif #endif
#define DEL '\177' /* delete character */ #define DEL '\177' /* delete character */
#define DUMMYCHAR ' ' /* use space as a dummy character */ #define DUMMYCHAR ' ' /* use space as a dummy character */
#define MSGLEN ((PATLEN) + 80) /* displayed message length */ #define MSGLEN ((PATLEN) + 80) /* displayed message length */
#define NUMLEN 10 /* line number length */ #define NUMLEN 10 /* line number length */
#define PATHLEN 250 /* file pathname length */ #define PATHLEN 250 /* file pathname length */
#define PATLEN 250 /* symbol pattern length */ #define PATLEN 250 /* symbol pattern length */
#define TEMPSTRING_LEN 8191 /* max strlen() of the global temp string */ #define TEMPSTRING_LEN 8191 /* max strlen() of the global temp string */
#define REFFILE "cscope.out" /* cross-reference output file */ #define REFFILE "cscope.out" /* cross-reference output file */
#define NAMEFILE "cscope.files" /* default list-of-files file */ #define NAMEFILE "cscope.files" /* default list-of-files file */
#define INVNAME "cscope.in.out" /* inverted index to the database */ #define INVNAME "cscope.in.out" /* inverted index to the database */
#define INVPOST "cscope.po.out" /* inverted index postings */ #define INVPOST "cscope.po.out" /* inverted index postings */
#define INVNAME2 "cscope.out.in"/* follows correct naming convention */ #define INVNAME2 "cscope.out.in"/* follows correct naming convention */
#define INVPOST2 "cscope.out.po"/* follows correct naming convention */ #define INVPOST2 "cscope.out.po"/* follows correct naming convention */
#define STMTMAX 10000 /* maximum source statement length */ #define STMTMAX 10000 /* maximum source statement length */
#define STR2(x) #x #define STR2(x) #x
#define STRINGIZE(x) STR2(x) #define STRINGIZE(x) STR2(x)
@ -84,32 +84,32 @@
#define TEMPSTRING_LEN_STR STRINGIZE(TEMPSTRING_LEN) #define TEMPSTRING_LEN_STR STRINGIZE(TEMPSTRING_LEN)
/* screen lines */ /* screen lines */
#define FLDLINE (LINES - FIELDS - 1 - 1) /* first input field line */ #define FLDLINE (LINES - FIELDS - 1 - 1) /* first input field line */
#define MSGLINE 0 /* message line */ #define MSGLINE 0 /* message line */
#define PRLINE (LINES - 1) /* input prompt line */ #define PRLINE (LINES - 1) /* input prompt line */
/* input fields (value matches field order on screen) */ /* input fields (value matches field order on screen) */
#define SYMBOL 0 #define SYMBOL 0
#define DEFINITION 1 #define DEFINITION 1
#define CALLEDBY 2 #define CALLEDBY 2
#define CALLING 3 #define CALLING 3
#define STRING 4 #define STRING 4
#define CHANGE 5 #define CHANGE 5
#define REGEXP 6 #define REGEXP 6
#define FILENAME 7 #define FILENAME 7
#define INCLUDES 8 #define INCLUDES 8
#define FIELDS 10 #define FIELDS 10
/* file open modes */ /* file open modes */
#ifndef R_OK #ifndef R_OK
# define READ R_OK # define READ R_OK
#else #else
# define READ 4 # define READ 4
#endif #endif
#ifdef W_OK #ifdef W_OK
# define WRITE W_OK # define WRITE W_OK
#else #else
# define WRITE 2 # define WRITE 2
#endif #endif
#define O_TEXT 0x00 #define O_TEXT 0x00
@ -159,7 +159,7 @@
/**/ /**/
#if (BSD || V9) && !__NetBSD__ && !__FreeBSD__ && !__APPLE__ #if (BSD || V9) && !__NetBSD__ && !__FreeBSD__ && !__APPLE__
# define TERMINFO 0 /* no terminfo curses */ # define TERMINFO 0 /* no terminfo curses */
#else #else
# define TERMINFO 1 # define TERMINFO 1
#endif #endif
@ -167,25 +167,25 @@
#if !TERMINFO #if !TERMINFO
# ifndef KEY_BREAK # ifndef KEY_BREAK
# define KEY_BREAK 0400 /* easier to define than to add #if around the use */ # define KEY_BREAK 0400 /* easier to define than to add #if around the use */
# endif # endif
# ifndef KEY_ENTER # ifndef KEY_ENTER
# define KEY_ENTER 0401 # define KEY_ENTER 0401
# endif # endif
# ifndef KEY_BACKSPACE # ifndef KEY_BACKSPACE
# define KEY_BACKSPACE 0402 # define KEY_BACKSPACE 0402
# endif # endif
# if !sun # if !sun
# define cbreak() crmode() /* name change */ # define cbreak() crmode() /* name change */
# endif # endif
# if UNIXPC # if UNIXPC
# define erasechar() (_tty.c_cc[VERASE]) /* equivalent */ # define erasechar() (_tty.c_cc[VERASE]) /* equivalent */
# define killchar() (_tty.c_cc[VKILL]) /* equivalent */ # define killchar() (_tty.c_cc[VKILL]) /* equivalent */
# else # else
# define erasechar() (_tty.sg_erase) /* equivalent */ # define erasechar() (_tty.sg_erase) /* equivalent */
# define killchar() (_tty.sg_kill) /* equivalent */ # define killchar() (_tty.sg_kill) /* equivalent */
# endif /* if UNIXPC */ # endif /* if UNIXPC */
#endif /* if !TERMINFO */ #endif /* if !TERMINFO */

View File

@ -58,30 +58,30 @@ typedef void (*sighandler_t)(int);
#include <fcntl.h> #include <fcntl.h>
typedef enum { /* boolean data type */ typedef enum { /* boolean data type */
NO, NO,
YES YES
} BOOL; } BOOL;
typedef enum { /* findinit return code */ typedef enum { /* findinit return code */
NOERROR, NOERROR,
NOTSYMBOL, NOTSYMBOL,
REGCMPERROR REGCMPERROR
} FINDINIT; } FINDINIT;
typedef struct { /* mouse action */ typedef struct { /* mouse action */
int button; int button;
int percent; int percent;
int x1; int x1;
int y1; int y1;
int x2; int x2;
int y2; int y2;
} MOUSE; } MOUSE;
struct cmd { /* command history struct */ struct cmd { /* command history struct */
struct cmd *prev, *next; /* list ptrs */ struct cmd *prev, *next; /* list ptrs */
int field; /* input field number */ int field; /* input field number */
char *text; /* input field text */ char *text; /* input field text */
}; };
enum { enum {
@ -100,113 +100,113 @@ enum {
/* digraph data for text compression */ /* digraph data for text compression */
extern char dichar1[]; /* 16 most frequent first chars */ extern char dichar1[]; /* 16 most frequent first chars */
extern char dichar2[]; /* 8 most frequent second chars extern char dichar2[]; /* 8 most frequent second chars
using the above as first chars */ using the above as first chars */
extern char dicode1[]; /* digraph first character code */ extern char dicode1[]; /* digraph first character code */
extern char dicode2[]; /* digraph second character code */ extern char dicode2[]; /* digraph second character code */
/* and some macros to help using dicodes: */ /* and some macros to help using dicodes: */
/* Check if a given pair of chars is compressable as a dicode: */ /* Check if a given pair of chars is compressable as a dicode: */
#define IS_A_DICODE(inchar1, inchar2) \ #define IS_A_DICODE(inchar1, inchar2) \
(dicode1[(unsigned char)(inchar1)] && dicode2[(unsigned char)(inchar2)]) (dicode1[(unsigned char)(inchar1)] && dicode2[(unsigned char)(inchar2)])
/* Combine the pair into a dicode */ /* Combine the pair into a dicode */
#define DICODE_COMPRESS(inchar1, inchar2) \ #define DICODE_COMPRESS(inchar1, inchar2) \
((0200 - 2) + dicode1[(unsigned char)(inchar1)] \ ((0200 - 2) + dicode1[(unsigned char)(inchar1)] \
+ dicode2[(unsigned char)(inchar2)]) + dicode2[(unsigned char)(inchar2)])
/* main.c global data */ /* main.c global data */
extern char *editor, *home, *shell, *lineflag; /* environment variables */ extern char *editor, *home, *shell, *lineflag; /* environment variables */
extern char *home; /* Home directory */ extern char *home; /* Home directory */
extern BOOL lineflagafterfile; extern BOOL lineflagafterfile;
extern char *argv0; /* command name */ extern char *argv0; /* command name */
extern BOOL compress; /* compress the characters in the crossref */ extern BOOL compress; /* compress the characters in the crossref */
extern BOOL dbtruncated; /* database symbols truncated to 8 chars */ extern BOOL dbtruncated; /* database symbols truncated to 8 chars */
extern int dispcomponents; /* file path components to display */ extern int dispcomponents; /* file path components to display */
#if CCS #if CCS
extern BOOL displayversion; /* display the C Compilation System version */ extern BOOL displayversion; /* display the C Compilation System version */
#endif #endif
extern BOOL editallprompt; /* prompt between editing files */ extern BOOL editallprompt; /* prompt between editing files */
extern unsigned int fileargc; /* file argument count */ extern unsigned int fileargc; /* file argument count */
extern char **fileargv; /* file argument values */ extern char **fileargv; /* file argument values */
extern int fileversion; /* cross-reference file version */ extern int fileversion; /* cross-reference file version */
extern BOOL incurses; /* in curses */ extern BOOL incurses; /* in curses */
extern BOOL invertedindex; /* the database has an inverted index */ extern BOOL invertedindex; /* the database has an inverted index */
extern BOOL isuptodate; /* consider the crossref up-to-date */ extern BOOL isuptodate; /* consider the crossref up-to-date */
extern BOOL kernelmode; /* don't use DFLT_INCDIR - bad for kernels */ extern BOOL kernelmode; /* don't use DFLT_INCDIR - bad for kernels */
extern BOOL linemode; /* use line oriented user interface */ extern BOOL linemode; /* use line oriented user interface */
extern BOOL verbosemode; /* print extra information on line mode */ extern BOOL verbosemode; /* print extra information on line mode */
extern BOOL recurse_dir; /* recurse dirs when searching for src files */ extern BOOL recurse_dir; /* recurse dirs when searching for src files */
extern char *namefile; /* file of file names */ extern char *namefile; /* file of file names */
extern BOOL ogs; /* display OGS book and subsystem names */ extern BOOL ogs; /* display OGS book and subsystem names */
extern char *prependpath; /* prepend path to file names */ extern char *prependpath; /* prepend path to file names */
extern FILE *refsfound; /* references found file */ extern FILE *refsfound; /* references found file */
extern char temp1[]; /* temporary file name */ extern char temp1[]; /* temporary file name */
extern char temp2[]; /* temporary file name */ extern char temp2[]; /* temporary file name */
extern long totalterms; /* total inverted index terms */ extern long totalterms; /* total inverted index terms */
extern BOOL trun_syms; /* truncate symbols to 8 characters */ extern BOOL trun_syms; /* truncate symbols to 8 characters */
extern char tempstring[TEMPSTRING_LEN + 1]; /* global dummy string buffer */ extern char tempstring[TEMPSTRING_LEN + 1]; /* global dummy string buffer */
extern char *tmpdir; /* temporary directory */ extern char *tmpdir; /* temporary directory */
/* command.c global data */ /* command.c global data */
extern BOOL caseless; /* ignore letter case when searching */ extern BOOL caseless; /* ignore letter case when searching */
extern BOOL *change; /* change this line */ extern BOOL *change; /* change this line */
extern BOOL changing; /* changing text */ extern BOOL changing; /* changing text */
extern unsigned int curdispline; extern unsigned int curdispline;
extern char newpat[]; /* new pattern */ extern char newpat[]; /* new pattern */
/* crossref.c global data */ /* crossref.c global data */
extern long dboffset; /* new database offset */ extern long dboffset; /* new database offset */
extern BOOL errorsfound; /* prompt before clearing error messages */ extern BOOL errorsfound; /* prompt before clearing error messages */
extern long lineoffset; /* source line database offset */ extern long lineoffset; /* source line database offset */
extern long npostings; /* number of postings */ extern long npostings; /* number of postings */
extern unsigned long symbols; /* number of symbols */ extern unsigned long symbols; /* number of symbols */
/* dir.c global data */ /* dir.c global data */
extern char currentdir[]; /* current directory */ extern char currentdir[]; /* current directory */
extern char **incdirs; /* #include directories */ extern char **incdirs; /* #include directories */
extern char **srcdirs; /* source directories */ extern char **srcdirs; /* source directories */
extern char **srcfiles; /* source files */ extern char **srcfiles; /* source files */
extern unsigned long nincdirs; /* number of #include directories */ extern unsigned long nincdirs; /* number of #include directories */
extern unsigned long nsrcdirs; /* number of source directories */ extern unsigned long nsrcdirs; /* number of source directories */
extern unsigned long nsrcfiles; /* number of source files */ extern unsigned long nsrcfiles; /* number of source files */
extern unsigned long msrcfiles; /* maximum number of source files */ extern unsigned long msrcfiles; /* maximum number of source files */
/* display.c global data */ /* display.c global data */
extern int subsystemlen; /* OGS subsystem name display field length */ extern int subsystemlen; /* OGS subsystem name display field length */
extern int booklen; /* OGS book name display field length */ extern int booklen; /* OGS book name display field length */
extern int filelen; /* file name display field length */ extern int filelen; /* file name display field length */
extern int fcnlen; /* function name display field length */ extern int fcnlen; /* function name display field length */
extern int numlen; /* line number display field length */ extern int numlen; /* line number display field length */
extern int *displine; /* screen line of displayed reference */ extern int *displine; /* screen line of displayed reference */
extern unsigned int disprefs; /* displayed references */ extern unsigned int disprefs; /* displayed references */
extern int field; /* input field */ extern int field; /* input field */
extern unsigned fldcolumn; /* input field column */ extern unsigned fldcolumn; /* input field column */
extern unsigned int mdisprefs; /* maximum displayed references */ extern unsigned int mdisprefs; /* maximum displayed references */
extern unsigned int nextline; /* next line to be shown */ extern unsigned int nextline; /* next line to be shown */
extern FILE *nonglobalrefs; /* non-global references file */ extern FILE *nonglobalrefs; /* non-global references file */
extern unsigned int topline; /* top line of page */ extern unsigned int topline; /* top line of page */
extern long searchcount; /* count of files searched */ extern long searchcount; /* count of files searched */
extern unsigned int totallines; /* total reference lines */ extern unsigned int totallines; /* total reference lines */
extern const char dispchars[]; /* display chars for jumping to lines */ extern const char dispchars[]; /* display chars for jumping to lines */
extern int window_change; extern int window_change;
/* find.c global data */ /* find.c global data */
extern char block[]; /* cross-reference file block */ extern char block[]; /* cross-reference file block */
extern char blockmark; /* mark character to be searched for */ extern char blockmark; /* mark character to be searched for */
extern long blocknumber; /* block number */ extern long blocknumber; /* block number */
extern char *blockp; /* pointer to current character in block */ extern char *blockp; /* pointer to current character in block */
extern int blocklen; /* length of disk block read */ extern int blocklen; /* length of disk block read */
/* lookup.c global data */ /* lookup.c global data */
extern struct keystruct { extern struct keystruct {
char *text; char *text;
char delim; char delim;
struct keystruct *next; struct keystruct *next;
} keyword[]; } keyword[];
/* mouse.c global data */ /* mouse.c global data */
extern BOOL mouse; /* mouse interface */ extern BOOL mouse; /* mouse interface */
/* readline.c global data */ /* readline.c global data */
extern char* rl_line_buffer; extern char* rl_line_buffer;
@ -214,7 +214,7 @@ extern char input_line[PATLEN + 1];
extern int rl_point; extern int rl_point;
#if UNIXPC #if UNIXPC
extern BOOL unixpcmouse; /* UNIX PC mouse interface */ extern BOOL unixpcmouse; /* UNIX PC mouse interface */
#endif #endif
/* cscope functions called from more than one function or between files */ /* cscope functions called from more than one function or between files */
@ -241,8 +241,8 @@ void error_usage(void);
void longusage(void); void longusage(void);
void usage(void); void usage(void);
extern BOOL remove_symfile_onexit; extern BOOL remove_symfile_onexit;
extern BOOL onesearch; /* one search only in line mode */ extern BOOL onesearch; /* one search only in line mode */
extern char *reflines; /* symbol reference lines file */ extern char *reflines; /* symbol reference lines file */
void verswp_field(void); void verswp_field(void);
void horswp_field(void); void horswp_field(void);
BOOL interpret(int c); // XXX: probably rename BOOL interpret(int c); // XXX: probably rename

View File

@ -33,19 +33,19 @@
#ifndef CSCOPE_INVLIB_H #ifndef CSCOPE_INVLIB_H
#define CSCOPE_INVLIB_H #define CSCOPE_INVLIB_H
#include <stdio.h> /* need definition of FILE* */ #include <stdio.h> /* need definition of FILE* */
#include <limits.h> /* need definition of CHAR_MAX */ #include <limits.h> /* need definition of CHAR_MAX */
/* inverted index definitions */ /* inverted index definitions */
/* postings temporary file long number coding into characters */ /* postings temporary file long number coding into characters */
#if CHAR_MAX==255 #if CHAR_MAX==255
# define BASE 223 /* 255 - ' ' */ # define BASE 223 /* 255 - ' ' */
# define PRECISION 4 /* maximum digits after converting a long */ # define PRECISION 4 /* maximum digits after converting a long */
#else #else
# if CHAR_MAX==127 /* assume sign-extension of a char when converted to an int */ # if CHAR_MAX==127 /* assume sign-extension of a char when converted to an int */
# define BASE 95 /* 127 - ' ' */ # define BASE 95 /* 127 - ' ' */
# define PRECISION 5 /* maximum digits after converting a long */ # define PRECISION 5 /* maximum digits after converting a long */
# else # else
#error Need a platform with 8 bits in a char value #error Need a platform with 8 bits in a char value
# endif # endif
@ -53,34 +53,34 @@
/* inverted index access parameters */ /* inverted index access parameters */
#define INVAVAIL 0 #define INVAVAIL 0
#define INVBUSY 1 #define INVBUSY 1
#define INVALONE 2 #define INVALONE 2
/* boolean set operations */ /* boolean set operations */
#define BOOL_OR 3 #define BOOL_OR 3
#define AND 4 #define AND 4
#define NOT 5 #define NOT 5
#define REVERSENOT 6 #define REVERSENOT 6
/* note that the entire first block is for parameters */ /* note that the entire first block is for parameters */
typedef struct { typedef struct {
long version; /* inverted index format version */ long version; /* inverted index format version */
long filestat; /* file status word */ long filestat; /* file status word */
long sizeblk; /* size of logical block in bytes */ long sizeblk; /* size of logical block in bytes */
long startbyte; /* first byte of superfinger */ long startbyte; /* first byte of superfinger */
long supsize; /* size of superfinger in bytes */ long supsize; /* size of superfinger in bytes */
long cntlsize; /* size of max cntl space (should be a multiple of BUFSIZ) */ long cntlsize; /* size of max cntl space (should be a multiple of BUFSIZ) */
long share; /* flag whether to use shared memory */ long share; /* flag whether to use shared memory */
} PARAM; } PARAM;
typedef struct { typedef struct {
FILE *invfile; /* the inverted file ptr */ FILE *invfile; /* the inverted file ptr */
FILE *postfile; /* posting file ptr */ FILE *postfile; /* posting file ptr */
PARAM param; /* control parameters for the file */ PARAM param; /* control parameters for the file */
char *iindex; /* ptr to space for superindex */ char *iindex; /* ptr to space for superindex */
union logicalblk *logblk; /* ptr to space for a logical block */ union logicalblk *logblk; /* ptr to space for a logical block */
long numblk; /* number of block presently at *logblk */ long numblk; /* number of block presently at *logblk */
long keypnt; /* number item in present block found */ long keypnt; /* number item in present block found */
} INVCONTROL; } INVCONTROL;
typedef struct { typedef struct {
@ -91,14 +91,14 @@ typedef struct {
} ENTRY; } ENTRY;
typedef struct { typedef struct {
long lineoffset; /* source line database offset */ long lineoffset; /* source line database offset */
long fcnoffset; /* function name database offset */ long fcnoffset; /* function name database offset */
long fileindex : 24; /* source file name index */ long fileindex : 24; /* source file name index */
long type : 8; /* reference type (mark character) */ long type : 8; /* reference type (mark character) */
} POSTING; } POSTING;
extern long *srcoffset; /* source file name database offsets */ extern long *srcoffset; /* source file name database offsets */
extern int nsrcoffset; /* number of file name database offsets */ extern int nsrcoffset; /* number of file name database offsets */
void boolclear(void); void boolclear(void);

View File

@ -33,7 +33,7 @@
#ifndef CSCOPE_LIBRARY_H #ifndef CSCOPE_LIBRARY_H
#define CSCOPE_LIBRARY_H #define CSCOPE_LIBRARY_H
#include <stdio.h> /* need FILE* type def. */ #include <stdio.h> /* need FILE* type def. */
/* private library */ /* private library */
char *compath(char *pathname); char *compath(char *pathname);

View File

@ -36,10 +36,10 @@
/* declarations for objects defined in lookup.c */ /* declarations for objects defined in lookup.c */
/* keyword text for fast testing of keywords in the scanner */ /* keyword text for fast testing of keywords in the scanner */
extern char enumtext[]; extern char enumtext[];
extern char externtext[]; extern char externtext[];
extern char structtext[]; extern char structtext[];
extern char typedeftext[]; extern char typedeftext[];
extern char uniontext[]; extern char uniontext[];
#endif /* CSCOPE_LOOKUP_H */ #endif /* CSCOPE_LOOKUP_H */

View File

@ -36,55 +36,55 @@
#include <stdio.h> #include <stdio.h>
#undef YYLMAX #undef YYLMAX
#define YYLMAX STMTMAX + PATLEN + 1 /* scanner line buffer size */ #define YYLMAX STMTMAX + PATLEN + 1 /* scanner line buffer size */
/* cross-reference database mark characters (when new ones are added, /* cross-reference database mark characters (when new ones are added,
* update the cscope.out format description in cscope.1) * update the cscope.out format description in cscope.1)
*/ */
#define CLASSDEF 'c' #define CLASSDEF 'c'
#define DEFINE '#' #define DEFINE '#'
#define DEFINEEND ')' #define DEFINEEND ')'
#define ENUMDEF 'e' #define ENUMDEF 'e'
#define FCNCALL '`' #define FCNCALL '`'
#define FCNDEF '$' #define FCNDEF '$'
#define FCNEND '}' #define FCNEND '}'
#define GLOBALDEF 'g' #define GLOBALDEF 'g'
#define INCLUDE '~' #define INCLUDE '~'
#define MEMBERDEF 'm' #define MEMBERDEF 'm'
#define NEWFILE '@' #define NEWFILE '@'
#define STRUCTDEF 's' #define STRUCTDEF 's'
#define TYPEDEF 't' #define TYPEDEF 't'
#define UNIONDEF 'u' #define UNIONDEF 'u'
/* other scanner token types */ /* other scanner token types */
#define LEXEOF 0 #define LEXEOF 0
#define LEXERR 1 #define LEXERR 1
#define IDENT 2 #define IDENT 2
#define NEWLINE 3 #define NEWLINE 3
/* scanner.l global data */ /* scanner.l global data */
extern int first; /* buffer index for first char of symbol */ extern int first; /* buffer index for first char of symbol */
extern int last; /* buffer index for last char of symbol */ extern int last; /* buffer index for last char of symbol */
extern int lineno; /* symbol line number */ extern int lineno; /* symbol line number */
extern FILE *yyin; /* input file descriptor */ extern FILE *yyin; /* input file descriptor */
extern FILE *yyout; /* output file */ extern FILE *yyout; /* output file */
extern int myylineno; /* input line number */ extern int myylineno; /* input line number */
#ifdef USING_LEX #ifdef USING_LEX
/* HBB 20010430: if lex is used instead of flex, have to simulate the /* HBB 20010430: if lex is used instead of flex, have to simulate the
* private copies of yytext and yytext for the world outside scanner.l: */ * private copies of yytext and yytext for the world outside scanner.l: */
/* FIXME: there should be a feature test for this! */ /* FIXME: there should be a feature test for this! */
#if defined(__OSF1__) || defined(__sun) || defined(_AIX) #if defined(__OSF1__) || defined(__sun) || defined(_AIX)
extern char yytext[]; extern char yytext[];
#else #else
extern unsigned char yytext[]; extern unsigned char yytext[];
#endif #endif
extern int yyleng; extern int yyleng;
# define my_yytext yytext # define my_yytext yytext
# define my_yyleng yyleng # define my_yyleng yyleng
#else #else
extern char *my_yytext; /* private copy of input line */ extern char *my_yytext; /* private copy of input line */
extern size_t my_yyleng; /* ... and current length of it */ extern size_t my_yyleng; /* ... and current length of it */
#endif #endif
/* The master function exported by scanner.l */ /* The master function exported by scanner.l */

View File

@ -39,7 +39,7 @@
#ifndef CSCOPE_VERSION_H #ifndef CSCOPE_VERSION_H
#define CSCOPE_VERSION_H #define CSCOPE_VERSION_H
#define FILEVERSION 15 /* Initial Open Source and Linux Port */ #define FILEVERSION 15 /* Initial Open Source and Linux Port */
#define FIXVERSION ".9" /* feature and bug fix version */ #define FIXVERSION ".9" /* feature and bug fix version */
#endif /* CSCOPE_VERSION_H */ #endif /* CSCOPE_VERSION_H */

View File

@ -32,36 +32,36 @@
/* /*
* VPATH assumptions: * VPATH assumptions:
* VPATH is the environment variable containing the view path * VPATH is the environment variable containing the view path
* where each path name is followed by ':', '\n', or '\0'. * where each path name is followed by ':', '\n', or '\0'.
* Embedded blanks are considered part of the path. * Embedded blanks are considered part of the path.
*/ */
#ifndef CSCOPE_VP_H #ifndef CSCOPE_VP_H
#define CSCOPE_VP_H #define CSCOPE_VP_H
#define MAXPATH 200 /* max length for entire name */ #define MAXPATH 200 /* max length for entire name */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" # include "config.h"
#else #else
# define HAVE_FCNTL_H 1 /* in case of doubt, assume it's there */ # define HAVE_FCNTL_H 1 /* in case of doubt, assume it's there */
#endif #endif
#ifdef HAVE_FCNTL_H #ifdef HAVE_FCNTL_H
# include <fcntl.h> /* needed for O_... open flags */ # include <fcntl.h> /* needed for O_... open flags */
#endif #endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#if !NOMALLOC #if !NOMALLOC
extern char **vpdirs; /* directories (including current) in view path */ extern char **vpdirs; /* directories (including current) in view path */
#else #else
#define MAXDIR 25 /* same as libVP */ #define MAXDIR 25 /* same as libVP */
#define DIRLEN 80 /* same as libVP */ #define DIRLEN 80 /* same as libVP */
extern char vpdirs[MAXDIR][DIRLEN + 1]; extern char vpdirs[MAXDIR][DIRLEN + 1];
#endif #endif
extern int vpndirs; /* number of directories in view path */ extern int vpndirs; /* number of directories in view path */
void vpinit(char *current_dir); void vpinit(char *current_dir);
int vpopen(char *path, int oflag); int vpopen(char *path, int oflag);