diff options
| author | Francesco Potortì | 1996-05-17 16:48:02 +0000 |
|---|---|---|
| committer | Francesco Potortì | 1996-05-17 16:48:02 +0000 |
| commit | cf347d3cca09faef8c09c651192da60e50b825fd (patch) | |
| tree | eba2cf6937431875b0f4f0643cc83a5e03799267 /lib-src | |
| parent | ce2d626fabd33f84e1560d83ab4e1e16b01675ce (diff) | |
| download | emacs-cf347d3cca09faef8c09c651192da60e50b825fd.tar.gz emacs-cf347d3cca09faef8c09c651192da60e50b825fd.zip | |
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
(Pascal_functions): Increase linecharno by the correct number of
chars, inline the GET_NEW_LINE macro and delete its definition.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/etags.c | 57 |
1 files changed, 21 insertions, 36 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c index ba1ac984156..3445d2de8a0 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` (F.Potorti@cnuce.cnr.it) is the current maintainer. | 31 | * Francesco Potorti` (F.Potorti@cnuce.cnr.it) is the current maintainer. |
| 32 | */ | 32 | */ |
| 33 | 33 | ||
| 34 | char pot_etags_version[] = "@(#) pot revision number is 11.59"; | 34 | char pot_etags_version[] = "@(#) pot revision number is 11.63"; |
| 35 | 35 | ||
| 36 | #define TRUE 1 | 36 | #define TRUE 1 |
| 37 | #define FALSE 0 | 37 | #define FALSE 0 |
| @@ -216,9 +216,7 @@ char searchar = '/'; /* use /.../ searches */ | |||
| 216 | 216 | ||
| 217 | int lineno; /* line number of current line */ | 217 | int lineno; /* line number of current line */ |
| 218 | long charno; /* current character number */ | 218 | long charno; /* current character number */ |
| 219 | 219 | long linecharno; /* charno of start of line */ | |
| 220 | long linecharno; /* charno of start of line; not used by C, | ||
| 221 | but by every other language. */ | ||
| 222 | 220 | ||
| 223 | char *curfile; /* current input file name */ | 221 | char *curfile; /* current input file name */ |
| 224 | char *tagfile; /* output file */ | 222 | char *tagfile; /* output file */ |
| @@ -880,7 +878,7 @@ main (argc, argv) | |||
| 880 | tagf = stdout; | 878 | tagf = stdout; |
| 881 | #ifdef DOS_NT | 879 | #ifdef DOS_NT |
| 882 | /* Switch redirected `stdout' to binary mode (setting `_fmode' | 880 | /* Switch redirected `stdout' to binary mode (setting `_fmode' |
| 883 | doesn't take effect until after `stdout' is already open), */ | 881 | doesn't take effect until after `stdout' is already open). */ |
| 884 | if (!isatty (fileno (stdout))) | 882 | if (!isatty (fileno (stdout))) |
| 885 | setmode (fileno (stdout), O_BINARY); | 883 | setmode (fileno (stdout), O_BINARY); |
| 886 | #endif /* DOS_NT */ | 884 | #endif /* DOS_NT */ |
| @@ -1071,15 +1069,11 @@ process_file (file) | |||
| 1071 | struct stat stat_buf; | 1069 | struct stat stat_buf; |
| 1072 | FILE *inf; | 1070 | FILE *inf; |
| 1073 | #ifdef DOS_NT | 1071 | #ifdef DOS_NT |
| 1074 | /* The rest of the program can't grok `\\'-style slashes. */ | 1072 | char *p; |
| 1075 | char *p = file; | ||
| 1076 | 1073 | ||
| 1077 | while (*p) | 1074 | for (p = file; *p != '\0'; p++) |
| 1078 | { | 1075 | if (*p == '\\') |
| 1079 | if (*p == '\\') | 1076 | *p = '/'; |
| 1080 | *p = '/'; | ||
| 1081 | ++p; | ||
| 1082 | } | ||
| 1083 | #endif | 1077 | #endif |
| 1084 | 1078 | ||
| 1085 | if (stat (file, &stat_buf) == 0 && !S_ISREG (stat_buf.st_mode)) | 1079 | if (stat (file, &stat_buf) == 0 && !S_ISREG (stat_buf.st_mode)) |
| @@ -2056,6 +2050,7 @@ typedef struct | |||
| 2056 | do { \ | 2050 | do { \ |
| 2057 | curlinepos = charno; \ | 2051 | curlinepos = charno; \ |
| 2058 | lineno++; \ | 2052 | lineno++; \ |
| 2053 | linecharno = charno; \ | ||
| 2059 | charno += readline (&curlb, inf); \ | 2054 | charno += readline (&curlb, inf); \ |
| 2060 | lp = curlb.buffer; \ | 2055 | lp = curlb.buffer; \ |
| 2061 | quotednl = FALSE; \ | 2056 | quotednl = FALSE; \ |
| @@ -2923,13 +2918,6 @@ Perl_functions (inf) | |||
| 2923 | /* Added by Mosur Mohan, 4/22/88 */ | 2918 | /* Added by Mosur Mohan, 4/22/88 */ |
| 2924 | /* Pascal parsing */ | 2919 | /* Pascal parsing */ |
| 2925 | 2920 | ||
| 2926 | #define GET_NEW_LINE \ | ||
| 2927 | { \ | ||
| 2928 | linecharno = charno; lineno++; \ | ||
| 2929 | charno += 1 + readline (&lb, inf); \ | ||
| 2930 | dbp = lb.buffer; \ | ||
| 2931 | } | ||
| 2932 | |||
| 2933 | /* | 2921 | /* |
| 2934 | * Locates tags for procedures & functions. Doesn't do any type- or | 2922 | * Locates tags for procedures & functions. Doesn't do any type- or |
| 2935 | * var-definitions. It does look for the keyword "extern" or | 2923 | * var-definitions. It does look for the keyword "extern" or |
| @@ -2976,7 +2964,10 @@ Pascal_functions (inf) | |||
| 2976 | c = *dbp++; | 2964 | c = *dbp++; |
| 2977 | if (c == '\0') /* if end of line */ | 2965 | if (c == '\0') /* if end of line */ |
| 2978 | { | 2966 | { |
| 2979 | GET_NEW_LINE; | 2967 | lineno++; |
| 2968 | linecharno = charno; | ||
| 2969 | charno += readline (&lb, inf); | ||
| 2970 | dbp = lb.buffer; | ||
| 2980 | if (*dbp == '\0') | 2971 | if (*dbp == '\0') |
| 2981 | continue; | 2972 | continue; |
| 2982 | if (!((found_tag && verify_tag) || | 2973 | if (!((found_tag && verify_tag) || |
| @@ -4318,14 +4309,11 @@ etags_getcwd () | |||
| 4318 | char *p, path[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */ | 4309 | char *p, path[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */ |
| 4319 | 4310 | ||
| 4320 | getwd (path); | 4311 | getwd (path); |
| 4321 | p = path; | 4312 | for (p = path; *p != '\0'; p++) |
| 4322 | while (*p) | 4313 | if (*p == '\\') |
| 4323 | { | 4314 | *p = '/'; |
| 4324 | if (*p == '\\') | 4315 | else |
| 4325 | *p++ = '/'; | 4316 | *p = lowcase (*p); |
| 4326 | else | ||
| 4327 | *p++ = lowcase (*p); | ||
| 4328 | } | ||
| 4329 | 4317 | ||
| 4330 | return strdup (path); | 4318 | return strdup (path); |
| 4331 | #else /* not DOS_NT */ | 4319 | #else /* not DOS_NT */ |
| @@ -4471,14 +4459,11 @@ absolute_dirname (file, cwd) | |||
| 4471 | char *slashp, *res; | 4459 | char *slashp, *res; |
| 4472 | char save; | 4460 | char save; |
| 4473 | #ifdef DOS_NT | 4461 | #ifdef DOS_NT |
| 4474 | char *p = file; | 4462 | char *p; |
| 4475 | 4463 | ||
| 4476 | while (*p) | 4464 | for (p = file; *p != '\0'; p++) |
| 4477 | { | 4465 | if (*p == '\\') |
| 4478 | if (*p == '\\') | 4466 | *p = '/'; |
| 4479 | *p = '/'; | ||
| 4480 | ++p; | ||
| 4481 | } | ||
| 4482 | #endif | 4467 | #endif |
| 4483 | 4468 | ||
| 4484 | slashp = etags_strrchr (file, '/'); | 4469 | slashp = etags_strrchr (file, '/'); |