aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorFrancesco Potortì2000-02-03 11:58:48 +0000
committerFrancesco Potortì2000-02-03 11:58:48 +0000
commit944bdd7208887c321dccd4663607db9aebd2d867 (patch)
tree3cdedc4e70cb7704df15f0a33cc1934e73c21e9e /lib-src
parent649351f90fbc89abb2f107a479d8474ab8371a50 (diff)
downloademacs-944bdd7208887c321dccd4663607db9aebd2d867.tar.gz
emacs-944bdd7208887c321dccd4663607db9aebd2d867.zip
2000-01-31 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
* etags.c [MSDOS]: Set MSDOS to 1 if #defined, 0 otherwise. (get_compressor_from_suffix, process_file): Use MSDOS in if clause. (etags_strchr, etags_strrchr): Use const char * and int as arguments. (getenv, getcwd): Only declare them if necessary. (EMACS_NAME): New constant macro. (print_version): Use it. (P_) [__STDC__]: Macro for defining function prototypes. (all functions): Made them static. 2000-01-18 Fabrice Popineau <Fabrice.Popineau@supelec.fr> * etags.c [WINDOWSNT]: #include <direct.h> 2000-01-18 Martin Buchholz <martin@xemacs.org> * etags.c: Prototypes and static for all the functions.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/etags.c451
1 files changed, 239 insertions, 212 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 552a09d2f01..bbc3f690511 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -31,18 +31,21 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
31 * Francesco Potorti` (pot@gnu.org) is the current maintainer. 31 * Francesco Potorti` (pot@gnu.org) is the current maintainer.
32 */ 32 */
33 33
34char pot_etags_version[] = "@(#) pot revision number is 13.33"; 34char pot_etags_version[] = "@(#) pot revision number is 13.38";
35 35
36#define TRUE 1 36#define TRUE 1
37#define FALSE 0 37#define FALSE 0
38 38
39#ifndef _GNU_SOURCE
40# define _GNU_SOURCE /* enables some compiler checks on GNU */
41#endif
42#ifndef DEBUG 39#ifndef DEBUG
43# define DEBUG FALSE 40# define DEBUG FALSE
44#endif 41#endif
45 42
43#if defined (__STDC__) && __STDC__
44# define P_(proto) proto
45#else
46# define P_(proto) ()
47#endif
48
46#ifdef HAVE_CONFIG_H 49#ifdef HAVE_CONFIG_H
47# include <config.h> 50# include <config.h>
48 /* On some systems, Emacs defines static as nothing for the sake 51 /* On some systems, Emacs defines static as nothing for the sake
@@ -52,7 +55,12 @@ char pot_etags_version[] = "@(#) pot revision number is 13.33";
52# define LONG_OPTIONS /* accept long options */ 55# define LONG_OPTIONS /* accept long options */
53#endif /* HAVE_CONFIG_H */ 56#endif /* HAVE_CONFIG_H */
54 57
58#ifndef _GNU_SOURCE
59# define _GNU_SOURCE 1 /* enables some compiler checks on GNU */
60#endif
61
55#ifdef MSDOS 62#ifdef MSDOS
63# define MSDOS TRUE
56# include <fcntl.h> 64# include <fcntl.h>
57# include <sys/param.h> 65# include <sys/param.h>
58# include <io.h> 66# include <io.h>
@@ -60,12 +68,15 @@ char pot_etags_version[] = "@(#) pot revision number is 13.33";
60# define DOS_NT 68# define DOS_NT
61# include <sys/config.h> 69# include <sys/config.h>
62# endif 70# endif
71#else
72# define MSDOS FALSE
63#endif /* MSDOS */ 73#endif /* MSDOS */
64 74
65#ifdef WINDOWSNT 75#ifdef WINDOWSNT
66# include <stdlib.h> 76# include <stdlib.h>
67# include <fcntl.h> 77# include <fcntl.h>
68# include <string.h> 78# include <string.h>
79# include <direct.h>
69# include <io.h> 80# include <io.h>
70# define MAXPATHLEN _MAX_PATH 81# define MAXPATHLEN _MAX_PATH
71# ifdef HAVE_CONFIG_H 82# ifdef HAVE_CONFIG_H
@@ -76,17 +87,19 @@ char pot_etags_version[] = "@(#) pot revision number is 13.33";
76# ifndef HAVE_GETCWD 87# ifndef HAVE_GETCWD
77# define HAVE_GETCWD 88# define HAVE_GETCWD
78# endif /* undef HAVE_GETCWD */ 89# endif /* undef HAVE_GETCWD */
79#endif /* WINDOWSNT */ 90#else /* !WINDOWSNT */
80 91# ifdef STDC_HEADERS
81#if !defined (WINDOWSNT) && defined (STDC_HEADERS) 92# include <stdlib.h>
82#include <stdlib.h> 93# include <string.h>
83#include <string.h> 94# else
84#endif 95 extern char *getenv ();
96# endif
97#endif /* !WINDOWSNT */
85 98
86#ifdef HAVE_UNISTD_H 99#ifdef HAVE_UNISTD_H
87# include <unistd.h> 100# include <unistd.h>
88#else 101#else
89# ifdef HAVE_GETCWD 102# if defined (HAVE_GETCWD) && !WINDOWSNT
90 extern char *getcwd (); 103 extern char *getcwd ();
91# endif 104# endif
92#endif /* HAVE_UNISTD_H */ 105#endif /* HAVE_UNISTD_H */
@@ -192,70 +205,105 @@ typedef struct
192 char **interpreters; 205 char **interpreters;
193} language; 206} language;
194 207
195extern char *getenv (); 208typedef struct node_st
209{ /* sorting structure */
210 char *name; /* function or type name */
211 char *file; /* file name */
212 bool is_func; /* use pattern or line no */
213 bool been_warned; /* set if noticed dup */
214 int lno; /* line number tag is on */
215 long cno; /* character number line starts on */
216 char *pat; /* search pattern */
217 struct node_st *left, *right; /* left and right sons */
218} node;
219
220/*
221 * A `linebuffer' is a structure which holds a line of text.
222 * `readline_internal' reads a line from a stream into a linebuffer
223 * and works regardless of the length of the line.
224 * SIZE is the size of BUFFER, LEN is the length of the string in
225 * BUFFER after readline reads it.
226 */
227typedef struct
228{
229 long size;
230 int len;
231 char *buffer;
232} linebuffer;
196 233
197/* Many compilers barf on this: 234/* Many compilers barf on this:
198 Lang_function Ada_funcs; 235 Lang_function Ada_funcs;
199 so let's write it this way */ 236 so let's write it this way */
200void Ada_funcs (); 237static void Ada_funcs P_((FILE *inf));
201void Asm_labels (); 238static void Asm_labels P_((FILE *inf));
202void C_entries (); 239static void C_entries P_((int c_ext, FILE *inf));
203void default_C_entries (); 240static void default_C_entries P_((FILE *inf));
204void plain_C_entries (); 241static void plain_C_entries P_((FILE *inf));
205void Cjava_entries (); 242static void Cjava_entries P_((FILE *inf));
206void Cobol_paragraphs (); 243static void Cobol_paragraphs P_((FILE *inf));
207void Cplusplus_entries (); 244static void Cplusplus_entries P_((FILE *inf));
208void Cstar_entries (); 245static void Cstar_entries P_((FILE *inf));
209void Erlang_functions (); 246static void Erlang_functions P_((FILE *inf));
210void Fortran_functions (); 247static void Fortran_functions P_((FILE *inf));
211void Yacc_entries (); 248static void Yacc_entries P_((FILE *inf));
212void Lisp_functions (); 249static void Lisp_functions P_((FILE *inf));
213void Pascal_functions (); 250static void Pascal_functions P_((FILE *inf));
214void Perl_functions (); 251static void Perl_functions P_((FILE *inf));
215void Postscript_functions (); 252static void Postscript_functions P_((FILE *inf));
216void Prolog_functions (); 253static void Prolog_functions P_((FILE *inf));
217void Python_functions (); 254static void Python_functions P_((FILE *inf));
218void Scheme_functions (); 255static void Scheme_functions P_((FILE *inf));
219void TeX_functions (); 256static void TeX_functions P_((FILE *inf));
220void just_read_file (); 257static void just_read_file P_((FILE *inf));
221 258
222compressor *get_compressor_from_suffix (); 259static compressor *get_compressor_from_suffix P_((char *file, char **extptr));
223language *get_language_from_name (); 260static language *get_language_from_name P_((char *name));
224language *get_language_from_interpreter (); 261static language *get_language_from_interpreter P_((char *interpreter));
225language *get_language_from_suffix (); 262static language *get_language_from_suffix P_((char *file));
226int total_size_of_entries (); 263static int total_size_of_entries P_((register node *np));
227long readline (), readline_internal (); 264static long readline P_((linebuffer *lbp, FILE *stream));
228void get_tag (); 265static long readline_internal P_((linebuffer *lbp, register FILE *stream));
266static void get_tag P_((register char *bp));
229 267
230#ifdef ETAGS_REGEXPS 268#ifdef ETAGS_REGEXPS
231void analyse_regex (); 269static void analyse_regex P_((char *regex_arg, bool ignore_case));
232void add_regex (); 270static void add_regex P_((char *regexp_pattern, bool ignore_case, language *lan));
233void free_patterns (); 271static void free_patterns P_((void));
234#endif /* ETAGS_REGEXPS */ 272#endif /* ETAGS_REGEXPS */
235void error (); 273static void error P_((const char *s1, const char *s2));
236void suggest_asking_for_help (); 274static void suggest_asking_for_help P_((void));
237void fatal (), pfatal (); 275static void fatal P_((char *s1, char *s2));
238void add_node (); 276static void pfatal P_((char *s1));
239 277static void add_node P_((node *np, node **cur_node_p));
240void init (); 278
241void initbuffer (); 279static void init P_((void));
242void find_entries (); 280static void initbuffer P_((linebuffer *lbp));
243void free_tree (); 281static void find_entries P_((char *file, FILE *inf));
244void pfnote (), new_pfnote (); 282static void free_tree P_((register node *np));
245void process_file (); 283static void pfnote P_((char *name, bool is_func, char *linestart,
246void put_entries (); 284 int linelen, int lno, long int cno));
247void takeprec (); 285static void new_pfnote P_((char *name, int namelen, bool is_func,
248 286 char *linestart, int linelen, int lno, long int cno));
249char *concat (); 287static void process_file P_((char *file));
250char *skip_spaces (), *skip_non_spaces (); 288static void put_entries P_((register node *np));
251char *savenstr (), *savestr (); 289static void takeprec P_((void));
252char *etags_strchr (), *etags_strrchr (); 290
253char *etags_getcwd (); 291static char *concat P_((char *s1, char *s2, char *s3));
254char *relative_filename (), *absolute_filename (), *absolute_dirname (); 292static char *skip_spaces P_((char *cp));
255bool filename_is_absolute (); 293static char *skip_non_spaces P_((char *cp));
256void canonicalize_filename (); 294static char *savenstr P_((char *cp, int len));
257void grow_linebuffer (); 295static char *savestr P_((char *cp));
258long *xmalloc (), *xrealloc (); 296static char *etags_strchr P_((const char *sp, int c));
297static char *etags_strrchr P_((const char *sp, int c));
298static char *etags_getcwd P_((void));
299static char *relative_filename P_((char *file, char *dir));
300static char *absolute_filename P_((char *file, char *dir));
301static char *absolute_dirname P_((char *file, char *dir));
302static bool filename_is_absolute P_((char *fn));
303static void canonicalize_filename P_((register char *fn));
304static void grow_linebuffer P_((linebuffer *lbp, int toksize));
305static long *xmalloc P_((unsigned int size));
306static long *xrealloc P_((char *ptr, unsigned int size));
259 307
260 308
261char searchar = '/'; /* use /.../ searches */ 309char searchar = '/'; /* use /.../ searches */
@@ -274,34 +322,8 @@ long charno; /* current character number */
274long linecharno; /* charno of start of current line */ 322long linecharno; /* charno of start of current line */
275char *dbp; /* pointer to start of current tag */ 323char *dbp; /* pointer to start of current tag */
276 324
277typedef struct node_st
278{ /* sorting structure */
279 char *name; /* function or type name */
280 char *file; /* file name */
281 bool is_func; /* use pattern or line no */
282 bool been_warned; /* set if noticed dup */
283 int lno; /* line number tag is on */
284 long cno; /* character number line starts on */
285 char *pat; /* search pattern */
286 struct node_st *left, *right; /* left and right sons */
287} node;
288
289node *head; /* the head of the binary tree of tags */ 325node *head; /* the head of the binary tree of tags */
290 326
291/*
292 * A `linebuffer' is a structure which holds a line of text.
293 * `readline_internal' reads a line from a stream into a linebuffer
294 * and works regardless of the length of the line.
295 * SIZE is the size of BUFFER, LEN is the length of the string in
296 * BUFFER after readline reads it.
297 */
298typedef struct
299{
300 long size;
301 int len;
302 char *buffer;
303} linebuffer;
304
305linebuffer lb; /* the current line */ 327linebuffer lb; /* the current line */
306linebuffer token_name; /* used by C_entries as a temporary area */ 328linebuffer token_name; /* used by C_entries as a temporary area */
307struct 329struct
@@ -531,7 +553,7 @@ language lang_names [] =
531 { NULL, NULL } /* end of list */ 553 { NULL, NULL } /* end of list */
532}; 554};
533 555
534void 556static void
535print_language_names () 557print_language_names ()
536{ 558{
537 language *lang; 559 language *lang;
@@ -556,20 +578,23 @@ Fortran is tried first; if no tags are found, C is tried next.\n\
556Compressed files are supported using gzip and bzip2."); 578Compressed files are supported using gzip and bzip2.");
557} 579}
558 580
581#ifndef EMACS_NAME
582# define EMACS_NAME "GNU Emacs"
583#endif
559#ifndef VERSION 584#ifndef VERSION
560# define VERSION "20" 585# define VERSION "21"
561#endif 586#endif
562void 587static void
563print_version () 588print_version ()
564{ 589{
565 printf ("%s (GNU Emacs %s)\n", (CTAGS) ? "ctags" : "etags", VERSION); 590 printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION);
566 puts ("Copyright (C) 1999 Free Software Foundation, Inc. and Ken Arnold"); 591 puts ("Copyright (C) 1999 Free Software Foundation, Inc. and Ken Arnold");
567 puts ("This program is distributed under the same terms as Emacs"); 592 puts ("This program is distributed under the same terms as Emacs");
568 593
569 exit (GOOD); 594 exit (GOOD);
570} 595}
571 596
572void 597static void
573print_help () 598print_help ()
574{ 599{
575 printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\ 600 printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\
@@ -750,7 +775,7 @@ typedef struct {
750#include <rmsdef.h> 775#include <rmsdef.h>
751#include <descrip.h> 776#include <descrip.h>
752#define OUTSIZE MAX_FILE_SPEC_LEN 777#define OUTSIZE MAX_FILE_SPEC_LEN
753short 778static short
754fn_exp (out, in) 779fn_exp (out, in)
755 vspec *out; 780 vspec *out;
756 char *in; 781 char *in;
@@ -795,7 +820,7 @@ fn_exp (out, in)
795 v1.01 nmm 19-Aug-85 gfnames - return in successive calls the 820 v1.01 nmm 19-Aug-85 gfnames - return in successive calls the
796 name of each file specified by the provided arg expanding wildcards. 821 name of each file specified by the provided arg expanding wildcards.
797*/ 822*/
798char * 823static char *
799gfnames (arg, p_error) 824gfnames (arg, p_error)
800 char *arg; 825 char *arg;
801 bool *p_error; 826 bool *p_error;
@@ -1171,7 +1196,7 @@ main (argc, argv)
1171 * and EXTPTR is not significant. 1196 * and EXTPTR is not significant.
1172 * Idea by Vladimir Alexiev <vladimir@cs.ualberta.ca> 1197 * Idea by Vladimir Alexiev <vladimir@cs.ualberta.ca>
1173 */ 1198 */
1174compressor * 1199static compressor *
1175get_compressor_from_suffix (file, extptr) 1200get_compressor_from_suffix (file, extptr)
1176 char *file; 1201 char *file;
1177 char **extptr; 1202 char **extptr;
@@ -1196,9 +1221,8 @@ get_compressor_from_suffix (file, extptr)
1196 for (compr = compressors; compr->suffix != NULL; compr++) 1221 for (compr = compressors; compr->suffix != NULL; compr++)
1197 if (streq (compr->suffix, suffix)) 1222 if (streq (compr->suffix, suffix))
1198 return compr; 1223 return compr;
1199#ifndef MSDOS 1224 if (!MSDOS)
1200 break; 1225 break; /* do it only once: not really a loop */
1201#endif
1202 if (extptr != NULL) 1226 if (extptr != NULL)
1203 *extptr = ++suffix; 1227 *extptr = ++suffix;
1204 } while (*suffix != '\0'); 1228 } while (*suffix != '\0');
@@ -1210,7 +1234,7 @@ get_compressor_from_suffix (file, extptr)
1210/* 1234/*
1211 * Return a language given the name. 1235 * Return a language given the name.
1212 */ 1236 */
1213language * 1237static language *
1214get_language_from_name (name) 1238get_language_from_name (name)
1215 char *name; 1239 char *name;
1216{ 1240{
@@ -1233,7 +1257,7 @@ get_language_from_name (name)
1233/* 1257/*
1234 * Return a language given the interpreter name. 1258 * Return a language given the interpreter name.
1235 */ 1259 */
1236language * 1260static language *
1237get_language_from_interpreter (interpreter) 1261get_language_from_interpreter (interpreter)
1238 char *interpreter; 1262 char *interpreter;
1239{ 1263{
@@ -1256,7 +1280,7 @@ get_language_from_interpreter (interpreter)
1256/* 1280/*
1257 * Return a language given the file name. 1281 * Return a language given the file name.
1258 */ 1282 */
1259language * 1283static language *
1260get_language_from_suffix (file) 1284get_language_from_suffix (file)
1261 char *file; 1285 char *file;
1262{ 1286{
@@ -1280,7 +1304,7 @@ get_language_from_suffix (file)
1280/* 1304/*
1281 * This routine is called on each file argument. 1305 * This routine is called on each file argument.
1282 */ 1306 */
1283void 1307static void
1284process_file (file) 1308process_file (file)
1285 char *file; 1309 char *file;
1286{ 1310{
@@ -1344,21 +1368,22 @@ process_file (file)
1344 compressed_name = concat (file, ".", compr->suffix); 1368 compressed_name = concat (file, ".", compr->suffix);
1345 if (stat (compressed_name, &stat_buf) != 0) 1369 if (stat (compressed_name, &stat_buf) != 0)
1346 { 1370 {
1347#ifdef MSDOS 1371 if (MSDOS)
1348 char *suf = compressed_name + strlen (file);
1349 size_t suflen = strlen (compr->suffix) + 1;
1350 for ( ; suf[1]; suf++, suflen--)
1351 { 1372 {
1352 memmove (suf, suf + 1, suflen); 1373 char *suf = compressed_name + strlen (file);
1353 if (stat (compressed_name, &stat_buf) == 0) 1374 size_t suflen = strlen (compr->suffix) + 1;
1375 for ( ; suf[1]; suf++, suflen--)
1354 { 1376 {
1355 real_name = compressed_name; 1377 memmove (suf, suf + 1, suflen);
1356 break; 1378 if (stat (compressed_name, &stat_buf) == 0)
1379 {
1380 real_name = compressed_name;
1381 break;
1382 }
1357 } 1383 }
1358 } 1384 if (real_name != NULL)
1359 if (real_name != NULL) 1385 break;
1360 break; 1386 } /* MSDOS */
1361#endif
1362 free (compressed_name); 1387 free (compressed_name);
1363 compressed_name = NULL; 1388 compressed_name = NULL;
1364 } 1389 }
@@ -1438,7 +1463,7 @@ process_file (file)
1438 * subscripted by the chars in "white" are set to TRUE. Thus "_wht" 1463 * subscripted by the chars in "white" are set to TRUE. Thus "_wht"
1439 * of a char is TRUE if it is the string "white", else FALSE. 1464 * of a char is TRUE if it is the string "white", else FALSE.
1440 */ 1465 */
1441void 1466static void
1442init () 1467init ()
1443{ 1468{
1444 register char *sp; 1469 register char *sp;
@@ -1464,7 +1489,7 @@ init ()
1464 */ 1489 */
1465node *last_node = NULL; 1490node *last_node = NULL;
1466 1491
1467void 1492static void
1468find_entries (file, inf) 1493find_entries (file, inf)
1469 char *file; 1494 char *file;
1470 FILE *inf; 1495 FILE *inf;
@@ -1663,7 +1688,7 @@ new_pfnote (name, namelen, is_func, linestart, linelen, lno, cno)
1663 * free_tree () 1688 * free_tree ()
1664 * recurse on left children, iterate on right children. 1689 * recurse on left children, iterate on right children.
1665 */ 1690 */
1666void 1691static void
1667free_tree (np) 1692free_tree (np)
1668 register node *np; 1693 register node *np;
1669{ 1694{
@@ -1688,7 +1713,7 @@ free_tree (np)
1688 * add_node is the only function allowed to add nodes, so it can 1713 * add_node is the only function allowed to add nodes, so it can
1689 * maintain state. 1714 * maintain state.
1690 */ 1715 */
1691void 1716static void
1692add_node (np, cur_node_p) 1717add_node (np, cur_node_p)
1693 node *np, **cur_node_p; 1718 node *np, **cur_node_p;
1694{ 1719{
@@ -1746,7 +1771,7 @@ add_node (np, cur_node_p)
1746 } 1771 }
1747} 1772}
1748 1773
1749void 1774static void
1750put_entries (np) 1775put_entries (np)
1751 register node *np; 1776 register node *np;
1752{ 1777{
@@ -1813,7 +1838,7 @@ put_entries (np)
1813} 1838}
1814 1839
1815/* Length of a number's decimal representation. */ 1840/* Length of a number's decimal representation. */
1816int 1841static int
1817number_len (num) 1842number_len (num)
1818 long num; 1843 long num;
1819{ 1844{
@@ -1830,7 +1855,7 @@ number_len (num)
1830 * is irrelevant with the new tags.el, but is still supplied for 1855 * is irrelevant with the new tags.el, but is still supplied for
1831 * backward compatibility. 1856 * backward compatibility.
1832 */ 1857 */
1833int 1858static int
1834total_size_of_entries (np) 1859total_size_of_entries (np)
1835 register node *np; 1860 register node *np;
1836{ 1861{
@@ -1993,7 +2018,7 @@ hash (str, len)
1993#ifdef __GNUC__ 2018#ifdef __GNUC__
1994__inline 2019__inline
1995#endif 2020#endif
1996struct C_stab_entry * 2021static struct C_stab_entry *
1997in_word_set (str, len) 2022in_word_set (str, len)
1998 register const char *str; 2023 register const char *str;
1999 register unsigned int len; 2024 register unsigned int len;
@@ -2091,7 +2116,7 @@ in_word_set (str, len)
2091} 2116}
2092/*%>*/ 2117/*%>*/
2093 2118
2094enum sym_type 2119static enum sym_type
2095C_symtype (str, len, c_ext) 2120C_symtype (str, len, c_ext)
2096 char *str; 2121 char *str;
2097 int len; 2122 int len;
@@ -2247,7 +2272,7 @@ int methodlen;
2247 * next_token_is_func IN OUT 2272 * next_token_is_func IN OUT
2248 */ 2273 */
2249 2274
2250bool 2275static bool
2251consider_token (str, len, c, c_ext, cblev, parlev, is_func_or_var) 2276consider_token (str, len, c, c_ext, cblev, parlev, is_func_or_var)
2252 register char *str; /* IN: token pointer */ 2277 register char *str; /* IN: token pointer */
2253 register int len; /* IN: token length */ 2278 register int len; /* IN: token length */
@@ -2552,7 +2577,7 @@ do { \
2552} while (0) 2577} while (0)
2553 2578
2554 2579
2555void 2580static void
2556make_C_tag (isfun) 2581make_C_tag (isfun)
2557 bool isfun; 2582 bool isfun;
2558{ 2583{
@@ -3254,7 +3279,7 @@ C_entries (c_ext, inf)
3254 * Process either a C++ file or a C file depending on the setting 3279 * Process either a C++ file or a C file depending on the setting
3255 * of a global flag. 3280 * of a global flag.
3256 */ 3281 */
3257void 3282static void
3258default_C_entries (inf) 3283default_C_entries (inf)
3259 FILE *inf; 3284 FILE *inf;
3260{ 3285{
@@ -3262,7 +3287,7 @@ default_C_entries (inf)
3262} 3287}
3263 3288
3264/* Always do plain ANSI C. */ 3289/* Always do plain ANSI C. */
3265void 3290static void
3266plain_C_entries (inf) 3291plain_C_entries (inf)
3267 FILE *inf; 3292 FILE *inf;
3268{ 3293{
@@ -3270,7 +3295,7 @@ plain_C_entries (inf)
3270} 3295}
3271 3296
3272/* Always do C++. */ 3297/* Always do C++. */
3273void 3298static void
3274Cplusplus_entries (inf) 3299Cplusplus_entries (inf)
3275 FILE *inf; 3300 FILE *inf;
3276{ 3301{
@@ -3278,7 +3303,7 @@ Cplusplus_entries (inf)
3278} 3303}
3279 3304
3280/* Always do Java. */ 3305/* Always do Java. */
3281void 3306static void
3282Cjava_entries (inf) 3307Cjava_entries (inf)
3283 FILE *inf; 3308 FILE *inf;
3284{ 3309{
@@ -3286,7 +3311,7 @@ Cjava_entries (inf)
3286} 3311}
3287 3312
3288/* Always do C*. */ 3313/* Always do C*. */
3289void 3314static void
3290Cstar_entries (inf) 3315Cstar_entries (inf)
3291 FILE *inf; 3316 FILE *inf;
3292{ 3317{
@@ -3294,7 +3319,7 @@ Cstar_entries (inf)
3294} 3319}
3295 3320
3296/* Always do Yacc. */ 3321/* Always do Yacc. */
3297void 3322static void
3298Yacc_entries (inf) 3323Yacc_entries (inf)
3299 FILE *inf; 3324 FILE *inf;
3300{ 3325{
@@ -3317,7 +3342,7 @@ Yacc_entries (inf)
3317 * Read a file, but do no processing. This is used to do regexp 3342 * Read a file, but do no processing. This is used to do regexp
3318 * matching on files that have no language defined. 3343 * matching on files that have no language defined.
3319 */ 3344 */
3320void 3345static void
3321just_read_file (inf) 3346just_read_file (inf)
3322 FILE *inf; 3347 FILE *inf;
3323{ 3348{
@@ -3329,7 +3354,7 @@ just_read_file (inf)
3329 3354
3330/* Fortran parsing */ 3355/* Fortran parsing */
3331 3356
3332bool 3357static bool
3333tail (cp) 3358tail (cp)
3334 char *cp; 3359 char *cp;
3335{ 3360{
@@ -3345,7 +3370,7 @@ tail (cp)
3345 return FALSE; 3370 return FALSE;
3346} 3371}
3347 3372
3348void 3373static void
3349takeprec () 3374takeprec ()
3350{ 3375{
3351 dbp = skip_spaces (dbp); 3376 dbp = skip_spaces (dbp);
@@ -3368,7 +3393,7 @@ takeprec ()
3368 while (isdigit (*dbp)); 3393 while (isdigit (*dbp));
3369} 3394}
3370 3395
3371void 3396static void
3372getit (inf) 3397getit (inf)
3373 FILE *inf; 3398 FILE *inf;
3374{ 3399{
@@ -3395,7 +3420,7 @@ getit (inf)
3395} 3420}
3396 3421
3397 3422
3398void 3423static void
3399Fortran_functions (inf) 3424Fortran_functions (inf)
3400 FILE *inf; 3425 FILE *inf;
3401{ 3426{
@@ -3474,7 +3499,7 @@ Fortran_functions (inf)
3474 */ 3499 */
3475/* Once we are positioned after an "interesting" keyword, let's get 3500/* Once we are positioned after an "interesting" keyword, let's get
3476 the real tag value necessary. */ 3501 the real tag value necessary. */
3477void 3502static void
3478adagetit (inf, name_qualifier) 3503adagetit (inf, name_qualifier)
3479 FILE *inf; 3504 FILE *inf;
3480 char *name_qualifier; 3505 char *name_qualifier;
@@ -3541,7 +3566,7 @@ adagetit (inf, name_qualifier)
3541 } 3566 }
3542} 3567}
3543 3568
3544void 3569static void
3545Ada_funcs (inf) 3570Ada_funcs (inf)
3546 FILE *inf; 3571 FILE *inf;
3547{ 3572{
@@ -3638,7 +3663,7 @@ Ada_funcs (inf)
3638 * Unix and microcontroller assembly tag handling 3663 * Unix and microcontroller assembly tag handling
3639 * look for '^[a-zA-Z_.$][a-zA_Z0-9_.$]*[: ^I^J]' 3664 * look for '^[a-zA-Z_.$][a-zA_Z0-9_.$]*[: ^I^J]'
3640 */ 3665 */
3641void 3666static void
3642Asm_labels (inf) 3667Asm_labels (inf)
3643 FILE *inf; 3668 FILE *inf;
3644{ 3669{
@@ -3670,7 +3695,7 @@ Asm_labels (inf)
3670 * Perl sub names: look for /^sub[ \t\n]+[^ \t\n{]+/ 3695 * Perl sub names: look for /^sub[ \t\n]+[^ \t\n{]+/
3671 * Perl variable names: /^(my|local).../ 3696 * Perl variable names: /^(my|local).../
3672 */ 3697 */
3673void 3698static void
3674Perl_functions (inf) 3699Perl_functions (inf)
3675 FILE *inf; 3700 FILE *inf;
3676{ 3701{
@@ -3736,7 +3761,7 @@ Perl_functions (inf)
3736 * Python support by Eric S. Raymond <esr@thyrsus.com> 3761 * Python support by Eric S. Raymond <esr@thyrsus.com>
3737 * Look for /^def[ \t\n]+[^ \t\n(:]+/ or /^class[ \t\n]+[^ \t\n(:]+/ 3762 * Look for /^def[ \t\n]+[^ \t\n(:]+/ or /^class[ \t\n]+[^ \t\n(:]+/
3738 */ 3763 */
3739void 3764static void
3740Python_functions (inf) 3765Python_functions (inf)
3741 FILE *inf; 3766 FILE *inf;
3742{ 3767{
@@ -3776,7 +3801,7 @@ Python_functions (inf)
3776 * We could look for anything that could be a paragraph name. 3801 * We could look for anything that could be a paragraph name.
3777 * i.e. anything that starts in column 8 is one word and ends in a full stop. 3802 * i.e. anything that starts in column 8 is one word and ends in a full stop.
3778 */ 3803 */
3779void 3804static void
3780Cobol_paragraphs (inf) 3805Cobol_paragraphs (inf)
3781 FILE *inf; 3806 FILE *inf;
3782{ 3807{
@@ -3809,7 +3834,7 @@ Cobol_paragraphs (inf)
3809 * "forward" immediately following the procedure statement; if found, 3834 * "forward" immediately following the procedure statement; if found,
3810 * the tag is skipped. 3835 * the tag is skipped.
3811 */ 3836 */
3812void 3837static void
3813Pascal_functions (inf) 3838Pascal_functions (inf)
3814 FILE *inf; 3839 FILE *inf;
3815{ 3840{
@@ -3986,7 +4011,7 @@ Pascal_functions (inf)
3986 * lisp tag functions 4011 * lisp tag functions
3987 * look for (def or (DEF, quote or QUOTE 4012 * look for (def or (DEF, quote or QUOTE
3988 */ 4013 */
3989int 4014static int
3990L_isdef (strp) 4015L_isdef (strp)
3991 register char *strp; 4016 register char *strp;
3992{ 4017{
@@ -3995,7 +4020,7 @@ L_isdef (strp)
3995 && (strp[3] == 'f' || strp[3] == 'F')); 4020 && (strp[3] == 'f' || strp[3] == 'F'));
3996} 4021}
3997 4022
3998int 4023static int
3999L_isquote (strp) 4024L_isquote (strp)
4000 register char *strp; 4025 register char *strp;
4001{ 4026{
@@ -4007,7 +4032,7 @@ L_isquote (strp)
4007 && isspace (*++strp)); 4032 && isspace (*++strp));
4008} 4033}
4009 4034
4010void 4035static void
4011L_getit () 4036L_getit ()
4012{ 4037{
4013 register char *cp; 4038 register char *cp;
@@ -4034,7 +4059,7 @@ L_getit ()
4034 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4059 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4035} 4060}
4036 4061
4037void 4062static void
4038Lisp_functions (inf) 4063Lisp_functions (inf)
4039 FILE *inf; 4064 FILE *inf;
4040{ 4065{
@@ -4080,7 +4105,7 @@ Lisp_functions (inf)
4080 * Also look at "defineps" for PSWrap 4105 * Also look at "defineps" for PSWrap
4081 * suggested by Masatake YAMATO <masata-y@is.aist-nara.ac.jp> 4106 * suggested by Masatake YAMATO <masata-y@is.aist-nara.ac.jp>
4082 */ 4107 */
4083void 4108static void
4084Postscript_functions (inf) 4109Postscript_functions (inf)
4085 FILE *inf; 4110 FILE *inf;
4086{ 4111{
@@ -4115,7 +4140,7 @@ Postscript_functions (inf)
4115 * look for (set! xyzzy 4140 * look for (set! xyzzy
4116 */ 4141 */
4117 4142
4118void 4143static void
4119Scheme_functions (inf) 4144Scheme_functions (inf)
4120 FILE *inf; 4145 FILE *inf;
4121{ 4146{
@@ -4168,9 +4193,9 @@ char *TEX_defenv = "\
4168:chapter:section:subsection:subsubsection:eqno:label:ref:cite:bibitem\ 4193:chapter:section:subsection:subsubsection:eqno:label:ref:cite:bibitem\
4169:part:appendix:entry:index"; 4194:part:appendix:entry:index";
4170 4195
4171void TEX_mode (); 4196static void TEX_mode P_((FILE *inf));
4172struct TEX_tabent *TEX_decode_env (); 4197static struct TEX_tabent *TEX_decode_env P_((char *evarname, char *defenv));
4173int TEX_Token (); 4198static int TEX_Token P_((char *cp));
4174 4199
4175char TEX_esc = '\\'; 4200char TEX_esc = '\\';
4176char TEX_opgrp = '{'; 4201char TEX_opgrp = '{';
@@ -4179,7 +4204,7 @@ char TEX_clgrp = '}';
4179/* 4204/*
4180 * TeX/LaTeX scanning loop. 4205 * TeX/LaTeX scanning loop.
4181 */ 4206 */
4182void 4207static void
4183TeX_functions (inf) 4208TeX_functions (inf)
4184 FILE *inf; 4209 FILE *inf;
4185{ 4210{
@@ -4226,7 +4251,7 @@ TeX_functions (inf)
4226 4251
4227/* Figure out whether TeX's escapechar is '\\' or '!' and set grouping 4252/* Figure out whether TeX's escapechar is '\\' or '!' and set grouping
4228 chars accordingly. */ 4253 chars accordingly. */
4229void 4254static void
4230TEX_mode (inf) 4255TEX_mode (inf)
4231 FILE *inf; 4256 FILE *inf;
4232{ 4257{
@@ -4261,7 +4286,7 @@ TEX_mode (inf)
4261 4286
4262/* Read environment and prepend it to the default string. 4287/* Read environment and prepend it to the default string.
4263 Build token table. */ 4288 Build token table. */
4264struct TEX_tabent * 4289static struct TEX_tabent *
4265TEX_decode_env (evarname, defenv) 4290TEX_decode_env (evarname, defenv)
4266 char *evarname; 4291 char *evarname;
4267 char *defenv; 4292 char *defenv;
@@ -4318,7 +4343,7 @@ TEX_decode_env (evarname, defenv)
4318 Otherwise return -1. 4343 Otherwise return -1.
4319 Keep the capital `T' in `token' for dumb truncating compilers 4344 Keep the capital `T' in `token' for dumb truncating compilers
4320 (this distinguishes it from `TEX_toktab' */ 4345 (this distinguishes it from `TEX_toktab' */
4321int 4346static int
4322TEX_Token (cp) 4347TEX_Token (cp)
4323 char *cp; 4348 char *cp;
4324{ 4349{
@@ -4336,11 +4361,11 @@ TEX_Token (cp)
4336 * Assumes that the predicate starts at column 0. 4361 * Assumes that the predicate starts at column 0.
4337 * Only the first clause of a predicate is added. 4362 * Only the first clause of a predicate is added.
4338 */ 4363 */
4339int prolog_pred (); 4364static int prolog_pred P_((char *s, char *last));
4340void prolog_skip_comment (); 4365static void prolog_skip_comment P_((linebuffer *plb, FILE *inf));
4341int prolog_atom (); 4366static int prolog_atom P_((char *s, int pos));
4342 4367
4343void 4368static void
4344Prolog_functions (inf) 4369Prolog_functions (inf)
4345 FILE *inf; 4370 FILE *inf;
4346{ 4371{
@@ -4376,7 +4401,7 @@ Prolog_functions (inf)
4376} 4401}
4377 4402
4378 4403
4379void 4404static void
4380prolog_skip_comment (plb, inf) 4405prolog_skip_comment (plb, inf)
4381 linebuffer *plb; 4406 linebuffer *plb;
4382 FILE *inf; 4407 FILE *inf;
@@ -4445,7 +4470,7 @@ prolog_pred (s, last)
4445 * - A quoted arbitrary string. Single quotes can escape themselves. 4470 * - A quoted arbitrary string. Single quotes can escape themselves.
4446 * Backslash quotes everything. 4471 * Backslash quotes everything.
4447 */ 4472 */
4448int 4473static int
4449prolog_atom (s, pos) 4474prolog_atom (s, pos)
4450 char *s; 4475 char *s;
4451 int pos; 4476 int pos;
@@ -4502,11 +4527,11 @@ prolog_atom (s, pos)
4502 * 4527 *
4503 * Assumes that Erlang functions start at column 0. 4528 * Assumes that Erlang functions start at column 0.
4504 */ 4529 */
4505int erlang_func (); 4530static int erlang_func P_((char *s, char *last));
4506void erlang_attribute (); 4531static void erlang_attribute P_((char *s));
4507int erlang_atom (); 4532static int erlang_atom P_((char *s, int pos));
4508 4533
4509void 4534static void
4510Erlang_functions (inf) 4535Erlang_functions (inf)
4511 FILE *inf; 4536 FILE *inf;
4512{ 4537{
@@ -4599,7 +4624,7 @@ erlang_func (s, last)
4599 * -define(Foo(M, N), M+N). 4624 * -define(Foo(M, N), M+N).
4600 * -record(graph, {vtab = notable, cyclic = true}). 4625 * -record(graph, {vtab = notable, cyclic = true}).
4601 */ 4626 */
4602void 4627static void
4603erlang_attribute (s) 4628erlang_attribute (s)
4604 char *s; 4629 char *s;
4605{ 4630{
@@ -4626,7 +4651,7 @@ erlang_attribute (s)
4626 * Consume an Erlang atom (or variable). 4651 * Consume an Erlang atom (or variable).
4627 * Return the number of bytes consumed, or -1 if there was an error. 4652 * Return the number of bytes consumed, or -1 if there was an error.
4628 */ 4653 */
4629int 4654static int
4630erlang_atom (s, pos) 4655erlang_atom (s, pos)
4631 char *s; 4656 char *s;
4632 int pos; 4657 int pos;
@@ -4680,7 +4705,7 @@ erlang_atom (s, pos)
4680 an unquoted separator. Also turns "\t" into a Tab character. 4705 an unquoted separator. Also turns "\t" into a Tab character.
4681 Returns pointer to terminating separator. Works in place. Null 4706 Returns pointer to terminating separator. Works in place. Null
4682 terminates name string. */ 4707 terminates name string. */
4683char * 4708static char *
4684scan_separators (name) 4709scan_separators (name)
4685 char *name; 4710 char *name;
4686{ 4711{
@@ -4719,7 +4744,7 @@ scan_separators (name)
4719 4744
4720/* Look at the argument of --regex or --no-regex and do the right 4745/* Look at the argument of --regex or --no-regex and do the right
4721 thing. Same for each line of a regexp file. */ 4746 thing. Same for each line of a regexp file. */
4722void 4747static void
4723analyse_regex (regex_arg, ignore_case) 4748analyse_regex (regex_arg, ignore_case)
4724 char *regex_arg; 4749 char *regex_arg;
4725 bool ignore_case; 4750 bool ignore_case;
@@ -4789,7 +4814,7 @@ analyse_regex (regex_arg, ignore_case)
4789 4814
4790/* Turn a name, which is an ed-style (but Emacs syntax) regular 4815/* Turn a name, which is an ed-style (but Emacs syntax) regular
4791 expression, into a real regular expression by compiling it. */ 4816 expression, into a real regular expression by compiling it. */
4792void 4817static void
4793add_regex (regexp_pattern, ignore_case, lang) 4818add_regex (regexp_pattern, ignore_case, lang)
4794 char *regexp_pattern; 4819 char *regexp_pattern;
4795 bool ignore_case; 4820 bool ignore_case;
@@ -4842,7 +4867,7 @@ add_regex (regexp_pattern, ignore_case, lang)
4842 * Do the substitutions indicated by the regular expression and 4867 * Do the substitutions indicated by the regular expression and
4843 * arguments. 4868 * arguments.
4844 */ 4869 */
4845char * 4870static char *
4846substitute (in, out, regs) 4871substitute (in, out, regs)
4847 char *in, *out; 4872 char *in, *out;
4848 struct re_registers *regs; 4873 struct re_registers *regs;
@@ -4891,7 +4916,7 @@ substitute (in, out, regs)
4891} 4916}
4892 4917
4893/* Deallocate all patterns. */ 4918/* Deallocate all patterns. */
4894void 4919static void
4895free_patterns () 4920free_patterns ()
4896{ 4921{
4897 pattern *pp; 4922 pattern *pp;
@@ -4906,7 +4931,7 @@ free_patterns ()
4906 return; 4931 return;
4907} 4932}
4908 4933
4909void 4934static void
4910get_tag (bp) 4935get_tag (bp)
4911 register char *bp; 4936 register char *bp;
4912{ 4937{
@@ -4925,7 +4950,7 @@ get_tag (bp)
4925 4950
4926#endif /* ETAGS_REGEXPS */ 4951#endif /* ETAGS_REGEXPS */
4927/* Initialize a linebuffer for use */ 4952/* Initialize a linebuffer for use */
4928void 4953static void
4929initbuffer (lbp) 4954initbuffer (lbp)
4930 linebuffer *lbp; 4955 linebuffer *lbp;
4931{ 4956{
@@ -4943,7 +4968,7 @@ initbuffer (lbp)
4943 * platforms (for text files, it translates CR-NL to NL as it reads in the 4968 * platforms (for text files, it translates CR-NL to NL as it reads in the
4944 * file). 4969 * file).
4945 */ 4970 */
4946long 4971static long
4947readline_internal (lbp, stream) 4972readline_internal (lbp, stream)
4948 linebuffer *lbp; 4973 linebuffer *lbp;
4949 register FILE *stream; 4974 register FILE *stream;
@@ -5007,7 +5032,7 @@ readline_internal (lbp, stream)
5007 * Like readline_internal, above, but in addition try to match the 5032 * Like readline_internal, above, but in addition try to match the
5008 * input line against relevant regular expressions. 5033 * input line against relevant regular expressions.
5009 */ 5034 */
5010long 5035static long
5011readline (lbp, stream) 5036readline (lbp, stream)
5012 linebuffer *lbp; 5037 linebuffer *lbp;
5013 FILE *stream; 5038 FILE *stream;
@@ -5068,7 +5093,7 @@ readline (lbp, stream)
5068 * Return a pointer to a space of size strlen(cp)+1 allocated 5093 * Return a pointer to a space of size strlen(cp)+1 allocated
5069 * with xnew where the string CP has been copied. 5094 * with xnew where the string CP has been copied.
5070 */ 5095 */
5071char * 5096static char *
5072savestr (cp) 5097savestr (cp)
5073 char *cp; 5098 char *cp;
5074{ 5099{
@@ -5079,7 +5104,7 @@ savestr (cp)
5079 * Return a pointer to a space of size LEN+1 allocated with xnew where 5104 * Return a pointer to a space of size LEN+1 allocated with xnew where
5080 * the string CP has been copied for at most the first LEN characters. 5105 * the string CP has been copied for at most the first LEN characters.
5081 */ 5106 */
5082char * 5107static char *
5083savenstr (cp, len) 5108savenstr (cp, len)
5084 char *cp; 5109 char *cp;
5085 int len; 5110 int len;
@@ -5096,13 +5121,14 @@ savenstr (cp, len)
5096 * Return the ptr in sp at which the character c last 5121 * Return the ptr in sp at which the character c last
5097 * appears; NULL if not found 5122 * appears; NULL if not found
5098 * 5123 *
5099 * Identical to System V strrchr, included for portability. 5124 * Identical to POSIX strrchr, included for portability.
5100 */ 5125 */
5101char * 5126static char *
5102etags_strrchr (sp, c) 5127etags_strrchr (sp, c)
5103 register char *sp, c; 5128 register const char *sp;
5129 register int c;
5104{ 5130{
5105 register char *r; 5131 register const char *r;
5106 5132
5107 r = NULL; 5133 r = NULL;
5108 do 5134 do
@@ -5110,7 +5136,7 @@ etags_strrchr (sp, c)
5110 if (*sp == c) 5136 if (*sp == c)
5111 r = sp; 5137 r = sp;
5112 } while (*sp++); 5138 } while (*sp++);
5113 return r; 5139 return (char *)r;
5114} 5140}
5115 5141
5116 5142
@@ -5118,22 +5144,23 @@ etags_strrchr (sp, c)
5118 * Return the ptr in sp at which the character c first 5144 * Return the ptr in sp at which the character c first
5119 * appears; NULL if not found 5145 * appears; NULL if not found
5120 * 5146 *
5121 * Identical to System V strchr, included for portability. 5147 * Identical to POSIX strchr, included for portability.
5122 */ 5148 */
5123char * 5149static char *
5124etags_strchr (sp, c) 5150etags_strchr (sp, c)
5125 register char *sp, c; 5151 register const char *sp;
5152 register int c;
5126{ 5153{
5127 do 5154 do
5128 { 5155 {
5129 if (*sp == c) 5156 if (*sp == c)
5130 return sp; 5157 return (char *)sp;
5131 } while (*sp++); 5158 } while (*sp++);
5132 return NULL; 5159 return NULL;
5133} 5160}
5134 5161
5135/* Skip spaces, return new pointer. */ 5162/* Skip spaces, return new pointer. */
5136char * 5163static char *
5137skip_spaces (cp) 5164skip_spaces (cp)
5138 char *cp; 5165 char *cp;
5139{ 5166{
@@ -5143,7 +5170,7 @@ skip_spaces (cp)
5143} 5170}
5144 5171
5145/* Skip non spaces, return new pointer. */ 5172/* Skip non spaces, return new pointer. */
5146char * 5173static char *
5147skip_non_spaces (cp) 5174skip_non_spaces (cp)
5148 char *cp; 5175 char *cp;
5149{ 5176{
@@ -5153,7 +5180,7 @@ skip_non_spaces (cp)
5153} 5180}
5154 5181
5155/* Print error message and exit. */ 5182/* Print error message and exit. */
5156void 5183static void
5157fatal (s1, s2) 5184fatal (s1, s2)
5158 char *s1, *s2; 5185 char *s1, *s2;
5159{ 5186{
@@ -5161,7 +5188,7 @@ fatal (s1, s2)
5161 exit (BAD); 5188 exit (BAD);
5162} 5189}
5163 5190
5164void 5191static void
5165pfatal (s1) 5192pfatal (s1)
5166 char *s1; 5193 char *s1;
5167{ 5194{
@@ -5169,7 +5196,7 @@ pfatal (s1)
5169 exit (BAD); 5196 exit (BAD);
5170} 5197}
5171 5198
5172void 5199static void
5173suggest_asking_for_help () 5200suggest_asking_for_help ()
5174{ 5201{
5175 fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", 5202 fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n",
@@ -5184,9 +5211,9 @@ suggest_asking_for_help ()
5184} 5211}
5185 5212
5186/* Print error message. `s1' is printf control string, `s2' is arg for it. */ 5213/* Print error message. `s1' is printf control string, `s2' is arg for it. */
5187void 5214static void
5188error (s1, s2) 5215error (s1, s2)
5189 char *s1, *s2; 5216 const char *s1, *s2;
5190{ 5217{
5191 fprintf (stderr, "%s: ", progname); 5218 fprintf (stderr, "%s: ", progname);
5192 fprintf (stderr, s1, s2); 5219 fprintf (stderr, s1, s2);
@@ -5195,7 +5222,7 @@ error (s1, s2)
5195 5222
5196/* Return a newly-allocated string whose contents 5223/* Return a newly-allocated string whose contents
5197 concatenate those of s1, s2, s3. */ 5224 concatenate those of s1, s2, s3. */
5198char * 5225static char *
5199concat (s1, s2, s3) 5226concat (s1, s2, s3)
5200 char *s1, *s2, *s3; 5227 char *s1, *s2, *s3;
5201{ 5228{
@@ -5212,7 +5239,7 @@ concat (s1, s2, s3)
5212 5239
5213/* Does the same work as the system V getcwd, but does not need to 5240/* Does the same work as the system V getcwd, but does not need to
5214 guess the buffer size in advance. */ 5241 guess the buffer size in advance. */
5215char * 5242static char *
5216etags_getcwd () 5243etags_getcwd ()
5217{ 5244{
5218#ifdef HAVE_GETCWD 5245#ifdef HAVE_GETCWD
@@ -5261,7 +5288,7 @@ etags_getcwd ()
5261 5288
5262/* Return a newly allocated string containing the file name of FILE 5289/* Return a newly allocated string containing the file name of FILE
5263 relative to the absolute directory DIR (which should end with a slash). */ 5290 relative to the absolute directory DIR (which should end with a slash). */
5264char * 5291static char *
5265relative_filename (file, dir) 5292relative_filename (file, dir)
5266 char *file, *dir; 5293 char *file, *dir;
5267{ 5294{
@@ -5301,7 +5328,7 @@ relative_filename (file, dir)
5301 5328
5302/* Return a newly allocated string containing the absolute file name 5329/* Return a newly allocated string containing the absolute file name
5303 of FILE given DIR (which should end with a slash). */ 5330 of FILE given DIR (which should end with a slash). */
5304char * 5331static char *
5305absolute_filename (file, dir) 5332absolute_filename (file, dir)
5306 char *file, *dir; 5333 char *file, *dir;
5307{ 5334{
@@ -5363,7 +5390,7 @@ absolute_filename (file, dir)
5363/* Return a newly allocated string containing the absolute 5390/* Return a newly allocated string containing the absolute
5364 file name of dir where FILE resides given DIR (which should 5391 file name of dir where FILE resides given DIR (which should
5365 end with a slash). */ 5392 end with a slash). */
5366char * 5393static char *
5367absolute_dirname (file, dir) 5394absolute_dirname (file, dir)
5368 char *file, *dir; 5395 char *file, *dir;
5369{ 5396{
@@ -5384,7 +5411,7 @@ absolute_dirname (file, dir)
5384 5411
5385/* Whether the argument string is an absolute file name. The argument 5412/* Whether the argument string is an absolute file name. The argument
5386 string must have been canonicalized with canonicalize_filename. */ 5413 string must have been canonicalized with canonicalize_filename. */
5387bool 5414static bool
5388filename_is_absolute (fn) 5415filename_is_absolute (fn)
5389 char *fn; 5416 char *fn;
5390{ 5417{
@@ -5396,7 +5423,7 @@ filename_is_absolute (fn)
5396} 5423}
5397 5424
5398/* Translate backslashes into slashes. Works in place. */ 5425/* Translate backslashes into slashes. Works in place. */
5399void 5426static void
5400canonicalize_filename (fn) 5427canonicalize_filename (fn)
5401 register char *fn; 5428 register char *fn;
5402{ 5429{
@@ -5415,7 +5442,7 @@ canonicalize_filename (fn)
5415} 5442}
5416 5443
5417/* Increase the size of a linebuffer. */ 5444/* Increase the size of a linebuffer. */
5418void 5445static void
5419grow_linebuffer (lbp, toksize) 5446grow_linebuffer (lbp, toksize)
5420 linebuffer *lbp; 5447 linebuffer *lbp;
5421 int toksize; 5448 int toksize;
@@ -5426,7 +5453,7 @@ grow_linebuffer (lbp, toksize)
5426} 5453}
5427 5454
5428/* Like malloc but get fatal error if memory is exhausted. */ 5455/* Like malloc but get fatal error if memory is exhausted. */
5429long * 5456static long *
5430xmalloc (size) 5457xmalloc (size)
5431 unsigned int size; 5458 unsigned int size;
5432{ 5459{
@@ -5436,7 +5463,7 @@ xmalloc (size)
5436 return result; 5463 return result;
5437} 5464}
5438 5465
5439long * 5466static long *
5440xrealloc (ptr, size) 5467xrealloc (ptr, size)
5441 char *ptr; 5468 char *ptr;
5442 unsigned int size; 5469 unsigned int size;