/[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.130 by h-iwamoto, Tue Aug 9 16:39:53 2005 UTC revision 1.131 by h-iwamoto, Fri Aug 19 05:08:14 2005 UTC
# Line 94  int debug; Line 94  int debug;
94  int secure_mode;  int secure_mode;
95  const char *extra_options;  const char *extra_options;
96  const char *info_string;  const char *info_string;
97    const char *file_list;
98    
99  int extractmethod;  int extractmethod;
100  int total;  int total;
# Line 130  static struct option const long_options[ Line 131  static struct option const long_options[
131          {"cxref", no_argument, &cxref, 1},          {"cxref", no_argument, &cxref, 1},
132          {"debug", no_argument, &debug, 1},          {"debug", no_argument, &debug, 1},
133          {"expand", required_argument, &do_expand, 1},          {"expand", required_argument, &do_expand, 1},
134            {"file", required_argument, NULL, 0},
135          {"find", no_argument, &do_find, 1},          {"find", no_argument, &do_find, 1},
136          {"gtagsconf", required_argument, &gtagsconf, 1},          {"gtagsconf", required_argument, &gtagsconf, 1},
137          {"gtagslabel", required_argument, &gtagslabel, 1},          {"gtagslabel", required_argument, &gtagslabel, 1},
# Line 220  main(argc, argv) Line 222  main(argc, argv)
222                                  }                                  }
223                                  set_env(name, value);                                  set_env(name, value);
224                                  gtagsconf = gtagslabel = 0;                                  gtagsconf = gtagslabel = 0;
225                            } else if (!strcmp(p, "file")) {
226                                    file_list = optarg;
227                          }                          }
228                          break;                          break;
229                  case 'c':                  case 'c':
# Line 684  incremental(dbpath, root) Line 688  incremental(dbpath, root)
688          /*          /*
689           * make add list and update list.           * make add list and update list.
690           */           */
691          for (find_open(NULL); (path = find_read()) != NULL; ) {          if (file_list)
692                    find_open_filelist(file_list, root);
693            else
694                    find_open(NULL);
695            while ((path = find_read()) != NULL) {
696                  const char *fid;                  const char *fid;
697    
698                  /* a blank at the head of path means 'NOT SOURCE'. */                  /* a blank at the head of path means 'NOT SOURCE'. */
# Line 925  createtags(dbpath, root, db) Line 933  createtags(dbpath, root, db)
933          int arg_count = 0;          int arg_count = 0;
934          STRBUF *path_list = strbuf_open(MAXPATHLEN);          STRBUF *path_list = strbuf_open(MAXPATHLEN);
935          int path_list_max;          int path_list_max;
936            static int gpath_created;
937    
938          /*          /*
939           * get tag command.           * get tag command.
# Line 973  createtags(dbpath, root, db) Line 982  createtags(dbpath, root, db)
982           * the source file as a lot as possible to decrease the invoking           * the source file as a lot as possible to decrease the invoking
983           * frequency of the parser.           * frequency of the parser.
984           */           */
985          for (find_open(NULL); (path = find_read()) != NULL; ) {          if (gpath_created)
986                    gfind_open(dbpath, NULL);
987            else if (file_list)
988                    find_open_filelist(file_list, root);
989            else
990                    find_open(NULL);
991            while ((path = gpath_created ? gfind_read() : find_read()) != NULL) {
992                  int skip = 0;                  int skip = 0;
993    
994                  /* a blank at the head of path means 'NOT SOURCE'. */                  /* a blank at the head of path means 'NOT SOURCE'. */
# Line 1028  createtags(dbpath, root, db) Line 1043  createtags(dbpath, root, db)
1043          if (strbuf_getlen(path_list))          if (strbuf_getlen(path_list))
1044                  gtags_add(gtop, strbuf_value(comline), path_list, gflags);                  gtags_add(gtop, strbuf_value(comline), path_list, gflags);
1045          total = count;                          /* save total count */          total = count;                          /* save total count */
1046          find_close();          if (gpath_created)
1047                    gfind_close();
1048            else
1049                    find_close();
1050            gpath_created = 1;
1051          gtags_close(gtop);          gtags_close(gtop);
1052          strbuf_close(comline);          strbuf_close(comline);
1053          strbuf_close(path_list);          strbuf_close(path_list);

Legend:
Removed from v.1.130  
changed lines
  Added in v.1.131

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