505 |
die("mkid not found."); |
die("mkid not found."); |
506 |
} |
} |
507 |
|
|
|
/* |
|
|
* Check whether or not your system has GLOBAL's gctags. |
|
|
* Some GNU/Linux distributions rename emacs's ctags to gctags! |
|
|
*/ |
|
|
{ |
|
|
FILE *ip = popen("gctags --check", "r"); |
|
|
STRBUF *ib = strbuf_open(MAXBUFLEN); |
|
|
if (strbuf_fgets(ib, ip, STRBUF_NOCRLF) == NULL || strcmp(strbuf_value(ib), "Part of GLOBAL")) { |
|
|
if (!qflag) { |
|
|
warning("gctags in your system is not GLOBAL's one."); |
|
|
fprintf(stderr, "Please type 'gctags --version'\n"); |
|
|
} |
|
|
} |
|
|
strbuf_close(ib); |
|
|
pclose(ip); /* don't check error status */ |
|
|
} |
|
508 |
if (!getcwd(cwd, MAXPATHLEN)) |
if (!getcwd(cwd, MAXPATHLEN)) |
509 |
die("cannot get current directory."); |
die("cannot get current directory."); |
510 |
canonpath(cwd); |
canonpath(cwd); |
548 |
if (cflag == 0 && getconfs("format", sb) && !strcmp(strbuf_value(sb), "compact")) |
if (cflag == 0 && getconfs("format", sb) && !strcmp(strbuf_value(sb), "compact")) |
549 |
cflag++; |
cflag++; |
550 |
/* |
/* |
551 |
* teach gctags(1) where is dbpath by environment variable. |
* teach gtags-parser(1) where is dbpath by environment variable. |
552 |
*/ |
*/ |
553 |
set_env("GTAGSDBPATH", dbpath); |
set_env("GTAGSDBPATH", dbpath); |
554 |
|
|
585 |
continue; |
continue; |
586 |
strbuf_reset(sb); |
strbuf_reset(sb); |
587 |
/* |
/* |
588 |
* get parser for db. (gctags by default) |
* get parser for db. (gtags-parser by default) |
589 |
*/ |
*/ |
590 |
if (!getconfs(dbname(db), sb)) |
if (!getconfs(dbname(db), sb)) |
591 |
continue; |
continue; |