diff options
| author | Francesco Potortì | 2000-02-10 21:28:51 +0000 |
|---|---|---|
| committer | Francesco Potortì | 2000-02-10 21:28:51 +0000 |
| commit | 71cbb89543ea21a9edea72cb24d2df6e714b60db (patch) | |
| tree | 5f5ba79305d67dd0bb0b6828116f380819a2b6ce /lib-src | |
| parent | 97fa0cc812e4151982e334e5ebfcd056445e5e94 (diff) | |
| download | emacs-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.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 11 | ||||
| -rw-r--r-- | lib-src/etags.c | 224 |
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 @@ | |||
| 1 | 2000-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 | |||
| 8 | 2000-02-04 Francesco Potorti` <F.Potorti@cnuce.cnr.it> | ||
| 9 | |||
| 10 | * etags.c (many functions): Add prototypes. | ||
| 11 | |||
| 1 | 2000-02-10 Dave Love <fx@gnu.org> | 12 | 2000-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 | ||
| 34 | char pot_etags_version[] = "@(#) pot revision number is 13.38"; | 34 | char 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 | ||
| 190 | typedef int bool; | 191 | typedef int bool; |
| 191 | 192 | ||
| 192 | typedef void Lang_function (); | 193 | typedef void Lang_function P_((FILE *)); |
| 193 | 194 | ||
| 194 | typedef struct | 195 | typedef 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 */ |
| 237 | static void Ada_funcs P_((FILE *inf)); | 238 | static void Ada_funcs P_((FILE *)); |
| 238 | static void Asm_labels P_((FILE *inf)); | 239 | static void Asm_labels P_((FILE *)); |
| 239 | static void C_entries P_((int c_ext, FILE *inf)); | 240 | static void C_entries P_((int c_ext, FILE *)); |
| 240 | static void default_C_entries P_((FILE *inf)); | 241 | static void default_C_entries P_((FILE *)); |
| 241 | static void plain_C_entries P_((FILE *inf)); | 242 | static void plain_C_entries P_((FILE *)); |
| 242 | static void Cjava_entries P_((FILE *inf)); | 243 | static void Cjava_entries P_((FILE *)); |
| 243 | static void Cobol_paragraphs P_((FILE *inf)); | 244 | static void Cobol_paragraphs P_((FILE *)); |
| 244 | static void Cplusplus_entries P_((FILE *inf)); | 245 | static void Cplusplus_entries P_((FILE *)); |
| 245 | static void Cstar_entries P_((FILE *inf)); | 246 | static void Cstar_entries P_((FILE *)); |
| 246 | static void Erlang_functions P_((FILE *inf)); | 247 | static void Erlang_functions P_((FILE *)); |
| 247 | static void Fortran_functions P_((FILE *inf)); | 248 | static void Fortran_functions P_((FILE *)); |
| 248 | static void Yacc_entries P_((FILE *inf)); | 249 | static void Yacc_entries P_((FILE *)); |
| 249 | static void Lisp_functions P_((FILE *inf)); | 250 | static void Lisp_functions P_((FILE *)); |
| 250 | static void Pascal_functions P_((FILE *inf)); | 251 | static void Pascal_functions P_((FILE *)); |
| 251 | static void Perl_functions P_((FILE *inf)); | 252 | static void Perl_functions P_((FILE *)); |
| 252 | static void Postscript_functions P_((FILE *inf)); | 253 | static void Postscript_functions P_((FILE *)); |
| 253 | static void Prolog_functions P_((FILE *inf)); | 254 | static void Prolog_functions P_((FILE *)); |
| 254 | static void Python_functions P_((FILE *inf)); | 255 | static void Python_functions P_((FILE *)); |
| 255 | static void Scheme_functions P_((FILE *inf)); | 256 | static void Scheme_functions P_((FILE *)); |
| 256 | static void TeX_functions P_((FILE *inf)); | 257 | static void TeX_functions P_((FILE *)); |
| 257 | static void just_read_file P_((FILE *inf)); | 258 | static void just_read_file P_((FILE *)); |
| 258 | 259 | ||
| 259 | static compressor *get_compressor_from_suffix P_((char *file, char **extptr)); | 260 | static void print_language_names P_((void)); |
| 260 | static language *get_language_from_name P_((char *name)); | 261 | static void print_version P_((void)); |
| 261 | static language *get_language_from_interpreter P_((char *interpreter)); | 262 | static void print_help P_((void)); |
| 262 | static language *get_language_from_suffix P_((char *file)); | 263 | int main P_((int, char **)); |
| 263 | static int total_size_of_entries P_((register node *np)); | 264 | static int number_len P_((long)); |
| 264 | static long readline P_((linebuffer *lbp, FILE *stream)); | 265 | |
| 265 | static long readline_internal P_((linebuffer *lbp, register FILE *stream)); | 266 | static compressor *get_compressor_from_suffix P_((char *, char **)); |
| 266 | static void get_tag P_((register char *bp)); | 267 | static language *get_language_from_name P_((char *)); |
| 268 | static language *get_language_from_interpreter P_((char *)); | ||
| 269 | static language *get_language_from_suffix P_((char *)); | ||
| 270 | static int total_size_of_entries P_((node *)); | ||
| 271 | static long readline P_((linebuffer *, FILE *)); | ||
| 272 | static long readline_internal P_((linebuffer *, FILE *)); | ||
| 273 | static void get_tag P_((char *)); | ||
| 267 | 274 | ||
| 268 | #ifdef ETAGS_REGEXPS | 275 | #ifdef ETAGS_REGEXPS |
| 269 | static void analyse_regex P_((char *regex_arg, bool ignore_case)); | 276 | static void analyse_regex P_((char *, bool)); |
| 270 | static void add_regex P_((char *regexp_pattern, bool ignore_case, language *lan)); | 277 | static void add_regex P_((char *, bool, language *)); |
| 271 | static void free_patterns P_((void)); | 278 | static void free_patterns P_((void)); |
| 272 | #endif /* ETAGS_REGEXPS */ | 279 | #endif /* ETAGS_REGEXPS */ |
| 273 | static void error P_((const char *s1, const char *s2)); | 280 | static void error P_((const char *, const char *)); |
| 274 | static void suggest_asking_for_help P_((void)); | 281 | static void suggest_asking_for_help P_((void)); |
| 275 | static void fatal P_((char *s1, char *s2)); | 282 | static void fatal P_((char *, char *)); |
| 276 | static void pfatal P_((char *s1)); | 283 | static void pfatal P_((char *)); |
| 277 | static void add_node P_((node *np, node **cur_node_p)); | 284 | static void add_node P_((node *, node **)); |
| 278 | 285 | ||
| 279 | static void init P_((void)); | 286 | static void init P_((void)); |
| 280 | static void initbuffer P_((linebuffer *lbp)); | 287 | static void initbuffer P_((linebuffer *)); |
| 281 | static void find_entries P_((char *file, FILE *inf)); | 288 | static void find_entries P_((char *, FILE *)); |
| 282 | static void free_tree P_((register node *np)); | 289 | static void free_tree P_((node *)); |
| 283 | static void pfnote P_((char *name, bool is_func, char *linestart, | 290 | static void pfnote P_((char *, bool, char *, int, int, long)); |
| 284 | int linelen, int lno, long int cno)); | 291 | static void new_pfnote P_((char *, int, bool, char *, int, int, long)); |
| 285 | static void new_pfnote P_((char *name, int namelen, bool is_func, | 292 | static void process_file P_((char *)); |
| 286 | char *linestart, int linelen, int lno, long int cno)); | 293 | static void put_entries P_((node *)); |
| 287 | static void process_file P_((char *file)); | ||
| 288 | static void put_entries P_((register node *np)); | ||
| 289 | static void takeprec P_((void)); | 294 | static void takeprec P_((void)); |
| 290 | 295 | ||
| 291 | static char *concat P_((char *s1, char *s2, char *s3)); | 296 | static char *concat P_((char *, char *, char *)); |
| 292 | static char *skip_spaces P_((char *cp)); | 297 | static char *skip_spaces P_((char *)); |
| 293 | static char *skip_non_spaces P_((char *cp)); | 298 | static char *skip_non_spaces P_((char *)); |
| 294 | static char *savenstr P_((char *cp, int len)); | 299 | static char *savenstr P_((char *, int)); |
| 295 | static char *savestr P_((char *cp)); | 300 | static char *savestr P_((char *)); |
| 296 | static char *etags_strchr P_((const char *sp, int c)); | 301 | static char *etags_strchr P_((const char *, int)); |
| 297 | static char *etags_strrchr P_((const char *sp, int c)); | 302 | static char *etags_strrchr P_((const char *, int)); |
| 298 | static char *etags_getcwd P_((void)); | 303 | static char *etags_getcwd P_((void)); |
| 299 | static char *relative_filename P_((char *file, char *dir)); | 304 | static char *relative_filename P_((char *, char *)); |
| 300 | static char *absolute_filename P_((char *file, char *dir)); | 305 | static char *absolute_filename P_((char *, char *)); |
| 301 | static char *absolute_dirname P_((char *file, char *dir)); | 306 | static char *absolute_dirname P_((char *, char *)); |
| 302 | static bool filename_is_absolute P_((char *fn)); | 307 | static bool filename_is_absolute P_((char *f)); |
| 303 | static void canonicalize_filename P_((register char *fn)); | 308 | static void canonicalize_filename P_((char *)); |
| 304 | static void grow_linebuffer P_((linebuffer *lbp, int toksize)); | 309 | static void grow_linebuffer P_((linebuffer *, int)); |
| 305 | static long *xmalloc P_((unsigned int size)); | 310 | static long *xmalloc P_((unsigned int)); |
| 306 | static long *xrealloc P_((char *ptr, unsigned int size)); | 311 | static long *xrealloc P_((char *, unsigned int)); |
| 307 | 312 | ||
| 308 | 313 | ||
| 309 | char searchar = '/'; /* use /.../ searches */ | 314 | char searchar = '/'; /* use /.../ searches */ |
| @@ -336,7 +341,7 @@ struct | |||
| 336 | bool _wht[CHARS], _nin[CHARS], _itk[CHARS], _btk[CHARS], _etk[CHARS]; | 341 | bool _wht[CHARS], _nin[CHARS], _itk[CHARS], _btk[CHARS], _etk[CHARS]; |
| 337 | char | 342 | char |
| 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 | ||
| 1900 | static unsigned int hash P_((const char *, unsigned int)); | ||
| 1901 | static struct C_stab_entry * in_word_set P_((const char *, unsigned int)); | ||
| 1902 | static 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 | */ |
| 2255 | int methodlen; | 2263 | int methodlen; |
| 2256 | 2264 | ||
| 2265 | static bool consider_token P_((char *, int, int, int, int, int, bool *)); | ||
| 2266 | static 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 | |||
| 2276 | consider_token (str, len, c, c_ext, cblev, parlev, is_func_or_var) | 2287 | consider_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 | ||
| 3368 | static bool tail P_((char *)); | ||
| 3369 | static void takeprec P_((void)); | ||
| 3370 | static void getit P_((FILE *)); | ||
| 3371 | |||
| 3357 | static bool | 3372 | static bool |
| 3358 | tail (cp) | 3373 | tail (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 | |||
| 3516 | static 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. */ |
| 3502 | static void | 3520 | static 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 | |||
| 4033 | static int L_isdef P_((char *)); | ||
| 4034 | static int L_isquote P_((char *)); | ||
| 4035 | static void L_getit P_((void)); | ||
| 4036 | |||
| 4014 | static int | 4037 | static int |
| 4015 | L_isdef (strp) | 4038 | L_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 | ||
| 4035 | static void | 4058 | static 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 | ||
| 4196 | static void TEX_mode P_((FILE *inf)); | 4219 | static void TEX_mode P_((FILE *)); |
| 4197 | static struct TEX_tabent *TEX_decode_env P_((char *evarname, char *defenv)); | 4220 | static struct TEX_tabent *TEX_decode_env P_((char *, char *)); |
| 4198 | static int TEX_Token P_((char *cp)); | 4221 | static int TEX_Token P_((char *)); |
| 4199 | 4222 | ||
| 4200 | char TEX_esc = '\\'; | 4223 | char TEX_esc = '\\'; |
| 4201 | char TEX_opgrp = '{'; | 4224 | char 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 | */ |
| 4364 | static int prolog_pred P_((char *s, char *last)); | 4387 | static int prolog_pred P_((char *, char *)); |
| 4365 | static void prolog_skip_comment P_((linebuffer *plb, FILE *inf)); | 4388 | static void prolog_skip_comment P_((linebuffer *, FILE *)); |
| 4366 | static int prolog_atom P_((char *s, int pos)); | 4389 | static int prolog_atom P_((char *, int)); |
| 4367 | 4390 | ||
| 4368 | static void | 4391 | static void |
| 4369 | Prolog_functions (inf) | 4392 | Prolog_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 | */ |
| 4530 | static int erlang_func P_((char *s, char *last)); | 4553 | static int erlang_func P_((char *, char *)); |
| 4531 | static void erlang_attribute P_((char *s)); | 4554 | static void erlang_attribute P_((char *)); |
| 4532 | static int erlang_atom P_((char *s, int pos)); | 4555 | static int erlang_atom P_((char *, int)); |
| 4533 | 4556 | ||
| 4534 | static void | 4557 | static void |
| 4535 | Erlang_functions (inf) | 4558 | Erlang_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 | ||
| 4725 | static char *scan_separators P_((char *)); | ||
| 4726 | static void analyse_regex P_((char *, bool)); | ||
| 4727 | static void add_regex P_((char *, bool, language *)); | ||
| 4728 | static 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 * | |||
| 5164 | skip_spaces (cp) | 5192 | skip_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 * | |||
| 5174 | skip_non_spaces (cp) | 5202 | skip_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 | } |