Mercurial > emacs
annotate lib-src/etags.c @ 17978:1471676365ac
(ielm-input): New defvar.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 27 May 1997 20:37:34 +0000 |
parents | 5b92f8ba5c6d |
children | c378dd0b8de7 |
rev | line source |
---|---|
240 | 1 /* Tags file maker to go with GNU Emacs |
11231 | 2 Copyright (C) 1984, 87, 88, 89, 93, 94, 95 |
3 Free Software Foundation, Inc. and Ken Arnold | |
14186
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
14144
diff
changeset
|
4 |
2932
b68f975d505a
Change permission notice (not "part of Emacs").
Richard M. Stallman <rms@gnu.org>
parents:
2911
diff
changeset
|
5 This file is not considered part of GNU Emacs. |
240 | 6 |
2932
b68f975d505a
Change permission notice (not "part of Emacs").
Richard M. Stallman <rms@gnu.org>
parents:
2911
diff
changeset
|
7 This program is free software; you can redistribute it and/or modify |
240 | 8 it under the terms of the GNU General Public License as published by |
2932
b68f975d505a
Change permission notice (not "part of Emacs").
Richard M. Stallman <rms@gnu.org>
parents:
2911
diff
changeset
|
9 the Free Software Foundation; either version 2 of the License, or |
b68f975d505a
Change permission notice (not "part of Emacs").
Richard M. Stallman <rms@gnu.org>
parents:
2911
diff
changeset
|
10 (at your option) any later version. |
240 | 11 |
2932
b68f975d505a
Change permission notice (not "part of Emacs").
Richard M. Stallman <rms@gnu.org>
parents:
2911
diff
changeset
|
12 This program is distributed in the hope that it will be useful, |
240 | 13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 GNU General Public License for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
14186
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
14144
diff
changeset
|
18 along with this program; if not, write to the Free Software Foundation, |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
14144
diff
changeset
|
19 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
240 | 20 |
21 /* | |
22 * Authors: | |
23 * Ctags originally by Ken Arnold. | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
24 * Fortran added by Jim Kleckner. |
240 | 25 * Ed Pelegri-Llopart added C typedefs. |
26 * Gnu Emacs TAGS format and modifications by RMS? | |
27 * Sam Kendall added C++. | |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
28 * Francesco Potorti` reorganised C and C++ based on work by Joe Wells. |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
29 * Regexp tags by Tom Tromey. |
4663
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
30 * |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
31 * Francesco Potorti` (F.Potorti@cnuce.cnr.it) is the current maintainer. |
240 | 32 */ |
10761
7aa80669e697
* etags.c (C_entries): Bug corrected in xrealloc of token_str.
Francesco Potortì <pot@gnu.org>
parents:
10754
diff
changeset
|
33 |
17785
5b92f8ba5c6d
Added support for the Java language.
Francesco Potortì <pot@gnu.org>
parents:
17778
diff
changeset
|
34 char pot_etags_version[] = "@(#) pot revision number is 11.91"; |
10801
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
35 |
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
36 #define TRUE 1 |
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
37 #define FALSE 0 |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
38 |
10801
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
39 #ifndef DEBUG |
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
40 # define DEBUG FALSE |
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
41 #endif |
10754
cd1c0b5e8634
* etags.c (C_entries): Initialise the new members of TOKEN.
Francesco Potortì <pot@gnu.org>
parents:
10623
diff
changeset
|
42 |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
43 #ifndef TeX_named_tokens |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
44 # define TeX_named_tokens FALSE |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
45 #endif |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
46 |
5448
18de002e47dd
(main) [MSDOS]: Open all files as binary.
Richard M. Stallman <rms@gnu.org>
parents:
5044
diff
changeset
|
47 #ifdef MSDOS |
14920
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
48 # include <string.h> |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
49 # include <fcntl.h> |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
50 # include <sys/param.h> |
5448
18de002e47dd
(main) [MSDOS]: Open all files as binary.
Richard M. Stallman <rms@gnu.org>
parents:
5044
diff
changeset
|
51 #endif /* MSDOS */ |
18de002e47dd
(main) [MSDOS]: Open all files as binary.
Richard M. Stallman <rms@gnu.org>
parents:
5044
diff
changeset
|
52 |
9773
bd49556a7552
(main, etags_getcwd): Test DOS_NT instead of MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
9635
diff
changeset
|
53 #ifdef WINDOWSNT |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
54 # include <stdlib.h> |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
55 # include <fcntl.h> |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
56 # include <string.h> |
14982
b470e33ce4a9
[WINDOWSNT]: Include io.h.
Richard M. Stallman <rms@gnu.org>
parents:
14924
diff
changeset
|
57 # include <io.h> |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
58 # define MAXPATHLEN _MAX_PATH |
9773
bd49556a7552
(main, etags_getcwd): Test DOS_NT instead of MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
9635
diff
changeset
|
59 #endif |
bd49556a7552
(main, etags_getcwd): Test DOS_NT instead of MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
9635
diff
changeset
|
60 |
4052
9535e8ffb209
* etags.c (alloca): removed all references to it.
Jim Blandy <jimb@redhat.com>
parents:
4051
diff
changeset
|
61 #ifdef HAVE_CONFIG_H |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
62 # include <config.h> |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
63 /* On some systems, Emacs defines static as nothing for the sake |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
64 of unexec. We don't want that here since we don't use unexec. */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
65 # undef static |
3208
daf2762a353c
* etags.c: Replace the CPP tangle for alloca with the one from the
Jim Blandy <jimb@redhat.com>
parents:
3099
diff
changeset
|
66 #endif |
401 | 67 |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
68 #if !defined (MSDOS) && !defined (WINDOWSNT) && defined (STDC_HEADERS) |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
69 #include <stdlib.h> |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
70 #include <string.h> |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
71 #endif |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
72 |
3921
e5e5b3634dd0
* etags.c: #include "config.h" and the alloca CPP tangle before
Jim Blandy <jimb@redhat.com>
parents:
3838
diff
changeset
|
73 #include <stdio.h> |
e5e5b3634dd0
* etags.c: #include "config.h" and the alloca CPP tangle before
Jim Blandy <jimb@redhat.com>
parents:
3838
diff
changeset
|
74 #include <ctype.h> |
9975
e21b0674f37c
* etags.c (<errno.h>): #include added.
Francesco Potortì <pot@gnu.org>
parents:
9773
diff
changeset
|
75 #include <errno.h> |
e21b0674f37c
* etags.c (<errno.h>): #include added.
Francesco Potortì <pot@gnu.org>
parents:
9773
diff
changeset
|
76 #ifndef errno |
e21b0674f37c
* etags.c (<errno.h>): #include added.
Francesco Potortì <pot@gnu.org>
parents:
9773
diff
changeset
|
77 extern int errno; |
e21b0674f37c
* etags.c (<errno.h>): #include added.
Francesco Potortì <pot@gnu.org>
parents:
9773
diff
changeset
|
78 #endif |
3921
e5e5b3634dd0
* etags.c: #include "config.h" and the alloca CPP tangle before
Jim Blandy <jimb@redhat.com>
parents:
3838
diff
changeset
|
79 #include <sys/types.h> |
e5e5b3634dd0
* etags.c: #include "config.h" and the alloca CPP tangle before
Jim Blandy <jimb@redhat.com>
parents:
3838
diff
changeset
|
80 #include <sys/stat.h> |
e5e5b3634dd0
* etags.c: #include "config.h" and the alloca CPP tangle before
Jim Blandy <jimb@redhat.com>
parents:
3838
diff
changeset
|
81 |
4804
810826b6e19a
* etags.c (process_file): dead code removed.
Francesco Potortì <pot@gnu.org>
parents:
4750
diff
changeset
|
82 #if !defined (S_ISREG) && defined (S_IFREG) |
810826b6e19a
* etags.c (process_file): dead code removed.
Francesco Potortì <pot@gnu.org>
parents:
4750
diff
changeset
|
83 # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) |
810826b6e19a
* etags.c (process_file): dead code removed.
Francesco Potortì <pot@gnu.org>
parents:
4750
diff
changeset
|
84 #endif |
810826b6e19a
* etags.c (process_file): dead code removed.
Francesco Potortì <pot@gnu.org>
parents:
4750
diff
changeset
|
85 |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
86 #include <getopt.h> |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
87 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
88 #ifdef ETAGS_REGEXPS |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
89 # include <regex.h> |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
90 #endif /* ETAGS_REGEXPS */ |
3921
e5e5b3634dd0
* etags.c: #include "config.h" and the alloca CPP tangle before
Jim Blandy <jimb@redhat.com>
parents:
3838
diff
changeset
|
91 |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
92 /* Define CTAGS to make the program "ctags" compatible with the usual one. |
17168
53314a257690
* etags.c (add_regex): reset *putbuf before using it.
Francesco Potortì <pot@gnu.org>
parents:
16733
diff
changeset
|
93 Leave it undefined to make the program "etags", which makes emacs-style |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
94 tag tables and tags typedefs, #defines and struct/union/enum by default. */ |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
95 #ifdef CTAGS |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
96 # undef CTAGS |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
97 # define CTAGS TRUE |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
98 #else |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
99 # define CTAGS FALSE |
240 | 100 #endif |
101 | |
102 /* Exit codes for success and failure. */ | |
103 #ifdef VMS | |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
104 # define GOOD 1 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
105 # define BAD 0 |
240 | 106 #else |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
107 # define GOOD 0 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
108 # define BAD 1 |
240 | 109 #endif |
110 | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
111 /* C extensions. */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
112 #define C_PLPL 0x00001 /* C++ */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
113 #define C_STAR 0x00003 /* C* */ |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
114 #define C_JAVA 0x00005 /* JAVA */ |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
115 #define YACC 0x10000 /* yacc file */ |
240 | 116 |
16733
a8927c5085fe
(streq, strneq): Use == NULL rather than !.
Richard M. Stallman <rms@gnu.org>
parents:
16607
diff
changeset
|
117 #define streq(s,t) ((DEBUG && (s) == NULL && (t) == NULL \ |
a8927c5085fe
(streq, strneq): Use == NULL rather than !.
Richard M. Stallman <rms@gnu.org>
parents:
16607
diff
changeset
|
118 && (abort (), 1)) || !strcmp (s, t)) |
a8927c5085fe
(streq, strneq): Use == NULL rather than !.
Richard M. Stallman <rms@gnu.org>
parents:
16607
diff
changeset
|
119 #define strneq(s,t,n) ((DEBUG && (s) == NULL && (t) == NULL \ |
a8927c5085fe
(streq, strneq): Use == NULL rather than !.
Richard M. Stallman <rms@gnu.org>
parents:
16607
diff
changeset
|
120 && (abort (), 1)) || !strncmp (s, t, n)) |
240 | 121 |
16573
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
122 #define lowcase(c) tolower ((char)c) |
12398
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
123 |
240 | 124 #define iswhite(arg) (_wht[arg]) /* T if char is white */ |
125 #define begtoken(arg) (_btk[arg]) /* T if char can start token */ | |
126 #define intoken(arg) (_itk[arg]) /* T if char can be in token */ | |
127 #define endtoken(arg) (_etk[arg]) /* T if char ends tokens */ | |
128 | |
12344
7e7941d8cceb
* etags.c (find_entries): rewind before rereading the input file.
Francesco Potortì <pot@gnu.org>
parents:
12242
diff
changeset
|
129 #ifdef DOS_NT |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
130 # define absolutefn(fn) (fn[0] == '/' \ |
14920
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
131 || (fn[1] == ':' && fn[2] == '/')) |
12344
7e7941d8cceb
* etags.c (find_entries): rewind before rereading the input file.
Francesco Potortì <pot@gnu.org>
parents:
12242
diff
changeset
|
132 #else |
7e7941d8cceb
* etags.c (find_entries): rewind before rereading the input file.
Francesco Potortì <pot@gnu.org>
parents:
12242
diff
changeset
|
133 # define absolutefn(fn) (fn[0] == '/') |
7e7941d8cceb
* etags.c (find_entries): rewind before rereading the input file.
Francesco Potortì <pot@gnu.org>
parents:
12242
diff
changeset
|
134 #endif |
7e7941d8cceb
* etags.c (find_entries): rewind before rereading the input file.
Francesco Potortì <pot@gnu.org>
parents:
12242
diff
changeset
|
135 |
7e7941d8cceb
* etags.c (find_entries): rewind before rereading the input file.
Francesco Potortì <pot@gnu.org>
parents:
12242
diff
changeset
|
136 |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
137 /* |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
138 * xnew -- allocate storage |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
139 * |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
140 * SYNOPSIS: Type *xnew (int n, Type); |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
141 */ |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
142 #ifdef chkmalloc |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
143 # include "chkmalloc.h" |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
144 # define xnew(n,Type) ((Type *) trace_xmalloc (__FILE__, __LINE__, \ |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
145 (n) * sizeof (Type))) |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
146 #else |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
147 # define xnew(n,Type) ((Type *) xmalloc ((n) * sizeof (Type))) |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
148 #endif |
240 | 149 |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
150 typedef int logical; |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
151 |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
152 typedef struct nd_st |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
153 { /* sorting structure */ |
240 | 154 char *name; /* function or type name */ |
155 char *file; /* file name */ | |
156 logical is_func; /* use pattern or line no */ | |
157 logical been_warned; /* set if noticed dup */ | |
158 int lno; /* line number tag is on */ | |
159 long cno; /* character number line starts on */ | |
160 char *pat; /* search pattern */ | |
161 struct nd_st *left, *right; /* left and right sons */ | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
162 } NODE; |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
163 |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
164 extern char *getenv (); |
240 | 165 |
166 char *concat (); | |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
167 char *savenstr (), *savestr (); |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
168 char *etags_strchr (), *etags_strrchr (); |
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
169 char *etags_getcwd (); |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
170 char *relative_filename (), *absolute_filename (), *absolute_dirname (); |
16573
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
171 void grow_linebuffer (); |
11673
46d2178719ad
(C_entries): Cast result of xrealloc.
Richard M. Stallman <rms@gnu.org>
parents:
11231
diff
changeset
|
172 long *xmalloc (), *xrealloc (); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
173 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
174 typedef void Lang_function (); |
10378
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
175 #if FALSE /* many compilers barf on this */ |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
176 Lang_function Asm_labels; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
177 Lang_function default_C_entries; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
178 Lang_function C_entries; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
179 Lang_function Cplusplus_entries; |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
180 Lang_function Cjava_entries; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
181 Lang_function Cstar_entries; |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
182 Lang_function Erlang_functions; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
183 Lang_function Fortran_functions; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
184 Lang_function Yacc_entries; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
185 Lang_function Lisp_functions; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
186 Lang_function Pascal_functions; |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
187 Lang_function Perl_functions; |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
188 Lang_function Postscript_functions; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
189 Lang_function Prolog_functions; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
190 Lang_function Scheme_functions; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
191 Lang_function TeX_functions; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
192 Lang_function just_read_file; |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
193 #else /* so let's write it this way */ |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
194 void Asm_labels (); |
12398
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
195 void C_entries (); |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
196 void default_C_entries (); |
12398
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
197 void plain_C_entries (); |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
198 void Cjava_entries (); |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
199 void Cplusplus_entries (); |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
200 void Cstar_entries (); |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
201 void Erlang_functions (); |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
202 void Fortran_functions (); |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
203 void Yacc_entries (); |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
204 void Lisp_functions (); |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
205 void Pascal_functions (); |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
206 void Perl_functions (); |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
207 void Postscript_functions (); |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
208 void Prolog_functions (); |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
209 void Scheme_functions (); |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
210 void TeX_functions (); |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
211 void just_read_file (); |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
212 #endif |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
213 |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
214 Lang_function *get_language_from_name (); |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
215 Lang_function *get_language_from_interpreter (); |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
216 Lang_function *get_language_from_suffix (); |
240 | 217 int total_size_of_entries (); |
218 long readline (); | |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
219 long readline_internal (); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
220 #ifdef ETAGS_REGEXPS |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
221 void analyse_regex (); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
222 void add_regex (); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
223 #endif |
240 | 224 void add_node (); |
225 void error (); | |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
226 void suggest_asking_for_help (); |
10378
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
227 void fatal (), pfatal (); |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
228 void find_entries (); |
240 | 229 void free_tree (); |
230 void getit (); | |
231 void init (); | |
232 void initbuffer (); | |
233 void pfnote (); | |
234 void process_file (); | |
235 void put_entries (); | |
236 void takeprec (); | |
237 | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
238 |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
239 char searchar = '/'; /* use /.../ searches */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
240 |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
241 int lineno; /* line number of current line */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
242 long charno; /* current character number */ |
15243
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
243 long linecharno; /* charno of start of line */ |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
244 |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
245 char *curfile; /* current input file name */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
246 char *tagfile; /* output file */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
247 char *progname; /* name this program was invoked with */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
248 char *cwd; /* current working directory */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
249 char *tagfiledir; /* directory of tagfile */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
250 |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
251 FILE *tagf; /* ioptr for tags file */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
252 NODE *head; /* the head of the binary tree of tags */ |
240 | 253 |
254 /* | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
255 * A `struct linebuffer' is a structure which holds a line of text. |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
256 * `readline' reads a line from a stream into a linebuffer and works |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
257 * regardless of the length of the line. |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
258 * SIZE is the size of BUFFER, LEN is the length of the string in |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
259 * BUFFER after readline reads it. |
240 | 260 */ |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
261 struct linebuffer |
240 | 262 { |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
263 long size; |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
264 int len; |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
265 char *buffer; |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
266 }; |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
267 |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
268 struct linebuffer lb; /* the current line */ |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
269 struct linebuffer token_name; /* used by C_entries as a temporary area */ |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
270 struct |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
271 { |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
272 long linepos; |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
273 struct linebuffer lb; /* used by C_entries instead of lb */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
274 } lbs[2]; |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
275 |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
276 /* boolean "functions" (see init) */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
277 logical _wht[0177], _etk[0177], _itk[0177], _btk[0177]; |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
278 char |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
279 /* white chars */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
280 *white = " \f\t\n\013", |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
281 /* token ending chars */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
282 *endtk = " \t\n\013\"'#()[]{}=-+%*/&|^~!<>;,.:?", |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
283 /* token starting chars */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
284 *begtk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$~@", |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
285 /* valid in-token chars */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
286 *intk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$0123456789"; |
240 | 287 |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
288 logical append_to_tagfile; /* -a: append to tags */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
289 /* The following three default to TRUE for etags, but to FALSE for ctags. */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
290 logical typedefs; /* -t: create tags for typedefs */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
291 logical typedefs_and_cplusplus; /* -T: create tags for typedefs, level */ |
240 | 292 /* 0 struct/enum/union decls, and C++ */ |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
293 /* member functions. */ |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
294 logical constantypedefs; /* -d: create tags for C #define and enum */ |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
295 /* constants. */ |
240 | 296 /* -D: opposite of -d. Default under ctags. */ |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
297 logical update; /* -u: update tags */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
298 logical vgrind_style; /* -v: create vgrind style index output */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
299 logical no_warnings; /* -w: suppress warnings */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
300 logical cxref_style; /* -x: create cxref style output */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
301 logical cplusplus; /* .[hc] means C++, not C */ |
10449
2266157d9bcc
* etags.c (longopts, print_help, main): Use -I as abbreviation
Francesco Potortì <pot@gnu.org>
parents:
10404
diff
changeset
|
302 logical noindentypedefs; /* -I: ignore indentation in C */ |
240 | 303 |
10047
9b284d98b102
* etags.c (print_help): print --regex usage for ctags also.
Francesco Potortì <pot@gnu.org>
parents:
9976
diff
changeset
|
304 struct option longopts[] = |
9b284d98b102
* etags.c (print_help): print --regex usage for ctags also.
Francesco Potortì <pot@gnu.org>
parents:
9976
diff
changeset
|
305 { |
621 | 306 { "append", no_argument, NULL, 'a' }, |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
307 { "backward-search", no_argument, NULL, 'B' }, |
621 | 308 { "c++", no_argument, NULL, 'C' }, |
309 { "cxref", no_argument, NULL, 'x' }, | |
310 { "defines", no_argument, NULL, 'd' }, | |
10047
9b284d98b102
* etags.c (print_help): print --regex usage for ctags also.
Francesco Potortì <pot@gnu.org>
parents:
9976
diff
changeset
|
311 { "help", no_argument, NULL, 'h' }, |
621 | 312 { "help", no_argument, NULL, 'H' }, |
10449
2266157d9bcc
* etags.c (longopts, print_help, main): Use -I as abbreviation
Francesco Potortì <pot@gnu.org>
parents:
10404
diff
changeset
|
313 { "ignore-indentation", no_argument, NULL, 'I' }, |
621 | 314 { "include", required_argument, NULL, 'i' }, |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
315 { "language", required_argument, NULL, 'l' }, |
621 | 316 { "no-defines", no_argument, NULL, 'D' }, |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
317 { "no-regex", no_argument, NULL, 'R' }, |
621 | 318 { "no-warn", no_argument, NULL, 'w' }, |
319 { "output", required_argument, NULL, 'o' }, | |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
320 { "regex", required_argument, NULL, 'r' }, |
621 | 321 { "typedefs", no_argument, NULL, 't' }, |
322 { "typedefs-and-c++", no_argument, NULL, 'T' }, | |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
323 { "update", no_argument, NULL, 'u' }, |
621 | 324 { "version", no_argument, NULL, 'V' }, |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
325 { "vgrind", no_argument, NULL, 'v' }, |
621 | 326 { 0 } |
327 }; | |
328 | |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
329 #ifdef ETAGS_REGEXPS |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
330 /* Structure defining a regular expression. Elements are |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
331 the compiled pattern, and the name string. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
332 struct pattern |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
333 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
334 struct re_pattern_buffer *pattern; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
335 struct re_registers regs; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
336 char *name_pattern; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
337 logical error_signaled; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
338 }; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
339 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
340 /* Number of regexps found. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
341 int num_patterns = 0; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
342 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
343 /* Array of all regexps. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
344 struct pattern *patterns = NULL; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
345 #endif /* ETAGS_REGEXPS */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
346 |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
347 /* |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
348 * Language stuff. |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
349 */ |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
350 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
351 /* Non-NULL if language fixed. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
352 Lang_function *lang_func = NULL; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
353 |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
354 /* Assembly code */ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
355 char *Asm_suffixes [] = { "a", /* Unix assembler */ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
356 "asm", /* Microcontroller assembly */ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
357 "def", /* BSO/Tasking definition includes */ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
358 "inc", /* Microcontroller include files */ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
359 "ins", /* Microcontroller include files */ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
360 "s", "sa", /* Unix assembler */ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
361 "src", /* BSO/Tasking C compiler output */ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
362 NULL |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
363 }; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
364 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
365 /* Note that .c and .h can be considered C++, if the --c++ flag was |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
366 given. That is why default_C_entries is called here. */ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
367 char *default_C_suffixes [] = |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
368 { "c", "h", NULL }; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
369 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
370 char *Cplusplus_suffixes [] = |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
371 { "C", "H", "c++", "cc", "cpp", "cxx", "h++", "hh", "hpp", "hxx", |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
372 "M", /* Objective C++ */ |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
373 "pdb", /* Postscript with C syntax */ |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
374 NULL }; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
375 |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
376 char *Cjava_suffixes [] = |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
377 { "java", NULL }; |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
378 |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
379 char *Cstar_suffixes [] = |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
380 { "cs", "hs", NULL }; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
381 |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
382 char *Erlang_suffixes [] = |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
383 { "erl", "hrl", NULL }; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
384 |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
385 char *Fortran_suffixes [] = |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
386 { "F", "f", "f90", "for", NULL }; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
387 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
388 char *Lisp_suffixes [] = |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
389 { "cl", "clisp", "el", "l", "lisp", "lsp", "ml", NULL }; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
390 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
391 char *Pascal_suffixes [] = |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
392 { "p", "pas", NULL }; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
393 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
394 char *Perl_suffixes [] = |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
395 { "pl", "pm", NULL }; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
396 char *Perl_interpreters [] = |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
397 { "perl", "@PERL@", NULL }; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
398 |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
399 char *plain_C_suffixes [] = |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
400 { "pc", /* Pro*C file */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
401 "m", /* Objective C file */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
402 "lm", /* Objective lex file */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
403 NULL }; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
404 |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
405 char *Postscript_suffixes [] = |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
406 { "ps", NULL }; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
407 |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
408 char *Prolog_suffixes [] = |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
409 { "prolog", NULL }; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
410 |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
411 /* Can't do the `SCM' or `scm' prefix with a version number. */ |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
412 char *Scheme_suffixes [] = |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
413 { "SCM", "SM", "oak", "sch", "scheme", "scm", "sm", "t", NULL }; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
414 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
415 char *TeX_suffixes [] = |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
416 { "TeX", "bib", "clo", "cls", "ltx", "sty", "tex", NULL }; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
417 |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
418 char *Yacc_suffixes [] = |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
419 { "y", "ym", NULL }; /* .ym is Objective yacc file */ |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
420 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
421 /* Table of language names and corresponding functions, file suffixes |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
422 and interpreter names. |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
423 It is ok for a given function to be listed under more than one |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
424 name. I just didn't. */ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
425 struct lang_entry |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
426 { |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
427 char *name; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
428 Lang_function *function; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
429 char **suffixes; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
430 char **interpreters; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
431 }; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
432 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
433 struct lang_entry lang_names [] = |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
434 { |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
435 { "asm", Asm_labels, Asm_suffixes, NULL }, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
436 { "c", default_C_entries, default_C_suffixes, NULL }, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
437 { "c++", Cplusplus_entries, Cplusplus_suffixes, NULL }, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
438 { "c*", Cstar_entries, Cstar_suffixes, NULL }, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
439 { "erlang", Erlang_functions, Erlang_suffixes, NULL }, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
440 { "fortran", Fortran_functions, Fortran_suffixes, NULL }, |
17785
5b92f8ba5c6d
Added support for the Java language.
Francesco Potortì <pot@gnu.org>
parents:
17778
diff
changeset
|
441 { "java", Cjava_entries, Cjava_suffixes, NULL }, |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
442 { "lisp", Lisp_functions, Lisp_suffixes, NULL }, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
443 { "pascal", Pascal_functions, Pascal_suffixes, NULL }, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
444 { "perl", Perl_functions, Perl_suffixes, Perl_interpreters }, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
445 { "postscript", Postscript_functions, Postscript_suffixes, NULL }, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
446 { "proc", plain_C_entries, plain_C_suffixes, NULL }, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
447 { "prolog", Prolog_functions, Prolog_suffixes, NULL }, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
448 { "scheme", Scheme_functions, Scheme_suffixes, NULL }, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
449 { "tex", TeX_functions, TeX_suffixes, NULL }, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
450 { "yacc", Yacc_entries, Yacc_suffixes, NULL }, |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
451 { "auto", NULL }, /* default guessing scheme */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
452 { "none", just_read_file }, /* regexp matching only */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
453 { NULL, NULL } /* end of list */ |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
454 }; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
455 |
240 | 456 |
457 void | |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
458 print_language_names () |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
459 { |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
460 struct lang_entry *lang; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
461 char **ext; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
462 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
463 puts ("\nThese are the currently supported languages, along with the\n\ |
12398
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
464 default file name suffixes:"); |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
465 for (lang = lang_names; lang->name != NULL; lang++) |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
466 { |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
467 printf ("\t%s\t", lang->name); |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
468 if (lang->suffixes != NULL) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
469 for (ext = lang->suffixes; *ext != NULL; ext++) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
470 printf (" .%s", *ext); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
471 puts (""); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
472 } |
12398
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
473 puts ("Where `auto' means use default language for files based on file\n\ |
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
474 name suffix, and `none' means only do regexp processing on files.\n\ |
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
475 If no language is specified and no matching suffix is found,\n\ |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
476 the first line of the file is read for a sharp-bang (#!) sequence\n\ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
477 followed by the name of an interpreter. If no such sequence is found,\n\ |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
478 Fortran is tried first; if no tags are found, C is tried next."); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
479 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
480 |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
481 #ifndef VERSION |
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
482 # define VERSION "19" |
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
483 #endif |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
484 void |
621 | 485 print_version () |
486 { | |
16373
d50369f4bb41
* etags.c (print_version): Print copyright info.
Francesco Potortì <pot@gnu.org>
parents:
16086
diff
changeset
|
487 printf ("%s (GNU Emacs %s)\n", (CTAGS) ? "ctags" : "etags", VERSION); |
d50369f4bb41
* etags.c (print_version): Print copyright info.
Francesco Potortì <pot@gnu.org>
parents:
16086
diff
changeset
|
488 puts ("Copyright (C) 1996 Free Software Foundation, Inc. and Ken Arnold"); |
d50369f4bb41
* etags.c (print_version): Print copyright info.
Francesco Potortì <pot@gnu.org>
parents:
16086
diff
changeset
|
489 puts ("This program is distributed under the same terms as Emacs"); |
621 | 490 |
5940
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
491 exit (GOOD); |
621 | 492 } |
493 | |
494 void | |
495 print_help () | |
496 { | |
497 printf ("These are the options accepted by %s. You may use unambiguous\n\ | |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
498 abbreviations for the long option names. A - as file name means read\n\ |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
499 names from stdin.", progname); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
500 if (!CTAGS) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
501 printf (" Absolute names are stored in the output file as they\n\ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
502 are. Relative ones are stored relative to the output file's directory."); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
503 puts ("\n"); |
621 | 504 |
4126
9a906e5f9b28
* etags.c (print_help): Break up the very long strings containing
Jim Blandy <jimb@redhat.com>
parents:
4052
diff
changeset
|
505 puts ("-a, --append\n\ |
9a906e5f9b28
* etags.c (print_help): Break up the very long strings containing
Jim Blandy <jimb@redhat.com>
parents:
4052
diff
changeset
|
506 Append tag entries to existing tags file."); |
5940
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
507 |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
508 if (CTAGS) |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
509 puts ("-B, --backward-search\n\ |
5940
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
510 Write the search commands for the tag entries using '?', the\n\ |
6945
63ab519f7057
* etags.c (main, print_help): eliminate the -F option.
Francesco Potortì <pot@gnu.org>
parents:
6944
diff
changeset
|
511 backward-search command instead of '/', the forward-search command."); |
5940
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
512 |
4126
9a906e5f9b28
* etags.c (print_help): Break up the very long strings containing
Jim Blandy <jimb@redhat.com>
parents:
4052
diff
changeset
|
513 puts ("-C, --c++\n\ |
12398
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
514 Treat files whose name suffix defaults to C language as C++ files."); |
621 | 515 |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
516 if (CTAGS) |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
517 puts ("-d, --defines\n\ |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
518 Create tag entries for C #define constants and enum constants, too."); |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
519 else |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
520 puts ("-D, --no-defines\n\ |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
521 Don't create tag entries for C #define constants and enum constants.\n\ |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
522 This makes the tags file smaller."); |
621 | 523 |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
524 if (!CTAGS) |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
525 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
526 puts ("-i FILE, --include=FILE\n\ |
5940
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
527 Include a note in tag file indicating that, when searching for\n\ |
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
528 a tag, one should also consult the tags file FILE after\n\ |
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
529 checking the current file."); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
530 puts ("-l LANG, --language=LANG\n\ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
531 Force the following files to be considered as written in the\n\ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
532 named language up to the next --language=LANG option."); |
10047
9b284d98b102
* etags.c (print_help): print --regex usage for ctags also.
Francesco Potortì <pot@gnu.org>
parents:
9976
diff
changeset
|
533 } |
9b284d98b102
* etags.c (print_help): print --regex usage for ctags also.
Francesco Potortì <pot@gnu.org>
parents:
9976
diff
changeset
|
534 |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
535 #ifdef ETAGS_REGEXPS |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
536 puts ("-r /REGEXP/, --regex=/REGEXP/ or --regex=@regexfile\n\ |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
537 Make a tag for each line matching pattern REGEXP in the\n\ |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
538 following files. regexfile is a file containing one REGEXP\n\ |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
539 per line. REGEXP is anchored (as if preceded by ^).\n\ |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
540 The form /REGEXP/NAME/ creates a named tag. For example Tcl\n\ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
541 named tags can be created with:\n\ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
542 --regex=/proc[ \\t]+\\([^ \\t]+\\)/\\1/."); |
10047
9b284d98b102
* etags.c (print_help): print --regex usage for ctags also.
Francesco Potortì <pot@gnu.org>
parents:
9976
diff
changeset
|
543 puts ("-R, --no-regex\n\ |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
544 Don't create tags from regexps for the following files."); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
545 #endif /* ETAGS_REGEXPS */ |
5940
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
546 puts ("-o FILE, --output=FILE\n\ |
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
547 Write the tags to FILE."); |
10449
2266157d9bcc
* etags.c (longopts, print_help, main): Use -I as abbreviation
Francesco Potortì <pot@gnu.org>
parents:
10404
diff
changeset
|
548 puts ("-I, --ignore-indentation\n\ |
621 | 549 Don't rely on indentation quite as much as normal. Currently,\n\ |
550 this means not to assume that a closing brace in the first\n\ | |
551 column is the final brace of a function or structure\n\ | |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
552 definition in C and C++."); |
621 | 553 |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
554 if (CTAGS) |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
555 { |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
556 puts ("-t, --typedefs\n\ |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
557 Generate tag entries for C typedefs."); |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
558 puts ("-T, --typedefs-and-c++\n\ |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
559 Generate tag entries for C typedefs, C struct/enum/union tags,\n\ |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
560 and C++ member functions."); |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
561 puts ("-u, --update\n\ |
621 | 562 Update the tag entries for the given files, leaving tag\n\ |
563 entries for other files in place. Currently, this is\n\ | |
564 implemented by deleting the existing entries for the given\n\ | |
565 files and then rewriting the new entries at the end of the\n\ | |
566 tags file. It is often faster to simply rebuild the entire\n\ | |
4126
9a906e5f9b28
* etags.c (print_help): Break up the very long strings containing
Jim Blandy <jimb@redhat.com>
parents:
4052
diff
changeset
|
567 tag file than to use this."); |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
568 puts ("-v, --vgrind\n\ |
621 | 569 Generates an index of items intended for human consumption,\n\ |
570 similar to the output of vgrind. The index is sorted, and\n\ | |
4126
9a906e5f9b28
* etags.c (print_help): Break up the very long strings containing
Jim Blandy <jimb@redhat.com>
parents:
4052
diff
changeset
|
571 gives the page number of each item."); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
572 puts ("-w, --no-warn\n\ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
573 Suppress warning messages about entries defined in multiple\n\ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
574 files."); |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
575 puts ("-x, --cxref\n\ |
621 | 576 Like --vgrind, but in the style of cxref, rather than vgrind.\n\ |
577 The output uses line numbers instead of page numbers, but\n\ | |
578 beyond that the differences are cosmetic; try both to see\n\ | |
4126
9a906e5f9b28
* etags.c (print_help): Break up the very long strings containing
Jim Blandy <jimb@redhat.com>
parents:
4052
diff
changeset
|
579 which you like."); |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
580 } |
621 | 581 |
582 puts ("-V, --version\n\ | |
583 Print the version of the program.\n\ | |
10047
9b284d98b102
* etags.c (print_help): print --regex usage for ctags also.
Francesco Potortì <pot@gnu.org>
parents:
9976
diff
changeset
|
584 -h, --help\n\ |
621 | 585 Print this help message."); |
586 | |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
587 print_language_names (); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
588 |
16373
d50369f4bb41
* etags.c (print_version): Print copyright info.
Francesco Potortì <pot@gnu.org>
parents:
16086
diff
changeset
|
589 puts (""); |
d50369f4bb41
* etags.c (print_version): Print copyright info.
Francesco Potortì <pot@gnu.org>
parents:
16086
diff
changeset
|
590 puts ("Report bugs to bug-gnu-emacs@prep.ai.mit.edu"); |
d50369f4bb41
* etags.c (print_version): Print copyright info.
Francesco Potortì <pot@gnu.org>
parents:
16086
diff
changeset
|
591 |
5940
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
592 exit (GOOD); |
621 | 593 } |
594 | |
595 | |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
596 enum argument_type |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
597 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
598 at_language, |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
599 at_regexp, |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
600 at_filename |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
601 }; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
602 |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
603 /* This structure helps us allow mixing of --lang and file names. */ |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
604 typedef struct |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
605 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
606 enum argument_type arg_type; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
607 char *what; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
608 Lang_function *function; |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
609 } argument; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
610 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
611 #ifdef VMS /* VMS specific functions */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
612 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
613 #define EOS '\0' |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
614 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
615 /* This is a BUG! ANY arbitrary limit is a BUG! |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
616 Won't someone please fix this? */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
617 #define MAX_FILE_SPEC_LEN 255 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
618 typedef struct { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
619 short curlen; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
620 char body[MAX_FILE_SPEC_LEN + 1]; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
621 } vspec; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
622 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
623 /* |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
624 v1.05 nmm 26-Jun-86 fn_exp - expand specification of list of file names |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
625 returning in each successive call the next file name matching the input |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
626 spec. The function expects that each in_spec passed |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
627 to it will be processed to completion; in particular, up to and |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
628 including the call following that in which the last matching name |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
629 is returned, the function ignores the value of in_spec, and will |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
630 only start processing a new spec with the following call. |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
631 If an error occurs, on return out_spec contains the value |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
632 of in_spec when the error occurred. |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
633 |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
634 With each successive file name returned in out_spec, the |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
635 function's return value is one. When there are no more matching |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
636 names the function returns zero. If on the first call no file |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
637 matches in_spec, or there is any other error, -1 is returned. |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
638 */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
639 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
640 #include <rmsdef.h> |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
641 #include <descrip.h> |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
642 #define OUTSIZE MAX_FILE_SPEC_LEN |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
643 short |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
644 fn_exp (out, in) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
645 vspec *out; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
646 char *in; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
647 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
648 static long context = 0; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
649 static struct dsc$descriptor_s o; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
650 static struct dsc$descriptor_s i; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
651 static logical pass1 = TRUE; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
652 long status; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
653 short retval; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
654 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
655 if (pass1) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
656 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
657 pass1 = FALSE; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
658 o.dsc$a_pointer = (char *) out; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
659 o.dsc$w_length = (short)OUTSIZE; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
660 i.dsc$a_pointer = in; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
661 i.dsc$w_length = (short)strlen(in); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
662 i.dsc$b_dtype = DSC$K_DTYPE_T; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
663 i.dsc$b_class = DSC$K_CLASS_S; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
664 o.dsc$b_dtype = DSC$K_DTYPE_VT; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
665 o.dsc$b_class = DSC$K_CLASS_VS; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
666 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
667 if ((status = lib$find_file(&i, &o, &context, 0, 0)) == RMS$_NORMAL) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
668 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
669 out->body[out->curlen] = EOS; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
670 return 1; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
671 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
672 else if (status == RMS$_NMF) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
673 retval = 0; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
674 else |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
675 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
676 strcpy(out->body, in); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
677 retval = -1; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
678 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
679 lib$find_file_end(&context); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
680 pass1 = TRUE; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
681 return retval; |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
682 } |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
683 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
684 /* |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
685 v1.01 nmm 19-Aug-85 gfnames - return in successive calls the |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
686 name of each file specified by the provided arg expanding wildcards. |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
687 */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
688 char * |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
689 gfnames (arg, p_error) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
690 char *arg; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
691 logical *p_error; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
692 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
693 static vspec filename = {MAX_FILE_SPEC_LEN, "\0"}; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
694 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
695 switch (fn_exp (&filename, arg)) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
696 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
697 case 1: |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
698 *p_error = FALSE; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
699 return filename.body; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
700 case 0: |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
701 *p_error = FALSE; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
702 return NULL; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
703 default: |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
704 *p_error = TRUE; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
705 return filename.body; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
706 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
707 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
708 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
709 #ifndef OLD /* Newer versions of VMS do provide `system'. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
710 system (cmd) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
711 char *cmd; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
712 { |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
713 error ("%s", "system() function not implemented under VMS"); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
714 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
715 #endif |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
716 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
717 #define VERSION_DELIM ';' |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
718 char *massage_name (s) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
719 char *s; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
720 { |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
721 char *start = s; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
722 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
723 for ( ; *s; s++) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
724 if (*s == VERSION_DELIM) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
725 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
726 *s = EOS; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
727 break; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
728 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
729 else |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
730 *s = lowcase (*s); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
731 return start; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
732 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
733 #endif /* VMS */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
734 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
735 |
15683 | 736 int |
240 | 737 main (argc, argv) |
738 int argc; | |
739 char *argv[]; | |
740 { | |
741 int i; | |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
742 unsigned int nincluded_files; |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
743 char **included_files; |
240 | 744 char *this_file; |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
745 argument *argbuffer; |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
746 int current_arg, file_count; |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
747 struct linebuffer filename_lb; |
240 | 748 #ifdef VMS |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
749 logical got_err; |
240 | 750 #endif |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
751 |
9773
bd49556a7552
(main, etags_getcwd): Test DOS_NT instead of MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
9635
diff
changeset
|
752 #ifdef DOS_NT |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
753 _fmode = O_BINARY; /* all of files are treated as binary files */ |
9773
bd49556a7552
(main, etags_getcwd): Test DOS_NT instead of MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
9635
diff
changeset
|
754 #endif /* DOS_NT */ |
5448
18de002e47dd
(main) [MSDOS]: Open all files as binary.
Richard M. Stallman <rms@gnu.org>
parents:
5044
diff
changeset
|
755 |
240 | 756 progname = argv[0]; |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
757 nincluded_files = 0; |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
758 included_files = xnew (argc, char *); |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
759 current_arg = 0; |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
760 file_count = 0; |
240 | 761 |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
762 /* Allocate enough no matter what happens. Overkill, but each one |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
763 is small. */ |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
764 argbuffer = xnew (argc, argument); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
765 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
766 #ifdef ETAGS_REGEXPS |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
767 /* Set syntax for regular expression routines. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
768 re_set_syntax (RE_SYNTAX_EMACS); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
769 #endif /* ETAGS_REGEXPS */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
770 |
240 | 771 /* |
772 * If etags, always find typedefs and structure tags. Why not? | |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
773 * Also default is to find macro constants and enum constants. |
240 | 774 */ |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
775 if (!CTAGS) |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
776 typedefs = typedefs_and_cplusplus = constantypedefs = TRUE; |
240 | 777 |
9975
e21b0674f37c
* etags.c (<errno.h>): #include added.
Francesco Potortì <pot@gnu.org>
parents:
9773
diff
changeset
|
778 while (1) |
240 | 779 { |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
780 int opt = getopt_long (argc, argv, |
10449
2266157d9bcc
* etags.c (longopts, print_help, main): Use -I as abbreviation
Francesco Potortì <pot@gnu.org>
parents:
10404
diff
changeset
|
781 "-aCdDf:Il:o:r:RStTi:BuvxwVhH", longopts, 0); |
621 | 782 |
783 if (opt == EOF) | |
784 break; | |
785 | |
786 switch (opt) | |
240 | 787 { |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
788 case 0: |
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
789 /* If getopt returns 0, then it has already processed a |
621 | 790 long-named option. We should do nothing. */ |
791 break; | |
240 | 792 |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
793 case 1: |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
794 /* This means that a file name has been seen. Record it. */ |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
795 argbuffer[current_arg].arg_type = at_filename; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
796 argbuffer[current_arg].what = optarg; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
797 ++current_arg; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
798 ++file_count; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
799 break; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
800 |
621 | 801 /* Common options. */ |
802 case 'a': | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
803 append_to_tagfile = TRUE; |
621 | 804 break; |
805 case 'C': | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
806 cplusplus = TRUE; |
621 | 807 break; |
808 case 'd': | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
809 constantypedefs = TRUE; |
621 | 810 break; |
811 case 'D': | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
812 constantypedefs = FALSE; |
621 | 813 break; |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
814 case 'f': /* for compatibility with old makefiles */ |
621 | 815 case 'o': |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
816 if (tagfile) |
621 | 817 { |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
818 error ("-%c option may only be given once.", opt); |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
819 suggest_asking_for_help (); |
240 | 820 } |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
821 tagfile = optarg; |
621 | 822 break; |
10449
2266157d9bcc
* etags.c (longopts, print_help, main): Use -I as abbreviation
Francesco Potortì <pot@gnu.org>
parents:
10404
diff
changeset
|
823 case 'I': |
2266157d9bcc
* etags.c (longopts, print_help, main): Use -I as abbreviation
Francesco Potortì <pot@gnu.org>
parents:
10404
diff
changeset
|
824 case 'S': /* for backward compatibility */ |
2266157d9bcc
* etags.c (longopts, print_help, main): Use -I as abbreviation
Francesco Potortì <pot@gnu.org>
parents:
10404
diff
changeset
|
825 noindentypedefs = TRUE; |
2266157d9bcc
* etags.c (longopts, print_help, main): Use -I as abbreviation
Francesco Potortì <pot@gnu.org>
parents:
10404
diff
changeset
|
826 break; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
827 case 'l': |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
828 argbuffer[current_arg].function = get_language_from_name (optarg); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
829 argbuffer[current_arg].arg_type = at_language; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
830 ++current_arg; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
831 break; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
832 #ifdef ETAGS_REGEXPS |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
833 case 'r': |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
834 argbuffer[current_arg].arg_type = at_regexp; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
835 argbuffer[current_arg].what = optarg; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
836 ++current_arg; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
837 break; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
838 case 'R': |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
839 argbuffer[current_arg].arg_type = at_regexp; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
840 argbuffer[current_arg].what = NULL; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
841 ++current_arg; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
842 break; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
843 #endif /* ETAGS_REGEXPS */ |
621 | 844 case 'V': |
845 print_version (); | |
846 break; | |
10047
9b284d98b102
* etags.c (print_help): print --regex usage for ctags also.
Francesco Potortì <pot@gnu.org>
parents:
9976
diff
changeset
|
847 case 'h': |
621 | 848 case 'H': |
849 print_help (); | |
850 break; | |
8180
c98f9acb71e3
* etags.c (main): Don't barf on obsolete -t and -T switches.
Francesco Potortì <pot@gnu.org>
parents:
7776
diff
changeset
|
851 case 't': |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
852 typedefs = TRUE; |
8180
c98f9acb71e3
* etags.c (main): Don't barf on obsolete -t and -T switches.
Francesco Potortì <pot@gnu.org>
parents:
7776
diff
changeset
|
853 break; |
c98f9acb71e3
* etags.c (main): Don't barf on obsolete -t and -T switches.
Francesco Potortì <pot@gnu.org>
parents:
7776
diff
changeset
|
854 case 'T': |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
855 typedefs = typedefs_and_cplusplus = TRUE; |
8180
c98f9acb71e3
* etags.c (main): Don't barf on obsolete -t and -T switches.
Francesco Potortì <pot@gnu.org>
parents:
7776
diff
changeset
|
856 break; |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
857 #if (!CTAGS) |
621 | 858 /* Etags options */ |
859 case 'i': | |
860 included_files[nincluded_files++] = optarg; | |
861 break; | |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
862 #else /* CTAGS */ |
621 | 863 /* Ctags options. */ |
864 case 'B': | |
865 searchar = '?'; | |
866 break; | |
867 case 'u': | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
868 update = TRUE; |
621 | 869 break; |
870 case 'v': | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
871 vgrind_style = TRUE; |
621 | 872 /*FALLTHRU*/ |
873 case 'x': | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
874 cxref_style = TRUE; |
621 | 875 break; |
876 case 'w': | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
877 no_warnings = TRUE; |
621 | 878 break; |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
879 #endif /* CTAGS */ |
621 | 880 default: |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
881 suggest_asking_for_help (); |
240 | 882 } |
883 } | |
884 | |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
885 for (; optind < argc; ++optind) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
886 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
887 argbuffer[current_arg].arg_type = at_filename; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
888 argbuffer[current_arg].what = argv[optind]; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
889 ++current_arg; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
890 ++file_count; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
891 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
892 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
893 if (nincluded_files == 0 && file_count == 0) |
240 | 894 { |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
895 error ("%s", "No input files specified."); |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
896 suggest_asking_for_help (); |
240 | 897 } |
898 | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
899 if (tagfile == NULL) |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
900 tagfile = CTAGS ? "tags" : "TAGS"; |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
901 cwd = etags_getcwd (); /* the current working directory */ |
15366
32ab7b623b9b
(main): Copy cwd when appending slash.
Richard M. Stallman <rms@gnu.org>
parents:
15243
diff
changeset
|
902 if (cwd[strlen (cwd) - 1] != '/') |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
903 { |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
904 char *oldcwd = cwd; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
905 cwd = concat (oldcwd, "/", ""); |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
906 free (oldcwd); |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
907 } |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
908 if (streq (tagfile, "-")) |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
909 tagfiledir = cwd; |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
910 else |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
911 tagfiledir = absolute_dirname (tagfile, cwd); |
240 | 912 |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
913 init (); /* set up boolean "functions" */ |
240 | 914 |
915 initbuffer (&lb); | |
10801
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
916 initbuffer (&token_name); |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
917 initbuffer (&lbs[0].lb); |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
918 initbuffer (&lbs[1].lb); |
240 | 919 initbuffer (&filename_lb); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
920 |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
921 if (!CTAGS) |
240 | 922 { |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
923 if (streq (tagfile, "-")) |
14920
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
924 { |
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
925 tagf = stdout; |
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
926 #ifdef DOS_NT |
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
927 /* Switch redirected `stdout' to binary mode (setting `_fmode' |
15243
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
928 doesn't take effect until after `stdout' is already open). */ |
14920
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
929 if (!isatty (fileno (stdout))) |
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
930 setmode (fileno (stdout), O_BINARY); |
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
931 #endif /* DOS_NT */ |
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
932 } |
240 | 933 else |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
934 tagf = fopen (tagfile, append_to_tagfile ? "a" : "w"); |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
935 if (tagf == NULL) |
10378
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
936 pfatal (tagfile); |
240 | 937 } |
938 | |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
939 /* |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
940 * Loop through files finding functions. |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
941 */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
942 for (i = 0; i < current_arg; ++i) |
240 | 943 { |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
944 switch (argbuffer[i].arg_type) |
240 | 945 { |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
946 case at_language: |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
947 lang_func = argbuffer[i].function; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
948 break; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
949 #ifdef ETAGS_REGEXPS |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
950 case at_regexp: |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
951 analyse_regex (argbuffer[i].what); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
952 break; |
240 | 953 #endif |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
954 case at_filename: |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
955 #ifdef VMS |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
956 while ((this_file = gfnames (argbuffer[i].what, &got_err)) != NULL) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
957 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
958 if (got_err) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
959 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
960 error ("Can't find file %s\n", this_file); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
961 argc--, argv++; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
962 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
963 else |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
964 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
965 this_file = massage_name (this_file); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
966 } |
240 | 967 #else |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
968 this_file = argbuffer[i].what; |
240 | 969 #endif |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
970 /* Input file named "-" means read file names from stdin |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
971 and use them. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
972 if (streq (this_file, "-")) |
10761
7aa80669e697
* etags.c (C_entries): Bug corrected in xrealloc of token_str.
Francesco Potortì <pot@gnu.org>
parents:
10754
diff
changeset
|
973 while (readline_internal (&filename_lb, stdin) > 0) |
7aa80669e697
* etags.c (C_entries): Bug corrected in xrealloc of token_str.
Francesco Potortì <pot@gnu.org>
parents:
10754
diff
changeset
|
974 process_file (filename_lb.buffer); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
975 else |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
976 process_file (this_file); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
977 #ifdef VMS |
240 | 978 } |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
979 #endif |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
980 break; |
240 | 981 } |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
982 } |
10761
7aa80669e697
* etags.c (C_entries): Bug corrected in xrealloc of token_str.
Francesco Potortì <pot@gnu.org>
parents:
10754
diff
changeset
|
983 |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
984 if (!CTAGS) |
240 | 985 { |
401 | 986 while (nincluded_files-- > 0) |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
987 fprintf (tagf, "\f\n%s,include\n", *included_files++); |
401 | 988 |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
989 fclose (tagf); |
5940
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
990 exit (GOOD); |
240 | 991 } |
992 | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
993 /* If CTAGS, we are here. process_file did not write the tags yet, |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
994 because we want them ordered. Let's do it now. */ |
240 | 995 if (cxref_style) |
996 { | |
997 put_entries (head); | |
998 exit (GOOD); | |
999 } | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1000 |
621 | 1001 if (update) |
240 | 1002 { |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1003 char cmd[BUFSIZ]; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1004 for (i = 0; i < current_arg; ++i) |
240 | 1005 { |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1006 if (argbuffer[i].arg_type != at_filename) |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1007 continue; |
240 | 1008 sprintf (cmd, |
1009 "mv %s OTAGS;fgrep -v '\t%s\t' OTAGS >%s;rm OTAGS", | |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1010 tagfile, argbuffer[i].what, tagfile); |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1011 if (system (cmd) != GOOD) |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
1012 fatal ("failed to execute shell command", (char *)NULL); |
240 | 1013 } |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1014 append_to_tagfile = TRUE; |
240 | 1015 } |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1016 |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1017 tagf = fopen (tagfile, append_to_tagfile ? "a" : "w"); |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1018 if (tagf == NULL) |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1019 pfatal (tagfile); |
240 | 1020 put_entries (head); |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1021 fclose (tagf); |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1022 |
240 | 1023 if (update) |
1024 { | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1025 char cmd[BUFSIZ]; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1026 sprintf (cmd, "sort %s -o %s", tagfile, tagfile); |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1027 exit (system (cmd)); |
240 | 1028 } |
16373
d50369f4bb41
* etags.c (print_version): Print copyright info.
Francesco Potortì <pot@gnu.org>
parents:
16086
diff
changeset
|
1029 return GOOD; |
240 | 1030 } |
1031 | |
1032 | |
1033 /* | |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1034 * Return a Lang_function given the name. |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1035 */ |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1036 Lang_function * |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1037 get_language_from_name (name) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1038 char *name; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1039 { |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1040 struct lang_entry *lang; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1041 |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1042 if (name != NULL) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1043 for (lang = lang_names; lang->name != NULL; lang++) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1044 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1045 if (streq (name, lang->name)) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1046 return lang->function; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1047 } |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1048 |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
1049 error ("language \"%s\" not recognized.", optarg); |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1050 suggest_asking_for_help (); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1051 |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1052 /* This point should never be reached. The function should either |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1053 return a function pointer or never return. Note that a NULL |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1054 pointer cannot be considered as an error, as it means that the |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1055 language has not been explicitely imposed by the user ("auto"). */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1056 return NULL; /* avoid warnings from compiler */ |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1057 } |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1058 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1059 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1060 /* |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1061 * Return a Lang_function given the interpreter name. |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1062 */ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1063 Lang_function * |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1064 get_language_from_interpreter (interpreter) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1065 char *interpreter; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1066 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1067 struct lang_entry *lang; |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1068 char **iname; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1069 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1070 if (interpreter == NULL) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1071 return NULL; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1072 for (lang = lang_names; lang->name != NULL; lang++) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1073 if (lang->interpreters != NULL) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1074 for (iname = lang->interpreters; *iname != NULL; iname++) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1075 if (streq (*iname, interpreter)) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1076 return lang->function; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1077 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1078 return NULL; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1079 } |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1080 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1081 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1082 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1083 /* |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1084 * Return a Lang_function given the file suffix. |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1085 */ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1086 Lang_function * |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1087 get_language_from_suffix (suffix) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1088 char *suffix; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1089 { |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1090 struct lang_entry *lang; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1091 char **ext; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1092 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1093 if (suffix == NULL) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1094 return NULL; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1095 for (lang = lang_names; lang->name != NULL; lang++) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1096 if (lang->suffixes != NULL) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1097 for (ext = lang->suffixes; *ext != NULL; ext++) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1098 if (streq (*ext, suffix)) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1099 return lang->function; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1100 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1101 return NULL; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1102 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1103 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1104 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1105 /* |
240 | 1106 * This routine is called on each file argument. |
1107 */ | |
1108 void | |
1109 process_file (file) | |
1110 char *file; | |
1111 { | |
1112 struct stat stat_buf; | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1113 FILE *inf; |
14920
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
1114 #ifdef DOS_NT |
15243
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
1115 char *p; |
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
1116 |
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
1117 for (p = file; *p != '\0'; p++) |
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
1118 if (*p == '\\') |
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
1119 *p = '/'; |
14920
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
1120 #endif |
240 | 1121 |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1122 if (stat (file, &stat_buf) == 0 && !S_ISREG (stat_buf.st_mode)) |
240 | 1123 { |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
1124 error ("Skipping %s: it is not a regular file.", file); |
240 | 1125 return; |
1126 } | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1127 if (streq (file, tagfile) && !streq (tagfile, "-")) |
240 | 1128 { |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
1129 error ("Skipping inclusion of %s in self.", file); |
240 | 1130 return; |
1131 } | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1132 inf = fopen (file, "r"); |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1133 if (inf == NULL) |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1134 { |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1135 perror (file); |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1136 return; |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1137 } |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1138 |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1139 find_entries (file, inf); |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1140 |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
1141 if (!CTAGS) |
240 | 1142 { |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1143 char *filename; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1144 |
12344
7e7941d8cceb
* etags.c (find_entries): rewind before rereading the input file.
Francesco Potortì <pot@gnu.org>
parents:
12242
diff
changeset
|
1145 if (absolutefn (file)) |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1146 { |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
1147 /* file is an absolute file name. Canonicalise it. */ |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1148 filename = absolute_filename (file, cwd); |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1149 } |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1150 else |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1151 { |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
1152 /* file is a file name relative to cwd. Make it relative |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1153 to the directory of the tags file. */ |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1154 filename = relative_filename (file, tagfiledir); |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1155 } |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1156 fprintf (tagf, "\f\n%s,%d\n", filename, total_size_of_entries (head)); |
10990
c0ceaa45ded7
* etags.c (process_file): free (filename) after using it.
Francesco Potortì <pot@gnu.org>
parents:
10801
diff
changeset
|
1157 free (filename); |
240 | 1158 put_entries (head); |
1159 free_tree (head); | |
1160 head = NULL; | |
1161 } | |
1162 } | |
1163 | |
1164 /* | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3569
diff
changeset
|
1165 * This routine sets up the boolean pseudo-functions which work |
2004
6469a137fea6
(C_entries): New local variable quotednl. Used for
Richard M. Stallman <rms@gnu.org>
parents:
1938
diff
changeset
|
1166 * by setting boolean flags dependent upon the corresponding character |
240 | 1167 * Every char which is NOT in that string is not a white char. Therefore, |
1168 * all of the array "_wht" is set to FALSE, and then the elements | |
1169 * subscripted by the chars in "white" are set to TRUE. Thus "_wht" | |
1170 * of a char is TRUE if it is the string "white", else FALSE. | |
1171 */ | |
1172 void | |
1173 init () | |
1174 { | |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1175 register char *sp; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1176 register int i; |
240 | 1177 |
1178 for (i = 0; i < 0177; i++) | |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1179 _wht[i] = _etk[i] = _itk[i] = _btk[i] = FALSE; |
240 | 1180 for (sp = white; *sp; sp++) |
1181 _wht[*sp] = TRUE; | |
1182 for (sp = endtk; *sp; sp++) | |
1183 _etk[*sp] = TRUE; | |
1184 for (sp = intk; *sp; sp++) | |
1185 _itk[*sp] = TRUE; | |
1186 for (sp = begtk; *sp; sp++) | |
1187 _btk[*sp] = TRUE; | |
1188 _wht[0] = _wht['\n']; | |
1189 _etk[0] = _etk['\n']; | |
1190 _btk[0] = _btk['\n']; | |
1191 _itk[0] = _itk['\n']; | |
1192 } | |
1193 | |
1194 /* | |
1195 * This routine opens the specified file and calls the function | |
1196 * which finds the function and type definitions. | |
1197 */ | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1198 void |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1199 find_entries (file, inf) |
240 | 1200 char *file; |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1201 FILE *inf; |
240 | 1202 { |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1203 char *cp; |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1204 Lang_function *function; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1205 NODE *old_last_node; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1206 extern NODE *last_node; |
240 | 1207 |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1208 |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
1209 /* Memory leakage here: the memory block pointed by curfile is never |
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
1210 released. The amount of memory leaked here is the sum of the |
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
1211 lengths of the input file names. */ |
240 | 1212 curfile = savestr (file); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1213 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1214 /* If user specified a language, use it. */ |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1215 function = lang_func; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1216 if (function != NULL) |
240 | 1217 { |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1218 function (inf); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1219 fclose (inf); |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1220 return; |
240 | 1221 } |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1222 |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1223 cp = etags_strrchr (file, '.'); |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1224 if (cp != NULL) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1225 { |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1226 cp += 1; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1227 function = get_language_from_suffix (cp); |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1228 if (function != NULL) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1229 { |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1230 function (inf); |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1231 fclose (inf); |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1232 return; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1233 } |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1234 } |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1235 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1236 /* Look for sharp-bang as the first two characters. */ |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
1237 if (readline_internal (&lb, inf) |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
1238 && lb.len >= 2 |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1239 && lb.buffer[0] == '#' |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1240 && lb.buffer[1] == '!') |
240 | 1241 { |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1242 char *lp; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1243 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1244 /* Set lp to point at the first char after the last slash in the |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1245 line or, if no slashes, at the first nonblank. Then set cp to |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1246 the first successive blank and terminate the string. */ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1247 lp = etags_strrchr (lb.buffer+2, '/'); |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1248 if (lp != NULL) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1249 lp += 1; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1250 else |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1251 for (lp = lb.buffer+2; *lp != '\0' && isspace (*lp); lp++) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1252 continue; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1253 for (cp = lp; *cp != '\0' && !isspace (*cp); cp++) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1254 continue; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1255 *cp = '\0'; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1256 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1257 if (strlen (lp) > 0) |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1258 { |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1259 function = get_language_from_interpreter (lp); |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1260 if (function != NULL) |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1261 { |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1262 function (inf); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1263 fclose (inf); |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1264 return; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1265 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1266 } |
240 | 1267 } |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1268 rewind (inf); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1269 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1270 /* Try Fortran. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1271 old_last_node = last_node; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1272 Fortran_functions (inf); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1273 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1274 /* No Fortran entries found. Try C. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1275 if (old_last_node == last_node) |
12344
7e7941d8cceb
* etags.c (find_entries): rewind before rereading the input file.
Francesco Potortì <pot@gnu.org>
parents:
12242
diff
changeset
|
1276 { |
7e7941d8cceb
* etags.c (find_entries): rewind before rereading the input file.
Francesco Potortì <pot@gnu.org>
parents:
12242
diff
changeset
|
1277 rewind (inf); |
7e7941d8cceb
* etags.c (find_entries): rewind before rereading the input file.
Francesco Potortì <pot@gnu.org>
parents:
12242
diff
changeset
|
1278 default_C_entries (inf); |
7e7941d8cceb
* etags.c (find_entries): rewind before rereading the input file.
Francesco Potortì <pot@gnu.org>
parents:
12242
diff
changeset
|
1279 } |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1280 fclose (inf); |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
1281 return; |
240 | 1282 } |
1283 | |
1284 /* Record a tag. */ | |
1285 void | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
1286 pfnote (name, is_func, linestart, linelen, lno, cno) |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1287 char *name; /* tag name, or NULL if unnamed */ |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1288 logical is_func; /* tag is a function */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1289 char *linestart; /* start of the line where tag is */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1290 int linelen; /* length of the line where tag is */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1291 int lno; /* line number */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1292 long cno; /* character number */ |
240 | 1293 { |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1294 register NODE *np; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1295 |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1296 if (CTAGS && name == NULL) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1297 return; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1298 |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1299 np = xnew (1, NODE); |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1300 |
240 | 1301 /* If ctags mode, change name "main" to M<thisfilename>. */ |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
1302 if (CTAGS && !cxref_style && streq (name, "main")) |
240 | 1303 { |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
1304 register char *fp = etags_strrchr (curfile, '/'); |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1305 np->name = concat ("M", fp == 0 ? curfile : fp + 1, ""); |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1306 fp = etags_strrchr (np->name, '.'); |
240 | 1307 if (fp && fp[1] != '\0' && fp[2] == '\0') |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1308 fp[0] = 0; |
240 | 1309 } |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1310 else |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
1311 np->name = name; |
10623
8a73e71a55e3
* etags.c (pfnote): Initialise been_warned in the node.
Francesco Potortì <pot@gnu.org>
parents:
10449
diff
changeset
|
1312 np->been_warned = FALSE; |
240 | 1313 np->file = curfile; |
1314 np->is_func = is_func; | |
1315 np->lno = lno; | |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
1316 /* Our char numbers are 0-base, because of C language tradition? |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
1317 ctags compatibility? old versions compatibility? I don't know. |
14021
19bab04cf346
(substitute): Fix spelling in message.
Karl Heuer <kwzh@gnu.org>
parents:
13696
diff
changeset
|
1318 Anyway, since emacs's are 1-base we expect etags.el to take care |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
1319 of the difference. If we wanted to have 1-based numbers, we would |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
1320 uncomment the +1 below. */ |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
1321 np->cno = cno /* + 1 */ ; |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1322 np->left = np->right = NULL; |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1323 if (CTAGS && !cxref_style) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1324 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1325 if (strlen (linestart) < 50) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1326 np->pat = concat (linestart, "$", ""); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1327 else |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1328 np->pat = savenstr (linestart, 50); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1329 } |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1330 else |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1331 np->pat = savenstr (linestart, linelen); |
240 | 1332 |
1333 add_node (np, &head); | |
1334 } | |
1335 | |
1336 /* | |
1337 * free_tree () | |
1338 * recurse on left children, iterate on right children. | |
1339 */ | |
1340 void | |
1341 free_tree (node) | |
1342 register NODE *node; | |
1343 { | |
1344 while (node) | |
1345 { | |
1346 register NODE *node_right = node->right; | |
1347 free_tree (node->left); | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
1348 if (node->name != NULL) |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1349 free (node->name); |
240 | 1350 free (node->pat); |
1351 free ((char *) node); | |
1352 node = node_right; | |
1353 } | |
1354 } | |
1355 | |
1356 /* | |
1357 * add_node () | |
1358 * Adds a node to the tree of nodes. In etags mode, we don't keep | |
1359 * it sorted; we just keep a linear list. In ctags mode, maintain | |
1360 * an ordered tree, with no attempt at balancing. | |
1361 * | |
1362 * add_node is the only function allowed to add nodes, so it can | |
1363 * maintain state. | |
1364 */ | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1365 NODE *last_node = NULL; |
240 | 1366 void |
1367 add_node (node, cur_node_p) | |
1368 NODE *node, **cur_node_p; | |
1369 { | |
1370 register int dif; | |
1371 register NODE *cur_node = *cur_node_p; | |
1372 | |
1373 if (cur_node == NULL) | |
1374 { | |
1375 *cur_node_p = node; | |
1376 last_node = node; | |
1377 return; | |
1378 } | |
1379 | |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
1380 if (!CTAGS) |
240 | 1381 { |
1382 /* Etags Mode */ | |
5940
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
1383 if (last_node == NULL) |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
1384 fatal ("internal error in add_node", (char *)NULL); |
240 | 1385 last_node->right = node; |
1386 last_node = node; | |
1387 } | |
1388 else | |
1389 { | |
1390 /* Ctags Mode */ | |
1391 dif = strcmp (node->name, cur_node->name); | |
1392 | |
1393 /* | |
1394 * If this tag name matches an existing one, then | |
1395 * do not add the node, but maybe print a warning. | |
1396 */ | |
1397 if (!dif) | |
1398 { | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
1399 if (streq (node->file, cur_node->file)) |
240 | 1400 { |
1401 if (!no_warnings) | |
1402 { | |
1403 fprintf (stderr, "Duplicate entry in file %s, line %d: %s\n", | |
1404 node->file, lineno, node->name); | |
1405 fprintf (stderr, "Second entry ignored\n"); | |
1406 } | |
1407 } | |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
1408 else if (!cur_node->been_warned && !no_warnings) |
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
1409 { |
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
1410 fprintf |
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
1411 (stderr, |
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
1412 "Duplicate entry in files %s and %s: %s (Warning only)\n", |
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
1413 node->file, cur_node->file, node->name); |
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
1414 cur_node->been_warned = TRUE; |
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
1415 } |
240 | 1416 return; |
1417 } | |
1418 | |
1419 /* Actually add the node */ | |
1420 add_node (node, dif < 0 ? &cur_node->left : &cur_node->right); | |
1421 } | |
1422 } | |
1423 | |
1424 void | |
1425 put_entries (node) | |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1426 register NODE *node; |
240 | 1427 { |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1428 register char *sp; |
240 | 1429 |
1430 if (node == NULL) | |
1431 return; | |
1432 | |
1433 /* Output subentries that precede this one */ | |
1434 put_entries (node->left); | |
1435 | |
1436 /* Output this entry */ | |
1437 | |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
1438 if (!CTAGS) |
240 | 1439 { |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
1440 if (node->name != NULL) |
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
1441 fprintf (tagf, "%s\177%s\001%d,%d\n", |
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
1442 node->pat, node->name, node->lno, node->cno); |
240 | 1443 else |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
1444 fprintf (tagf, "%s\177%d,%d\n", |
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
1445 node->pat, node->lno, node->cno); |
240 | 1446 } |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1447 else |
240 | 1448 { |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1449 if (node->name == NULL) |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
1450 error ("internal error: NULL name in ctags mode.", (char *)NULL); |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1451 |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1452 if (cxref_style) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1453 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1454 if (vgrind_style) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1455 fprintf (stdout, "%s %s %d\n", |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1456 node->name, node->file, (node->lno + 63) / 64); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1457 else |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1458 fprintf (stdout, "%-16s %3d %-16s %s\n", |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1459 node->name, node->lno, node->file, node->pat); |
240 | 1460 } |
1461 else | |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1462 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1463 fprintf (tagf, "%s\t%s\t", node->name, node->file); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1464 |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1465 if (node->is_func) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1466 { /* a function */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1467 putc (searchar, tagf); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1468 putc ('^', tagf); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1469 |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1470 for (sp = node->pat; *sp; sp++) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1471 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1472 if (*sp == '\\' || *sp == searchar) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1473 putc ('\\', tagf); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1474 putc (*sp, tagf); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1475 } |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1476 putc (searchar, tagf); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1477 } |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1478 else |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1479 { /* a typedef; text pattern inadequate */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1480 fprintf (tagf, "%d", node->lno); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1481 } |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1482 putc ('\n', tagf); |
240 | 1483 } |
1484 } | |
1485 | |
1486 /* Output subentries that follow this one */ | |
1487 put_entries (node->right); | |
1488 } | |
1489 | |
1490 /* Length of a number's decimal representation. */ | |
1491 int | |
1492 number_len (num) | |
1493 long num; | |
1494 { | |
1495 int len = 0; | |
1496 if (!num) | |
1497 return 1; | |
1498 for (; num; num /= 10) | |
1499 ++len; | |
1500 return len; | |
1501 } | |
1502 | |
1503 /* | |
1504 * Return total number of characters that put_entries will output for | |
6530
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
1505 * the nodes in the subtree of the specified node. Works only if |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
1506 * we are not ctags, but called only in that case. This count |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
1507 * is irrelevant with the new tags.el, but is still supplied for |
12e47da67bb5
* etags.c (emacs_tags_format, ETAGS): removed. Use CTAGS instead.
Francesco Potortì <pot@gnu.org>
parents:
6482
diff
changeset
|
1508 * backward compatibility. |
240 | 1509 */ |
1510 int | |
1511 total_size_of_entries (node) | |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1512 register NODE *node; |
240 | 1513 { |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1514 register int total; |
240 | 1515 |
1516 if (node == NULL) | |
1517 return 0; | |
1518 | |
1519 total = 0; | |
1520 for (; node; node = node->right) | |
1521 { | |
1522 /* Count left subentries. */ | |
1523 total += total_size_of_entries (node->left); | |
1524 | |
1525 /* Count this entry */ | |
1526 total += strlen (node->pat) + 1; | |
1527 total += number_len ((long) node->lno) + 1 + number_len (node->cno) + 1; | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
1528 if (node->name != NULL) |
240 | 1529 total += 1 + strlen (node->name); /* \001name */ |
1530 } | |
1531 | |
1532 return total; | |
1533 } | |
1534 | |
1535 /* | |
1536 * The C symbol tables. | |
1537 */ | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1538 enum sym_type |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1539 { |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1540 st_none, st_C_objprot, st_C_objimpl, st_C_objend, st_C_gnumacro, |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1541 st_C_struct, st_C_enum, st_C_define, st_C_typedef, st_C_typespec, |
17785
5b92f8ba5c6d
Added support for the Java language.
Francesco Potortì <pot@gnu.org>
parents:
17778
diff
changeset
|
1542 st_C_javastruct |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1543 }; |
240 | 1544 |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1545 /* Feed stuff between (but not including) %[ and %] lines to: |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1546 gperf -c -k 1,3 -o -p -r -t |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1547 %[ |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1548 struct C_stab_entry { char *name; int c_ext; enum sym_type type; } |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1549 %% |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1550 @interface, 0, st_C_objprot |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1551 @protocol, 0, st_C_objprot |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1552 @implementation,0, st_C_objimpl |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1553 @end, 0, st_C_objend |
17785
5b92f8ba5c6d
Added support for the Java language.
Francesco Potortì <pot@gnu.org>
parents:
17778
diff
changeset
|
1554 extends, C_JAVA, st_C_javastruct |
5b92f8ba5c6d
Added support for the Java language.
Francesco Potortì <pot@gnu.org>
parents:
17778
diff
changeset
|
1555 implements, C_JAVA, st_C_javastruct |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1556 class, C_PLPL, st_C_struct |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1557 namespace, C_PLPL, st_C_struct |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1558 domain, C_STAR, st_C_struct |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1559 union, 0, st_C_struct |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1560 struct, 0, st_C_struct |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1561 enum, 0, st_C_enum |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1562 typedef, 0, st_C_typedef |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1563 define, 0, st_C_define |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1564 bool, C_PLPL, st_C_typespec |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1565 long, 0, st_C_typespec |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1566 short, 0, st_C_typespec |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1567 int, 0, st_C_typespec |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1568 char, 0, st_C_typespec |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1569 float, 0, st_C_typespec |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1570 double, 0, st_C_typespec |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1571 signed, 0, st_C_typespec |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1572 unsigned, 0, st_C_typespec |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1573 auto, 0, st_C_typespec |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1574 void, 0, st_C_typespec |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1575 extern, 0, st_C_typespec |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1576 static, 0, st_C_typespec |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1577 const, 0, st_C_typespec |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1578 volatile, 0, st_C_typespec |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1579 explicit, C_PLPL, st_C_typespec |
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1580 mutable, C_PLPL, st_C_typespec |
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1581 typename, C_PLPL, st_C_typespec |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1582 # DEFUN used in emacs, the next three used in glibc (SYSCALL only for mach). |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1583 DEFUN, 0, st_C_gnumacro |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1584 SYSCALL, 0, st_C_gnumacro |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1585 ENTRY, 0, st_C_gnumacro |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1586 PSEUDO, 0, st_C_gnumacro |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1587 # These are defined inside C functions, so currently they are not met. |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1588 # EXFUN used in glibc, DEFVAR_* in emacs. |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1589 #EXFUN, 0, st_C_gnumacro |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1590 #DEFVAR_, 0, st_C_gnumacro |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1591 %] |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1592 and replace lines between %< and %> with its output. */ |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1593 /*%<*/ |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1594 /* C code produced by gperf version 2.1 (K&R C version) */ |
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1595 /* Command-line: gperf -c -k 1,3 -o -p -r -t */ |
240 | 1596 |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1597 |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1598 struct C_stab_entry { char *name; int c_ext; enum sym_type type; }; |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1599 |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1600 #define MIN_WORD_LENGTH 3 |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1601 #define MAX_WORD_LENGTH 15 |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1602 #define MIN_HASH_VALUE 33 |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1603 #define MAX_HASH_VALUE 126 |
240 | 1604 /* |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1605 36 keywords |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1606 94 is the maximum key range |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1607 */ |
240 | 1608 |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1609 int |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1610 hash (str, len) |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1611 register char *str; |
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1612 register unsigned int len; |
240 | 1613 { |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1614 static unsigned char hash_table[] = |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1615 { |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1616 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1617 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1618 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1619 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1620 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1621 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1622 126, 126, 126, 126, 15, 126, 126, 126, 53, 24, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1623 41, 126, 126, 126, 126, 126, 126, 126, 126, 126, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1624 51, 126, 126, 26, 47, 126, 126, 126, 126, 126, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1625 126, 126, 126, 126, 126, 126, 126, 11, 36, 26, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1626 35, 13, 22, 39, 126, 34, 126, 126, 43, 21, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1627 36, 6, 49, 126, 47, 61, 28, 57, 35, 126, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1628 126, 126, 126, 126, 126, 126, 126, 126, |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1629 }; |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1630 return len + hash_table[str[2]] + hash_table[str[0]]; |
240 | 1631 } |
1632 | |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1633 struct C_stab_entry * |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1634 in_word_set (str, len) |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1635 register char *str; |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1636 register unsigned int len; |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1637 { |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1638 |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1639 static struct C_stab_entry wordlist[] = |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1640 { |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1641 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, |
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1642 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, |
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1643 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1644 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1645 {"float", 0, st_C_typespec}, |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1646 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1647 {"char", 0, st_C_typespec}, |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1648 {"class", C_PLPL, st_C_struct}, |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1649 {"auto", 0, st_C_typespec}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1650 {"",}, {"",}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1651 {"bool", C_PLPL, st_C_typespec}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1652 {"extern", 0, st_C_typespec}, |
17785
5b92f8ba5c6d
Added support for the Java language.
Francesco Potortì <pot@gnu.org>
parents:
17778
diff
changeset
|
1653 {"extends", C_JAVA, st_C_javastruct}, |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1654 {"",}, {"",}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1655 {"@implementation", 0, st_C_objimpl}, |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1656 {"",}, {"",}, {"",}, |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1657 {"@end", 0, st_C_objend}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1658 {"mutable", C_PLPL, st_C_typespec}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1659 {"",}, {"",}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1660 {"SYSCALL", 0, st_C_gnumacro}, |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1661 {"",}, |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1662 {"@interface", 0, st_C_objprot}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1663 {"domain", C_STAR, st_C_struct}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1664 {"define", 0, st_C_define}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1665 {"",}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1666 {"int", 0, st_C_typespec}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1667 {"namespace", C_PLPL, st_C_struct}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1668 {"const", 0, st_C_typespec}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1669 {"",}, {"",}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1670 {"explicit", C_PLPL, st_C_typespec}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1671 {"@protocol", 0, st_C_objprot}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1672 {"short", 0, st_C_typespec}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1673 {"void", 0, st_C_typespec}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1674 {"enum", 0, st_C_enum}, |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1675 {"",}, |
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1676 {"ENTRY", 0, st_C_gnumacro}, |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1677 {"",}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1678 {"static", 0, st_C_typespec}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1679 {"",}, {"",}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1680 {"PSEUDO", 0, st_C_gnumacro}, |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1681 {"",}, |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1682 {"long", 0, st_C_typespec}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1683 {"typedef", 0, st_C_typedef}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1684 {"typename", C_PLPL, st_C_typespec}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1685 {"volatile", 0, st_C_typespec}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1686 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, |
17785
5b92f8ba5c6d
Added support for the Java language.
Francesco Potortì <pot@gnu.org>
parents:
17778
diff
changeset
|
1687 {"implements", C_JAVA, st_C_javastruct}, |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1688 {"",}, {"",}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1689 {"union", 0, st_C_struct}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1690 {"",}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1691 {"double", 0, st_C_typespec}, |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1692 {"DEFUN", 0, st_C_gnumacro}, |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1693 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1694 {"signed", 0, st_C_typespec}, |
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1695 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, |
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1696 {"struct", 0, st_C_struct}, |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1697 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1698 {"",}, {"",}, |
15579
690a439bcc0e
* etags.c (C_stab_entry): New keywords for C++ namespace, bool,
Francesco Potortì <pot@gnu.org>
parents:
15407
diff
changeset
|
1699 {"unsigned", 0, st_C_typespec}, |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1700 }; |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1701 |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1702 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1703 { |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1704 register int key = hash (str, len); |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1705 |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1706 if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE) |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1707 { |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1708 register char *s = wordlist[key].name; |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1709 |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1710 if (*s == *str && !strncmp (str + 1, s + 1, len - 1)) |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1711 return &wordlist[key]; |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1712 } |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1713 } |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1714 return 0; |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1715 } |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1716 /*%>*/ |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1717 |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1718 enum sym_type |
16573
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
1719 C_symtype (str, len, c_ext) |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1720 char *str; |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1721 int len; |
240 | 1722 int c_ext; |
1723 { | |
16573
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
1724 register struct C_stab_entry *se = in_word_set (str, len); |
240 | 1725 |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1726 if (se == NULL || (se->c_ext && !(c_ext & se->c_ext))) |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1727 return st_none; |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1728 return se->type; |
240 | 1729 } |
1730 | |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1731 /* |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1732 * C functions are recognized using a simple finite automaton. |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1733 * funcdef is its state variable. |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1734 */ |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1735 enum |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1736 { |
4663
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
1737 fnone, /* nothing seen */ |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
1738 ftagseen, /* function-like tag seen */ |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
1739 fstartlist, /* just after open parenthesis */ |
4663
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
1740 finlist, /* in parameter list */ |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
1741 flistseen, /* after parameter list */ |
5044
d3bd7baee39f
(FUNCST, TYPEDST, STRUCTST, DEFINEST): Delete excess commas.
Richard M. Stallman <rms@gnu.org>
parents:
4937
diff
changeset
|
1742 fignore /* before open brace */ |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1743 } funcdef; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1744 |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1745 |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1746 /* |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1747 * typedefs are recognized using a simple finite automaton. |
14021
19bab04cf346
(substitute): Fix spelling in message.
Karl Heuer <kwzh@gnu.org>
parents:
13696
diff
changeset
|
1748 * typdef is its state variable. |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1749 */ |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1750 enum |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1751 { |
4663
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
1752 tnone, /* nothing seen */ |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
1753 ttypedseen, /* typedef keyword seen */ |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
1754 tinbody, /* inside typedef body */ |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1755 tend, /* just before typedef tag */ |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1756 tignore /* junk after typedef tag */ |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1757 } typdef; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1758 |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1759 |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
1760 /* |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1761 * struct-like structures (enum, struct and union) are recognized |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1762 * using another simple finite automaton. `structdef' is its state |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1763 * variable. |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1764 */ |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1765 enum |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1766 { |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1767 snone, /* nothing seen yet */ |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1768 skeyseen, /* struct-like keyword seen */ |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1769 stagseen, /* struct-like tag seen */ |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1770 scolonseen, /* colon seen after struct-like tag */ |
5044
d3bd7baee39f
(FUNCST, TYPEDST, STRUCTST, DEFINEST): Delete excess commas.
Richard M. Stallman <rms@gnu.org>
parents:
4937
diff
changeset
|
1771 sinbody /* in struct body: recognize member func defs*/ |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1772 } structdef; |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
1773 |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1774 /* |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1775 * When structdef is stagseen, scolonseen, or sinbody, structtag is the |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
1776 * struct tag, and structtype is the type of the preceding struct-like |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1777 * keyword. |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1778 */ |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1779 char *structtag = "<uninited>"; |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
1780 enum sym_type structtype; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1781 |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1782 /* |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1783 * When objdef is different from onone, objtag is the name of the class. |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1784 */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1785 char *objtag = "<uninited>"; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1786 |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1787 /* |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1788 * Yet another little state machine to deal with preprocessor lines. |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1789 */ |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1790 enum |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1791 { |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1792 dnone, /* nothing seen */ |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1793 dsharpseen, /* '#' seen as first char on line */ |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1794 ddefineseen, /* '#' and 'define' seen */ |
5044
d3bd7baee39f
(FUNCST, TYPEDST, STRUCTST, DEFINEST): Delete excess commas.
Richard M. Stallman <rms@gnu.org>
parents:
4937
diff
changeset
|
1795 dignorerest /* ignore rest of line */ |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1796 } definedef; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1797 |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1798 /* |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1799 * State machine for Objective C protocols and implementations. |
17785
5b92f8ba5c6d
Added support for the Java language.
Francesco Potortì <pot@gnu.org>
parents:
17778
diff
changeset
|
1800 * Tom R.Hageman <tom@basil.icce.rug.nl> |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1801 */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1802 enum |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1803 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1804 onone, /* nothing seen */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1805 oprotocol, /* @interface or @protocol seen */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1806 oimplementation, /* @implementations seen */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1807 otagseen, /* class name seen */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1808 oparenseen, /* parenthesis before category seen */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1809 ocatseen, /* category name seen */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1810 oinbody, /* in @implementation body */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1811 omethodsign, /* in @implementation body, after +/- */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1812 omethodtag, /* after method name */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1813 omethodcolon, /* after method colon */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1814 omethodparm, /* after method parameter */ |
14230
6b836f84bccf
(enum sym_type, anonymous enum): Delete final comma.
Karl Heuer <kwzh@gnu.org>
parents:
14186
diff
changeset
|
1815 oignore /* wait for @end */ |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1816 } objdef; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1817 |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1818 /* |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1819 * Set this to TRUE, and the next token considered is called a function. |
10378
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
1820 * Used only for GNU emacs's function-defining macros. |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1821 */ |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1822 logical next_token_is_func; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1823 |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1824 /* |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1825 * TRUE in the rules part of a yacc file, FALSE outside (parse as C). |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1826 */ |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1827 logical yacc_rules; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
1828 |
240 | 1829 /* |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1830 * methodlen is the length of the method name stored in token_name. |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1831 */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1832 int methodlen; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1833 |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1834 /* |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1835 * consider_token () |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1836 * checks to see if the current token is at the start of a |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1837 * function, or corresponds to a typedef, or is a struct/union/enum |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
1838 * tag, or #define, or an enum constant. |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1839 * |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
1840 * *IS_FUNC gets TRUE iff the token is a function or #define macro |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
1841 * with args. C_EXT is which language we are looking at. |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1842 * |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1843 * In the future we will need some way to adjust where the end of |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1844 * the token is; for instance, implementing the C++ keyword |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1845 * `operator' properly will adjust the end of the token to be after |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1846 * whatever follows `operator'. |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1847 * |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1848 * Globals |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1849 * funcdef IN OUT |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1850 * structdef IN OUT |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1851 * definedef IN OUT |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1852 * typdef IN OUT |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1853 * objdef IN OUT |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1854 * next_token_is_func IN OUT |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1855 */ |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1856 |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1857 logical |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1858 consider_token (str, len, c, c_ext, cblev, parlev, is_func) |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1859 register char *str; /* IN: token pointer */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1860 register int len; /* IN: token length */ |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1861 register char c; /* IN: first char after the token */ |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1862 int c_ext; /* IN: C extensions mask */ |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1863 int cblev; /* IN: curly brace level */ |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
1864 int parlev; /* IN: parenthesis level */ |
9635
8defeb29b293
* etags.c (prestr, substr): return a logical type.
Francesco Potortì <pot@gnu.org>
parents:
9621
diff
changeset
|
1865 logical *is_func; /* OUT: function found */ |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1866 { |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1867 enum sym_type toktype = C_symtype (str, len, c_ext); |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1868 |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1869 /* |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1870 * Advance the definedef state machine. |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1871 */ |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1872 switch (definedef) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1873 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1874 case dnone: |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1875 /* We're not on a preprocessor line. */ |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1876 break; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1877 case dsharpseen: |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1878 if (toktype == st_C_define) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1879 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1880 definedef = ddefineseen; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1881 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1882 else |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1883 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1884 definedef = dignorerest; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1885 } |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1886 return FALSE; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1887 case ddefineseen: |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1888 /* |
9193
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
1889 * Make a tag for any macro, unless it is a constant |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
1890 * and constantypedefs is FALSE. |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1891 */ |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1892 definedef = dignorerest; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1893 *is_func = (c == '('); |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1894 if (!*is_func && !constantypedefs) |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1895 return FALSE; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1896 else |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1897 return TRUE; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1898 case dignorerest: |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1899 return FALSE; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1900 default: |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
1901 error ("internal error: definedef value.", (char *)NULL); |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1902 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1903 |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1904 /* |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1905 * Now typedefs |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1906 */ |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1907 switch (typdef) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1908 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1909 case tnone: |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1910 if (toktype == st_C_typedef) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1911 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1912 if (typedefs) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1913 typdef = ttypedseen; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1914 funcdef = fnone; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1915 return FALSE; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1916 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1917 break; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1918 case ttypedseen: |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1919 switch (toktype) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1920 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1921 case st_none: |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1922 case st_C_typespec: |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1923 typdef = tend; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1924 break; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1925 case st_C_struct: |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1926 case st_C_enum: |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1927 break; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1928 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1929 /* Do not return here, so the structdef stuff has a chance. */ |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1930 break; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1931 case tend: |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1932 switch (toktype) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1933 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1934 case st_C_typespec: |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1935 case st_C_struct: |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1936 case st_C_enum: |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1937 return FALSE; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1938 } |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1939 return TRUE; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1940 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1941 |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1942 /* |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1943 * This structdef business is currently only invoked when cblev==0. |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1944 * It should be recursively invoked whatever the curly brace level, |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1945 * and a stack of states kept, to allow for definitions of structs |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1946 * within structs. |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1947 * |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1948 * This structdef business is NOT invoked when we are ctags and the |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1949 * file is plain C. This is because a struct tag may have the same |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1950 * name as another tag, and this loses with ctags. |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1951 */ |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1952 switch (toktype) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1953 { |
17785
5b92f8ba5c6d
Added support for the Java language.
Francesco Potortì <pot@gnu.org>
parents:
17778
diff
changeset
|
1954 case st_C_javastruct: |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1955 if (structdef == stagseen) |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1956 structdef = scolonseen; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1957 return FALSE; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
1958 break; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1959 case st_C_struct: |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1960 case st_C_enum: |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1961 if (typdef == ttypedseen |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1962 || (typedefs_and_cplusplus && cblev == 0 && structdef == snone)) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1963 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1964 structdef = skeyseen; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1965 structtype = toktype; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1966 } |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1967 return FALSE; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1968 } |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
1969 |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1970 if (structdef == skeyseen) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1971 { |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1972 /* Save the tag for struct/union/class, for functions that may be |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1973 defined inside. */ |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1974 if (structtype == st_C_struct) |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1975 structtag = savenstr (str, len); |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1976 else |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
1977 structtag = "<enum>"; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1978 structdef = stagseen; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1979 return TRUE; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1980 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1981 |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1982 /* Avoid entering funcdef stuff if typdef is going on. */ |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1983 if (typdef != tnone) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1984 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1985 definedef = dnone; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
1986 return FALSE; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1987 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
1988 |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
1989 /* Detect GNU macros. |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
1990 |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
1991 DEFUN note for writers of emacs C code: |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
1992 The DEFUN macro, used in emacs C source code, has a first arg |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
1993 that is a string (the lisp function name), and a second arg that |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
1994 is a C function name. Since etags skips strings, the second arg |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
1995 is tagged. This is unfortunate, as it would be better to tag the |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
1996 first arg. The simplest way to deal with this problem would be |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
1997 to name the tag with a name built from the function name, by |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
1998 removing the initial 'F' character and substituting '-' for '_'. |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
1999 Anyway, this assumes that the conventions of naming lisp |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
2000 functions will never change. Currently, this method is not |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
2001 implemented, so writers of emacs code are recommended to put the |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
2002 first two args of a DEFUN on the same line. */ |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2003 if (definedef == dnone && toktype == st_C_gnumacro) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2004 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2005 next_token_is_func = TRUE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2006 return FALSE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2007 } |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2008 if (next_token_is_func) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2009 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2010 next_token_is_func = FALSE; |
9635
8defeb29b293
* etags.c (prestr, substr): return a logical type.
Francesco Potortì <pot@gnu.org>
parents:
9621
diff
changeset
|
2011 funcdef = fignore; |
8defeb29b293
* etags.c (prestr, substr): return a logical type.
Francesco Potortì <pot@gnu.org>
parents:
9621
diff
changeset
|
2012 *is_func = TRUE; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2013 return TRUE; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2014 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2015 |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
2016 /* Detect Objective C constructs. */ |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2017 switch (objdef) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2018 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2019 case onone: |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2020 switch (toktype) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2021 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2022 case st_C_objprot: |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2023 objdef = oprotocol; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2024 return FALSE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2025 case st_C_objimpl: |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2026 objdef = oimplementation; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2027 return FALSE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2028 } |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2029 break; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2030 case oimplementation: |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2031 /* Save the class tag for functions that may be defined inside. */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2032 objtag = savenstr (str, len); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2033 objdef = oinbody; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2034 return FALSE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2035 case oprotocol: |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2036 /* Save the class tag for categories. */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2037 objtag = savenstr (str, len); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2038 objdef = otagseen; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2039 *is_func = TRUE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2040 return TRUE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2041 case oparenseen: |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2042 objdef = ocatseen; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2043 *is_func = TRUE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2044 return TRUE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2045 case oinbody: |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2046 break; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2047 case omethodsign: |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2048 if (parlev == 0) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2049 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2050 objdef = omethodtag; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2051 methodlen = len; |
16573
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
2052 grow_linebuffer (&token_name, methodlen+1); |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2053 strncpy (token_name.buffer, str, len); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2054 token_name.buffer[methodlen] = '\0'; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2055 return TRUE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2056 } |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2057 return FALSE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2058 case omethodcolon: |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2059 if (parlev == 0) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2060 objdef = omethodparm; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2061 return FALSE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2062 case omethodparm: |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2063 if (parlev == 0) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2064 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2065 objdef = omethodtag; |
14144
beb39f795f21
(consider_token): Fix typo in expression.
Karl Heuer <kwzh@gnu.org>
parents:
14021
diff
changeset
|
2066 methodlen += len; |
16573
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
2067 grow_linebuffer (&token_name, methodlen+1); |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2068 strncat (token_name.buffer, str, len); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2069 return TRUE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2070 } |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2071 return FALSE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2072 case oignore: |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2073 if (toktype == st_C_objend) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2074 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2075 /* Memory leakage here: the string pointed by objtag is |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2076 never released, because many tests would be needed to |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2077 avoid breaking on incorrect input code. The amount of |
14021
19bab04cf346
(substitute): Fix spelling in message.
Karl Heuer <kwzh@gnu.org>
parents:
13696
diff
changeset
|
2078 memory leaked here is the sum of the lengths of the |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2079 class tags. |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2080 free (objtag); */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2081 objdef = onone; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2082 } |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2083 return FALSE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2084 } |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2085 |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
2086 /* A function or enum constant? */ |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2087 switch (toktype) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2088 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2089 case st_C_typespec: |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2090 if (funcdef != finlist && funcdef != fignore) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2091 funcdef = fnone; /* should be useless */ |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2092 return FALSE; |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
2093 case st_none: |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
2094 if (constantypedefs && structdef == sinbody && structtype == st_C_enum) |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
2095 return TRUE; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2096 if (funcdef == fnone) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2097 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2098 funcdef = ftagseen; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2099 *is_func = TRUE; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2100 return TRUE; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2101 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2102 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2103 |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2104 return FALSE; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2105 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2106 |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2107 /* |
240 | 2108 * C_entries () |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
2109 * This routine finds functions, typedefs, #define's, enum |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
2110 * constants and struct/union/enum definitions in C syntax |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
2111 * and adds them to the list. |
240 | 2112 */ |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2113 typedef struct |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2114 { |
10801
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
2115 logical valid; |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2116 char *str; |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2117 logical named; |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2118 int linelen; |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2119 int lineno; |
10754
cd1c0b5e8634
* etags.c (C_entries): Initialise the new members of TOKEN.
Francesco Potortì <pot@gnu.org>
parents:
10623
diff
changeset
|
2120 long linepos; |
cd1c0b5e8634
* etags.c (C_entries): Initialise the new members of TOKEN.
Francesco Potortì <pot@gnu.org>
parents:
10623
diff
changeset
|
2121 char *buffer; |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2122 } TOKEN; |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2123 |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2124 #define current_lb_is_new (newndx == curndx) |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2125 #define switch_line_buffers() (curndx = 1 - curndx) |
240 | 2126 |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2127 #define curlb (lbs[curndx].lb) |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2128 #define othlb (lbs[1-curndx].lb) |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2129 #define newlb (lbs[newndx].lb) |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2130 #define curlinepos (lbs[curndx].linepos) |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2131 #define othlinepos (lbs[1-curndx].linepos) |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2132 #define newlinepos (lbs[newndx].linepos) |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2133 |
240 | 2134 #define CNL_SAVE_DEFINEDEF \ |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2135 do { \ |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2136 curlinepos = charno; \ |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2137 lineno++; \ |
15243
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
2138 linecharno = charno; \ |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2139 charno += readline (&curlb, inf); \ |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2140 lp = curlb.buffer; \ |
2004
6469a137fea6
(C_entries): New local variable quotednl. Used for
Richard M. Stallman <rms@gnu.org>
parents:
1938
diff
changeset
|
2141 quotednl = FALSE; \ |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2142 newndx = curndx; \ |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2143 } while (0) |
240 | 2144 |
2145 #define CNL \ | |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2146 do { \ |
240 | 2147 CNL_SAVE_DEFINEDEF; \ |
10801
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
2148 if (savetok.valid) \ |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2149 { \ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2150 tok = savetok; \ |
10801
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
2151 savetok.valid = FALSE; \ |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2152 } \ |
240 | 2153 definedef = dnone; \ |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2154 } while (0) |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2155 |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2156 |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2157 void |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2158 make_C_tag (isfun, tokp) |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2159 logical isfun; |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2160 TOKEN *tokp; |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2161 { |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2162 char *name = NULL; |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2163 |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2164 /* This function should never be called when tok.valid is FALSE, but |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2165 we must protect against invalid input or internal errors. */ |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2166 if (tokp->valid) |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2167 { |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2168 if (CTAGS || tokp->named) |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2169 name = savestr (token_name.buffer); |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2170 pfnote (name, isfun, |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2171 tokp->buffer, tokp->linelen, tokp->lineno, tokp->linepos); |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2172 tokp->valid = FALSE; |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2173 } |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2174 else if (DEBUG) |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2175 abort (); |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2176 } |
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2177 |
240 | 2178 |
2179 void | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2180 C_entries (c_ext, inf) |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2181 int c_ext; /* extension of C */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2182 FILE *inf; /* input file */ |
240 | 2183 { |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2184 register char c; /* latest char read; '\0' for end of line */ |
240 | 2185 register char *lp; /* pointer one beyond the character `c' */ |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2186 int curndx, newndx; /* indices for current and new lb */ |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2187 TOKEN tok; /* latest token read */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2188 register int tokoff; /* offset in line of start of current token */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2189 register int toklen; /* length of current token */ |
4051
73aa16fc728d
(consider_token): was `==', now is `='.
Richard M. Stallman <rms@gnu.org>
parents:
3921
diff
changeset
|
2190 int cblev; /* current curly brace level */ |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2191 int parlev; /* current parenthesis level */ |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2192 logical incomm, inquote, inchar, quotednl, midtoken; |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
2193 logical cplpl, cjava; |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2194 TOKEN savetok; /* token saved during preprocessor handling */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2195 |
10801
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
2196 |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2197 curndx = newndx = 0; |
240 | 2198 lineno = 0; |
2199 charno = 0; | |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2200 lp = curlb.buffer; |
240 | 2201 *lp = 0; |
2202 | |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2203 funcdef = fnone; typdef = tnone; structdef = snone; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2204 definedef = dnone; objdef = onone; |
10801
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
2205 next_token_is_func = yacc_rules = FALSE; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2206 midtoken = inquote = inchar = incomm = quotednl = FALSE; |
10801
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
2207 tok.valid = savetok.valid = FALSE; |
4051
73aa16fc728d
(consider_token): was `==', now is `='.
Richard M. Stallman <rms@gnu.org>
parents:
3921
diff
changeset
|
2208 cblev = 0; |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2209 parlev = 0; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2210 cplpl = c_ext & C_PLPL; |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
2211 cjava = c_ext & C_JAVA; |
240 | 2212 |
2213 while (!feof (inf)) | |
2214 { | |
2215 c = *lp++; | |
2216 if (c == '\\') | |
2217 { | |
621 | 2218 /* If we're at the end of the line, the next character is a |
2219 '\0'; don't skip it, because it's the thing that tells us | |
2220 to read the next line. */ | |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2221 if (*lp == '\0') |
2004
6469a137fea6
(C_entries): New local variable quotednl. Used for
Richard M. Stallman <rms@gnu.org>
parents:
1938
diff
changeset
|
2222 { |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2223 quotednl = TRUE; |
2004
6469a137fea6
(C_entries): New local variable quotednl. Used for
Richard M. Stallman <rms@gnu.org>
parents:
1938
diff
changeset
|
2224 continue; |
6469a137fea6
(C_entries): New local variable quotednl. Used for
Richard M. Stallman <rms@gnu.org>
parents:
1938
diff
changeset
|
2225 } |
401 | 2226 lp++; |
240 | 2227 c = ' '; |
2228 } | |
2229 else if (incomm) | |
2230 { | |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2231 switch (c) |
240 | 2232 { |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2233 case '*': |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2234 if (*lp == '/') |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2235 { |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2236 c = *lp++; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2237 incomm = FALSE; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2238 } |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2239 break; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2240 case '\0': |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2241 /* Newlines inside comments do not end macro definitions in |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2242 traditional cpp. */ |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2243 CNL_SAVE_DEFINEDEF; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2244 break; |
240 | 2245 } |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2246 continue; |
240 | 2247 } |
2248 else if (inquote) | |
2249 { | |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2250 switch (c) |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2251 { |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2252 case '"': |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2253 inquote = FALSE; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2254 break; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2255 case '\0': |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
2256 /* Newlines inside strings do not end macro definitions |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2257 in traditional cpp, even though compilers don't |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2258 usually accept them. */ |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2259 CNL_SAVE_DEFINEDEF; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2260 break; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2261 } |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2262 continue; |
240 | 2263 } |
2264 else if (inchar) | |
2265 { | |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
2266 switch (c) |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
2267 { |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
2268 case '\0': |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
2269 /* Hmmm, something went wrong. */ |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
2270 CNL; |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
2271 /* FALLTHRU */ |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
2272 case '\'': |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2273 inchar = FALSE; |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
2274 break; |
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
2275 } |
240 | 2276 continue; |
2277 } | |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
2278 else |
240 | 2279 switch (c) |
2280 { | |
2281 case '"': | |
2282 inquote = TRUE; | |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2283 if (funcdef != finlist && funcdef != fignore) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2284 funcdef = fnone; |
240 | 2285 continue; |
2286 case '\'': | |
2287 inchar = TRUE; | |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2288 if (funcdef != finlist && funcdef != fignore) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2289 funcdef = fnone; |
240 | 2290 continue; |
2291 case '/': | |
2292 if (*lp == '*') | |
2293 { | |
2294 lp++; | |
2295 incomm = TRUE; | |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2296 continue; |
240 | 2297 } |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2298 else if (/* cplpl && */ *lp == '/') |
240 | 2299 { |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2300 c = '\0'; |
727 | 2301 break; |
240 | 2302 } |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2303 else |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2304 break; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2305 case '%': |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2306 if ((c_ext & YACC) && *lp == '%') |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2307 { |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2308 /* entering or exiting rules section in yacc file */ |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2309 lp++; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2310 definedef = dnone; funcdef = fnone; |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2311 typdef = tnone; structdef = snone; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2312 next_token_is_func = FALSE; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2313 midtoken = inquote = inchar = incomm = quotednl = FALSE; |
4051
73aa16fc728d
(consider_token): was `==', now is `='.
Richard M. Stallman <rms@gnu.org>
parents:
3921
diff
changeset
|
2314 cblev = 0; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2315 yacc_rules = !yacc_rules; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2316 continue; |
4051
73aa16fc728d
(consider_token): was `==', now is `='.
Richard M. Stallman <rms@gnu.org>
parents:
3921
diff
changeset
|
2317 } |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2318 else |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2319 break; |
240 | 2320 case '#': |
9193
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2321 if (definedef == dnone) |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2322 { |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2323 char *cp; |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2324 logical cpptoken = TRUE; |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2325 |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2326 /* Look back on this line. If all blanks, or nonblanks |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2327 followed by an end of comment, this is a preprocessor |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2328 token. */ |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2329 for (cp = newlb.buffer; cp < lp-1; cp++) |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2330 if (!iswhite (*cp)) |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2331 { |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2332 if (*cp == '*' && *(cp+1) == '/') |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2333 { |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2334 cp++; |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2335 cpptoken = TRUE; |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2336 } |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2337 else |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2338 cpptoken = FALSE; |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2339 } |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2340 if (cpptoken) |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2341 definedef = dsharpseen; |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2342 } /* if (definedef == dnone) */ |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2343 |
240 | 2344 continue; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2345 } /* switch (c) */ |
240 | 2346 |
2347 | |
4051
73aa16fc728d
(consider_token): was `==', now is `='.
Richard M. Stallman <rms@gnu.org>
parents:
3921
diff
changeset
|
2348 /* Consider token only if some complicated conditions are satisfied. */ |
9193
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2349 if ((definedef != dnone |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2350 || (cblev == 0 && structdef != scolonseen) |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
2351 || (cblev == 1 && cplpl && structdef == sinbody) |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
2352 || (structdef == sinbody && structtype == st_C_enum)) |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2353 && typdef != tignore |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2354 && definedef != dignorerest |
9193
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2355 && funcdef != finlist) |
240 | 2356 { |
2357 if (midtoken) | |
2358 { | |
2359 if (endtoken (c)) | |
2360 { | |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2361 if (c == ':' && cplpl && *lp == ':' && begtoken(*(lp + 1))) |
240 | 2362 { |
2363 /* | |
9193
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2364 * This handles :: in the middle, but not at the |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2365 * beginning of an identifier. |
240 | 2366 */ |
2367 lp += 2; | |
2368 toklen += 3; | |
2369 } | |
2370 else | |
2371 { | |
4750
cdefe4f21650
Mon Sep 20 18:06:12 1993 Francesco Potorti` (pot at fly)
Francesco Potortì <pot@gnu.org>
parents:
4696
diff
changeset
|
2372 logical is_func = FALSE; |
240 | 2373 |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2374 if (yacc_rules |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2375 || consider_token (newlb.buffer + tokoff, toklen, c, |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2376 c_ext, cblev, parlev, &is_func)) |
240 | 2377 { |
2004
6469a137fea6
(C_entries): New local variable quotednl. Used for
Richard M. Stallman <rms@gnu.org>
parents:
1938
diff
changeset
|
2378 if (structdef == sinbody |
4750
cdefe4f21650
Mon Sep 20 18:06:12 1993 Francesco Potorti` (pot at fly)
Francesco Potortì <pot@gnu.org>
parents:
4696
diff
changeset
|
2379 && definedef == dnone |
cdefe4f21650
Mon Sep 20 18:06:12 1993 Francesco Potorti` (pot at fly)
Francesco Potortì <pot@gnu.org>
parents:
4696
diff
changeset
|
2380 && is_func) |
cdefe4f21650
Mon Sep 20 18:06:12 1993 Francesco Potorti` (pot at fly)
Francesco Potortì <pot@gnu.org>
parents:
4696
diff
changeset
|
2381 /* function defined in C++ class body */ |
cdefe4f21650
Mon Sep 20 18:06:12 1993 Francesco Potorti` (pot at fly)
Francesco Potortì <pot@gnu.org>
parents:
4696
diff
changeset
|
2382 { |
16573
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
2383 grow_linebuffer (&token_name, |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2384 strlen(structtag)+2+toklen+1); |
10801
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
2385 strcpy (token_name.buffer, structtag); |
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
2386 strcat (token_name.buffer, "::"); |
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
2387 strncat (token_name.buffer, |
10754
cd1c0b5e8634
* etags.c (C_entries): Initialise the new members of TOKEN.
Francesco Potortì <pot@gnu.org>
parents:
10623
diff
changeset
|
2388 newlb.buffer+tokoff, toklen); |
9193
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2389 tok.named = TRUE; |
240 | 2390 } |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2391 else if (objdef == ocatseen) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2392 /* Objective C category */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2393 { |
16573
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
2394 grow_linebuffer (&token_name, |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2395 strlen(objtag)+2+toklen+1); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2396 strcpy (token_name.buffer, objtag); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2397 strcat (token_name.buffer, "("); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2398 strncat (token_name.buffer, |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2399 newlb.buffer+tokoff, toklen); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2400 strcat (token_name.buffer, ")"); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2401 tok.named = TRUE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2402 } |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2403 else if (objdef == omethodtag |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2404 || objdef == omethodparm) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2405 /* Objective C method */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2406 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2407 tok.named = TRUE; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2408 } |
240 | 2409 else |
2410 { | |
16573
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
2411 grow_linebuffer (&token_name, toklen+1); |
10801
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
2412 strncpy (token_name.buffer, |
10754
cd1c0b5e8634
* etags.c (C_entries): Initialise the new members of TOKEN.
Francesco Potortì <pot@gnu.org>
parents:
10623
diff
changeset
|
2413 newlb.buffer+tokoff, toklen); |
10801
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
2414 token_name.buffer[toklen] = '\0'; |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2415 if (structdef == stagseen |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2416 || typdef == tend |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2417 || (is_func |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2418 && definedef == dignorerest)) /* macro */ |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2419 tok.named = TRUE; |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2420 else |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2421 tok.named = FALSE; |
240 | 2422 } |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2423 tok.lineno = lineno; |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2424 tok.linelen = tokoff + toklen + 1; |
10754
cd1c0b5e8634
* etags.c (C_entries): Initialise the new members of TOKEN.
Francesco Potortì <pot@gnu.org>
parents:
10623
diff
changeset
|
2425 tok.buffer = newlb.buffer; |
cd1c0b5e8634
* etags.c (C_entries): Initialise the new members of TOKEN.
Francesco Potortì <pot@gnu.org>
parents:
10623
diff
changeset
|
2426 tok.linepos = newlinepos; |
10801
32f98b512dd9
* etags.c (C_entries): token_saved removed. Initialise tok.valid and
Francesco Potortì <pot@gnu.org>
parents:
10761
diff
changeset
|
2427 tok.valid = TRUE; |
4750
cdefe4f21650
Mon Sep 20 18:06:12 1993 Francesco Potorti` (pot at fly)
Francesco Potortì <pot@gnu.org>
parents:
4696
diff
changeset
|
2428 |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2429 if (definedef == dnone |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2430 && (funcdef == ftagseen |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2431 || structdef == stagseen |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2432 || typdef == tend |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2433 || objdef != onone)) |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2434 { |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2435 if (current_lb_is_new) |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2436 switch_line_buffers (); |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2437 } |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2438 else |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2439 make_C_tag (is_func, &tok); |
240 | 2440 } |
2441 midtoken = FALSE; | |
2442 } | |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2443 } /* if (endtoken (c)) */ |
240 | 2444 else if (intoken (c)) |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2445 { |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2446 toklen++; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2447 continue; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2448 } |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2449 } /* if (midtoken) */ |
240 | 2450 else if (begtoken (c)) |
2451 { | |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2452 switch (definedef) |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2453 { |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2454 case dnone: |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2455 switch (funcdef) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2456 { |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2457 case fstartlist: |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2458 funcdef = finlist; |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2459 continue; |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2460 case flistseen: |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2461 make_C_tag (TRUE, &tok); |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2462 funcdef = fignore; |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2463 break; |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2464 case ftagseen: |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2465 funcdef = fnone; |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2466 break; |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2467 } |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
2468 if (structdef == stagseen && !cjava) |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2469 structdef = snone; |
4663
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
2470 break; |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2471 case dsharpseen: |
10623
8a73e71a55e3
* etags.c (pfnote): Initialise been_warned in the node.
Francesco Potortì <pot@gnu.org>
parents:
10449
diff
changeset
|
2472 savetok = tok; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2473 } |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2474 if (!yacc_rules || lp == newlb.buffer + 1) |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2475 { |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2476 tokoff = lp - 1 - newlb.buffer; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2477 toklen = 1; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2478 midtoken = TRUE; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2479 } |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2480 continue; |
10623
8a73e71a55e3
* etags.c (pfnote): Initialise been_warned in the node.
Francesco Potortì <pot@gnu.org>
parents:
10449
diff
changeset
|
2481 } /* if (begtoken) */ |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2482 } /* if must look at token */ |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2483 |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2484 |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2485 /* Detect end of line, colon, comma, semicolon and various braces |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2486 after having handled a token.*/ |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2487 switch (c) |
401 | 2488 { |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2489 case ':': |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2490 if (definedef != dnone) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2491 break; |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2492 switch (objdef) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2493 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2494 case otagseen: |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2495 objdef = oignore; |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2496 make_C_tag (TRUE, &tok); |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2497 break; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2498 case omethodtag: |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2499 case omethodparm: |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2500 objdef = omethodcolon; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2501 methodlen += 1; |
16573
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
2502 grow_linebuffer (&token_name, methodlen+1); |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2503 strcat (token_name.buffer, ":"); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2504 break; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2505 } |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2506 if (structdef == stagseen) |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2507 structdef = scolonseen; |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2508 else |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2509 switch (funcdef) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2510 { |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2511 case ftagseen: |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2512 if (yacc_rules) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2513 { |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2514 make_C_tag (FALSE, &tok); |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2515 funcdef = fignore; |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2516 } |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2517 break; |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2518 case fstartlist: |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2519 funcdef = fnone; |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2520 break; |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2521 } |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2522 break; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2523 case ';': |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2524 if (definedef != dnone) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2525 break; |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2526 if (cblev == 0) |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2527 switch (typdef) |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2528 { |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2529 case tend: |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2530 make_C_tag (FALSE, &tok); |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2531 /* FALLTHRU */ |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2532 default: |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2533 typdef = tnone; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2534 } |
4663
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
2535 if (funcdef != fignore) |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
2536 { |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
2537 funcdef = fnone; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
2538 /* The following instruction invalidates the token. |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
2539 Probably the token should be invalidated in all |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
2540 other cases where some state machine is reset. */ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
2541 tok.valid = FALSE; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
2542 } |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2543 if (structdef == stagseen) |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2544 structdef = snone; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2545 break; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2546 case ',': |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2547 if (definedef != dnone) |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2548 break; |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2549 switch (objdef) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2550 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2551 case omethodtag: |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2552 case omethodparm: |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2553 make_C_tag (TRUE, &tok); |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2554 objdef = oinbody; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2555 break; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2556 } |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2557 if (funcdef != finlist && funcdef != fignore) |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2558 funcdef = fnone; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2559 if (structdef == stagseen) |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2560 structdef = snone; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2561 break; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2562 case '[': |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2563 if (definedef != dnone) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2564 break; |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2565 if (cblev == 0 && typdef == tend) |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2566 { |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2567 typdef = tignore; |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2568 make_C_tag (FALSE, &tok); |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2569 break; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2570 } |
4663
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
2571 if (funcdef != finlist && funcdef != fignore) |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2572 funcdef = fnone; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2573 if (structdef == stagseen) |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2574 structdef = snone; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2575 break; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2576 case '(': |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2577 if (definedef != dnone) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2578 break; |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2579 if (objdef == otagseen && parlev == 0) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2580 objdef = oparenseen; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2581 switch (funcdef) |
1938
1045deef809f
(C_entries): Don't reset definedef when a newline inside a comment is met.
Richard M. Stallman <rms@gnu.org>
parents:
1796
diff
changeset
|
2582 { |
9193
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2583 case fnone: |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2584 switch (typdef) |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2585 { |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2586 case ttypedseen: |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2587 case tend: |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2588 /* Make sure that the next char is not a '*'. |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2589 This handles constructs like: |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2590 typedef void OperatorFun (int fun); */ |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2591 if (tok.valid && *lp != '*') |
9193
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2592 { |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2593 typdef = tignore; |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2594 make_C_tag (FALSE, &tok); |
9193
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2595 } |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2596 break; |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2597 } /* switch (typdef) */ |
86fd33a4f327
* etags.c (C_entries): Recognise typedef of ANSI style functions.
Francesco Potortì <pot@gnu.org>
parents:
8789
diff
changeset
|
2598 break; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2599 case ftagseen: |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2600 funcdef = fstartlist; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2601 break; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2602 case flistseen: |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2603 funcdef = finlist; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2604 break; |
1938
1045deef809f
(C_entries): Don't reset definedef when a newline inside a comment is met.
Richard M. Stallman <rms@gnu.org>
parents:
1796
diff
changeset
|
2605 } |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2606 parlev++; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2607 break; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2608 case ')': |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2609 if (definedef != dnone) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2610 break; |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2611 if (objdef == ocatseen && parlev == 1) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2612 { |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2613 make_C_tag (TRUE, &tok); |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2614 objdef = oignore; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2615 } |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2616 if (--parlev == 0) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2617 { |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2618 switch (funcdef) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2619 { |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2620 case fstartlist: |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2621 case finlist: |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2622 funcdef = flistseen; |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2623 break; |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2624 } |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2625 if (cblev == 0 && typdef == tend) |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2626 { |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2627 typdef = tignore; |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2628 make_C_tag (FALSE, &tok); |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2629 } |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2630 } |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2631 else if (parlev < 0) /* can happen due to ill-conceived #if's. */ |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2632 parlev = 0; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2633 break; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2634 case '{': |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2635 if (definedef != dnone) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2636 break; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2637 if (typdef == ttypedseen) |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2638 typdef = tinbody; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2639 switch (structdef) |
1938
1045deef809f
(C_entries): Don't reset definedef when a newline inside a comment is met.
Richard M. Stallman <rms@gnu.org>
parents:
1796
diff
changeset
|
2640 { |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2641 case skeyseen: /* unnamed struct */ |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
2642 structdef = sinbody; |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2643 structtag = "_anonymous_"; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2644 break; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2645 case stagseen: |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2646 case scolonseen: /* named struct */ |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2647 structdef = sinbody; |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2648 make_C_tag (FALSE, &tok); |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2649 break; |
1938
1045deef809f
(C_entries): Don't reset definedef when a newline inside a comment is met.
Richard M. Stallman <rms@gnu.org>
parents:
1796
diff
changeset
|
2650 } |
4663
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
2651 switch (funcdef) |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
2652 { |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
2653 case flistseen: |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2654 make_C_tag (TRUE, &tok); |
4663
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
2655 /* FALLTHRU */ |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
2656 case fignore: |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
2657 funcdef = fnone; |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2658 break; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
2659 case fnone: |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2660 switch (objdef) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2661 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2662 case otagseen: |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2663 make_C_tag (TRUE, &tok); |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2664 objdef = oignore; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2665 break; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2666 case omethodtag: |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2667 case omethodparm: |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2668 make_C_tag (TRUE, &tok); |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2669 objdef = oinbody; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2670 break; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2671 default: |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
2672 /* Neutralize `extern "C" {' grot. */ |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2673 if (cblev == 0 && structdef == snone && typdef == tnone) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2674 cblev = -1; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2675 } |
4663
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
2676 } |
4051
73aa16fc728d
(consider_token): was `==', now is `='.
Richard M. Stallman <rms@gnu.org>
parents:
3921
diff
changeset
|
2677 cblev++; |
4663
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
2678 break; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2679 case '*': |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2680 if (definedef != dnone) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2681 break; |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2682 if (funcdef == fstartlist) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2683 funcdef = fnone; /* avoid tagging `foo' in `foo (*bar()) ()' */ |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2684 break; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2685 case '}': |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2686 if (definedef != dnone) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2687 break; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2688 if (!noindentypedefs && lp == newlb.buffer + 1) |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2689 { |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2690 cblev = 0; /* reset curly brace level if first column */ |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2691 parlev = 0; /* also reset paren level, just in case... */ |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2692 } |
4051
73aa16fc728d
(consider_token): was `==', now is `='.
Richard M. Stallman <rms@gnu.org>
parents:
3921
diff
changeset
|
2693 else if (cblev > 0) |
73aa16fc728d
(consider_token): was `==', now is `='.
Richard M. Stallman <rms@gnu.org>
parents:
3921
diff
changeset
|
2694 cblev--; |
73aa16fc728d
(consider_token): was `==', now is `='.
Richard M. Stallman <rms@gnu.org>
parents:
3921
diff
changeset
|
2695 if (cblev == 0) |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2696 { |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2697 if (typdef == tinbody) |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2698 typdef = tend; |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
2699 /* Memory leakage here: the string pointed by structtag is |
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
2700 never released, because I fear to miss something and |
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
2701 break things while freeing the area. The amount of |
14021
19bab04cf346
(substitute): Fix spelling in message.
Karl Heuer <kwzh@gnu.org>
parents:
13696
diff
changeset
|
2702 memory leaked here is the sum of the lengths of the |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
2703 struct tags. |
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
2704 if (structdef == sinbody) |
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
2705 free (structtag); */ |
10761
7aa80669e697
* etags.c (C_entries): Bug corrected in xrealloc of token_str.
Francesco Potortì <pot@gnu.org>
parents:
10754
diff
changeset
|
2706 |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2707 structdef = snone; |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2708 structtag = "<error>"; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2709 } |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2710 break; |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2711 case '+': |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2712 case '-': |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2713 if (objdef == oinbody && cblev == 0) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2714 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2715 objdef = omethodsign; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2716 break; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2717 } |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2718 /* FALLTHRU */ |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2719 case '=': case '#': case '~': case '&': case '%': case '/': |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
2720 case '|': case '^': case '!': case '<': case '>': case '.': case '?': |
4937
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2721 if (definedef != dnone) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2722 break; |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2723 /* These surely cannot follow a function tag. */ |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2724 if (funcdef != finlist && funcdef != fignore) |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2725 funcdef = fnone; |
50db67ef8d64
Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl)
Francesco Potortì <pot@gnu.org>
parents:
4905
diff
changeset
|
2726 break; |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2727 case '\0': |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2728 if (objdef == otagseen) |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2729 { |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
2730 make_C_tag (TRUE, &tok); |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2731 objdef = oignore; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2732 } |
2323
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2733 /* If a macro spans multiple lines don't reset its state. */ |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2734 if (quotednl) |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2735 CNL_SAVE_DEFINEDEF; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2736 else |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2737 CNL; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2738 break; |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2739 } /* switch (c) */ |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2740 |
626d9ac52bc9
(YACC): flag added to c_ext.
Richard M. Stallman <rms@gnu.org>
parents:
2004
diff
changeset
|
2741 } /* while not eof */ |
240 | 2742 } |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2743 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2744 /* |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2745 * Process either a C++ file or a C file depending on the setting |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2746 * of a global flag. |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2747 */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2748 void |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2749 default_C_entries (inf) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2750 FILE *inf; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2751 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2752 C_entries (cplusplus ? C_PLPL : 0, inf); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2753 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2754 |
12398
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
2755 /* Always do plain ANSI C. */ |
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
2756 void |
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
2757 plain_C_entries (inf) |
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
2758 FILE *inf; |
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
2759 { |
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
2760 C_entries (0, inf); |
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
2761 } |
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
2762 |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2763 /* Always do C++. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2764 void |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2765 Cplusplus_entries (inf) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2766 FILE *inf; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2767 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2768 C_entries (C_PLPL, inf); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2769 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2770 |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
2771 /* Always do Java. */ |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
2772 void |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
2773 Cjava_entries (FILE *inf) |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
2774 { |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
2775 C_entries (C_JAVA, inf); |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
2776 } |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
2777 |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2778 /* Always do C*. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2779 void |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2780 Cstar_entries (inf) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2781 FILE *inf; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2782 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2783 C_entries (C_STAR, inf); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2784 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2785 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2786 /* Always do Yacc. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2787 void |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2788 Yacc_entries (inf) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2789 FILE *inf; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2790 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2791 C_entries (YACC, inf); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2792 } |
240 | 2793 |
2794 /* Fortran parsing */ | |
2795 | |
2796 char *dbp; | |
2797 | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2798 logical |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2799 tail (cp) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2800 char *cp; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2801 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2802 register int len = 0; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2803 |
12398
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
2804 while (*cp && lowcase(*cp) == lowcase(dbp[len])) |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2805 cp++, len++; |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
2806 if (*cp == '\0' && !intoken(dbp[len])) |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2807 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2808 dbp += len; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2809 return TRUE; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2810 } |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2811 return FALSE; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2812 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2813 |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2814 void |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2815 takeprec () |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2816 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2817 while (isspace (*dbp)) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2818 dbp++; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2819 if (*dbp != '*') |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2820 return; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2821 dbp++; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2822 while (isspace (*dbp)) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2823 dbp++; |
12398
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
2824 if (strneq (dbp, "(*)", 3)) |
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
2825 { |
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
2826 dbp += 3; |
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
2827 return; |
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
2828 } |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2829 if (!isdigit (*dbp)) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2830 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2831 --dbp; /* force failure */ |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2832 return; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2833 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2834 do |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2835 dbp++; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2836 while (isdigit (*dbp)); |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2837 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2838 |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2839 void |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2840 getit (inf) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2841 FILE *inf; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2842 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2843 register char *cp; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2844 |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2845 while (isspace (*dbp)) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2846 dbp++; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2847 if (*dbp == '\0') |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2848 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2849 lineno++; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2850 linecharno = charno; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2851 charno += readline (&lb, inf); |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2852 dbp = lb.buffer; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2853 if (dbp[5] != '&') |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2854 return; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2855 dbp += 6; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2856 while (isspace (*dbp)) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2857 dbp++; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2858 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2859 if (!isalpha (*dbp) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2860 && *dbp != '_' |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2861 && *dbp != '$') |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2862 return; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2863 for (cp = dbp + 1; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2864 (*cp |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2865 && (isalpha (*cp) || isdigit (*cp) || (*cp == '_') || (*cp == '$'))); |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2866 cp++) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2867 continue; |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2868 pfnote ((CTAGS) ? savenstr (dbp, cp-dbp) : NULL, TRUE, |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2869 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2870 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2871 |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
2872 void |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2873 Fortran_functions (inf) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2874 FILE *inf; |
240 | 2875 { |
2876 lineno = 0; | |
2877 charno = 0; | |
2878 | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2879 while (!feof (inf)) |
240 | 2880 { |
2881 lineno++; | |
2882 linecharno = charno; | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2883 charno += readline (&lb, inf); |
240 | 2884 dbp = lb.buffer; |
2885 if (*dbp == '%') | |
2886 dbp++; /* Ratfor escape to fortran */ | |
2887 while (isspace (*dbp)) | |
2888 dbp++; | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
2889 if (*dbp == '\0') |
240 | 2890 continue; |
12398
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
2891 switch (lowcase (*dbp)) |
240 | 2892 { |
2893 case 'i': | |
2894 if (tail ("integer")) | |
2895 takeprec (); | |
2896 break; | |
2897 case 'r': | |
2898 if (tail ("real")) | |
2899 takeprec (); | |
2900 break; | |
2901 case 'l': | |
2902 if (tail ("logical")) | |
2903 takeprec (); | |
2904 break; | |
2905 case 'c': | |
2906 if (tail ("complex") || tail ("character")) | |
2907 takeprec (); | |
2908 break; | |
2909 case 'd': | |
2910 if (tail ("double")) | |
2911 { | |
2912 while (isspace (*dbp)) | |
2913 dbp++; | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
2914 if (*dbp == '\0') |
240 | 2915 continue; |
2916 if (tail ("precision")) | |
2917 break; | |
2918 continue; | |
2919 } | |
2920 break; | |
2921 } | |
2922 while (isspace (*dbp)) | |
2923 dbp++; | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
2924 if (*dbp == '\0') |
240 | 2925 continue; |
12398
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
2926 switch (lowcase (*dbp)) |
240 | 2927 { |
2928 case 'f': | |
2929 if (tail ("function")) | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2930 getit (inf); |
240 | 2931 continue; |
2932 case 's': | |
2933 if (tail ("subroutine")) | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2934 getit (inf); |
240 | 2935 continue; |
1026
cc96e2df9b71
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
774
diff
changeset
|
2936 case 'e': |
cc96e2df9b71
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
774
diff
changeset
|
2937 if (tail ("entry")) |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2938 getit (inf); |
1026
cc96e2df9b71
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
774
diff
changeset
|
2939 continue; |
240 | 2940 case 'p': |
2941 if (tail ("program")) | |
2942 { | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2943 getit (inf); |
240 | 2944 continue; |
2945 } | |
2946 if (tail ("procedure")) | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2947 getit (inf); |
240 | 2948 continue; |
2949 } | |
2950 } | |
2951 } | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2952 |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2953 /* |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2954 * Bob Weiner, Motorola Inc., 4/3/94 |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2955 * Unix and microcontroller assembly tag handling |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2956 * look for '^[a-zA-Z_.$][a-zA_Z0-9_.$]*[: ^I^J]' |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2957 */ |
240 | 2958 void |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2959 Asm_labels (inf) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2960 FILE *inf; |
240 | 2961 { |
2962 register char *cp; | |
2963 | |
2964 lineno = 0; | |
2965 charno = 0; | |
2966 | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2967 while (!feof (inf)) |
240 | 2968 { |
2969 lineno++; | |
2970 linecharno = charno; | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2971 charno += readline (&lb, inf); |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2972 cp = lb.buffer; |
240 | 2973 |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2974 /* If first char is alphabetic or one of [_.$], test for colon |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2975 following identifier. */ |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2976 if (isalpha (*cp) || *cp == '_' || *cp == '.' || *cp == '$') |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2977 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2978 /* Read past label. */ |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2979 cp++; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2980 while (isalnum (*cp) || *cp == '_' || *cp == '.' || *cp == '$') |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2981 cp++; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2982 if (*cp == ':' || isspace (*cp)) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2983 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2984 /* Found end of label, so copy it and add it to the table. */ |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
2985 pfnote ((CTAGS) ? savenstr(lb.buffer, cp-lb.buffer) : NULL, TRUE, |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
2986 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2987 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
2988 } |
240 | 2989 } |
2990 } | |
2991 | |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
2992 /* |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
2993 * Perl support by Bart Robinson <lomew@cs.utah.edu> |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
2994 * Perl sub names: look for /^sub[ \t\n]+[^ \t\n{]+/ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
2995 */ |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
2996 void |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
2997 Perl_functions (inf) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
2998 FILE *inf; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
2999 { |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3000 register char *cp; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3001 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3002 lineno = 0; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3003 charno = 0; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3004 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3005 while (!feof (inf)) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3006 { |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3007 lineno++; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3008 linecharno = charno; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3009 charno += readline (&lb, inf); |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3010 cp = lb.buffer; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3011 |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3012 if (*cp++ == 's' && *cp++ == 'u' && *cp++ == 'b' && isspace(*cp++)) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3013 { |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3014 while (*cp && isspace(*cp)) |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3015 cp++; |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3016 while (*cp && ! isspace(*cp) && *cp != '{') |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3017 cp++; |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
3018 pfnote ((CTAGS) ? savenstr (lb.buffer, cp-lb.buffer) : NULL, TRUE, |
13404
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3019 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3020 } |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3021 } |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3022 } |
9d6c77b66cfb
* etags.c (get_lang_from_name, get_lang_from_interpreter,
Francesco Potortì <pot@gnu.org>
parents:
13380
diff
changeset
|
3023 |
240 | 3024 /* Added by Mosur Mohan, 4/22/88 */ |
3025 /* Pascal parsing */ | |
3026 | |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
3027 /* |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
3028 * Locates tags for procedures & functions. Doesn't do any type- or |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
3029 * var-definitions. It does look for the keyword "extern" or |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
3030 * "forward" immediately following the procedure statement; if found, |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
3031 * the tag is skipped. |
240 | 3032 */ |
3033 void | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3034 Pascal_functions (inf) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3035 FILE *inf; |
240 | 3036 { |
3037 struct linebuffer tline; /* mostly copied from C_entries */ | |
3038 long save_lcno; | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3039 int save_lineno, save_len; |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
3040 char c, *cp, *namebuf; |
240 | 3041 |
3042 logical /* each of these flags is TRUE iff: */ | |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
3043 incomment, /* point is inside a comment */ |
240 | 3044 inquote, /* point is inside '..' string */ |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3045 get_tagname, /* point is after PROCEDURE/FUNCTION |
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3046 keyword, so next item = potential tag */ |
240 | 3047 found_tag, /* point is after a potential tag */ |
3048 inparms, /* point is within parameter-list */ | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3049 verify_tag; /* point has passed the parm-list, so the |
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3050 next token will determine whether this |
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3051 is a FORWARD/EXTERN to be ignored, or |
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3052 whether it is a real tag */ |
240 | 3053 |
3054 lineno = 0; | |
3055 charno = 0; | |
3056 dbp = lb.buffer; | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3057 *dbp = '\0'; |
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3058 save_len = 0; |
240 | 3059 initbuffer (&tline); |
3060 | |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
3061 incomment = inquote = FALSE; |
240 | 3062 found_tag = FALSE; /* have a proc name; check if extern */ |
3063 get_tagname = FALSE; /* have found "procedure" keyword */ | |
3064 inparms = FALSE; /* found '(' after "proc" */ | |
3065 verify_tag = FALSE; /* check if "extern" is ahead */ | |
3066 | |
3067 /* long main loop to get next char */ | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3068 while (!feof (inf)) |
240 | 3069 { |
3070 c = *dbp++; | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3071 if (c == '\0') /* if end of line */ |
240 | 3072 { |
15243
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
3073 lineno++; |
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
3074 linecharno = charno; |
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
3075 charno += readline (&lb, inf); |
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
3076 dbp = lb.buffer; |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3077 if (*dbp == '\0') |
240 | 3078 continue; |
3079 if (!((found_tag && verify_tag) || | |
3080 get_tagname)) | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3081 c = *dbp++; /* only if don't need *dbp pointing |
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3082 to the beginning of the name of |
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3083 the procedure or function */ |
240 | 3084 } |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
3085 if (incomment) |
240 | 3086 { |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3087 if (c == '}') /* within { } comments */ |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
3088 incomment = FALSE; |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3089 else if (c == '*' && *dbp == ')') /* within (* *) comments */ |
240 | 3090 { |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
3091 dbp++; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
3092 incomment = FALSE; |
240 | 3093 } |
3094 continue; | |
3095 } | |
3096 else if (inquote) | |
3097 { | |
3098 if (c == '\'') | |
3099 inquote = FALSE; | |
3100 continue; | |
3101 } | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3102 else |
240 | 3103 switch (c) |
3104 { | |
3105 case '\'': | |
3106 inquote = TRUE; /* found first quote */ | |
3107 continue; | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3108 case '{': /* found open { comment */ |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
3109 incomment = TRUE; |
240 | 3110 continue; |
3111 case '(': | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3112 if (*dbp == '*') /* found open (* comment */ |
240 | 3113 { |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
3114 incomment = TRUE; |
240 | 3115 dbp++; |
3116 } | |
3117 else if (found_tag) /* found '(' after tag, i.e., parm-list */ | |
3118 inparms = TRUE; | |
3119 continue; | |
3120 case ')': /* end of parms list */ | |
3121 if (inparms) | |
3122 inparms = FALSE; | |
3123 continue; | |
3124 case ';': | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3125 if (found_tag && !inparms) /* end of proc or fn stmt */ |
240 | 3126 { |
3127 verify_tag = TRUE; | |
3128 break; | |
3129 } | |
3130 continue; | |
3131 } | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3132 if (found_tag && verify_tag && (*dbp != ' ')) |
240 | 3133 { |
3134 /* check if this is an "extern" declaration */ | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3135 if (*dbp == '\0') |
240 | 3136 continue; |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3137 if (lowcase (*dbp == 'e')) |
240 | 3138 { |
3139 if (tail ("extern")) /* superfluous, really! */ | |
3140 { | |
3141 found_tag = FALSE; | |
3142 verify_tag = FALSE; | |
3143 } | |
3144 } | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3145 else if (lowcase (*dbp) == 'f') |
240 | 3146 { |
3147 if (tail ("forward")) /* check for forward reference */ | |
3148 { | |
3149 found_tag = FALSE; | |
3150 verify_tag = FALSE; | |
3151 } | |
3152 } | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3153 if (found_tag && verify_tag) /* not external proc, so make tag */ |
240 | 3154 { |
3155 found_tag = FALSE; | |
3156 verify_tag = FALSE; | |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
3157 pfnote (namebuf, TRUE, |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3158 tline.buffer, save_len, save_lineno, save_lcno); |
240 | 3159 continue; |
3160 } | |
3161 } | |
3162 if (get_tagname) /* grab name of proc or fn */ | |
3163 { | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3164 if (*dbp == '\0') |
240 | 3165 continue; |
3166 | |
3167 /* save all values for later tagging */ | |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
3168 grow_linebuffer (&tline, lb.len + 1); |
240 | 3169 strcpy (tline.buffer, lb.buffer); |
3170 save_lineno = lineno; | |
3171 save_lcno = linecharno; | |
3172 | |
3173 /* grab block name */ | |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
3174 for (cp = dbp + 1; *cp && (!endtoken (*cp)); cp++) |
240 | 3175 continue; |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
3176 namebuf = (CTAGS) ? savenstr (dbp, cp-dbp) : NULL; |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
3177 dbp = cp; /* set dbp to e-o-token */ |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3178 save_len = dbp - lb.buffer + 1; |
240 | 3179 get_tagname = FALSE; |
3180 found_tag = TRUE; | |
3181 continue; | |
3182 | |
3183 /* and proceed to check for "extern" */ | |
3184 } | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3185 else if (!incomment && !inquote && !found_tag) |
240 | 3186 { |
3187 /* check for proc/fn keywords */ | |
12398
ccfd646cfad9
* etags.c (plain_C_entries): new function.
Francesco Potortì <pot@gnu.org>
parents:
12344
diff
changeset
|
3188 switch (lowcase (c)) |
240 | 3189 { |
3190 case 'p': | |
3191 if (tail ("rocedure")) /* c = 'p', dbp has advanced */ | |
3192 get_tagname = TRUE; | |
3193 continue; | |
3194 case 'f': | |
3195 if (tail ("unction")) | |
3196 get_tagname = TRUE; | |
3197 continue; | |
3198 } | |
3199 } | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3200 } /* while not eof */ |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
3201 |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3202 free (tline.buffer); |
240 | 3203 } |
3204 | |
3205 /* | |
3206 * lisp tag functions | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3207 * look for (def or (DEF, quote or QUOTE |
240 | 3208 */ |
3209 int | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3210 L_isdef (strp) |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3211 register char *strp; |
240 | 3212 { |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3213 return ((strp[1] == 'd' || strp[1] == 'D') |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3214 && (strp[2] == 'e' || strp[2] == 'E') |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3215 && (strp[3] == 'f' || strp[3] == 'F')); |
4663
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
3216 } |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
3217 |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
3218 int |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3219 L_isquote (strp) |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3220 register char *strp; |
4663
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
3221 { |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3222 return ((*(++strp) == 'q' || *strp == 'Q') |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3223 && (*(++strp) == 'u' || *strp == 'U') |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3224 && (*(++strp) == 'o' || *strp == 'O') |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3225 && (*(++strp) == 't' || *strp == 'T') |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3226 && (*(++strp) == 'e' || *strp == 'E') |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3227 && isspace(*(++strp))); |
240 | 3228 } |
3229 | |
3230 void | |
3231 L_getit () | |
3232 { | |
3233 register char *cp; | |
3234 | |
4663
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
3235 if (*dbp == '\'') /* Skip prefix quote */ |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
3236 dbp++; |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
3237 else if (*dbp == '(' && L_isquote (dbp)) /* Skip "(quote " */ |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
3238 { |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
3239 dbp += 7; |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
3240 while (isspace(*dbp)) |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
3241 dbp++; |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
3242 } |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3243 for (cp = dbp /*+1*/; |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3244 *cp && *cp != '(' && *cp != ' ' && *cp != ')'; |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3245 cp++) |
4663
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
3246 continue; |
5f0ff5c890a8
* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
Francesco Potortì <pot@gnu.org>
parents:
4406
diff
changeset
|
3247 if (cp == dbp) |
240 | 3248 return; |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
3249 |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
3250 pfnote ((CTAGS) ? savenstr (dbp, cp-dbp) : NULL, TRUE, |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
3251 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); |
240 | 3252 } |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3253 |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3254 void |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3255 Lisp_functions (inf) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3256 FILE *inf; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3257 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3258 lineno = 0; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3259 charno = 0; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3260 |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3261 while (!feof (inf)) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3262 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3263 lineno++; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3264 linecharno = charno; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3265 charno += readline (&lb, inf); |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3266 dbp = lb.buffer; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3267 if (dbp[0] == '(') |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3268 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3269 if (L_isdef (dbp)) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3270 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3271 while (!isspace (*dbp)) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3272 dbp++; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3273 while (isspace (*dbp)) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3274 dbp++; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3275 L_getit (); |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3276 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3277 else |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3278 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3279 /* Check for (foo::defmumble name-defined ... */ |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3280 do |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3281 dbp++; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3282 while (*dbp && !isspace (*dbp) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3283 && *dbp != ':' && *dbp != '(' && *dbp != ')'); |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3284 if (*dbp == ':') |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3285 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3286 do |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3287 dbp++; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3288 while (*dbp == ':'); |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3289 |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3290 if (L_isdef (dbp - 1)) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3291 { |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3292 while (!isspace (*dbp)) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3293 dbp++; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3294 while (isspace (*dbp)) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3295 dbp++; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3296 L_getit (); |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3297 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3298 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3299 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3300 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3301 } |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3302 } |
240 | 3303 |
3304 /* | |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3305 * Postscript tag functions |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3306 * Just look for lines where the first character is '/' |
17785
5b92f8ba5c6d
Added support for the Java language.
Francesco Potortì <pot@gnu.org>
parents:
17778
diff
changeset
|
3307 * Richard Mlynarik <mly@adoc.xerox.com> |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3308 */ |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3309 void |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3310 Postscript_functions (inf) |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3311 FILE *inf; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3312 { |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3313 lineno = 0; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3314 charno = 0; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3315 while (!feof (inf)) |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3316 { |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3317 lineno++; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3318 linecharno = charno; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3319 charno += readline (&lb, inf); |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3320 dbp = lb.buffer; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3321 if (dbp[0] == '/') |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3322 { |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3323 register char *cp; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3324 for (cp = dbp+1; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3325 *cp != '\0' && *cp != ' ' && *cp != '{'; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3326 cp++) |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3327 continue; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3328 pfnote ((CTAGS) ? savenstr (dbp, cp-dbp) : NULL, TRUE, |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3329 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3330 } |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3331 } |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3332 } |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3333 |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3334 |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3335 /* |
240 | 3336 * Scheme tag functions |
3337 * look for (def... xyzzy | |
3338 * look for (def... (xyzzy | |
3339 * look for (def ... ((...(xyzzy .... | |
3340 * look for (set! xyzzy | |
3341 */ | |
3342 | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3343 void get_scheme (); |
240 | 3344 |
3345 void | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3346 Scheme_functions (inf) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3347 FILE *inf; |
240 | 3348 { |
3349 lineno = 0; | |
3350 charno = 0; | |
3351 | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3352 while (!feof (inf)) |
240 | 3353 { |
3354 lineno++; | |
3355 linecharno = charno; | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3356 charno += readline (&lb, inf); |
240 | 3357 dbp = lb.buffer; |
3358 if (dbp[0] == '(' && | |
3359 (dbp[1] == 'D' || dbp[1] == 'd') && | |
3360 (dbp[2] == 'E' || dbp[2] == 'e') && | |
3361 (dbp[3] == 'F' || dbp[3] == 'f')) | |
3362 { | |
3363 while (!isspace (*dbp)) | |
3364 dbp++; | |
3365 /* Skip over open parens and white space */ | |
3366 while (*dbp && (isspace (*dbp) || *dbp == '(')) | |
3367 dbp++; | |
3368 get_scheme (); | |
3369 } | |
3370 if (dbp[0] == '(' && | |
3371 (dbp[1] == 'S' || dbp[1] == 's') && | |
3372 (dbp[2] == 'E' || dbp[2] == 'e') && | |
3373 (dbp[3] == 'T' || dbp[3] == 't') && | |
3374 (dbp[4] == '!' || dbp[4] == '!') && | |
3375 (isspace (dbp[5]))) | |
3376 { | |
3377 while (!isspace (*dbp)) | |
3378 dbp++; | |
3379 /* Skip over white space */ | |
3380 while (isspace (*dbp)) | |
3381 dbp++; | |
3382 get_scheme (); | |
3383 } | |
3384 } | |
3385 } | |
3386 | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3387 void |
240 | 3388 get_scheme () |
3389 { | |
3390 register char *cp; | |
3391 | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3392 if (*dbp == '\0') |
240 | 3393 return; |
3394 /* Go till you get to white space or a syntactic break */ | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3395 for (cp = dbp + 1; |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3396 *cp && *cp != '(' && *cp != ')' && !isspace (*cp); |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
3397 cp++) |
240 | 3398 continue; |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
3399 pfnote ((CTAGS) ? savenstr (dbp, cp-dbp) : NULL, TRUE, |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
3400 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); |
240 | 3401 } |
3402 | |
3403 /* Find tags in TeX and LaTeX input files. */ | |
3404 | |
3405 /* TEX_toktab is a table of TeX control sequences that define tags. | |
3406 Each TEX_tabent records one such control sequence. | |
3407 CONVERT THIS TO USE THE Stab TYPE!! */ | |
3408 struct TEX_tabent | |
3409 { | |
3410 char *name; | |
3411 int len; | |
3412 }; | |
3413 | |
3414 struct TEX_tabent *TEX_toktab = NULL; /* Table with tag tokens */ | |
3415 | |
3416 /* Default set of control sequences to put into TEX_toktab. | |
3417 The value of environment var TEXTAGS is prepended to this. */ | |
3418 | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3419 char *TEX_defenv = "\ |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
3420 :chapter:section:subsection:subsubsection:eqno:label:ref:cite:bibitem\ |
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
3421 :part:appendix:entry:index"; |
240 | 3422 |
3423 void TEX_mode (); | |
3424 struct TEX_tabent *TEX_decode_env (); | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3425 int TEX_Token (); |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
3426 static void TEX_getit (); |
240 | 3427 |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3428 char TEX_esc = '\\'; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3429 char TEX_opgrp = '{'; |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3430 char TEX_clgrp = '}'; |
240 | 3431 |
3432 /* | |
3433 * TeX/LaTeX scanning loop. | |
3434 */ | |
3435 void | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3436 TeX_functions (inf) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3437 FILE *inf; |
240 | 3438 { |
3439 char *lasthit; | |
3440 | |
3441 lineno = 0; | |
3442 charno = 0; | |
3443 | |
3444 /* Select either \ or ! as escape character. */ | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3445 TEX_mode (inf); |
240 | 3446 |
3447 /* Initialize token table once from environment. */ | |
3448 if (!TEX_toktab) | |
3449 TEX_toktab = TEX_decode_env ("TEXTAGS", TEX_defenv); | |
3450 | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3451 while (!feof (inf)) |
1040 | 3452 { /* Scan each line in file */ |
240 | 3453 lineno++; |
3454 linecharno = charno; | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3455 charno += readline (&lb, inf); |
240 | 3456 dbp = lb.buffer; |
3457 lasthit = dbp; | |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3458 while (dbp = etags_strchr (dbp, TEX_esc)) /* Look at each esc in line */ |
1026
cc96e2df9b71
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
774
diff
changeset
|
3459 { |
cc96e2df9b71
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
774
diff
changeset
|
3460 register int i; |
240 | 3461 |
1026
cc96e2df9b71
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
774
diff
changeset
|
3462 if (!*(++dbp)) |
cc96e2df9b71
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
774
diff
changeset
|
3463 break; |
cc96e2df9b71
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
774
diff
changeset
|
3464 linecharno += dbp - lasthit; |
240 | 3465 lasthit = dbp; |
1026
cc96e2df9b71
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
774
diff
changeset
|
3466 i = TEX_Token (lasthit); |
cc96e2df9b71
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
774
diff
changeset
|
3467 if (0 <= i) |
240 | 3468 { |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
3469 pfnote ((char *)NULL, TRUE, |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
3470 lb.buffer, lb.len, lineno, linecharno); |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
3471 if (TeX_named_tokens) |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
3472 TEX_getit (lasthit, TEX_toktab[i].len); |
1040 | 3473 break; /* We only save a line once */ |
240 | 3474 } |
3475 } | |
3476 } | |
3477 } | |
3478 | |
3479 #define TEX_LESC '\\' | |
3480 #define TEX_SESC '!' | |
3481 #define TEX_cmt '%' | |
3482 | |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
3483 /* Figure out whether TeX's escapechar is '\\' or '!' and set grouping |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
3484 chars accordingly. */ |
240 | 3485 void |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3486 TEX_mode (inf) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3487 FILE *inf; |
240 | 3488 { |
3489 int c; | |
3490 | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3491 while ((c = getc (inf)) != EOF) |
240 | 3492 { |
3493 /* Skip to next line if we hit the TeX comment char. */ | |
3494 if (c == TEX_cmt) | |
3495 while (c != '\n') | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3496 c = getc (inf); |
240 | 3497 else if (c == TEX_LESC || c == TEX_SESC ) |
3498 break; | |
3499 } | |
3500 | |
3501 if (c == TEX_LESC) | |
3502 { | |
3503 TEX_esc = TEX_LESC; | |
3504 TEX_opgrp = '{'; | |
3505 TEX_clgrp = '}'; | |
3506 } | |
3507 else | |
3508 { | |
3509 TEX_esc = TEX_SESC; | |
3510 TEX_opgrp = '<'; | |
3511 TEX_clgrp = '>'; | |
3512 } | |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3513 rewind (inf); |
240 | 3514 } |
3515 | |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
3516 /* Read environment and prepend it to the default string. |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
3517 Build token table. */ |
240 | 3518 struct TEX_tabent * |
3519 TEX_decode_env (evarname, defenv) | |
3520 char *evarname; | |
3521 char *defenv; | |
3522 { | |
3523 register char *env, *p; | |
3524 | |
3525 struct TEX_tabent *tab; | |
3526 int size, i; | |
3527 | |
3528 /* Append default string to environment. */ | |
3529 env = getenv (evarname); | |
3530 if (!env) | |
3531 env = defenv; | |
3532 else | |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3533 { |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3534 char *oldenv = env; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3535 env = concat (oldenv, defenv, ""); |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3536 free (oldenv); |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
3537 } |
240 | 3538 |
3539 /* Allocate a token table */ | |
3540 for (size = 1, p = env; p;) | |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
3541 if ((p = etags_strchr (p, ':')) && *(++p)) |
240 | 3542 size++; |
1026
cc96e2df9b71
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
774
diff
changeset
|
3543 /* Add 1 to leave room for null terminator. */ |
cc96e2df9b71
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
774
diff
changeset
|
3544 tab = xnew (size + 1, struct TEX_tabent); |
240 | 3545 |
3546 /* Unpack environment string into token table. Be careful about */ | |
3547 /* zero-length strings (leading ':', "::" and trailing ':') */ | |
3548 for (i = 0; *env;) | |
3549 { | |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
3550 p = etags_strchr (env, ':'); |
240 | 3551 if (!p) /* End of environment string. */ |
3552 p = env + strlen (env); | |
3553 if (p - env > 0) | |
3554 { /* Only non-zero strings. */ | |
3555 tab[i].name = savenstr (env, p - env); | |
3556 tab[i].len = strlen (tab[i].name); | |
3557 i++; | |
3558 } | |
3559 if (*p) | |
3560 env = p + 1; | |
3561 else | |
3562 { | |
3563 tab[i].name = NULL; /* Mark end of table. */ | |
3564 tab[i].len = 0; | |
3565 break; | |
3566 } | |
3567 } | |
3568 return tab; | |
3569 } | |
3570 | |
3571 /* Record a tag defined by a TeX command of length LEN and starting at NAME. | |
3572 The name being defined actually starts at (NAME + LEN + 1). | |
3573 But we seem to include the TeX command in the tag name. */ | |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
3574 static void |
240 | 3575 TEX_getit (name, len) |
3576 char *name; | |
3577 int len; | |
3578 { | |
3579 char *p = name + len; | |
3580 | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3581 if (*name == '\0') |
240 | 3582 return; |
3583 | |
3584 /* Let tag name extend to next group close (or end of line) */ | |
3585 while (*p && *p != TEX_clgrp) | |
3586 p++; | |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
3587 pfnote (savenstr (name, p-name), TRUE, |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
3588 lb.buffer, lb.len, lineno, linecharno); |
240 | 3589 } |
3590 | |
3591 /* If the text at CP matches one of the tag-defining TeX command names, | |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
3592 return the pointer to the first occurrence of that command in TEX_toktab. |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
3593 Otherwise return -1. |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
3594 Keep the capital `T' in `Token' for dumb truncating compilers |
240 | 3595 (this distinguishes it from `TEX_toktab' */ |
3596 int | |
3597 TEX_Token (cp) | |
3598 char *cp; | |
3599 { | |
3600 int i; | |
3601 | |
3602 for (i = 0; TEX_toktab[i].len > 0; i++) | |
5940
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
3603 if (strneq (TEX_toktab[i].name, cp, TEX_toktab[i].len)) |
240 | 3604 return i; |
3605 return -1; | |
3606 } | |
3607 | |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3608 /* |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3609 * Prolog support (rewritten) by Anders Lindgren, Mar. 96 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3610 * |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3611 * Assumes that the predicate starts at column 0. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3612 * Only the first clause of a predicate is added. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3613 */ |
240 | 3614 void |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3615 Prolog_functions (inf) |
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3616 FILE *inf; |
240 | 3617 { |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3618 int prolog_pred (); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3619 void prolog_skip_comment (); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3620 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3621 char * last; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3622 int len; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3623 int allocated; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3624 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3625 allocated = 0; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3626 len = 0; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3627 last = NULL; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3628 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3629 lineno = 0; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3630 linecharno = 0; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3631 charno = 0; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3632 |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3633 while (!feof (inf)) |
240 | 3634 { |
3635 lineno++; | |
3636 linecharno += charno; | |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3637 charno = readline (&lb, inf); |
240 | 3638 dbp = lb.buffer; |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3639 if (dbp[0] == '\0') /* Empty line */ |
240 | 3640 continue; |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3641 else if (isspace (dbp[0])) /* Not a predicate */ |
240 | 3642 continue; |
3643 else if (dbp[0] == '/' && dbp[1] == '*') /* comment. */ | |
16573
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
3644 prolog_skip_comment (&lb, inf); |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3645 else if (len = prolog_pred (dbp, last)) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3646 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3647 /* Predicate. Store the function name so that we only |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
3648 generate a tag for the first clause. */ |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3649 if (last == NULL) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3650 last = xnew(len + 1, char); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3651 else if (len + 1 > allocated) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3652 last = (char *) xrealloc(last, len + 1); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3653 allocated = len + 1; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3654 strncpy (last, dbp, len); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3655 last[len] = '\0'; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3656 } |
240 | 3657 } |
3658 } | |
3659 | |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3660 |
240 | 3661 void |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3662 prolog_skip_comment (plb, inf) |
240 | 3663 struct linebuffer *plb; |
6756
8086a2590e2f
* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
Francesco Potortì <pot@gnu.org>
parents:
6592
diff
changeset
|
3664 FILE *inf; |
240 | 3665 { |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
3666 char *cp; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
3667 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
3668 do |
240 | 3669 { |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
3670 for (cp = plb->buffer; *cp != '\0'; cp++) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
3671 if (cp[0] == '*' && cp[1] == '/') |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
3672 return; |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3673 lineno++; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3674 linecharno += readline (plb, inf); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
3675 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
3676 while (!feof(inf)); |
240 | 3677 } |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3678 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3679 /* |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3680 * A predicate definition is added if it matches: |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3681 * <beginning of line><Prolog Atom><whitespace>( |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3682 * |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3683 * It is added to the tags database if it doesn't match the |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3684 * name of the previous clause header. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3685 * |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3686 * Return the size of the name of the predicate, or 0 if no header |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3687 * was found. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3688 */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3689 int |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3690 prolog_pred (s, last) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3691 char *s; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3692 char *last; /* Name of last clause. */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3693 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3694 int prolog_atom(); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3695 int prolog_white(); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3696 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3697 int pos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3698 int len; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3699 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3700 pos = prolog_atom(s, 0); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3701 if (pos < 1) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3702 return 0; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3703 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3704 len = pos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3705 pos += prolog_white(s, pos); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3706 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3707 if ((s[pos] == '(') || (s[pos] == '.')) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3708 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3709 if (s[pos] == '(') |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3710 pos++; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3711 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3712 /* Save only the first clause. */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3713 if ((last == NULL) || |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3714 (len != strlen(last)) || |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3715 (strncmp(s, last, len) != 0)) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3716 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3717 pfnote ((CTAGS) ? savenstr (s, len) : NULL, TRUE, |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3718 s, pos, lineno, linecharno); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3719 return len; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3720 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3721 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3722 return 0; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3723 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3724 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3725 /* |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3726 * Consume a Prolog atom. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3727 * Return the number of bytes consumed, or -1 if there was an error. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3728 * |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3729 * A prolog atom, in this context, could be one of: |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3730 * - An alphanumeric sequence, starting with a lower case letter. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3731 * - A quoted arbitrary string. Single quotes can escape themselves. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3732 * Backslash quotes everything. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3733 */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3734 int |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3735 prolog_atom (s, pos) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3736 char *s; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3737 int pos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3738 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3739 int origpos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3740 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3741 origpos = pos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3742 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3743 if (islower(s[pos]) || (s[pos] == '_')) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3744 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3745 /* The atom is unquoted. */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3746 pos++; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3747 while (isalnum(s[pos]) || (s[pos] == '_')) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3748 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3749 pos++; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3750 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3751 return pos - origpos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3752 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3753 else if (s[pos] == '\'') |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3754 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3755 pos++; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3756 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3757 while (1) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3758 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3759 if (s[pos] == '\'') |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3760 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3761 pos++; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3762 if (s[pos] != '\'') |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3763 break; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3764 pos++; /* A double quote */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3765 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3766 else if (s[pos] == '\0') |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3767 /* Multiline quoted atoms are ignored. */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3768 return -1; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3769 else if (s[pos] == '\\') |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3770 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3771 if (s[pos+1] == '\0') |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3772 return -1; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3773 pos += 2; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3774 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3775 else |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3776 pos++; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3777 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3778 return pos - origpos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3779 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3780 else |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3781 return -1; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3782 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3783 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3784 /* Consume whitespace. Return the number of bytes eaten. */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3785 int |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3786 prolog_white (s, pos) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3787 char *s; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3788 int pos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3789 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3790 int origpos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3791 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3792 origpos = pos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3793 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3794 while (isspace(s[pos])) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3795 pos++; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3796 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3797 return pos - origpos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3798 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3799 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3800 /* |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3801 * Support for Erlang -- Anders Lindgren, Feb 1996. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3802 * |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3803 * Generates tags for functions, defines, and records. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3804 * |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3805 * Assumes that Erlang functions start at column 0. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3806 */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3807 void |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3808 Erlang_functions (inf) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3809 FILE *inf; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3810 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3811 int erlang_func (); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3812 void erlang_attribute (); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3813 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3814 char * last; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3815 int len; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3816 int allocated; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3817 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3818 allocated = 0; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3819 len = 0; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3820 last = NULL; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3821 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3822 lineno = 0; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3823 linecharno = 0; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3824 charno = 0; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3825 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3826 while (!feof (inf)) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3827 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3828 lineno++; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3829 linecharno += charno; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3830 charno = readline (&lb, inf); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3831 dbp = lb.buffer; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3832 if (dbp[0] == '\0') /* Empty line */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3833 continue; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3834 else if (isspace (dbp[0])) /* Not function nor attribute */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3835 continue; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3836 else if (dbp[0] == '%') /* comment */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3837 continue; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3838 else if (dbp[0] == '"') /* Sometimes, strings start in column one */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3839 continue; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3840 else if (dbp[0] == '-') /* attribute, e.g. "-define" */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3841 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3842 erlang_attribute(dbp); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3843 last = NULL; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3844 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3845 else if (len = erlang_func (dbp, last)) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3846 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3847 /* |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3848 * Function. Store the function name so that we only |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3849 * generates a tag for the first clause. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3850 */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3851 if (last == NULL) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3852 last = xnew(len + 1, char); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3853 else if (len + 1 > allocated) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3854 last = (char *) xrealloc(last, len + 1); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3855 allocated = len + 1; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3856 strncpy (last, dbp, len); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3857 last[len] = '\0'; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3858 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3859 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3860 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3861 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3862 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3863 /* |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3864 * A function definition is added if it matches: |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3865 * <beginning of line><Erlang Atom><whitespace>( |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3866 * |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3867 * It is added to the tags database if it doesn't match the |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3868 * name of the previous clause header. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3869 * |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3870 * Return the size of the name of the function, or 0 if no function |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3871 * was found. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3872 */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3873 int |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3874 erlang_func (s, last) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3875 char *s; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3876 char *last; /* Name of last clause. */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3877 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3878 int erlang_atom (); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3879 int erlang_white (); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3880 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3881 int pos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3882 int len; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3883 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3884 pos = erlang_atom(s, 0); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3885 if (pos < 1) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3886 return 0; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3887 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3888 len = pos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3889 pos += erlang_white(s, pos); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3890 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3891 if (s[pos++] == '(') |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3892 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3893 /* Save only the first clause. */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3894 if ((last == NULL) || |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3895 (len != strlen(last)) || |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3896 (strncmp(s, last, len) != 0)) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3897 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3898 pfnote ((CTAGS) ? savenstr (s, len) : NULL, TRUE, |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3899 s, pos, lineno, linecharno); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3900 return len; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3901 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3902 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3903 return 0; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3904 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3905 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3906 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3907 /* |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3908 * Handle attributes. Currently, tags are generated for defines |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3909 * and records. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3910 * |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3911 * They are on the form: |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3912 * -define(foo, bar). |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3913 * -define(Foo(M, N), M+N). |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3914 * -record(graph, {vtab = notable, cyclic = true}). |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3915 */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3916 void |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3917 erlang_attribute (s) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3918 char *s; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3919 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3920 int erlang_atom (); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3921 int erlang_white (); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3922 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3923 int pos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3924 int len; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3925 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3926 if ((strncmp(s, "-define", 7) == 0) || |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3927 (strncmp(s, "-record", 7) == 0)) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3928 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3929 pos = 7; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3930 pos += erlang_white(s, pos); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3931 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3932 if (s[pos++] == '(') |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3933 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3934 pos += erlang_white(s, pos); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3935 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3936 if (len = erlang_atom(s, pos)) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3937 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3938 pfnote ((CTAGS) ? savenstr (& s[pos], len) : NULL, TRUE, |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3939 s, pos + len, lineno, linecharno); |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3940 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3941 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3942 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3943 return; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3944 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3945 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3946 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3947 /* |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3948 * Consume an Erlang atom (or variable). |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3949 * Return the number of bytes consumed, or -1 if there was an error. |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3950 */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3951 int |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3952 erlang_atom (s, pos) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3953 char *s; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3954 int pos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3955 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3956 int origpos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3957 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3958 origpos = pos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3959 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3960 if (isalpha (s[pos]) || s[pos] == '_') |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3961 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3962 /* The atom is unquoted. */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3963 pos++; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3964 while (isalnum (s[pos]) || s[pos] == '_') |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3965 pos++; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3966 return pos - origpos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3967 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3968 else if (s[pos] == '\'') |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3969 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3970 pos++; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3971 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3972 while (1) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3973 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3974 if (s[pos] == '\'') |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3975 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3976 pos++; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3977 break; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3978 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3979 else if (s[pos] == '\0') |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3980 /* Multiline quoted atoms are ignored. */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3981 return -1; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3982 else if (s[pos] == '\\') |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3983 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3984 if (s[pos+1] == '\0') |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3985 return -1; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3986 pos += 2; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3987 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3988 else |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3989 pos++; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3990 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3991 return pos - origpos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3992 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3993 else |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3994 return -1; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3995 } |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3996 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3997 /* Consume whitespace. Return the number of bytes eaten */ |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3998 int |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
3999 erlang_white (s, pos) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
4000 char *s; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
4001 int pos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
4002 { |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
4003 int origpos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
4004 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
4005 origpos = pos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
4006 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
4007 while (isspace (s[pos])) |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
4008 pos++; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
4009 |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
4010 return pos - origpos; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
4011 } |
240 | 4012 |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4013 #ifdef ETAGS_REGEXPS |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4014 /* Take a string like "/blah/" and turn it into "blah", making sure |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4015 that the first and last characters are the same, and handling |
14021
19bab04cf346
(substitute): Fix spelling in message.
Karl Heuer <kwzh@gnu.org>
parents:
13696
diff
changeset
|
4016 quoted separator characters. Actually, stops on the occurrence of |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4017 an unquoted separator. Also turns "\t" into a Tab character. |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4018 Returns pointer to terminating separator. Works in place. Null |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4019 terminates name string. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4020 char * |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4021 scan_separators (name) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4022 char *name; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4023 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4024 char sep = name[0]; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4025 char *copyto = name; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4026 logical quoted = FALSE; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4027 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4028 for (++name; *name != '\0'; ++name) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4029 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4030 if (quoted) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4031 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4032 if (*name == 't') |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4033 *copyto++ = '\t'; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4034 else if (*name == sep) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4035 *copyto++ = sep; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4036 else |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4037 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4038 /* Something else is quoted, so preserve the quote. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4039 *copyto++ = '\\'; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4040 *copyto++ = *name; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4041 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4042 quoted = FALSE; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4043 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4044 else if (*name == '\\') |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4045 quoted = TRUE; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4046 else if (*name == sep) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4047 break; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4048 else |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4049 *copyto++ = *name; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4050 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4051 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4052 /* Terminate copied string. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4053 *copyto = '\0'; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4054 return name; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4055 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4056 |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4057 /* Look at the argument of --regex or --no-regex and do the right |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4058 thing. */ |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4059 void |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4060 analyse_regex (regex_arg) |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4061 char *regex_arg; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4062 { |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4063 struct stat stat_buf; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4064 |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4065 if (regex_arg == NULL) |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4066 { |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4067 /* Remove existing regexps. */ |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4068 num_patterns = 0; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4069 patterns = NULL; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4070 return; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4071 } |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4072 if (regex_arg[0] == '\0') |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4073 { |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4074 error ("missing regexp", (char *)NULL); |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4075 return; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4076 } |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4077 if (regex_arg[0] == '@' |
17785
5b92f8ba5c6d
Added support for the Java language.
Francesco Potortì <pot@gnu.org>
parents:
17778
diff
changeset
|
4078 && stat (regex_arg + 1, &stat_buf) == 0) |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4079 { |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4080 FILE *regexfp; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4081 struct linebuffer regexbuf; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4082 char *regexfile = regex_arg + 1; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4083 |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4084 /* regexfile is a file containing regexps, one per line. */ |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4085 regexfp = fopen (regexfile, "r"); |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4086 if (regexfp == NULL) |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4087 { |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4088 perror (regexfile); |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4089 return; |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4090 } |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4091 initbuffer (®exbuf); |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4092 while (readline_internal (®exbuf, regexfp)) |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4093 add_regex (regexbuf.buffer); |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4094 free (regexbuf.buffer); |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4095 fclose (regexfp); |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4096 } |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4097 else |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4098 { |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4099 add_regex (regex_arg); |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4100 } |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4101 } |
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4102 |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4103 /* Turn a name, which is an ed-style (but Emacs syntax) regular |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4104 expression, into a real regular expression by compiling it. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4105 void |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4106 add_regex (regexp_pattern) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4107 char *regexp_pattern; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4108 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4109 char *name; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4110 const char *err; |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4111 struct re_pattern_buffer *patbuf; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4112 |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4113 |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4114 if (regexp_pattern[strlen(regexp_pattern)-1] != regexp_pattern[0]) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4115 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4116 error ("%s: unterminated regexp", regexp_pattern); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4117 return; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4118 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4119 name = scan_separators (regexp_pattern); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4120 if (regexp_pattern[0] == '\0') |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4121 { |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
4122 error ("null regexp", (char *)NULL); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4123 return; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4124 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4125 (void) scan_separators (name); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4126 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4127 patbuf = xnew (1, struct re_pattern_buffer); |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4128 patbuf->translate = NULL; |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4129 patbuf->fastmap = NULL; |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4130 patbuf->buffer = NULL; |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4131 patbuf->allocated = 0; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4132 |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4133 re_syntax_options = RE_INTERVALS; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4134 err = re_compile_pattern (regexp_pattern, strlen (regexp_pattern), patbuf); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4135 if (err != NULL) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4136 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4137 error ("%s while compiling pattern", err); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4138 return; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4139 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4140 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4141 num_patterns += 1; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4142 if (num_patterns == 1) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4143 patterns = xnew (1, struct pattern); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4144 else |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4145 patterns = ((struct pattern *) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4146 xrealloc (patterns, |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4147 (num_patterns * sizeof (struct pattern)))); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4148 patterns[num_patterns - 1].pattern = patbuf; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4149 patterns[num_patterns - 1].name_pattern = savestr (name); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4150 patterns[num_patterns - 1].error_signaled = FALSE; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4151 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4152 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4153 /* |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
4154 * Do the substitutions indicated by the regular expression and |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4155 * arguments. |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4156 */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4157 char * |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4158 substitute (in, out, regs) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4159 char *in, *out; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4160 struct re_registers *regs; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4161 { |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4162 char *result, *t; |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4163 int size, dig, diglen; |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4164 |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4165 result = NULL; |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4166 size = strlen (out); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4167 |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4168 /* Pass 1: figure out how much to allocate by finding all \N strings. */ |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4169 if (out[size - 1] == '\\') |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4170 fatal ("pattern error in \"%s\"", out); |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4171 for (t = etags_strchr (out, '\\'); |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4172 t != NULL; |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4173 t = etags_strchr (t + 2, '\\')) |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4174 if (isdigit (t[1])) |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4175 { |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4176 dig = t[1] - '0'; |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4177 diglen = regs->end[dig] - regs->start[dig]; |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4178 size += diglen - 2; |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4179 } |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4180 else |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4181 size -= 1; |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4182 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4183 /* Allocate space and do the substitutions. */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4184 result = xnew (size + 1, char); |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4185 |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4186 for (t = result; *out != '\0'; out++) |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4187 if (*out == '\\' && isdigit (*++out)) |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4188 { |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4189 /* Using "dig2" satisfies my debugger. Bleah. */ |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4190 dig = *out - '0'; |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4191 diglen = regs->end[dig] - regs->start[dig]; |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4192 strncpy (t, in + regs->start[dig], diglen); |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4193 t += diglen; |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4194 } |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4195 else |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4196 *t++ = *out; |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4197 *t = '\0'; |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4198 |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4199 if (DEBUG && (t > result + size || t - result != strlen (result))) |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4200 abort (); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4201 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4202 return result; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4203 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4204 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4205 #endif /* ETAGS_REGEXPS */ |
240 | 4206 /* Initialize a linebuffer for use */ |
4207 void | |
4208 initbuffer (linebuffer) | |
4209 struct linebuffer *linebuffer; | |
4210 { | |
4211 linebuffer->size = 200; | |
4212 linebuffer->buffer = xnew (200, char); | |
4213 } | |
4214 | |
4215 /* | |
4216 * Read a line of text from `stream' into `linebuffer'. | |
4217 * Return the number of characters read from `stream', | |
4218 * which is the length of the line including the newline, if any. | |
4219 */ | |
4220 long | |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4221 readline_internal (linebuffer, stream) |
240 | 4222 struct linebuffer *linebuffer; |
4223 register FILE *stream; | |
4224 { | |
4225 char *buffer = linebuffer->buffer; | |
4226 register char *p = linebuffer->buffer; | |
4227 register char *pend; | |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
4228 int chars_deleted; |
240 | 4229 |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3569
diff
changeset
|
4230 pend = p + linebuffer->size; /* Separate to avoid 386/IX compiler bug. */ |
240 | 4231 |
4232 while (1) | |
4233 { | |
4234 register int c = getc (stream); | |
4235 if (p == pend) | |
4236 { | |
4237 linebuffer->size *= 2; | |
4238 buffer = (char *) xrealloc (buffer, linebuffer->size); | |
4239 p += buffer - linebuffer->buffer; | |
4240 pend = buffer + linebuffer->size; | |
4241 linebuffer->buffer = buffer; | |
4242 } | |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
4243 if (c == EOF) |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
4244 { |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
4245 *p = '\0'; |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
4246 chars_deleted = 0; |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
4247 break; |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
4248 } |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
4249 if (c == '\n') |
240 | 4250 { |
10990
c0ceaa45ded7
* etags.c (process_file): free (filename) after using it.
Francesco Potortì <pot@gnu.org>
parents:
10801
diff
changeset
|
4251 if (p > buffer && p[-1] == '\r') |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
4252 { |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4253 p -= 1; |
15772
eb1cef7102e3
(readline_internal) [DOS_NT]: Don't include CRs when
Richard M. Stallman <rms@gnu.org>
parents:
15683
diff
changeset
|
4254 #ifdef DOS_NT |
16373
d50369f4bb41
* etags.c (print_version): Print copyright info.
Francesco Potortì <pot@gnu.org>
parents:
16086
diff
changeset
|
4255 /* Assume CRLF->LF translation will be performed by Emacs |
d50369f4bb41
* etags.c (print_version): Print copyright info.
Francesco Potortì <pot@gnu.org>
parents:
16086
diff
changeset
|
4256 when loading this file, so CRs won't appear in the buffer. |
d50369f4bb41
* etags.c (print_version): Print copyright info.
Francesco Potortì <pot@gnu.org>
parents:
16086
diff
changeset
|
4257 It would be cleaner to compensate within Emacs; |
d50369f4bb41
* etags.c (print_version): Print copyright info.
Francesco Potortì <pot@gnu.org>
parents:
16086
diff
changeset
|
4258 however, Emacs does not know how many CRs were deleted |
d50369f4bb41
* etags.c (print_version): Print copyright info.
Francesco Potortì <pot@gnu.org>
parents:
16086
diff
changeset
|
4259 before any given point in the file. */ |
15772
eb1cef7102e3
(readline_internal) [DOS_NT]: Don't include CRs when
Richard M. Stallman <rms@gnu.org>
parents:
15683
diff
changeset
|
4260 chars_deleted = 1; |
eb1cef7102e3
(readline_internal) [DOS_NT]: Don't include CRs when
Richard M. Stallman <rms@gnu.org>
parents:
15683
diff
changeset
|
4261 #else |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
4262 chars_deleted = 2; |
15772
eb1cef7102e3
(readline_internal) [DOS_NT]: Don't include CRs when
Richard M. Stallman <rms@gnu.org>
parents:
15683
diff
changeset
|
4263 #endif |
10376
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
4264 } |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
4265 else |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
4266 { |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
4267 chars_deleted = 1; |
b1c4515958b6
* etags.c (Lang_function): Use void instead to declare the
Francesco Potortì <pot@gnu.org>
parents:
10355
diff
changeset
|
4268 } |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4269 *p = '\0'; |
240 | 4270 break; |
4271 } | |
4272 *p++ = c; | |
4273 } | |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4274 linebuffer->len = p - buffer; |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4275 |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4276 return linebuffer->len + chars_deleted; |
240 | 4277 } |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4278 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4279 /* |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4280 * Like readline_internal, above, but in addition try to match the |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4281 * input line against any existing regular expressions. |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4282 */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4283 long |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4284 readline (linebuffer, stream) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4285 struct linebuffer *linebuffer; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4286 FILE *stream; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4287 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4288 /* Read new line. */ |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
4289 long result = readline_internal (linebuffer, stream); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
4290 #ifdef ETAGS_REGEXPS |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4291 int i; |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
4292 |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4293 /* Match against all listed patterns. */ |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4294 if (linebuffer->len > 0) |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4295 for (i = 0; i < num_patterns; ++i) |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4296 { |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4297 int match = re_match (patterns[i].pattern, linebuffer->buffer, |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4298 linebuffer->len, 0, &patterns[i].regs); |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4299 switch (match) |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4300 { |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4301 case -2: |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4302 /* Some error. */ |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4303 if (!patterns[i].error_signaled) |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4304 { |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4305 error ("error while matching pattern %d", i); |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4306 patterns[i].error_signaled = TRUE; |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4307 } |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4308 break; |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4309 case -1: |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4310 /* No match. */ |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4311 break; |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4312 default: |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4313 /* Match occurred. Construct a tag. */ |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4314 if (patterns[i].name_pattern[0] != '\0') |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4315 { |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4316 /* Make a named tag. */ |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4317 char *name = substitute (linebuffer->buffer, |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4318 patterns[i].name_pattern, |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4319 &patterns[i].regs); |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4320 if (name != NULL) |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4321 pfnote (name, TRUE, |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4322 linebuffer->buffer, match, lineno, linecharno); |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4323 } |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4324 else |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4325 { |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4326 /* Make an unnamed tag. */ |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4327 pfnote ((char *)NULL, TRUE, |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
4328 linebuffer->buffer, match, lineno, linecharno); |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4329 } |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4330 break; |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4331 } |
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4332 } |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4333 #endif /* ETAGS_REGEXPS */ |
17602
39b58a508be6
* etags.c [TeX_named_tokens]: Set to FALSE if undefined.
Francesco Potortì <pot@gnu.org>
parents:
17477
diff
changeset
|
4334 |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4335 return result; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4336 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4337 |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4338 /* |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4339 * Read a file, but do no processing. This is used to do regexp |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4340 * matching on files that have no language defined. |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4341 */ |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4342 void |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4343 just_read_file (inf) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4344 FILE *inf; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4345 { |
14859
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
4346 lineno = 0; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
4347 charno = 0; |
efa1bc6b7b17
* etags.c (just_read_file): Reset lineno and charno on entry.
Francesco Potortì <pot@gnu.org>
parents:
14230
diff
changeset
|
4348 |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4349 while (!feof (inf)) |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4350 { |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4351 ++lineno; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4352 linecharno = charno; |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4353 charno += readline (&lb, inf); |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4354 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4355 } |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4356 |
240 | 4357 |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
4358 /* |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
4359 * Return a pointer to a space of size strlen(cp)+1 allocated |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
4360 * with xnew where the string CP has been copied. |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
4361 */ |
240 | 4362 char * |
4363 savestr (cp) | |
4364 char *cp; | |
4365 { | |
4366 return savenstr (cp, strlen (cp)); | |
4367 } | |
4368 | |
10404
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
4369 /* |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
4370 * Return a pointer to a space of size LEN+1 allocated with xnew where |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
4371 * the string CP has been copied for at most the first LEN characters. |
631f1dac6f7a
Global polishing, some bugs corrected, dynamic allocation used instead
Francesco Potortì <pot@gnu.org>
parents:
10378
diff
changeset
|
4372 */ |
240 | 4373 char * |
4374 savenstr (cp, len) | |
4375 char *cp; | |
4376 int len; | |
4377 { | |
4378 register char *dp; | |
4379 | |
4380 dp = xnew (len + 1, char); | |
5940
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
4381 strncpy (dp, cp, len); |
240 | 4382 dp[len] = '\0'; |
4383 return dp; | |
4384 } | |
4385 | |
4386 /* | |
4387 * Return the ptr in sp at which the character c last | |
4388 * appears; NULL if not found | |
4389 * | |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
4390 * Identical to System V strrchr, included for portability. |
240 | 4391 */ |
4392 char * | |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
4393 etags_strrchr (sp, c) |
240 | 4394 register char *sp, c; |
4395 { | |
4396 register char *r; | |
4397 | |
4398 r = NULL; | |
4399 do | |
4400 { | |
4401 if (*sp == c) | |
4402 r = sp; | |
4403 } while (*sp++); | |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4404 return r; |
240 | 4405 } |
4406 | |
774 | 4407 |
240 | 4408 /* |
4409 * Return the ptr in sp at which the character c first | |
4410 * appears; NULL if not found | |
4411 * | |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
4412 * Identical to System V strchr, included for portability. |
240 | 4413 */ |
4414 char * | |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
4415 etags_strchr (sp, c) |
240 | 4416 register char *sp, c; |
4417 { | |
4418 do | |
4419 { | |
4420 if (*sp == c) | |
9976
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4421 return sp; |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4422 } while (*sp++); |
2869e501c2de
* etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
Francesco Potortì <pot@gnu.org>
parents:
9975
diff
changeset
|
4423 return NULL; |
240 | 4424 } |
4425 | |
4426 /* Print error message and exit. */ | |
4427 void | |
4428 fatal (s1, s2) | |
4429 char *s1, *s2; | |
4430 { | |
4431 error (s1, s2); | |
5940
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
4432 exit (BAD); |
240 | 4433 } |
4434 | |
10378
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4435 void |
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4436 pfatal (s1) |
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4437 char *s1; |
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4438 { |
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4439 perror (s1); |
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4440 exit (BAD); |
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4441 } |
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4442 |
13696
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
4443 void |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
4444 suggest_asking_for_help () |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
4445 { |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
4446 fprintf (stderr, "\tTry `%s --help' for a complete list of options.\n", |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
4447 progname); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
4448 exit (BAD); |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
4449 } |
f89aa5a5c485
* etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
Francesco Potortì <pot@gnu.org>
parents:
13404
diff
changeset
|
4450 |
240 | 4451 /* Print error message. `s1' is printf control string, `s2' is arg for it. */ |
4452 void | |
4453 error (s1, s2) | |
4454 char *s1, *s2; | |
4455 { | |
4456 fprintf (stderr, "%s: ", progname); | |
4457 fprintf (stderr, s1, s2); | |
4458 fprintf (stderr, "\n"); | |
4459 } | |
4460 | |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4461 /* Return a newly-allocated string whose contents |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4462 concatenate those of s1, s2, s3. */ |
240 | 4463 char * |
4464 concat (s1, s2, s3) | |
4465 char *s1, *s2, *s3; | |
4466 { | |
4467 int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); | |
4468 char *result = xnew (len1 + len2 + len3 + 1, char); | |
4469 | |
5940
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
4470 strcpy (result, s1); |
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
4471 strcpy (result + len1, s2); |
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
4472 strcpy (result + len1 + len2, s3); |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4473 result[len1 + len2 + len3] = '\0'; |
240 | 4474 |
4475 return result; | |
4476 } | |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
4477 |
10378
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4478 /* Does the same work as the system V getcwd, but does not need to |
13380
12bfc1ecec61
* etags.c (lowcase): Use the standard tolower function.
Francesco Potortì <pot@gnu.org>
parents:
12879
diff
changeset
|
4479 guess the buffer size in advance. */ |
7227
6fa038c33a0f
[MSDOS]: #include <sys/param.h> for the following.
Richard M. Stallman <rms@gnu.org>
parents:
7049
diff
changeset
|
4480 char * |
6fa038c33a0f
[MSDOS]: #include <sys/param.h> for the following.
Richard M. Stallman <rms@gnu.org>
parents:
7049
diff
changeset
|
4481 etags_getcwd () |
11992
e550e0d13e83
* etags.c (etags_getcwd): Undo the /bin/pwd change. It may raise
Francesco Potortì <pot@gnu.org>
parents:
11990
diff
changeset
|
4482 { |
16086
33519c691e63
(etags_getcwd): Use getcwd if available even if MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
15772
diff
changeset
|
4483 #ifdef HAVE_GETCWD |
10378
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4484 int bufsize = 200; |
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4485 char *path = xnew (bufsize, char); |
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4486 |
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4487 while (getcwd (path, bufsize) == NULL) |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
4488 { |
9975
e21b0674f37c
* etags.c (<errno.h>): #include added.
Francesco Potortì <pot@gnu.org>
parents:
9773
diff
changeset
|
4489 if (errno != ERANGE) |
11886
c5db1295f7df
* etags.c (etags_getcwd): Use /bin/pwd instead of pwd because the
Francesco Potortì <pot@gnu.org>
parents:
11673
diff
changeset
|
4490 pfatal ("getcwd"); |
9975
e21b0674f37c
* etags.c (<errno.h>): #include added.
Francesco Potortì <pot@gnu.org>
parents:
9773
diff
changeset
|
4491 bufsize *= 2; |
17778
c3ff4c535c9c
* etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
Francesco Potortì <pot@gnu.org>
parents:
17602
diff
changeset
|
4492 free (path); |
10378
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4493 path = xnew (bufsize, char); |
8789
81a2817b99b2
(etags_getcwd): Use getcwd if available.
Karl Heuer <kwzh@gnu.org>
parents:
8180
diff
changeset
|
4494 } |
10378
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4495 |
16394
675944d1abc9
(etags_getcwd) [WINDOWSNT]: Convert backslashes to slashes.
Richard M. Stallman <rms@gnu.org>
parents:
16373
diff
changeset
|
4496 #if WINDOWSNT |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
4497 { |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
4498 /* Convert backslashes to slashes. */ |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
4499 char *p; |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
4500 for (p = path; *p != '\0'; p++) |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
4501 if (*p == '\\') |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
4502 *p = '/'; |
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
4503 } |
16394
675944d1abc9
(etags_getcwd) [WINDOWSNT]: Convert backslashes to slashes.
Richard M. Stallman <rms@gnu.org>
parents:
16373
diff
changeset
|
4504 #endif |
675944d1abc9
(etags_getcwd) [WINDOWSNT]: Convert backslashes to slashes.
Richard M. Stallman <rms@gnu.org>
parents:
16373
diff
changeset
|
4505 |
10378
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4506 return path; |
16394
675944d1abc9
(etags_getcwd) [WINDOWSNT]: Convert backslashes to slashes.
Richard M. Stallman <rms@gnu.org>
parents:
16373
diff
changeset
|
4507 |
16086
33519c691e63
(etags_getcwd): Use getcwd if available even if MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
15772
diff
changeset
|
4508 #else /* not HAVE_GETCWD */ |
33519c691e63
(etags_getcwd): Use getcwd if available even if MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
15772
diff
changeset
|
4509 #ifdef MSDOS |
33519c691e63
(etags_getcwd): Use getcwd if available even if MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
15772
diff
changeset
|
4510 char *p, path[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */ |
33519c691e63
(etags_getcwd): Use getcwd if available even if MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
15772
diff
changeset
|
4511 |
33519c691e63
(etags_getcwd): Use getcwd if available even if MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
15772
diff
changeset
|
4512 getwd (path); |
33519c691e63
(etags_getcwd): Use getcwd if available even if MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
15772
diff
changeset
|
4513 |
33519c691e63
(etags_getcwd): Use getcwd if available even if MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
15772
diff
changeset
|
4514 for (p = path; *p != '\0'; p++) |
33519c691e63
(etags_getcwd): Use getcwd if available even if MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
15772
diff
changeset
|
4515 if (*p == '\\') |
33519c691e63
(etags_getcwd): Use getcwd if available even if MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
15772
diff
changeset
|
4516 *p = '/'; |
33519c691e63
(etags_getcwd): Use getcwd if available even if MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
15772
diff
changeset
|
4517 else |
33519c691e63
(etags_getcwd): Use getcwd if available even if MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
15772
diff
changeset
|
4518 *p = lowcase (*p); |
33519c691e63
(etags_getcwd): Use getcwd if available even if MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
15772
diff
changeset
|
4519 |
33519c691e63
(etags_getcwd): Use getcwd if available even if MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
15772
diff
changeset
|
4520 return strdup (path); |
33519c691e63
(etags_getcwd): Use getcwd if available even if MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
15772
diff
changeset
|
4521 #else /* not MSDOS */ |
10378
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4522 struct linebuffer path; |
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4523 FILE *pipe; |
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4524 |
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4525 initbuffer (&path); |
11990
1e5d25c997ca
* etags.c (etags_getcwd): Undo the /bin/pwd change. It may raise
Francesco Potortì <pot@gnu.org>
parents:
11957
diff
changeset
|
4526 pipe = (FILE *) popen ("pwd 2>/dev/null", "r"); |
10378
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4527 if (pipe == NULL || readline_internal (&path, pipe) == 0) |
11990
1e5d25c997ca
* etags.c (etags_getcwd): Undo the /bin/pwd change. It may raise
Francesco Potortì <pot@gnu.org>
parents:
11957
diff
changeset
|
4528 pfatal ("pwd"); |
10378
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4529 pclose (pipe); |
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4530 |
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4531 return path.buffer; |
16086
33519c691e63
(etags_getcwd): Use getcwd if available even if MSDOS.
Richard M. Stallman <rms@gnu.org>
parents:
15772
diff
changeset
|
4532 #endif /* not MSDOS */ |
11992
e550e0d13e83
* etags.c (etags_getcwd): Undo the /bin/pwd change. It may raise
Francesco Potortì <pot@gnu.org>
parents:
11990
diff
changeset
|
4533 #endif /* not HAVE_GETCWD */ |
10378
fb23ac6e6199
* etags.c (pfatal): New function.
Francesco Potortì <pot@gnu.org>
parents:
10376
diff
changeset
|
4534 } |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
4535 |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4536 /* Return a newly allocated string containing the file name |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
4537 of FILE relative to the absolute directory DIR (which |
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
4538 should end with a slash). */ |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4539 char * |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4540 relative_filename (file, dir) |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4541 char *file, *dir; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4542 { |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
4543 char *fp, *dp, *abs, *res; |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4544 int i; |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4545 |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
4546 /* Find the common root of file and dir (with a trailing slash). */ |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
4547 abs = absolute_filename (file, cwd); |
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
4548 fp = abs; |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4549 dp = dir; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4550 while (*fp++ == *dp++) |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4551 continue; |
16573
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
4552 fp--, dp--; /* back to the first differing char */ |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4553 do /* look at the equal chars until '/' */ |
16540
bf7e776e40f6
* etags.c (relative_filename): Bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
16394
diff
changeset
|
4554 fp--, dp--; |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4555 while (*fp != '/'); |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4556 |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4557 /* Build a sequence of "../" strings for the resulting relative file name. */ |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4558 i = 0; |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4559 while ((dp = etags_strchr (dp + 1, '/')) != NULL) |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4560 i += 1; |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4561 res = xnew (3*i + strlen (fp + 1) + 1, char); |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4562 res[0] = '\0'; |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4563 while (i-- > 0) |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4564 strcat (res, "../"); |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4565 |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4566 /* Add the file name relative to the common root of file and dir. */ |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4567 strcat (res, fp + 1); |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
4568 free (abs); |
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
4569 |
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
4570 return res; |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4571 } |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4572 |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4573 /* Return a newly allocated string containing the |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4574 absolute file name of FILE given CWD (which should |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
4575 end with a slash). */ |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4576 char * |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4577 absolute_filename (file, cwd) |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4578 char *file, *cwd; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4579 { |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4580 char *slashp, *cp, *res; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4581 |
12344
7e7941d8cceb
* etags.c (find_entries): rewind before rereading the input file.
Francesco Potortì <pot@gnu.org>
parents:
12242
diff
changeset
|
4582 if (absolutefn (file)) |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4583 res = savestr (file); |
14920
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
4584 #ifdef DOS_NT |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4585 /* We don't support non-absolute file names with a drive |
14920
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
4586 letter, like `d:NAME' (it's too much hassle). */ |
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
4587 else if (file[1] == ':') |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4588 fatal ("%s: relative file names with drive letters not supported", file); |
14920
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
4589 #endif |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4590 else |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4591 res = concat (cwd, file, ""); |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4592 |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4593 /* Delete the "/dirname/.." and "/." substrings. */ |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
4594 slashp = etags_strchr (res, '/'); |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4595 while (slashp != NULL && slashp[0] != '\0') |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4596 { |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4597 if (slashp[1] == '.') |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4598 { |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4599 if (slashp[2] == '.' |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4600 && (slashp[3] == '/' || slashp[3] == '\0')) |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4601 { |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4602 cp = slashp; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4603 do |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4604 cp--; |
14924
67ec801831b8
(absolute_filename): Use absolutefn.
Richard M. Stallman <rms@gnu.org>
parents:
14920
diff
changeset
|
4605 while (cp >= res && !absolutefn (cp)); |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4606 if (cp < res) |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4607 cp = slashp; /* the absolute name begins with "/.." */ |
14920
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
4608 #ifdef DOS_NT |
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
4609 /* Under MSDOS and NT we get `d:/NAME' as absolute |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4610 file name, so the luser could say `d:/../NAME'. |
14920
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
4611 We silently treat this as `d:/NAME'. */ |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4612 else if (cp[0] != '/') |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4613 cp = slashp; |
14920
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
4614 #endif |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4615 strcpy (cp, slashp + 3); |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4616 slashp = cp; |
7776
f91e2cf8770b
* etags.c (absolute_filename): Remove infinite loop bug when
Francesco Potortì <pot@gnu.org>
parents:
7775
diff
changeset
|
4617 continue; |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4618 } |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4619 else if (slashp[2] == '/' || slashp[2] == '\0') |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4620 { |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4621 strcpy (slashp, slashp + 2); |
7776
f91e2cf8770b
* etags.c (absolute_filename): Remove infinite loop bug when
Francesco Potortì <pot@gnu.org>
parents:
7775
diff
changeset
|
4622 continue; |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4623 } |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4624 } |
7776
f91e2cf8770b
* etags.c (absolute_filename): Remove infinite loop bug when
Francesco Potortì <pot@gnu.org>
parents:
7775
diff
changeset
|
4625 |
f91e2cf8770b
* etags.c (absolute_filename): Remove infinite loop bug when
Francesco Potortì <pot@gnu.org>
parents:
7775
diff
changeset
|
4626 slashp = etags_strchr (slashp + 1, '/'); |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4627 } |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4628 |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4629 if (res[0] == '\0') |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4630 return savestr ("/"); |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4631 else |
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4632 return res; |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4633 } |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4634 |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
4635 /* Return a newly allocated string containing the absolute |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4636 file name of dir where FILE resides given CWD (which should |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
4637 end with a slash). */ |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4638 char * |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4639 absolute_dirname (file, cwd) |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4640 char *file, *cwd; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4641 { |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4642 char *slashp, *res; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4643 char save; |
14920
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
4644 #ifdef DOS_NT |
15243
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
4645 char *p; |
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
4646 |
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
4647 for (p = file; *p != '\0'; p++) |
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
4648 if (*p == '\\') |
c024dca549c5
* etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
Francesco Potortì <pot@gnu.org>
parents:
14982
diff
changeset
|
4649 *p = '/'; |
14920
b909bb3e64c9
(absolutefn) [DOS_NT]: Support Novell drives whose drive
Richard M. Stallman <rms@gnu.org>
parents:
14859
diff
changeset
|
4650 #endif |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4651 |
6592
9a76406c9f98
* etags.c (main): use etags_getcwd for compatibility.
Francesco Potortì <pot@gnu.org>
parents:
6530
diff
changeset
|
4652 slashp = etags_strrchr (file, '/'); |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4653 if (slashp == NULL) |
17477
1b5cc3740793
Tue Apr 15 16:09:15 1997 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
17168
diff
changeset
|
4654 return savestr (cwd); |
6482
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4655 save = slashp[1]; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4656 slashp[1] = '\0'; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4657 res = absolute_filename (file, cwd); |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4658 slashp[1] = save; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4659 |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4660 return res; |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4661 } |
91112dd5c9f5
* etags.c (cwd, outfiledir): vars added.
Francesco Potortì <pot@gnu.org>
parents:
5976
diff
changeset
|
4662 |
16573
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
4663 /* Increase the size of a linebuffer. */ |
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
4664 void |
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
4665 grow_linebuffer (bufp, toksize) |
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
4666 struct linebuffer *bufp; |
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
4667 int toksize; |
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
4668 { |
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
4669 while (bufp->size < toksize) |
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
4670 bufp->size *= 2; |
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
4671 bufp->buffer = (char *) xrealloc (bufp->buffer, bufp->size); |
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
4672 } |
4ed8667d6bd9
Wed Nov 13 17:51:29 1996 Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Francesco Potortì <pot@gnu.org>
parents:
16540
diff
changeset
|
4673 |
240 | 4674 /* Like malloc but get fatal error if memory is exhausted. */ |
11673
46d2178719ad
(C_entries): Cast result of xrealloc.
Richard M. Stallman <rms@gnu.org>
parents:
11231
diff
changeset
|
4675 long * |
240 | 4676 xmalloc (size) |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
4677 unsigned int size; |
240 | 4678 { |
11673
46d2178719ad
(C_entries): Cast result of xrealloc.
Richard M. Stallman <rms@gnu.org>
parents:
11231
diff
changeset
|
4679 long *result = (long *) malloc (size); |
5940
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
4680 if (result == NULL) |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
4681 fatal ("virtual memory exhausted", (char *)NULL); |
240 | 4682 return result; |
4683 } | |
4684 | |
11673
46d2178719ad
(C_entries): Cast result of xrealloc.
Richard M. Stallman <rms@gnu.org>
parents:
11231
diff
changeset
|
4685 long * |
240 | 4686 xrealloc (ptr, size) |
4687 char *ptr; | |
5580
517d8eb361f8
* etags.c (stab_entry, stab_create, stab_find, stab_search,
Francesco Potortì <pot@gnu.org>
parents:
5448
diff
changeset
|
4688 unsigned int size; |
240 | 4689 { |
12879
3b90cbba7dad
* etags.c (Pascal_functions): Close comment bug corrected.
Francesco Potortì <pot@gnu.org>
parents:
12398
diff
changeset
|
4690 long *result = (long *) realloc (ptr, size); |
5940
e663f6626075
* etags.c (absolute_pathnames, cwd): added global vars.
Francesco Potortì <pot@gnu.org>
parents:
5580
diff
changeset
|
4691 if (result == NULL) |
16607
16b8d910795f
* etags.c (C_entries): Test tok.valid. This handles some
Francesco Potortì <pot@gnu.org>
parents:
16573
diff
changeset
|
4692 fatal ("virtual memory exhausted", (char *)NULL); |
240 | 4693 return result; |
4694 } |