2 * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * 3. All advertising materials mentioning features or use of this software
13 * must display the following acknowledgement:
14 * This product includes software developed by Shigio Yamaguchi.
15 * 4. Neither the name of the author nor the names of any co-contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 #define VERSIONKEY " __.VERSION"
43 #define COMPACTKEY " __.COMPACT"
44 #define PATHINDEXKEY " __.PATHINDEX"
52 #define GTAGS_CREATE 1
53 #define GTAGS_MODIFY 2
56 #define GTAGS_STANDARD 0 /* standard format */
57 #define GTAGS_COMPACT 1 /* compact format */
58 #define GTAGS_PATHINDEX 2 /* use path index */
60 #define GTAGS_UNIQUE 1 /* compress duplicate lines */
61 #define GTAGS_EXTRACTMETHOD 2 /* extract method from class definition */
63 #define GTOP_KEY 1 /* read key part */
64 #define GTOP_PREFIX 2 /* prefixed read */
67 DBOP *dbop; /* descripter of DBOP */
68 int format_version; /* format version */
69 int format; /* GTAGS_STANDARD, GTAGS_COMPACT */
71 int db; /* 0:GTAGS, 1:GRTAGS, 2:GSYMS */
72 int flags; /* flags */
73 char root[MAXPATHLEN+1]; /* root directory of source tree */
75 * Stuff for compact format
77 int opened; /* wether or not file opened */
78 char *line; /* current record */
79 char tag[IDENTLEN+1]; /* current tag */
80 char prev_tag[IDENTLEN+1]; /* previous tag */
81 char path[MAXPATHLEN+1]; /* current path */
82 char prev_path[MAXPATHLEN+1];/* previous path */
83 STRBUF *sb; /* string buffer */
84 FILE *fp; /* descriptor of 'path' */
85 char *lnop; /* current line number */
86 int lno; /* integer value of 'lnop' */
91 #define __P(protos) protos
93 #define __P(protos) ()
97 const char *dbname __P((int));
98 void makecommand __P((char *, char *, STRBUF *));
99 int formatcheck __P((char *, int));
100 GTOP *gtagsopen __P((char *, char *, int, int, int));
101 void gtagsput __P((GTOP *, char *, char *));
102 char *gtagsget __P((GTOP *, char *));
103 void gtagsadd __P((GTOP *, char *, char *, int));
104 void gtagsdelete __P((GTOP *, char *));
105 char *gtagsfirst __P((GTOP *, char *, int));
106 char *gtagsnext __P((GTOP *));
107 void gtagsclose __P((GTOP *));
109 #endif /* ! _GTOP_H_ */