Mercurial > illumos > onarm
annotate usr/src/tools/cscope-fast/global.h @ 9:2027089f4c3a
cscope-fast getline conflicts with getline in illumos
author | Andrew Stormont <andyjstormont@gmail.com> |
---|---|
date | Wed, 29 Feb 2012 06:38:16 +0000 |
parents | 1a15d5aaf794 |
children |
rev | line source |
---|---|
0 | 1 /* |
2 * CDDL HEADER START | |
3 * | |
4 * The contents of this file are subject to the terms of the | |
5 * Common Development and Distribution License, Version 1.0 only | |
6 * (the "License"). You may not use this file except in compliance | |
7 * with the License. | |
8 * | |
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | |
10 * or http://www.opensolaris.org/os/licensing. | |
11 * See the License for the specific language governing permissions | |
12 * and limitations under the License. | |
13 * | |
14 * When distributing Covered Code, include this CDDL HEADER in each | |
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. | |
16 * If applicable, add the following below this CDDL HEADER, with the | |
17 * fields enclosed by brackets "[]" replaced with your own identifying | |
18 * information: Portions Copyright [yyyy] [name of copyright owner] | |
19 * | |
20 * CDDL HEADER END | |
9
2027089f4c3a
cscope-fast getline conflicts with getline in illumos
Andrew Stormont <andyjstormont@gmail.com>
parents:
4
diff
changeset
|
21 * |
2027089f4c3a
cscope-fast getline conflicts with getline in illumos
Andrew Stormont <andyjstormont@gmail.com>
parents:
4
diff
changeset
|
22 * Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved. |
0 | 23 */ |
24 /* Copyright (c) 1988 AT&T */ | |
25 /* All Rights Reserved */ | |
26 | |
27 | |
28 /* | |
29 * cscope - interactive C symbol cross-reference | |
30 * | |
31 * global type, data, and function definitions | |
32 */ | |
33 | |
34 /* | |
35 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. | |
36 * Use is subject to license terms. | |
37 */ | |
38 | |
4
1a15d5aaf794
synchronized with onnv_86 (6202) in onnv-gate
Koji Uno <koji.uno@sun.com>
parents:
0
diff
changeset
|
39 #pragma ident "%Z%%M% %I% %E% SMI" |
0 | 40 |
41 #include <ctype.h> /* isalpha, isdigit, etc. */ | |
42 #include <signal.h> /* SIGINT and SIGQUIT */ | |
43 #include <stdio.h> /* standard I/O package */ | |
44 #include <sys/types.h> | |
45 #include "constants.h" /* misc. constants */ | |
46 #include "invlib.h" /* inverted index library */ | |
47 #include "library.h" /* library function return values */ | |
48 #include "mouse.h" /* mouse interface */ | |
49 #define SIGTYPE void | |
50 | |
51 typedef enum { /* boolean data type */ | |
52 NO, | |
53 YES | |
54 } BOOL; | |
55 | |
56 typedef enum { /* findinit return code */ | |
57 NOERROR, | |
58 NOTSYMBOL, | |
59 REGCMPERROR | |
60 } FINDINIT; | |
61 | |
62 typedef struct history { /* command history */ | |
63 int field; | |
64 char *text; | |
65 struct history *previous; | |
66 struct history *next; | |
67 } HISTORY; | |
68 | |
69 typedef enum { /* keyword type */ | |
70 DECL, /* type declaration */ | |
71 FLOW, /* control flow (do, if, for, while, switch, etc.) */ | |
72 MISC /* misc.: sizeof or table placeholder for compression */ | |
73 } KEYWORD; | |
74 | |
75 /* digraph data for text compression */ | |
76 extern char dichar1[]; /* 16 most frequent first chars */ | |
77 extern char dichar2[]; /* 8 most frequent second chars */ | |
78 /* using the above as first chars */ | |
79 extern char dicode1[]; /* digraph first character code */ | |
80 extern char dicode2[]; /* digraph second character code */ | |
81 | |
82 /* main.c global data */ | |
83 extern char *editor, *home, *shell; /* environment variables */ | |
84 extern BOOL compress; /* compress the characters in the crossref */ | |
85 extern int cscopedepth; /* cscope invocation nesting depth */ | |
86 extern char currentdir[]; /* current directory */ | |
87 extern BOOL dbtruncated; /* database symbols are truncated to 8 chars */ | |
88 extern char **dbvpdirs; /* directories (including current) in */ | |
89 /* database view path */ | |
90 extern int dbvpndirs; /* number of directories in database */ | |
91 /* view path */ | |
92 extern int dispcomponents; /* file path components to display */ | |
93 extern BOOL editallprompt; /* prompt between editing files */ | |
94 extern int fileargc; /* file argument count */ | |
95 extern char **fileargv; /* file argument values */ | |
96 extern int fileversion; /* cross-reference file version */ | |
97 extern BOOL incurses; /* in curses */ | |
98 extern INVCONTROL invcontrol; /* inverted file control structure */ | |
99 extern BOOL invertedindex; /* the database has an inverted index */ | |
100 extern BOOL isuptodate; /* consider the crossref up-to-date */ | |
101 extern BOOL linemode; /* use line oriented user interface */ | |
102 extern char *namefile; /* file of file names */ | |
103 extern char *newreffile; /* new cross-reference file name */ | |
104 extern FILE *newrefs; /* new cross-reference */ | |
105 extern BOOL noacttimeout; /* no activity timeout occurred */ | |
106 extern BOOL ogs; /* display OGS book and subsystem names */ | |
107 extern FILE *postings; /* new inverted index postings */ | |
108 extern char *prependpath; /* prepend path to file names */ | |
109 extern BOOL returnrequired; /* RETURN required after selection number */ | |
110 extern int symrefs; /* cross-reference file */ | |
111 extern char temp1[]; /* temporary file name */ | |
112 extern char temp2[]; /* temporary file name */ | |
113 extern long totalterms; /* total inverted index terms */ | |
114 extern BOOL truncatesyms; /* truncate symbols to 8 characters */ | |
115 | |
116 /* command.c global data */ | |
117 extern BOOL caseless; /* ignore letter case when searching */ | |
118 extern BOOL *change; /* change this line */ | |
119 extern BOOL changing; /* changing text */ | |
120 extern char newpat[]; /* new pattern */ | |
121 extern char pattern[]; /* symbol or text pattern */ | |
122 | |
123 /* crossref.c global data */ | |
124 extern long dboffset; /* new database offset */ | |
125 extern BOOL errorsfound; /* prompt before clearing error messages */ | |
126 extern long fileindex; /* source file name index */ | |
127 extern long lineoffset; /* source line database offset */ | |
128 extern long npostings; /* number of postings */ | |
129 extern int symbols; /* number of symbols */ | |
130 | |
131 /* dir.c global data */ | |
132 extern char **incdirs; /* #include directories */ | |
133 extern char **srcdirs; /* source directories */ | |
134 extern char **srcfiles; /* source files */ | |
135 extern int nincdirs; /* number of #include directories */ | |
136 extern int nsrcdirs; /* number of source directories */ | |
137 extern int nsrcfiles; /* number of source files */ | |
138 extern int msrcfiles; /* maximum number of source files */ | |
139 | |
140 /* display.c global data */ | |
141 extern int *displine; /* screen line of displayed reference */ | |
142 extern int disprefs; /* displayed references */ | |
143 extern int field; /* input field */ | |
144 extern unsigned fldcolumn; /* input field column */ | |
145 extern int mdisprefs; /* maximum displayed references */ | |
146 extern int selectlen; /* selection number field length */ | |
147 extern int nextline; /* next line to be shown */ | |
148 extern int topline; /* top line of page */ | |
149 extern int bottomline; /* bottom line of page */ | |
150 extern int totallines; /* total reference lines */ | |
151 extern FILE *refsfound; /* references found file */ | |
152 extern FILE *nonglobalrefs; /* non-global references file */ | |
153 | |
154 /* exec.c global data */ | |
155 extern pid_t childpid; /* child's process ID */ | |
156 | |
157 /* find.c global data */ | |
158 extern char block[]; /* cross-reference file block */ | |
159 extern int blocklen; /* length of disk block read */ | |
160 extern char blockmark; /* mark character to be searched for */ | |
161 extern long blocknumber; /* block number */ | |
162 extern char *blockp; /* pointer to current character in block */ | |
163 extern char lastfilepath[]; /* last file that full path was computed for */ | |
164 | |
165 /* lookup.c global data */ | |
166 extern struct keystruct { | |
167 char *text; | |
168 char delim; | |
169 KEYWORD type; | |
170 struct keystruct *next; | |
171 } keyword[]; | |
172 | |
173 /* scanner.l global data */ | |
174 extern int first; /* buffer index for first char of symbol */ | |
175 extern int last; /* buffer index for last char of symbol */ | |
176 extern int lineno; /* symbol line number */ | |
177 extern FILE *yyin; /* input file descriptor */ | |
178 extern int yyleng; /* input line length */ | |
179 extern int yylineno; /* input line number */ | |
180 #if hpux | |
181 extern unsigned char yytext[]; /* input line text */ | |
182 #else | |
183 extern char yytext[]; /* input line text */ | |
184 #endif | |
185 | |
186 /* vpinit.c global data */ | |
187 extern char *argv0; /* command name */ | |
188 | |
189 /* cscope functions called from more than one function or between files */ | |
190 /* cgrep.c */ | |
191 void egrepcaseless(int i); | |
192 char *egrepinit(char *expression); | |
193 int egrep(char *f, FILE *o, char *fo); | |
194 | |
195 /* command.c */ | |
196 BOOL command(int commandc); | |
197 void clearprompt(void); | |
198 BOOL readrefs(char *filename); | |
199 BOOL changestring(void); | |
200 void mark(int i); | |
201 | |
202 /* crossref.c */ | |
203 void crossref(char *srcfile); | |
204 void savesymbol(int token); | |
205 void putfilename(char *srcfile); | |
206 void putposting(char *term, int type); | |
207 void putstring(char *s); | |
208 void warning(char *text); | |
209 | |
210 /* dir.c */ | |
211 void sourcedir(char *dirlist); | |
212 void includedir(char *dirlist); | |
213 void makefilelist(void); | |
214 void incfile(char *file, int type); | |
215 BOOL infilelist(char *file); | |
216 void addsrcfile(char *path); | |
217 void freefilelist(void); | |
218 | |
219 /* display.c */ | |
220 void dispinit(void); | |
221 void display(void); | |
222 void setfield(void); | |
223 void atfield(void); | |
224 void jumpback(int sig); | |
225 BOOL search(void); | |
226 BOOL writerefsfound(void); | |
227 void countrefs(void); | |
228 void myperror(char *text); | |
229 void putmsg(char *msg); | |
230 void clearmsg2(void); | |
231 void putmsg2(char *msg); | |
232 void seekline(int line); | |
233 void ogsnames(char *file, char **subsystem, char **book); | |
234 char *pathcomponents(char *path, int components); | |
235 void strtoupper(char *s); | |
236 | |
237 /* edit.c */ | |
238 void editref(int i); | |
239 void editall(void); | |
240 void edit(char *file, char *linenum); | |
241 | |
242 /* find.c */ | |
243 void findsymbol(void); | |
244 void finddef(void); | |
245 void findallfcns(void); | |
246 void findcalledby(void); | |
247 void findcalling(void); | |
248 void findassignments(void); | |
249 char *findgreppat(void); | |
250 char *findegreppat(char *egreppat); | |
251 void findfile(void); | |
252 void findinclude(void); | |
253 FINDINIT findinit(void); | |
254 void findcleanup(void); | |
255 void initprogress(void); | |
256 void progress(char *format, long n1, long n2); | |
257 BOOL match(void); | |
258 BOOL matchrest(void); | |
259 void getstring(char *s); | |
260 char *scanpast(int c); | |
261 char *readblock(void); | |
262 long dbseek(long offset); | |
263 | |
264 /* help.c */ | |
265 void help(void); | |
266 | |
267 /* history.c */ | |
268 void addcmd(int f, char *s); | |
269 void resetcmd(void); | |
270 HISTORY *currentcmd(void); | |
271 HISTORY *prevcmd(void); | |
272 HISTORY *nextcmd(void); | |
273 | |
274 /* input.c */ | |
275 void catchint(int sig); | |
276 int ungetch(int c); | |
277 int mygetch(void); | |
9
2027089f4c3a
cscope-fast getline conflicts with getline in illumos
Andrew Stormont <andyjstormont@gmail.com>
parents:
4
diff
changeset
|
278 int mygetline(char s[], size_t size, int firstchar, BOOL iscaseless); |
0 | 279 void askforchar(void); |
280 void askforreturn(void); | |
281 void shellpath(char *out, int limit, char *in); | |
282 | |
283 /* lookup.c */ | |
284 void initsymtab(void); | |
285 struct keystruct *lookup(char *ident); | |
286 int hash(char *s); | |
287 | |
288 /* main.c */ | |
289 void rebuild(void); | |
290 void entercurses(void); | |
291 void exitcurses(void); | |
292 void myexit(int sig); | |
293 void cannotopen(char *file); | |
294 void cannotwrite(char *file); | |
295 | |
296 /* menu.c */ | |
297 void initmenu(void); | |
298 | |
299 extern void initscanner(char *srcfile); | |
300 extern int yylex(void); | |
301 extern int execute(char *, ...); |