"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "gtags/gtags.c" between
global-6.6.4.tar.gz and global-6.6.5.tar.gz

About: GNU GLOBAL is a source code tag system that works the same way across diverse environments. It is similar to ctags or etags, but it is independent of any editor.

gtags.c  (global-6.6.4):gtags.c  (global-6.6.5)
/* /*
* Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2008, * Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2008,
* 2009, 2010, 2012, 2014, 2015, 2016, 2018 * 2009, 2010, 2012, 2014, 2015, 2016, 2018, 2020
* Tama Communications Corporation * Tama Communications Corporation
* *
* This file is part of GNU GLOBAL. * This file is part of GNU GLOBAL.
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 150 skipping to change at line 150
STRBUF *sb = strbuf_open(0); STRBUF *sb = strbuf_open(0);
if (getconfs(name, sb)) if (getconfs(name, sb))
fprintf(stdout, "%s\n", strbuf_value(sb)); fprintf(stdout, "%s\n", strbuf_value(sb));
else else
exist = 0; exist = 0;
strbuf_close(sb); strbuf_close(sb);
} }
return exist; return exist;
} }
static const char *short_options = "cd:f:iIn:oOqvwse"; const char *short_options = "cC:d:f:iIn:oOqvwse";
static struct option const long_options[] = { struct option const long_options[] = {
/* /*
* These options have long name and short name. * These options have long name and short name.
* We throw them to the processing of short options. * We throw them to the processing of short options.
* *
* Though the -o(--omit-gsyms) was removed, this code * Though the -o(--omit-gsyms) was removed, this code
* is left for compatibility. * is left for compatibility.
*/ */
{"compact", no_argument, NULL, 'c'}, {"compact", no_argument, NULL, 'c'},
{"directory", required_argument, NULL, 'C'},
{"dump", required_argument, NULL, 'd'}, {"dump", required_argument, NULL, 'd'},
{"file", required_argument, NULL, 'f'}, {"file", required_argument, NULL, 'f'},
{"idutils", no_argument, NULL, 'I'}, {"idutils", no_argument, NULL, 'I'},
{"incremental", no_argument, NULL, 'i'}, {"incremental", no_argument, NULL, 'i'},
{"max-args", required_argument, NULL, 'n'}, {"max-args", required_argument, NULL, 'n'},
{"omit-gsyms", no_argument, NULL, 'o'}, /* removed */ {"omit-gsyms", no_argument, NULL, 'o'}, /* removed */
{"objdir", no_argument, NULL, 'O'}, {"objdir", no_argument, NULL, 'O'},
{"quiet", no_argument, NULL, 'q'}, {"quiet", no_argument, NULL, 'q'},
{"verbose", no_argument, NULL, 'v'}, {"verbose", no_argument, NULL, 'v'},
{"warning", no_argument, NULL, 'w'}, {"warning", no_argument, NULL, 'w'},
/* /*
* The following are long name only. * The following are long name only.
*/ */
#define OPT_CONFIG 128 #define OPT_CONFIG 128
#define OPT_GTAGSCONF 129 #define OPT_PATH 129
#define OPT_GTAGSLABEL 130 #define OPT_SINGLE_UPDATE 130
#define OPT_PATH 131 #define OPT_ACCEPT_DOTFILES 131
#define OPT_SINGLE_UPDATE 132 #define OPT_SKIP_UNREADABLE 132
#define OPT_ACCEPT_DOTFILES 133 #define OPT_GTAGSSKIP_SYMLINK 133
#define OPT_SKIP_UNREADABLE 134
#define OPT_GTAGSSKIP_SYMLINK 135
/* flag value */ /* flag value */
{"accept-dotfiles", no_argument, NULL, OPT_ACCEPT_DOTFILES}, {"accept-dotfiles", no_argument, NULL, OPT_ACCEPT_DOTFILES},
{"debug", no_argument, &debug, 1}, {"debug", no_argument, &debug, 1},
{"explain", no_argument, &explain, 1}, {"explain", no_argument, &explain, 1},
#ifdef USE_SQLITE3 #ifdef USE_SQLITE3
{"sqlite3", no_argument, &use_sqlite3, 1}, {"sqlite3", no_argument, &use_sqlite3, 1},
#endif #endif
{"skip-unreadable", no_argument, NULL, OPT_SKIP_UNREADABLE}, {"skip-unreadable", no_argument, NULL, OPT_SKIP_UNREADABLE},
{"statistics", no_argument, &statistics, STATISTICS_STYLE_TABLE}, {"statistics", no_argument, &statistics, STATISTICS_STYLE_TABLE},
{"version", no_argument, &show_version, 1}, {"version", no_argument, &show_version, 1},
skipping to change at line 235 skipping to change at line 234
main(int argc, char **argv) main(int argc, char **argv)
{ {
char dbpath[MAXPATHLEN]; char dbpath[MAXPATHLEN];
char cwd[MAXPATHLEN]; char cwd[MAXPATHLEN];
STRBUF *sb = strbuf_open(0); STRBUF *sb = strbuf_open(0);
int optchar; int optchar;
int option_index = 0; int option_index = 0;
STATISTICS_TIME *tim; STATISTICS_TIME *tim;
/* /*
* Setup GTAGSCONF and GTAGSLABEL environment variable * pick up --gtagsconf, --gtagslabel and --directory (-C).
* according to the --gtagsconf and --gtagslabel option.
*/ */
preparse_options(argc, argv); if (preparse_options(argc, argv) < 0)
usage();
/* /*
* Get the project root directory. * Get the project root directory.
*/ */
if (!vgetcwd(cwd, MAXPATHLEN)) if (!vgetcwd(cwd, MAXPATHLEN))
die("cannot get current directory."); die("cannot get current directory.");
canonpath(cwd); canonpath(cwd);
/* /*
* Load configuration file. * Load configuration file.
*/ */
openconf(cwd); openconf(cwd);
configuration(); configuration();
setenv_from_config(); setenv_from_config();
{ {
char *env = getenv("GTAGS_OPTIONS"); char *env = getenv("GTAGS_OPTIONS");
if (env && *env) if (env && *env)
argv = prepend_options(&argc, argv, env); argv = prepend_options(&argc, argv, env);
} }
/* /*
* Execute gtags_hook before the jobs. * Execute gtags_hook before the jobs.
* The hook is not executed when the following options are specified.
* --help, --dump, --config, --version
* These are informational options only.
*/ */
if (getconfs("gtags_hook", sb)) { {
char *p = serialize_options(argc, argv); int skip_hook = 0;
set_env("GTAGS_COMMANDLINE", p);
free(p); /* Make a decision whether to execute gtags_hook. */
if (system(strbuf_value(sb))) while ((optchar = getopt_long(argc, argv,
fprintf(stderr, "gtags-hook failed: %s\n", strbuf_value(s short_options, long_options, &option_index)) != EOF) {
b)); switch (optchar) {
case OPT_CONFIG:
case 'd':
skip_hook++;
break;
default:
break;
}
}
optind = 1; /* Reset getopt(3) library. */
if (show_version || show_help)
skip_hook++;
if (skip_hook) {
if (debug)
fprintf(stderr, "Gtags_hook is skipped.\n");
} else if (getconfs("gtags_hook", sb)) {
char *p = serialize_options(argc, argv);
set_env("GTAGS_COMMANDLINE", p);
free(p);
if (system(strbuf_value(sb)))
fprintf(stderr, "gtags-hook failed: %s\n", strbuf
_value(sb));
}
} }
logging_arguments(argc, argv); logging_arguments(argc, argv);
while ((optchar = getopt_long(argc, argv, short_options, long_options, &o ption_index)) != EOF) { while ((optchar = getopt_long(argc, argv, short_options, long_options, &o ption_index)) != EOF) {
switch (optchar) { switch (optchar) {
case 0: case 0:
/* already flags set */ /* already flags set */
break; break;
case OPT_CONFIG: case OPT_CONFIG:
show_config = 1; show_config = 1;
if (optarg) if (optarg)
config_name = optarg; config_name = optarg;
break; break;
case OPT_GTAGSCONF: case OPT_GTAGSCONF:
case OPT_GTAGSLABEL: case OPT_GTAGSLABEL:
/* These options are already parsed in preparse_options() case 'C':
*/ /* These options are already parsed in preparse_options()
. */
break; break;
case OPT_SINGLE_UPDATE: case OPT_SINGLE_UPDATE:
iflag++; iflag++;
single_update = optarg; single_update = optarg;
break; break;
case OPT_ACCEPT_DOTFILES: case OPT_ACCEPT_DOTFILES:
accept_dotfiles = 1; accept_dotfiles = 1;
break; break;
case OPT_SKIP_UNREADABLE: case OPT_SKIP_UNREADABLE:
skip_unreadable = 1; skip_unreadable = 1;
 End of changes. 9 change blocks. 
22 lines changed or deleted 47 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)