Commit | Line | Data |
---|---|---|
86e31eca | 1 | /* |
ffa8a268 KB |
2 | * Copyright (c) 1987 The Regents of the University of California. |
3 | * All rights reserved. | |
4 | * | |
a3bb5b82 | 5 | * %sccs.include.redist.c% |
86e31eca KB |
6 | */ |
7 | ||
8 | #ifndef lint | |
6c2ce1d3 | 9 | static char sccsid[] = "@(#)lisp.c 5.5 (Berkeley) %G%"; |
ffa8a268 | 10 | #endif /* not lint */ |
86e31eca | 11 | |
6c2ce1d3 | 12 | #include <stdio.h> |
38dde0cd | 13 | #include <string.h> |
6c2ce1d3 | 14 | #include "ctags.h" |
86e31eca KB |
15 | |
16 | extern char *lbp; /* pointer shared with fortran */ | |
17 | ||
18 | /* | |
19 | * lisp tag functions | |
20 | * just look for (def or (DEF | |
21 | */ | |
22 | l_entries() | |
23 | { | |
24 | register int special; | |
25 | register char *cp, | |
26 | savedc; | |
27 | char tok[MAXTOKEN]; | |
28 | ||
29 | for (;;) { | |
30 | lineftell = ftell(inf); | |
31 | if (!fgets(lbuf,sizeof(lbuf),inf)) | |
32 | return; | |
33 | ++lineno; | |
34 | lbp = lbuf; | |
35 | if (!cicmp("(def")) | |
36 | continue; | |
37 | special = NO; | |
38 | switch(*lbp | ' ') { | |
39 | case 'm': | |
40 | if (cicmp("method")) | |
41 | special = YES; | |
42 | break; | |
43 | case 'w': | |
44 | if (cicmp("wrapper") || cicmp("whopper")) | |
45 | special = YES; | |
46 | } | |
47 | for (;!isspace(*lbp);++lbp); | |
48 | for (;isspace(*lbp);++lbp); | |
49 | for (cp = lbp;*cp && *cp != '\n';++cp); | |
50 | *cp = EOS; | |
51 | if (special) { | |
52 | if (!(cp = index(lbp,')'))) | |
53 | continue; | |
54 | for (;cp >= lbp && *cp != ':';--cp); | |
55 | if (cp < lbp) | |
56 | continue; | |
57 | lbp = cp; | |
58 | for (;*cp && *cp != ')' && *cp != ' ';++cp); | |
59 | } | |
60 | else | |
61 | for (cp = lbp + 1; | |
62 | *cp && *cp != '(' && *cp != ' ';++cp); | |
63 | savedc = *cp; | |
64 | *cp = EOS; | |
65 | (void)strcpy(tok,lbp); | |
66 | *cp = savedc; | |
67 | getline(); | |
68 | pfnote(tok,lineno); | |
69 | } | |
70 | /*NOTREACHED*/ | |
71 | } |