1 | /* |
---|
2 | * $Id: proto.h,v 1.1.1.1 1997-09-03 21:08:10 ghudson Exp $ |
---|
3 | * |
---|
4 | * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA |
---|
5 | * All rights reserved. |
---|
6 | * |
---|
7 | * Redistribution and use in source and binary forms, with or without |
---|
8 | * modification, are permitted provided that the following conditions |
---|
9 | * are met: |
---|
10 | * |
---|
11 | * 1. Redistributions of source code must retain the above copyright |
---|
12 | * notice, this list of conditions and the following disclaimer. |
---|
13 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
14 | * notice, this list of conditions and the following disclaimer in the |
---|
15 | * documentation and/or other materials provided with the distribution. |
---|
16 | * 3. All modifications to the source code must be clearly marked as |
---|
17 | * such. Binary redistributions based on modified source code |
---|
18 | * must be clearly marked as modified versions in the documentation |
---|
19 | * and/or other materials provided with the distribution. |
---|
20 | * 4. All advertising materials mentioning features or use of this software |
---|
21 | * must display the following acknowledgment: |
---|
22 | * This product includes software developed by Geoff Kuenning and |
---|
23 | * other unpaid contributors. |
---|
24 | * 5. The name of Geoff Kuenning may not be used to endorse or promote |
---|
25 | * products derived from this software without specific prior |
---|
26 | * written permission. |
---|
27 | * |
---|
28 | * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND |
---|
29 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
30 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
31 | * ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE |
---|
32 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
---|
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
---|
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
---|
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
---|
36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
---|
37 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
---|
38 | * SUCH DAMAGE. |
---|
39 | * |
---|
40 | */ |
---|
41 | |
---|
42 | /* |
---|
43 | * $Log: not supported by cvs2svn $ |
---|
44 | * Revision 1.15 1994/10/25 05:46:38 geoff |
---|
45 | * Protoize bzero the way 4.1.1 does it (which I hope is the standard). |
---|
46 | * |
---|
47 | * Revision 1.14 1994/05/24 06:23:10 geoff |
---|
48 | * Make cap_ok a global routine. |
---|
49 | * |
---|
50 | * Revision 1.13 1994/05/17 06:44:20 geoff |
---|
51 | * Add the new arguments to chk_aff, good, and compoundgood. |
---|
52 | * |
---|
53 | * Revision 1.12 1994/03/16 03:49:15 geoff |
---|
54 | * Add an ifdef so that there won't be a conflict with the definition of |
---|
55 | * free() on braindamaged Sun systems. |
---|
56 | * |
---|
57 | * Revision 1.11 1994/02/14 00:34:55 geoff |
---|
58 | * Add new arguments to the prototype for correct(). |
---|
59 | * |
---|
60 | * Revision 1.10 1994/02/08 05:45:34 geoff |
---|
61 | * Don't undef P unless we're going to redefine it |
---|
62 | * |
---|
63 | * Revision 1.9 1994/02/07 08:10:47 geoff |
---|
64 | * Add the GENERATE_LIBRARY_PROTOS option. Put the definitions of |
---|
65 | * index/rindex back the way they were, because that's what's needed on |
---|
66 | * my system (sigh). |
---|
67 | * |
---|
68 | * Revision 1.8 1994/02/07 05:45:25 geoff |
---|
69 | * Change the second parameter of index/rindex to be a char |
---|
70 | * |
---|
71 | * Revision 1.7 1994/01/25 07:12:05 geoff |
---|
72 | * Get rid of all old RCS log lines in preparation for the 3.1 release. |
---|
73 | * |
---|
74 | */ |
---|
75 | |
---|
76 | extern int addvheader P ((struct dent * ent)); |
---|
77 | extern void askmode P ((void)); |
---|
78 | extern void backup P ((void)); |
---|
79 | #ifndef NO_CAPITALIZATION_SUPPORT |
---|
80 | extern int cap_ok P ((ichar_t * word, struct success * hit, int len)); |
---|
81 | #endif /* NO_CAPITALIZATION_SUPPORT */ |
---|
82 | extern int casecmp P ((char * a, char * b, int canonical)); |
---|
83 | extern void chupcase P ((char * s)); |
---|
84 | extern void checkfile P ((void)); |
---|
85 | extern void checkline P ((FILE * ofile)); |
---|
86 | extern void chk_aff P ((ichar_t * word, ichar_t * ucword, int len, |
---|
87 | int ignoreflagbits, int allhits, int pfxopts, int sfxopts)); |
---|
88 | extern int combinecaps P ((struct dent * hdr, struct dent * newent)); |
---|
89 | extern int compoundgood P ((ichar_t * word, int pfxopts)); |
---|
90 | extern void copyout P ((char ** cc, int cnt)); |
---|
91 | extern void correct P ((char * ctok, int ctokl, ichar_t * itok, int itokl, |
---|
92 | char ** curchar)); |
---|
93 | extern char * do_regex_lookup P ((char * expr, int whence)); |
---|
94 | extern SIGNAL_TYPE done P ((int)); |
---|
95 | extern void dumpmode P ((void)); |
---|
96 | extern void erase P ((void)); |
---|
97 | extern int expand_pre P ((char * croot, ichar_t * rootword, |
---|
98 | MASKTYPE mask[], int option, char *extra)); |
---|
99 | extern int expand_suf P ((char * croot, ichar_t * rootword, |
---|
100 | MASKTYPE mask[], int crossonly, int option, char * extra)); |
---|
101 | extern int findfiletype P ((char * name, int searchnames, |
---|
102 | int * deformatter)); |
---|
103 | extern void flagpr P ((ichar_t * word, int preflag, int prestrip, |
---|
104 | int preadd, int sufflag, int sufadd)); |
---|
105 | extern void givehelp P ((int interactive)); |
---|
106 | extern int good P ((ichar_t * word, int ignoreflagbits, int allhits, |
---|
107 | int pfxopts, int sfxopts)); |
---|
108 | extern int hash P ((ichar_t * word, int hashtablesize)); |
---|
109 | #ifndef ICHAR_IS_CHAR |
---|
110 | extern int icharcmp P ((ichar_t * s1, ichar_t * s2)); |
---|
111 | extern ichar_t * icharcpy P ((ichar_t * out, ichar_t * in)); |
---|
112 | extern int icharlen P ((ichar_t * str)); |
---|
113 | extern int icharncmp P ((ichar_t * s1, ichar_t * s2, int n)); |
---|
114 | #endif /* ICHAR_IS_CHAR */ |
---|
115 | extern int ichartostr P ((char * out, ichar_t * in, int outlen, |
---|
116 | int canonical)); |
---|
117 | extern char * ichartosstr P ((ichar_t * in, int canonical)); |
---|
118 | extern int ins_root_cap P ((ichar_t * word, ichar_t * pattern, |
---|
119 | int prestrip, int preadd, int sufstrip, int sufadd, |
---|
120 | struct dent * firstdent, struct flagent * pfxent, |
---|
121 | struct flagent * sufent)); |
---|
122 | extern void inverse P ((void)); |
---|
123 | extern int linit P ((void)); |
---|
124 | extern struct dent * lookup P ((ichar_t * word, int dotree)); |
---|
125 | extern void lowcase P ((ichar_t * string)); |
---|
126 | extern int makedent P ((char * lbuf, int lbuflen, struct dent * d)); |
---|
127 | extern void makepossibilities P ((ichar_t * word)); |
---|
128 | extern void move P ((int row, int col)); |
---|
129 | extern void normal P ((void)); |
---|
130 | extern char * printichar P ((int in)); |
---|
131 | #ifdef USESH |
---|
132 | extern int shellescape P ((char * buf)); |
---|
133 | extern void shescape P ((char * buf)); |
---|
134 | #else /* USESH */ |
---|
135 | #ifndef REGEX_LOOKUP |
---|
136 | extern int shellescape P ((char * buf)); |
---|
137 | #endif /* REGEX_LOOKUP */ |
---|
138 | #endif /* USESH */ |
---|
139 | extern char * skipoverword P ((char * bufp)); |
---|
140 | extern void stop P ((void)); |
---|
141 | extern int stringcharlen P ((char * bufp, int canonical)); |
---|
142 | extern int strtoichar P ((ichar_t * out, char * in, int outlen, |
---|
143 | int canonical)); |
---|
144 | extern ichar_t * strtosichar P ((char * in, int canonical)); |
---|
145 | extern void terminit P ((void)); |
---|
146 | extern void toutent P ((FILE * outfile, struct dent * hent, |
---|
147 | int onlykeep)); |
---|
148 | extern void treeinit P ((char * persdict, char * LibDict)); |
---|
149 | extern void treeinsert P ((char * word, int wordlen, int keep)); |
---|
150 | extern struct dent * treelookup P ((ichar_t * word)); |
---|
151 | extern void treeoutput P ((void)); |
---|
152 | extern void upcase P ((ichar_t * string)); |
---|
153 | #ifndef NO_CAPITALIZATION_SUPPORT |
---|
154 | extern long whatcap P ((ichar_t * word)); |
---|
155 | #endif |
---|
156 | extern char * xgets P ((char * string, int size, FILE * stream)); |
---|
157 | extern void yyinit P ((void)); |
---|
158 | extern int yyopen P ((char * file)); |
---|
159 | extern int yyparse P ((void)); |
---|
160 | |
---|
161 | extern void myfree P ((VOID * area)); |
---|
162 | extern VOID * mymalloc P ((unsigned int)); |
---|
163 | extern VOID * myrealloc P ((VOID * area, unsigned int size, |
---|
164 | unsigned int oldsize)); |
---|
165 | |
---|
166 | /* |
---|
167 | * C library functions. If possible, we get these from stdlib.h. |
---|
168 | * |
---|
169 | * Even if stdlib.h doesn't exist, we don't generate proper prototypes |
---|
170 | * on most systems. This protects us against minor differences in |
---|
171 | * declarations that break the compilation unnecessarily. |
---|
172 | * GENERATE_LIBRARY_PROTOS is mostly for the benefit of the ispell |
---|
173 | * developer. |
---|
174 | */ |
---|
175 | #ifndef GENERATE_LIBRARY_PROTOS |
---|
176 | #undef P |
---|
177 | #define P(x) () |
---|
178 | #endif /* GENERATE_LIBRARY_PROTOS */ |
---|
179 | |
---|
180 | #ifdef NO_STDLIB_H |
---|
181 | extern int access P ((const char * file, int mode)); |
---|
182 | extern int atoi P ((const char * string)); |
---|
183 | #ifndef USG |
---|
184 | extern VOID * bcopy P ((const VOID * src, VOID * dest, unsigned int size)); |
---|
185 | extern void bzero P ((VOID * dest, int size)); |
---|
186 | #endif /* USG */ |
---|
187 | extern VOID * calloc P ((unsigned int nelems, unsigned int elemsize)); |
---|
188 | #ifdef _POSIX_SOURCE |
---|
189 | extern int chmod P ((const char * file, unsigned int mode)); |
---|
190 | #else /* _POSIX_SOURCE */ |
---|
191 | extern int chmod P ((const char * file, unsigned long mode)); |
---|
192 | #endif /* POSIX_SOURCE */ |
---|
193 | extern int close P ((int fd)); |
---|
194 | extern int creat P ((const char * file, int mode)); |
---|
195 | extern int execvp P ((const char * name, const char * argv[])); |
---|
196 | extern void _exit P ((int status)); |
---|
197 | extern void exit P ((int status)); |
---|
198 | extern char * fgets P ((char * string, int size, FILE * stream)); |
---|
199 | extern int fork P ((void)); |
---|
200 | #ifdef __STDC__ |
---|
201 | /* |
---|
202 | * Some flaming cretin at Sun decided that free() should be declared |
---|
203 | * as returning an int in /usr/include/malloc.h, so the following |
---|
204 | * declaration causes a conflict. Fortunately, it doesn't really do a |
---|
205 | * lot of harm to leave it undeclared, since (a) we always properly |
---|
206 | * ignore the return value and (b) any machine that really needs |
---|
207 | * special code to handle ignoring the return value is likely to also |
---|
208 | * provide a correct declaration. |
---|
209 | * |
---|
210 | * (Why is this ifdef'ed on __STDC__? Because I want it to be correct |
---|
211 | * on my development machine, so I can catch lint problems.) |
---|
212 | * |
---|
213 | * A pox on those who violate long-established standards! |
---|
214 | */ |
---|
215 | extern void free P ((VOID * area)); |
---|
216 | #endif /* __STDC__ */ |
---|
217 | extern char * getenv P ((const char * varname)); |
---|
218 | extern int ioctl P ((int fd, int func, char * arg)); |
---|
219 | extern int kill P ((int pid, int sig)); |
---|
220 | extern int link P ((const char * existing, const char * new)); |
---|
221 | extern long lseek P ((int fd, long offset, int whence)); |
---|
222 | extern VOID * malloc P ((unsigned int size)); |
---|
223 | #ifdef USG |
---|
224 | extern VOID * memcpy P ((VOID * dest, const VOID * src)); |
---|
225 | extern VOID * memset P ((VOID * dest, int val, unsigned int len)); |
---|
226 | #endif /* USG */ |
---|
227 | extern char * mktemp P ((char * prototype)); |
---|
228 | extern int open P ((const char * file, int mode)); |
---|
229 | extern void perror P ((const char * msg)); |
---|
230 | extern void qsort P ((VOID * array, unsigned int nelems, |
---|
231 | unsigned int elemsize, |
---|
232 | int (*cmp) (const VOID * a, const VOID * b))); |
---|
233 | extern int read P ((int fd, VOID * buf, unsigned int n)); |
---|
234 | extern VOID * realloc P ((VOID * area, unsigned int size)); |
---|
235 | extern unsigned int |
---|
236 | sleep P ((unsigned int)); |
---|
237 | extern char * strcat P ((char * dest, const char * src)); |
---|
238 | #ifdef USG |
---|
239 | extern char * strchr P ((const char * string, int ch)); |
---|
240 | #endif /* USG */ |
---|
241 | extern int strcmp P ((const char * s1, const char * s2)); |
---|
242 | extern char * strcpy P ((char * dest, const char * src)); |
---|
243 | extern unsigned int |
---|
244 | strlen P ((const char * str)); |
---|
245 | extern int strncmp P ((const char * s1, const char * s2, |
---|
246 | unsigned int len)); |
---|
247 | #ifdef USG |
---|
248 | extern char * strrchr P ((const char * string, int ch)); |
---|
249 | #endif /* USG */ |
---|
250 | extern int system P ((const char * command)); |
---|
251 | extern int unlink P ((const char * file)); |
---|
252 | extern int wait P ((int * statusp)); |
---|
253 | #else /* NO_STDLIB_H */ |
---|
254 | #include <stdlib.h> |
---|
255 | #include <string.h> |
---|
256 | #endif /* NO_STDLIB_H */ |
---|
257 | |
---|
258 | #ifndef USG |
---|
259 | extern char * index P ((const char * string, int ch)); |
---|
260 | extern char * rindex P ((const char * string, int ch)); |
---|
261 | #endif /* USG */ |
---|
262 | #ifdef REGEX_LOOKUP |
---|
263 | #ifdef USG |
---|
264 | extern char * regcmp P ((const char * expr, const char * terminator, ...)); |
---|
265 | extern char * regex P ((const char * pat, const char * subject, ...)); |
---|
266 | #else /* USG */ |
---|
267 | extern char * re_comp P ((const char * expr)); |
---|
268 | extern int * re_exec P ((const char * pat)); |
---|
269 | #endif /* USG */ |
---|
270 | #endif /* REGEX_LOOKUP */ |
---|
271 | extern int tgetent P ((char * buf, const char * termname)); |
---|
272 | extern int tgetnum P ((const char * id)); |
---|
273 | extern char * tgetstr P ((const char * id, char ** area)); |
---|
274 | extern char * tgoto P ((const char * cm, int col, int row)); |
---|
275 | extern char * tputs P ((const char * str, int pad, int (*func) (int ch))); |
---|
276 | |
---|
277 | #ifndef GENERATE_LIBRARY_PROTOS |
---|
278 | #ifdef __STDC__ |
---|
279 | #undef P |
---|
280 | #define P(x) x |
---|
281 | #endif /* __STDC__ */ |
---|
282 | #endif /* GENERATE_LIBRARY_PROTOS */ |
---|