/[global]/global/gtags/gtags.c
ViewVC logotype

Diff of /global/gtags/gtags.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.144 by shigio, Tue Oct 4 07:59:03 2005 UTC revision 1.145 by shigio, Sat Oct 8 12:49:50 2005 UTC
# Line 65  struct dup_entry { Line 65  struct dup_entry {
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 **);
# Line 152  static struct option const long_options[ Line 150  static struct option const long_options[
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   */   */
# Line 646  main(int argc, char **argv) Line 619  main(int argc, char **argv)
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    
# Line 677  main(int argc, char **argv) Line 649  main(int argc, char **argv)
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.
# Line 797  incremental(const char *dbpath, const ch Line 767  incremental(const char *dbpath, const ch
767          /*          /*
768           * execute updating.           * execute updating.
769           */           */
         signal_setup();  
770          if (updated) {          if (updated) {
771                  int db;                  int db;
772    
# Line 811  incremental(const char *dbpath, const ch Line 780  incremental(const char *dbpath, const ch
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) {
# Line 822  incremental(const char *dbpath, const ch Line 789  incremental(const char *dbpath, const ch
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                  /*                  /*
# Line 949  updatetags(const char *dbpath, const cha Line 912  updatetags(const char *dbpath, const cha
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                           */                           */
# Line 1038  createtags(const char *dbpath, const cha Line 999  createtags(const char *dbpath, const cha
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.

Legend:
Removed from v.1.144  
changed lines
  Added in v.1.145

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26