65 |
|
|
66 |
static void usage(void); |
static void usage(void); |
67 |
static void help(void); |
static void help(void); |
|
void signal_setup(void); |
|
|
void onintr(int); |
|
68 |
static int compare_dup_entry(const void *, const void *); |
static int compare_dup_entry(const void *, const void *); |
69 |
static void put_lines(char *, struct dup_entry *, int); |
static void put_lines(char *, struct dup_entry *, int); |
70 |
int main(int, char **); |
int main(int, char **); |
150 |
{ 0 } |
{ 0 } |
151 |
}; |
}; |
152 |
|
|
|
/* |
|
|
* Gtags catch signal even if the parent ignore it. |
|
|
*/ |
|
|
int exitflag = 0; |
|
|
|
|
153 |
static const char *langmap = DEFAULTLANGMAP; |
static const char *langmap = DEFAULTLANGMAP; |
154 |
|
|
|
void |
|
|
onintr(int signo) |
|
|
{ |
|
|
signo = 0; /* to satisfy compiler */ |
|
|
exitflag = 1; |
|
|
} |
|
|
|
|
|
void |
|
|
signal_setup(void) |
|
|
{ |
|
|
signal(SIGINT, onintr); |
|
|
signal(SIGTERM, onintr); |
|
|
#ifdef SIGHUP |
|
|
signal(SIGHUP, onintr); |
|
|
#endif |
|
|
#ifdef SIGQUIT |
|
|
signal(SIGQUIT, onintr); |
|
|
#endif |
|
|
} |
|
|
|
|
155 |
/* |
/* |
156 |
* compare_dup_entry: compare function for sorting. |
* compare_dup_entry: compare function for sorting. |
157 |
*/ |
*/ |
619 |
/* |
/* |
620 |
* create GTAGS, GRTAGS and GSYMS |
* create GTAGS, GRTAGS and GSYMS |
621 |
*/ |
*/ |
|
signal_setup(); |
|
622 |
total = 0; /* counting file */ |
total = 0; /* counting file */ |
623 |
for (db = GTAGS; db < GTAGLIM; db++) { |
for (db = GTAGS; db < GTAGLIM; db++) { |
624 |
|
|
649 |
if (system(strbuf_value(sb))) |
if (system(strbuf_value(sb))) |
650 |
fprintf(stderr, "GSYMS_extra command failed: %s\n", strbuf_value(sb)); |
fprintf(stderr, "GSYMS_extra command failed: %s\n", strbuf_value(sb)); |
651 |
} |
} |
|
if (exitflag) |
|
|
exit(1); |
|
652 |
} |
} |
653 |
/* |
/* |
654 |
* create id-utils index. |
* create id-utils index. |
767 |
/* |
/* |
768 |
* execute updating. |
* execute updating. |
769 |
*/ |
*/ |
|
signal_setup(); |
|
770 |
if (updated) { |
if (updated) { |
771 |
int db; |
int db; |
772 |
|
|
780 |
if (vflag) |
if (vflag) |
781 |
fprintf(stderr, "[%s] Updating '%s'.\n", now(), dbname(db)); |
fprintf(stderr, "[%s] Updating '%s'.\n", now(), dbname(db)); |
782 |
updatetags(dbpath, root, deleteset, addlist, addtotal, db); |
updatetags(dbpath, root, deleteset, addlist, addtotal, db); |
|
if (exitflag) |
|
|
exit(1); |
|
783 |
} |
} |
784 |
} |
} |
785 |
if (strbuf_getlen(deletelist) > 0) { |
if (strbuf_getlen(deletelist) > 0) { |
789 |
|
|
790 |
gpath_open(dbpath, 2); |
gpath_open(dbpath, 2); |
791 |
for (p = start; p < end; p += strlen(p) + 1) { |
for (p = start; p < end; p += strlen(p) + 1) { |
|
if (exitflag) |
|
|
break; |
|
792 |
gpath_delete(p); |
gpath_delete(p); |
793 |
} |
} |
794 |
gpath_close(); |
gpath_close(); |
795 |
} |
} |
|
if (exitflag) |
|
|
exit(1); |
|
796 |
if (updated) { |
if (updated) { |
797 |
int db; |
int db; |
798 |
/* |
/* |
912 |
arg_count = 0; |
arg_count = 0; |
913 |
} |
} |
914 |
} |
} |
|
if (exitflag) |
|
|
break; |
|
915 |
/* |
/* |
916 |
* Add a path to the path list. |
* Add a path to the path list. |
917 |
*/ |
*/ |
999 |
/* a blank at the head of path means 'NOT SOURCE'. */ |
/* a blank at the head of path means 'NOT SOURCE'. */ |
1000 |
if (*path == ' ') |
if (*path == ' ') |
1001 |
continue; |
continue; |
|
if (exitflag) |
|
|
break; |
|
1002 |
count++; |
count++; |
1003 |
/* |
/* |
1004 |
* GSYMS doesn't treat asembler. |
* GSYMS doesn't treat asembler. |