/[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.166 by shigio, Fri Nov 11 05:30:56 2005 UTC revision 1.167 by shigio, Fri Nov 11 08:04:05 2005 UTC
# Line 91  int cxref; Line 91  int cxref;
91  int fileid;  int fileid;
92  int gtagsconf;  int gtagsconf;
93  int gtagslabel;  int gtagslabel;
94    int unique;
95  int debug;  int debug;
96  const char *extra_options;  const char *extra_options;
97  const char *info_string;  const char *info_string;
# Line 135  static struct option const long_options[ Line 136  static struct option const long_options[
136          {"gtagslabel", required_argument, &gtagslabel, 1},          {"gtagslabel", required_argument, &gtagslabel, 1},
137          {"relative", no_argument, &do_relative, 1},          {"relative", no_argument, &do_relative, 1},
138          {"sort", no_argument, &do_sort, 1},          {"sort", no_argument, &do_sort, 1},
139            {"unique", no_argument, &unique, 1},
140          {"version", no_argument, &show_version, 1},          {"version", no_argument, &show_version, 1},
141          {"help", no_argument, &show_help, 1},          {"help", no_argument, &show_help, 1},
142          { 0 }          { 0 }
# Line 188  put_lines(char *lines, struct dup_entry Line 190  put_lines(char *lines, struct dup_entry
190                  struct dup_entry *e = &entries[i];                  struct dup_entry *e = &entries[i];
191                  int skip = 0;                  int skip = 0;
192    
193                  if (!strcmp(e->ptable.part[PART_PATH].start, last_path)) {                  if (unique) {
194                          if (e->lineno == last_lineno)                          if (!strcmp(e->ptable.part[PART_PATH].start, last_path)) {
195                                  skip = 1;                                  if (e->lineno == last_lineno)
196                          else                                          skip = 1;
197                                    else
198                                            last_lineno = e->lineno;
199                            } else {
200                                  last_lineno = e->lineno;                                  last_lineno = e->lineno;
201                  } else {                                  strlimcpy(last_path, e->ptable.part[PART_PATH].start, sizeof(last_path));
202                          last_lineno = e->lineno;                          }
                         strlimcpy(last_path, e->ptable.part[PART_PATH].start, sizeof(last_path));  
203                  }                  }
204                  recover(&e->ptable);                  recover(&e->ptable);
205                  if (!skip)                  if (!skip)
# Line 300  main(int argc, char **argv) Line 304  main(int argc, char **argv)
304                   * As long as the input meets the undermentioned requirement,                   * As long as the input meets the undermentioned requirement,
305                   * you can use this special sort command as a sort filter for                   * you can use this special sort command as a sort filter for
306                   * global(1) instead of external sort command.                   * global(1) instead of external sort command.
307                   * 'gtags --sort' is equivalent with                   * 'gtags --sort [--unique]' is equivalent with
308                   * 'sort -k 1,1 -k 3,3 -k 2,2n -u', but does not need temporary                   * 'sort -k 1,1 -k 3,3 -k 2,2n [-u]', but does not need
309                   *  files.                   * temporary files.
310                   *                   *
311                   * - Requirement -                   * - Requirement -
312                   * 1. input must be ctags -x format.                   * 1. input must be ctags -x format.

Legend:
Removed from v.1.166  
changed lines
  Added in v.1.167

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