46 |
defined(name) |
defined(name) |
47 |
const char *name; |
const char *name; |
48 |
{ |
{ |
|
char *path; |
|
|
|
|
49 |
if (dbop == NULL) { |
if (dbop == NULL) { |
50 |
const char *dbpath; |
const char *dbpath; |
51 |
|
|
54 |
*/ |
*/ |
55 |
if (!(dbpath = getenv("GTAGSDBPATH"))) |
if (!(dbpath = getenv("GTAGSDBPATH"))) |
56 |
dbpath = "."; |
dbpath = "."; |
57 |
path = strdup(makepath(dbpath, "GTAGS", NULL)); |
dbop = dbop_open(makepath(dbpath, "GTAGS", NULL), 0, 0, 0); |
|
if (path == NULL) |
|
|
die("short of memory."); |
|
|
dbop = dbop_open(path, 0, 0, 0); |
|
|
free(path); |
|
58 |
if (dbop == NULL) |
if (dbop == NULL) |
59 |
die("'%s' not found.", path); |
die("'GTAGS' not found."); |
60 |
} |
} |
61 |
if (dbop_get(dbop, name)) |
if (dbop_get(dbop, name)) |
62 |
return 1; |
return 1; |