57 |
static int opened; |
static int opened; |
58 |
|
|
59 |
static void trim(char *); |
static void trim(char *); |
60 |
static char *readrecord(const char *); |
static const char *readrecord(const char *); |
61 |
static void includelabel(STRBUF *, const char *, int); |
static void includelabel(STRBUF *, const char *, int); |
62 |
|
|
63 |
#ifndef isblank |
#ifndef isblank |
112 |
* o append following line. |
* o append following line. |
113 |
* o format check. |
* o format check. |
114 |
*/ |
*/ |
115 |
static char * |
static const char * |
116 |
readrecord(label) |
readrecord(label) |
117 |
const char *label; |
const char *label; |
118 |
{ |
{ |
135 |
} |
} |
136 |
trim(p); |
trim(p); |
137 |
for (;;) { |
for (;;) { |
138 |
char *candidate; |
const char *candidate; |
139 |
/* |
/* |
140 |
* pick up candidate. |
* pick up candidate. |
141 |
*/ |
*/ |
173 |
* i) label record label |
* i) label record label |
174 |
* i) level nest level for check |
* i) level nest level for check |
175 |
*/ |
*/ |
176 |
static void |
static void |
177 |
includelabel(sb, label, level) |
includelabel(sb, label, level) |
178 |
STRBUF *sb; |
STRBUF *sb; |
179 |
const char *label; |
const char *label; |
180 |
int level; |
int level; |
181 |
{ |
{ |
182 |
char *savep, *p, *q; |
const char *savep, *p, *q; |
183 |
|
|
184 |
if (++level > allowed_nest_level) |
if (++level > allowed_nest_level) |
185 |
die("nested include= (or tc=) over flow."); |
die("nested include= (or tc=) over flow."); |
197 |
strbuf_close(inc); |
strbuf_close(inc); |
198 |
} |
} |
199 |
strbuf_puts(sb, p); |
strbuf_puts(sb, p); |
200 |
free(savep); |
free((void *)savep); |
201 |
} |
} |
202 |
/* |
/* |
203 |
* configpath: get path of configuration file. |
* configpath: get path of configuration file. |
206 |
configpath(void) |
configpath(void) |
207 |
{ |
{ |
208 |
STATIC_STRBUF(sb); |
STATIC_STRBUF(sb); |
209 |
char *p; |
const char *p; |
210 |
|
|
211 |
strbuf_clear(sb); |
strbuf_clear(sb); |
212 |
/* |
/* |
244 |
openconf(void) |
openconf(void) |
245 |
{ |
{ |
246 |
STRBUF *sb; |
STRBUF *sb; |
247 |
char *config; |
const char *config; |
248 |
extern int vflag; |
extern int vflag; |
249 |
|
|
250 |
assert(opened == 0); |
assert(opened == 0); |
308 |
|
|
309 |
if (!getconfs("suffixes", NULL)) { |
if (!getconfs("suffixes", NULL)) { |
310 |
STRBUF *tmp = strbuf_open(0); |
STRBUF *tmp = strbuf_open(0); |
311 |
char *langmap = NULL; |
const char *langmap = NULL; |
312 |
|
|
313 |
/* |
/* |
314 |
* Variable 'suffixes' is obsoleted. But it is generated |
* Variable 'suffixes' is obsoleted. But it is generated |
332 |
* (Otherwise, nothing to do for gtags.) |
* (Otherwise, nothing to do for gtags.) |
333 |
*/ |
*/ |
334 |
if (!getconfs("GTAGS", NULL) && !getconfs("GRTAGS", NULL) && !getconfs("GSYMS", NULL)) { |
if (!getconfs("GTAGS", NULL) && !getconfs("GRTAGS", NULL) && !getconfs("GSYMS", NULL)) { |
335 |
char *path; |
const char *path; |
336 |
|
|
337 |
/* |
/* |
338 |
* usable search in BINDIR at first. |
* usable search in BINDIR at first. |
377 |
const char *name; |
const char *name; |
378 |
int *num; |
int *num; |
379 |
{ |
{ |
380 |
char *p; |
const char *p; |
381 |
char buf[MAXPROPLEN+1]; |
char buf[MAXPROPLEN+1]; |
382 |
|
|
383 |
if (!opened) |
if (!opened) |
403 |
const char *name; |
const char *name; |
404 |
STRBUF *sb; |
STRBUF *sb; |
405 |
{ |
{ |
406 |
char *p; |
const char *p; |
407 |
char buf[MAXPROPLEN+1]; |
char buf[MAXPROPLEN+1]; |
408 |
int all = 0; |
int all = 0; |
409 |
int exist = 0; |
int exist = 0; |
464 |
/* |
/* |
465 |
* getconfline: print loaded config entry. |
* getconfline: print loaded config entry. |
466 |
*/ |
*/ |
467 |
char * |
const char * |
468 |
getconfline(void) |
getconfline(void) |
469 |
{ |
{ |
470 |
if (!opened) |
if (!opened) |