aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Potortì2000-02-10 21:28:51 +0000
committerFrancesco Potortì2000-02-10 21:28:51 +0000
commit71cbb89543ea21a9edea72cb24d2df6e714b60db (patch)
tree5f5ba79305d67dd0bb0b6828116f380819a2b6ce
parent97fa0cc812e4151982e334e5ebfcd056445e5e94 (diff)
downloademacs-71cbb89543ea21a9edea72cb24d2df6e714b60db.tar.gz
emacs-71cbb89543ea21a9edea72cb24d2df6e714b60db.zip
2000-02-10 Francesco Potorti` <pot@gnu.org>
* etags.c (iswhite): Redefined not to consider '\0' as white space, and use it throughout in place of isspace, thus preventing a potential signed char to int conversion problem. (MSDOS): #undefine befere redefining 2000-02-04 Francesco Potorti` <F.Potorti@cnuce.cnr.it> * etags.c (many functions): Add prototypes.
-rw-r--r--lib-src/ChangeLog11
-rw-r--r--lib-src/etags.c224
2 files changed, 137 insertions, 98 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 2113de1f022..e44745dde5f 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,14 @@
12000-02-10 Francesco Potorti` <pot@gnu.org>
2
3 * etags.c (iswhite): Redefined not to consider '\0' as white
4 space, and use it throughout in place of isspace, thus preventing a
5 potential signed char to int conversion problem.
6 (MSDOS): #undefine befere redefining
7
82000-02-04 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
9
10 * etags.c (many functions): Add prototypes.
11
12000-02-10 Dave Love <fx@gnu.org> 122000-02-10 Dave Love <fx@gnu.org>
2 13
3 * etags.c (pfnote, new_pfnote, C_entries, prolog_pred) 14 * etags.c (pfnote, new_pfnote, C_entries, prolog_pred)
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 2a4ce864405..e0902077822 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -31,7 +31,7 @@ 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.38"; 34char pot_etags_version[] = "@(#) pot revision number is 13.44";
35 35
36#define TRUE 1 36#define TRUE 1
37#define FALSE 0 37#define FALSE 0
@@ -40,7 +40,7 @@ char pot_etags_version[] = "@(#) pot revision number is 13.38";
40# define DEBUG FALSE 40# define DEBUG FALSE
41#endif 41#endif
42 42
43#if defined (__STDC__) && __STDC__ 43#if defined(__STDC__) && (__STDC__ || defined(__SUNPRO_C))
44# define P_(proto) proto 44# define P_(proto) proto
45#else 45#else
46# define P_(proto) () 46# define P_(proto) ()
@@ -60,6 +60,7 @@ char pot_etags_version[] = "@(#) pot revision number is 13.38";
60#endif 60#endif
61 61
62#ifdef MSDOS 62#ifdef MSDOS
63# undef MSDOS
63# define MSDOS TRUE 64# define MSDOS TRUE
64# include <fcntl.h> 65# include <fcntl.h>
65# include <sys/param.h> 66# include <sys/param.h>
@@ -100,7 +101,7 @@ char pot_etags_version[] = "@(#) pot revision number is 13.38";
100# include <unistd.h> 101# include <unistd.h>
101#else 102#else
102# if defined (HAVE_GETCWD) && !WINDOWSNT 103# if defined (HAVE_GETCWD) && !WINDOWSNT
103 extern char *getcwd (); 104 extern char *getcwd (char *buf, size_t size);
104# endif 105# endif
105#endif /* HAVE_UNISTD_H */ 106#endif /* HAVE_UNISTD_H */
106 107
@@ -189,7 +190,7 @@ char pot_etags_version[] = "@(#) pot revision number is 13.38";
189 190
190typedef int bool; 191typedef int bool;
191 192
192typedef void Lang_function (); 193typedef void Lang_function P_((FILE *));
193 194
194typedef struct 195typedef struct
195{ 196{
@@ -234,76 +235,80 @@ typedef struct
234/* Many compilers barf on this: 235/* Many compilers barf on this:
235 Lang_function Ada_funcs; 236 Lang_function Ada_funcs;
236 so let's write it this way */ 237 so let's write it this way */
237static void Ada_funcs P_((FILE *inf)); 238static void Ada_funcs P_((FILE *));
238static void Asm_labels P_((FILE *inf)); 239static void Asm_labels P_((FILE *));
239static void C_entries P_((int c_ext, FILE *inf)); 240static void C_entries P_((int c_ext, FILE *));
240static void default_C_entries P_((FILE *inf)); 241static void default_C_entries P_((FILE *));
241static void plain_C_entries P_((FILE *inf)); 242static void plain_C_entries P_((FILE *));
242static void Cjava_entries P_((FILE *inf)); 243static void Cjava_entries P_((FILE *));
243static void Cobol_paragraphs P_((FILE *inf)); 244static void Cobol_paragraphs P_((FILE *));
244static void Cplusplus_entries P_((FILE *inf)); 245static void Cplusplus_entries P_((FILE *));
245static void Cstar_entries P_((FILE *inf)); 246static void Cstar_entries P_((FILE *));
246static void Erlang_functions P_((FILE *inf)); 247static void Erlang_functions P_((FILE *));
247static void Fortran_functions P_((FILE *inf)); 248static void Fortran_functions P_((FILE *));
248static void Yacc_entries P_((FILE *inf)); 249static void Yacc_entries P_((FILE *));
249static void Lisp_functions P_((FILE *inf)); 250static void Lisp_functions P_((FILE *));
250static void Pascal_functions P_((FILE *inf)); 251static void Pascal_functions P_((FILE *));
251static void Perl_functions P_((FILE *inf)); 252static void Perl_functions P_((FILE *));
252static void Postscript_functions P_((FILE *inf)); 253static void Postscript_functions P_((FILE *));
253static void Prolog_functions P_((FILE *inf)); 254static void Prolog_functions P_((FILE *));
254static void Python_functions P_((FILE *inf)); 255static void Python_functions P_((FILE *));
255static void Scheme_functions P_((FILE *inf)); 256static void Scheme_functions P_((FILE *));
256static void TeX_functions P_((FILE *inf)); 257static void TeX_functions P_((FILE *));
257static void just_read_file P_((FILE *inf)); 258static void just_read_file P_((FILE *));
258 259
259static compressor *get_compressor_from_suffix P_((char *file, char **extptr)); 260static void print_language_names P_((void));
260static language *get_language_from_name P_((char *name)); 261static void print_version P_((void));
261static language *get_language_from_interpreter P_((char *interpreter)); 262static void print_help P_((void));
262static language *get_language_from_suffix P_((char *file)); 263int main P_((int, char **));
263static int total_size_of_entries P_((register node *np)); 264static int number_len P_((long));
264static long readline P_((linebuffer *lbp, FILE *stream)); 265
265static long readline_internal P_((linebuffer *lbp, register FILE *stream)); 266static compressor *get_compressor_from_suffix P_((char *, char **));
266static void get_tag P_((register char *bp)); 267static language *get_language_from_name P_((char *));
268static language *get_language_from_interpreter P_((char *));
269static language *get_language_from_suffix P_((char *));
270static int total_size_of_entries P_((node *));
271static long readline P_((linebuffer *, FILE *));
272static long readline_internal P_((linebuffer *, FILE *));
273static void get_tag P_((char *));
267 274
268#ifdef ETAGS_REGEXPS 275#ifdef ETAGS_REGEXPS
269static void analyse_regex P_((char *regex_arg, bool ignore_case)); 276static void analyse_regex P_((char *, bool));
270static void add_regex P_((char *regexp_pattern, bool ignore_case, language *lan)); 277static void add_regex P_((char *, bool, language *));
271static void free_patterns P_((void)); 278static void free_patterns P_((void));
272#endif /* ETAGS_REGEXPS */ 279#endif /* ETAGS_REGEXPS */
273static void error P_((const char *s1, const char *s2)); 280static void error P_((const char *, const char *));
274static void suggest_asking_for_help P_((void)); 281static void suggest_asking_for_help P_((void));
275static void fatal P_((char *s1, char *s2)); 282static void fatal P_((char *, char *));
276static void pfatal P_((char *s1)); 283static void pfatal P_((char *));
277static void add_node P_((node *np, node **cur_node_p)); 284static void add_node P_((node *, node **));
278 285
279static void init P_((void)); 286static void init P_((void));
280static void initbuffer P_((linebuffer *lbp)); 287static void initbuffer P_((linebuffer *));
281static void find_entries P_((char *file, FILE *inf)); 288static void find_entries P_((char *, FILE *));
282static void free_tree P_((register node *np)); 289static void free_tree P_((node *));
283static void pfnote P_((char *name, bool is_func, char *linestart, 290static void pfnote P_((char *, bool, char *, int, int, long));
284 int linelen, int lno, long int cno)); 291static void new_pfnote P_((char *, int, bool, char *, int, int, long));
285static void new_pfnote P_((char *name, int namelen, bool is_func, 292static void process_file P_((char *));
286 char *linestart, int linelen, int lno, long int cno)); 293static void put_entries P_((node *));
287static void process_file P_((char *file));
288static void put_entries P_((register node *np));
289static void takeprec P_((void)); 294static void takeprec P_((void));
290 295
291static char *concat P_((char *s1, char *s2, char *s3)); 296static char *concat P_((char *, char *, char *));
292static char *skip_spaces P_((char *cp)); 297static char *skip_spaces P_((char *));
293static char *skip_non_spaces P_((char *cp)); 298static char *skip_non_spaces P_((char *));
294static char *savenstr P_((char *cp, int len)); 299static char *savenstr P_((char *, int));
295static char *savestr P_((char *cp)); 300static char *savestr P_((char *));
296static char *etags_strchr P_((const char *sp, int c)); 301static char *etags_strchr P_((const char *, int));
297static char *etags_strrchr P_((const char *sp, int c)); 302static char *etags_strrchr P_((const char *, int));
298static char *etags_getcwd P_((void)); 303static char *etags_getcwd P_((void));
299static char *relative_filename P_((char *file, char *dir)); 304static char *relative_filename P_((char *, char *));
300static char *absolute_filename P_((char *file, char *dir)); 305static char *absolute_filename P_((char *, char *));
301static char *absolute_dirname P_((char *file, char *dir)); 306static char *absolute_dirname P_((char *, char *));
302static bool filename_is_absolute P_((char *fn)); 307static bool filename_is_absolute P_((char *f));
303static void canonicalize_filename P_((register char *fn)); 308static void canonicalize_filename P_((char *));
304static void grow_linebuffer P_((linebuffer *lbp, int toksize)); 309static void grow_linebuffer P_((linebuffer *, int));
305static long *xmalloc P_((unsigned int size)); 310static long *xmalloc P_((unsigned int));
306static long *xrealloc P_((char *ptr, unsigned int size)); 311static long *xrealloc P_((char *, unsigned int));
307 312
308 313
309char searchar = '/'; /* use /.../ searches */ 314char searchar = '/'; /* use /.../ searches */
@@ -336,7 +341,7 @@ struct
336bool _wht[CHARS], _nin[CHARS], _itk[CHARS], _btk[CHARS], _etk[CHARS]; 341bool _wht[CHARS], _nin[CHARS], _itk[CHARS], _btk[CHARS], _etk[CHARS];
337char 342char
338 /* white chars */ 343 /* white chars */
339 *white = " \f\t\n\r", 344 *white = " \f\t\n\r\v",
340 /* not in a name */ 345 /* not in a name */
341 *nonam = " \f\t\n\r(=,[;", 346 *nonam = " \f\t\n\r(=,[;",
342 /* token ending chars */ 347 /* token ending chars */
@@ -1473,13 +1478,12 @@ init ()
1473 iswhite(i) = notinname(i) = begtoken(i) = intoken(i) = endtoken(i) = FALSE; 1478 iswhite(i) = notinname(i) = begtoken(i) = intoken(i) = endtoken(i) = FALSE;
1474 for (sp = white; *sp != '\0'; sp++) iswhite (*sp) = TRUE; 1479 for (sp = white; *sp != '\0'; sp++) iswhite (*sp) = TRUE;
1475 for (sp = nonam; *sp != '\0'; sp++) notinname (*sp) = TRUE; 1480 for (sp = nonam; *sp != '\0'; sp++) notinname (*sp) = TRUE;
1476 for (sp = begtk; *sp != '\0'; sp++) begtoken (*sp) = TRUE;
1477 for (sp = midtk; *sp != '\0'; sp++) intoken (*sp) = TRUE;
1478 for (sp = endtk; *sp != '\0'; sp++) endtoken (*sp) = TRUE;
1479 iswhite('\0') = iswhite('\n');
1480 notinname('\0') = notinname('\n'); 1481 notinname('\0') = notinname('\n');
1482 for (sp = begtk; *sp != '\0'; sp++) begtoken (*sp) = TRUE;
1481 begtoken('\0') = begtoken('\n'); 1483 begtoken('\0') = begtoken('\n');
1484 for (sp = midtk; *sp != '\0'; sp++) intoken (*sp) = TRUE;
1482 intoken('\0') = intoken('\n'); 1485 intoken('\0') = intoken('\n');
1486 for (sp = endtk; *sp != '\0'; sp++) endtoken (*sp) = TRUE;
1483 endtoken('\0') = endtoken('\n'); 1487 endtoken('\0') = endtoken('\n');
1484} 1488}
1485 1489
@@ -1893,6 +1897,10 @@ enum sym_type
1893 st_C_struct, st_C_extern, st_C_enum, st_C_define, st_C_typedef, st_C_typespec 1897 st_C_struct, st_C_extern, st_C_enum, st_C_define, st_C_typedef, st_C_typespec
1894}; 1898};
1895 1899
1900static unsigned int hash P_((const char *, unsigned int));
1901static struct C_stab_entry * in_word_set P_((const char *, unsigned int));
1902static enum sym_type C_symtype P_((char *, int, int));
1903
1896/* Feed stuff between (but not including) %[ and %] lines to: 1904/* Feed stuff between (but not including) %[ and %] lines to:
1897 gperf -c -k 1,3 -o -p -r -t 1905 gperf -c -k 1,3 -o -p -r -t
1898%[ 1906%[
@@ -2254,6 +2262,9 @@ bool yacc_rules;
2254 */ 2262 */
2255int methodlen; 2263int methodlen;
2256 2264
2265static bool consider_token P_((char *, int, int, int, int, int, bool *));
2266static void make_C_tag P_((bool));
2267
2257/* 2268/*
2258 * consider_token () 2269 * consider_token ()
2259 * checks to see if the current token is at the start of a 2270 * checks to see if the current token is at the start of a
@@ -2276,7 +2287,7 @@ static bool
2276consider_token (str, len, c, c_ext, cblev, parlev, is_func_or_var) 2287consider_token (str, len, c, c_ext, cblev, parlev, is_func_or_var)
2277 register char *str; /* IN: token pointer */ 2288 register char *str; /* IN: token pointer */
2278 register int len; /* IN: token length */ 2289 register int len; /* IN: token length */
2279 register char c; /* IN: first char after the token */ 2290 register int c; /* IN: first char after the token */
2280 int c_ext; /* IN: C extensions mask */ 2291 int c_ext; /* IN: C extensions mask */
2281 int cblev; /* IN: curly brace level */ 2292 int cblev; /* IN: curly brace level */
2282 int parlev; /* IN: parenthesis level */ 2293 int parlev; /* IN: parenthesis level */
@@ -2828,7 +2839,7 @@ C_entries (c_ext, inf)
2828 if (*lp != '\0') 2839 if (*lp != '\0')
2829 lp += 1; 2840 lp += 1;
2830 while (*lp != '\0' 2841 while (*lp != '\0'
2831 && !isspace (*lp) && *lp != '(') 2842 && !iswhite (*lp) && *lp != '(')
2832 lp += 1; 2843 lp += 1;
2833 c = *lp++; 2844 c = *lp++;
2834 toklen += lp - oldlp; 2845 toklen += lp - oldlp;
@@ -3354,6 +3365,10 @@ just_read_file (inf)
3354 3365
3355/* Fortran parsing */ 3366/* Fortran parsing */
3356 3367
3368static bool tail P_((char *));
3369static void takeprec P_((void));
3370static void getit P_((FILE *));
3371
3357static bool 3372static bool
3358tail (cp) 3373tail (cp)
3359 char *cp; 3374 char *cp;
@@ -3497,6 +3512,9 @@ Fortran_functions (inf)
3497 * Philippe Waroquiers <philippe.waroquiers@eurocontrol.be>, 1998-04-24 3512 * Philippe Waroquiers <philippe.waroquiers@eurocontrol.be>, 1998-04-24
3498 * Ada parsing 3513 * Ada parsing
3499 */ 3514 */
3515
3516static void adagetit P_((FILE *, char *));
3517
3500/* Once we are positioned after an "interesting" keyword, let's get 3518/* Once we are positioned after an "interesting" keyword, let's get
3501 the real tag value necessary. */ 3519 the real tag value necessary. */
3502static void 3520static void
@@ -3679,7 +3697,7 @@ Asm_labels (inf)
3679 cp++; 3697 cp++;
3680 while (isalnum (*cp) || *cp == '_' || *cp == '.' || *cp == '$') 3698 while (isalnum (*cp) || *cp == '_' || *cp == '.' || *cp == '$')
3681 cp++; 3699 cp++;
3682 if (*cp == ':' || isspace (*cp)) 3700 if (*cp == ':' || iswhite (*cp))
3683 { 3701 {
3684 /* Found end of label, so copy it and add it to the table. */ 3702 /* Found end of label, so copy it and add it to the table. */
3685 pfnote (savenstr(lb.buffer, cp-lb.buffer), TRUE, 3703 pfnote (savenstr(lb.buffer, cp-lb.buffer), TRUE,
@@ -3705,14 +3723,14 @@ Perl_functions (inf)
3705 { 3723 {
3706 if (*cp++ == 's' 3724 if (*cp++ == 's'
3707 && *cp++ == 'u' 3725 && *cp++ == 'u'
3708 && *cp++ == 'b' && isspace (*cp++)) 3726 && *cp++ == 'b' && iswhite (*cp++))
3709 { 3727 {
3710 cp = skip_spaces (cp); 3728 cp = skip_spaces (cp);
3711 if (*cp != '\0') 3729 if (*cp != '\0')
3712 { 3730 {
3713 char *sp = cp; 3731 char *sp = cp;
3714 while (*cp != '\0' 3732 while (*cp != '\0'
3715 && !isspace (*cp) && *cp != '{' && *cp != '(') 3733 && !iswhite (*cp) && *cp != '{' && *cp != '(')
3716 cp++; 3734 cp++;
3717 pfnote (savenstr (sp, cp-sp), TRUE, 3735 pfnote (savenstr (sp, cp-sp), TRUE,
3718 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 3736 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
@@ -3728,7 +3746,7 @@ Perl_functions (inf)
3728 && *cp++ == 'c' 3746 && *cp++ == 'c'
3729 && *cp++ == 'a' 3747 && *cp++ == 'a'
3730 && *cp++ == 'l')) 3748 && *cp++ == 'l'))
3731 && (*cp == '(' || isspace (*cp))) 3749 && (*cp == '(' || iswhite (*cp)))
3732 { 3750 {
3733 /* After "my" or "local", but before any following paren or space. */ 3751 /* After "my" or "local", but before any following paren or space. */
3734 char *varname = NULL; 3752 char *varname = NULL;
@@ -3771,10 +3789,10 @@ Python_functions (inf)
3771 { 3789 {
3772 if (*cp++ == 'd' 3790 if (*cp++ == 'd'
3773 && *cp++ == 'e' 3791 && *cp++ == 'e'
3774 && *cp++ == 'f' && isspace (*cp++)) 3792 && *cp++ == 'f' && iswhite (*cp++))
3775 { 3793 {
3776 cp = skip_spaces (cp); 3794 cp = skip_spaces (cp);
3777 while (*cp != '\0' && !isspace (*cp) && *cp != '(' && *cp != ':') 3795 while (*cp != '\0' && !iswhite (*cp) && *cp != '(' && *cp != ':')
3778 cp++; 3796 cp++;
3779 pfnote (NULL, TRUE, 3797 pfnote (NULL, TRUE,
3780 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 3798 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
@@ -3785,10 +3803,10 @@ Python_functions (inf)
3785 && *cp++ == 'l' 3803 && *cp++ == 'l'
3786 && *cp++ == 'a' 3804 && *cp++ == 'a'
3787 && *cp++ == 's' 3805 && *cp++ == 's'
3788 && *cp++ == 's' && isspace (*cp++)) 3806 && *cp++ == 's' && iswhite (*cp++))
3789 { 3807 {
3790 cp = skip_spaces (cp); 3808 cp = skip_spaces (cp);
3791 while (*cp != '\0' && !isspace (*cp) && *cp != '(' && *cp != ':') 3809 while (*cp != '\0' && !iswhite (*cp) && *cp != '(' && *cp != ':')
3792 cp++; 3810 cp++;
3793 pfnote (NULL, TRUE, 3811 pfnote (NULL, TRUE,
3794 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 3812 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
@@ -4011,6 +4029,11 @@ Pascal_functions (inf)
4011 * lisp tag functions 4029 * lisp tag functions
4012 * look for (def or (DEF, quote or QUOTE 4030 * look for (def or (DEF, quote or QUOTE
4013 */ 4031 */
4032
4033static int L_isdef P_((char *));
4034static int L_isquote P_((char *));
4035static void L_getit P_((void));
4036
4014static int 4037static int
4015L_isdef (strp) 4038L_isdef (strp)
4016 register char *strp; 4039 register char *strp;
@@ -4029,7 +4052,7 @@ L_isquote (strp)
4029 && (*++strp == 'o' || *strp == 'O') 4052 && (*++strp == 'o' || *strp == 'O')
4030 && (*++strp == 't' || *strp == 'T') 4053 && (*++strp == 't' || *strp == 'T')
4031 && (*++strp == 'e' || *strp == 'E') 4054 && (*++strp == 'e' || *strp == 'E')
4032 && isspace (*++strp)); 4055 && iswhite (*++strp));
4033} 4056}
4034 4057
4035static void 4058static void
@@ -4049,7 +4072,7 @@ L_getit ()
4049 } 4072 }
4050 4073
4051 for (cp = dbp /*+1*/; 4074 for (cp = dbp /*+1*/;
4052 *cp != '\0' && *cp != '(' && !isspace(*cp) && *cp != ')'; 4075 *cp != '\0' && *cp != '(' && !iswhite(*cp) && *cp != ')';
4053 cp++) 4076 cp++)
4054 continue; 4077 continue;
4055 if (cp == dbp) 4078 if (cp == dbp)
@@ -4078,7 +4101,7 @@ Lisp_functions (inf)
4078 /* Check for (foo::defmumble name-defined ... */ 4101 /* Check for (foo::defmumble name-defined ... */
4079 do 4102 do
4080 dbp++; 4103 dbp++;
4081 while (*dbp != '\0' && !isspace (*dbp) 4104 while (*dbp != '\0' && !iswhite (*dbp)
4082 && *dbp != ':' && *dbp != '(' && *dbp != ')'); 4105 && *dbp != ':' && *dbp != '(' && *dbp != ')');
4083 if (*dbp == ':') 4106 if (*dbp == ':')
4084 { 4107 {
@@ -4155,7 +4178,7 @@ Scheme_functions (inf)
4155 { 4178 {
4156 bp = skip_non_spaces (bp); 4179 bp = skip_non_spaces (bp);
4157 /* Skip over open parens and white space */ 4180 /* Skip over open parens and white space */
4158 while (isspace (*bp) || *bp == '(') 4181 while (iswhite (*bp) || *bp == '(')
4159 bp++; 4182 bp++;
4160 get_tag (bp); 4183 get_tag (bp);
4161 } 4184 }
@@ -4164,7 +4187,7 @@ Scheme_functions (inf)
4164 && (bp[2] == 'E' || bp[2] == 'e') 4187 && (bp[2] == 'E' || bp[2] == 'e')
4165 && (bp[3] == 'T' || bp[3] == 't') 4188 && (bp[3] == 'T' || bp[3] == 't')
4166 && (bp[4] == '!' || bp[4] == '!') 4189 && (bp[4] == '!' || bp[4] == '!')
4167 && (isspace (bp[5]))) 4190 && (iswhite (bp[5])))
4168 { 4191 {
4169 bp = skip_non_spaces (bp); 4192 bp = skip_non_spaces (bp);
4170 bp = skip_spaces (bp); 4193 bp = skip_spaces (bp);
@@ -4193,9 +4216,9 @@ char *TEX_defenv = "\
4193:chapter:section:subsection:subsubsection:eqno:label:ref:cite:bibitem\ 4216:chapter:section:subsection:subsubsection:eqno:label:ref:cite:bibitem\
4194:part:appendix:entry:index"; 4217:part:appendix:entry:index";
4195 4218
4196static void TEX_mode P_((FILE *inf)); 4219static void TEX_mode P_((FILE *));
4197static struct TEX_tabent *TEX_decode_env P_((char *evarname, char *defenv)); 4220static struct TEX_tabent *TEX_decode_env P_((char *, char *));
4198static int TEX_Token P_((char *cp)); 4221static int TEX_Token P_((char *));
4199 4222
4200char TEX_esc = '\\'; 4223char TEX_esc = '\\';
4201char TEX_opgrp = '{'; 4224char TEX_opgrp = '{';
@@ -4361,9 +4384,9 @@ TEX_Token (cp)
4361 * Assumes that the predicate starts at column 0. 4384 * Assumes that the predicate starts at column 0.
4362 * Only the first clause of a predicate is added. 4385 * Only the first clause of a predicate is added.
4363 */ 4386 */
4364static int prolog_pred P_((char *s, char *last)); 4387static int prolog_pred P_((char *, char *));
4365static void prolog_skip_comment P_((linebuffer *plb, FILE *inf)); 4388static void prolog_skip_comment P_((linebuffer *, FILE *));
4366static int prolog_atom P_((char *s, int pos)); 4389static int prolog_atom P_((char *, int));
4367 4390
4368static void 4391static void
4369Prolog_functions (inf) 4392Prolog_functions (inf)
@@ -4381,7 +4404,7 @@ Prolog_functions (inf)
4381 { 4404 {
4382 if (cp[0] == '\0') /* Empty line */ 4405 if (cp[0] == '\0') /* Empty line */
4383 continue; 4406 continue;
4384 else if (isspace (cp[0])) /* Not a predicate */ 4407 else if (iswhite (cp[0])) /* Not a predicate */
4385 continue; 4408 continue;
4386 else if (cp[0] == '/' && cp[1] == '*') /* comment. */ 4409 else if (cp[0] == '/' && cp[1] == '*') /* comment. */
4387 prolog_skip_comment (&lb, inf); 4410 prolog_skip_comment (&lb, inf);
@@ -4527,9 +4550,9 @@ prolog_atom (s, pos)
4527 * 4550 *
4528 * Assumes that Erlang functions start at column 0. 4551 * Assumes that Erlang functions start at column 0.
4529 */ 4552 */
4530static int erlang_func P_((char *s, char *last)); 4553static int erlang_func P_((char *, char *));
4531static void erlang_attribute P_((char *s)); 4554static void erlang_attribute P_((char *));
4532static int erlang_atom P_((char *s, int pos)); 4555static int erlang_atom P_((char *, int));
4533 4556
4534static void 4557static void
4535Erlang_functions (inf) 4558Erlang_functions (inf)
@@ -4547,7 +4570,7 @@ Erlang_functions (inf)
4547 { 4570 {
4548 if (cp[0] == '\0') /* Empty line */ 4571 if (cp[0] == '\0') /* Empty line */
4549 continue; 4572 continue;
4550 else if (isspace (cp[0])) /* Not function nor attribute */ 4573 else if (iswhite (cp[0])) /* Not function nor attribute */
4551 continue; 4574 continue;
4552 else if (cp[0] == '%') /* comment */ 4575 else if (cp[0] == '%') /* comment */
4553 continue; 4576 continue;
@@ -4699,6 +4722,11 @@ erlang_atom (s, pos)
4699 4722
4700#ifdef ETAGS_REGEXPS 4723#ifdef ETAGS_REGEXPS
4701 4724
4725static char *scan_separators P_((char *));
4726static void analyse_regex P_((char *, bool));
4727static void add_regex P_((char *, bool, language *));
4728static char *substitute P_((char *, char *, struct re_registers *));
4729
4702/* Take a string like "/blah/" and turn it into "blah", making sure 4730/* Take a string like "/blah/" and turn it into "blah", making sure
4703 that the first and last characters are the same, and handling 4731 that the first and last characters are the same, and handling
4704 quoted separator characters. Actually, stops on the occurrence of 4732 quoted separator characters. Actually, stops on the occurrence of
@@ -4941,7 +4969,7 @@ get_tag (bp)
4941 return; 4969 return;
4942 /* Go till you get to white space or a syntactic break */ 4970 /* Go till you get to white space or a syntactic break */
4943 for (cp = bp + 1; 4971 for (cp = bp + 1;
4944 *cp != '\0' && *cp != '(' && *cp != ')' && !isspace (*cp); 4972 *cp != '\0' && *cp != '(' && *cp != ')' && !iswhite (*cp);
4945 cp++) 4973 cp++)
4946 continue; 4974 continue;
4947 pfnote (savenstr (bp, cp-bp), TRUE, 4975 pfnote (savenstr (bp, cp-bp), TRUE,
@@ -5164,7 +5192,7 @@ static char *
5164skip_spaces (cp) 5192skip_spaces (cp)
5165 char *cp; 5193 char *cp;
5166{ 5194{
5167 while (isspace (*cp)) /* isspace('\0')==FALSE */ 5195 while (iswhite (*cp))
5168 cp++; 5196 cp++;
5169 return cp; 5197 return cp;
5170} 5198}
@@ -5174,7 +5202,7 @@ static char *
5174skip_non_spaces (cp) 5202skip_non_spaces (cp)
5175 char *cp; 5203 char *cp;
5176{ 5204{
5177 while (!iswhite (*cp)) /* iswhite('\0')==TRUE */ 5205 while (*cp != '\0' && !iswhite (*cp))
5178 cp++; 5206 cp++;
5179 return cp; 5207 return cp;
5180} 5208}