140 |
|
|
141 |
static int command; |
static int command; |
142 |
static void |
static void |
143 |
setcom(c) |
setcom(int c) |
|
int c; |
|
144 |
{ |
{ |
145 |
if (command == 0) |
if (command == 0) |
146 |
command = c; |
command = c; |
148 |
usage(); |
usage(); |
149 |
} |
} |
150 |
int |
int |
151 |
main(argc, argv) |
main(int argc, char **argv) |
|
int argc; |
|
|
char *argv[]; |
|
152 |
{ |
{ |
153 |
const char *av = NULL; |
const char *av = NULL; |
154 |
int count; |
int count; |
531 |
* o) filter buffer |
* o) filter buffer |
532 |
*/ |
*/ |
533 |
void |
void |
534 |
makefilter(sb) |
makefilter(STRBUF *sb) |
|
STRBUF *sb; |
|
535 |
{ |
{ |
536 |
if (!nflag) { |
if (!nflag) { |
537 |
strbuf_puts(sb, strbuf_value(sortfilter)); |
strbuf_puts(sb, strbuf_value(sortfilter)); |
562 |
return op; |
return op; |
563 |
} |
} |
564 |
void |
void |
565 |
closefilter(op) |
closefilter(FILE *op) |
|
FILE *op; |
|
566 |
{ |
{ |
567 |
if (op != stdout) |
if (op != stdout) |
568 |
if (pclose(op) != 0) |
if (pclose(op) != 0) |
576 |
* i) prefix prefix of primary key |
* i) prefix prefix of primary key |
577 |
*/ |
*/ |
578 |
void |
void |
579 |
completion(dbpath, root, prefix) |
completion(const char *dbpath, const char *root, const char *prefix) |
|
const char *dbpath; |
|
|
const char *root; |
|
|
const char *prefix; |
|
580 |
{ |
{ |
581 |
const char *p; |
const char *p; |
582 |
int flags = GTOP_KEY; |
int flags = GTOP_KEY; |
603 |
* i) line tag's line |
* i) line tag's line |
604 |
*/ |
*/ |
605 |
void |
void |
606 |
printtag(op, line) |
printtag(FILE *op, const char *line) /* virtually const */ |
|
FILE *op; |
|
|
const char *line; /* virtually const */ |
|
607 |
{ |
{ |
608 |
if (xflag) { |
if (xflag) { |
609 |
fputs(line, op); |
fputs(line, op); |
636 |
* i) dbpath GTAGS directory |
* i) dbpath GTAGS directory |
637 |
*/ |
*/ |
638 |
void |
void |
639 |
idutils(pattern, dbpath) |
idutils(const char *pattern, const char *dbpath) |
|
const char *pattern; |
|
|
const char *dbpath; |
|
640 |
{ |
{ |
641 |
FILE *ip, *op; |
FILE *ip, *op; |
642 |
STRBUF *ib = strbuf_open(0); |
STRBUF *ib = strbuf_open(0); |
739 |
* i) pattern POSIX regular expression |
* i) pattern POSIX regular expression |
740 |
*/ |
*/ |
741 |
void |
void |
742 |
grep(pattern) |
grep(const char *pattern) |
|
const char *pattern; |
|
743 |
{ |
{ |
744 |
FILE *op, *fp; |
FILE *op, *fp; |
745 |
STRBUF *ib = strbuf_open(MAXBUFLEN); |
STRBUF *ib = strbuf_open(MAXBUFLEN); |
808 |
* i) dbpath |
* i) dbpath |
809 |
*/ |
*/ |
810 |
void |
void |
811 |
pathlist(dbpath, av) |
pathlist(const char *dbpath, const char *av) |
|
const char *dbpath; |
|
|
const char *av; |
|
812 |
{ |
{ |
813 |
FILE *op; |
FILE *op; |
814 |
const char *path, *p; |
const char *path, *p; |
876 |
* i) db type of parse |
* i) db type of parse |
877 |
*/ |
*/ |
878 |
void |
void |
879 |
parsefile(argc, argv, cwd, root, dbpath, db) |
parsefile(int argc, char **argv, const char *cwd, const char *root, const char *dbpath, int db) |
|
int argc; |
|
|
char **argv; |
|
|
const char *cwd; |
|
|
const char *root; |
|
|
const char *dbpath; |
|
|
int db; |
|
880 |
{ |
{ |
881 |
char rootdir[MAXPATHLEN+1]; |
char rootdir[MAXPATHLEN+1]; |
882 |
char buf[MAXPATHLEN+1], *path; |
char buf[MAXPATHLEN+1], *path; |
991 |
* r) number of objects found |
* r) number of objects found |
992 |
*/ |
*/ |
993 |
static int |
static int |
994 |
exec_parser(parser, path_list, cwd, root, op) |
exec_parser(const char *parser, STRBUF *path_list, const char *cwd, const char *root, FILE *op) |
|
const char *parser; |
|
|
STRBUF *path_list; |
|
|
const char *cwd; |
|
|
const char *root; |
|
|
FILE *op; |
|
995 |
{ |
{ |
996 |
const char *p; |
const char *p; |
997 |
FILE *ip; |
FILE *ip; |
1036 |
* r) count of output lines |
* r) count of output lines |
1037 |
*/ |
*/ |
1038 |
int |
int |
1039 |
search(pattern, root, dbpath, db) |
search(const char *pattern, const char *root, const char *dbpath, int db) |
|
const char *pattern; |
|
|
const char *root; |
|
|
const char *dbpath; |
|
|
int db; |
|
1040 |
{ |
{ |
1041 |
const char *p; |
const char *p; |
1042 |
int count = 0; |
int count = 0; |
1093 |
* i) from string |
* i) from string |
1094 |
*/ |
*/ |
1095 |
void |
void |
1096 |
ffformat(to, size, from) |
ffformat(char *to, int size, const char *from) |
|
char *to; |
|
|
int size; |
|
|
const char *from; |
|
1097 |
{ |
{ |
1098 |
const char *p; |
const char *p; |
1099 |
char *e = to; |
char *e = to; |