Thread: [Icomplete-general] icomplete/src error.c,1.2,1.3 main.c,1.5,1.6 options.c,1.3,1.4 options.h,1.2,1.3
Brought to you by:
maxauthority
From: MaxAuthority <max...@us...> - 2006-04-07 00:15:21
|
Update of /cvsroot/icomplete/icomplete/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30645/src Modified Files: error.c main.c options.c options.h parse.c treeold.c Log Message: added --tagfile option (patch by Yuxuan Wang) Index: options.h =================================================================== RCS file: /cvsroot/icomplete/icomplete/src/options.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** options.h 20 Dec 2005 02:44:36 -0000 1.2 --- options.h 7 Apr 2006 00:15:08 -0000 1.3 *************** *** 26,29 **** --- 26,30 ---- extern char* opt_liststatic; ///< ??!? extern char* opt_lang; ///< Language (defaults to c++) + extern char* opt_tagfile; ///< Tag file (defaults to tags) extern cache_e opt_cache; ///< Wether we should build cache or not extern const char* opt_progname; ///< argv[0] Index: options.c =================================================================== RCS file: /cvsroot/icomplete/icomplete/src/options.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** options.c 22 Dec 2005 22:25:33 -0000 1.3 --- options.c 7 Apr 2006 00:15:08 -0000 1.4 *************** *** 15,20 **** char *opt_liststatic = NULL; char *opt_lang = "c++"; cache_e opt_cache = CACHE_AUTO; ! const char *opt_progname = PACKAGE_NAME; struct config_s config={NULL,NULL}; --- 15,21 ---- char *opt_liststatic = NULL; char *opt_lang = "c++"; + char *opt_tagfile = "tags"; cache_e opt_cache = CACHE_AUTO; ! const char *opt_progname = PACKAGE; struct config_s config={NULL,NULL}; *************** *** 33,36 **** --- 34,38 ---- {"output" , 1 , 0 , 'o' } , {"lang" , 1 , 0 , 'g' } , + {"tagfile" , 1 , 0 , 't' } , {"version" , 0 , 0 , 'v' } , {0 , 0 , 0 , 0 } *************** *** 41,45 **** /* int this_option_optind = optind ? optind : 1; */ int option_index = 0; ! c = getopt_long (argc, argv, "a:c:g:hl:m:o:s:v", long_options, &option_index); if (c == -1) break; --- 43,47 ---- /* int this_option_optind = optind ? optind : 1; */ int option_index = 0; ! c = getopt_long (argc, argv, "a:c:g:t:hl:m:o:s:v", long_options, &option_index); if (c == -1) break; *************** *** 84,87 **** --- 86,93 ---- break; + case 't': + opt_tagfile = optarg; + break; + case 'v': printf(PACKAGE_NAME "\nVersion: " VERSION "\n"); Index: error.c =================================================================== RCS file: /cvsroot/icomplete/icomplete/src/error.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** error.c 20 Dec 2005 02:44:36 -0000 1.2 --- error.c 7 Apr 2006 00:15:08 -0000 1.3 *************** *** 16,19 **** --- 16,20 ---- " -c --column=<num> : The column number where completion should start\n" " -l --line=<num> : The line number where completion should start\n" + " -t --tagfile=<filename> : Write and read tags from <filename> instead of `tags'\n" " -g --lang=c++|java|cs : Input is considered as this language, c++ is default\n" " -m --list-members=<class> : List all (also inherited) members of <class>\n" *************** *** 32,34 **** exit (EXIT_FAILURE); } - --- 33,34 ---- Index: treeold.c =================================================================== RCS file: /cvsroot/icomplete/icomplete/src/treeold.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** treeold.c 20 Dec 2005 02:44:36 -0000 1.1 --- treeold.c 7 Apr 2006 00:15:08 -0000 1.2 *************** *** 38,42 **** tagEntry entry; tagFileInfo info; ! tagFile *tfile = tagsOpen ("tags", &info); //brc: split namespace part and classname --- 38,42 ---- tagEntry entry; tagFileInfo info; ! tagFile *tfile = tagsOpen (opt_tagfile, &info); //brc: split namespace part and classname *************** *** 259,263 **** tagEntry entry; tagFileInfo info; ! tagFile *tfile = tagsOpen ("tags", &info); char lasttag[256] = ""; /* store last tag to avoid duplicates */ --- 259,263 ---- tagEntry entry; tagFileInfo info; ! tagFile *tfile = tagsOpen (opt_tagfile, &info); char lasttag[256] = ""; /* store last tag to avoid duplicates */ *************** *** 433,437 **** else { ! bailout("Could not open `tags' file. You should be able to build a valid one by running this command:\n\nicomplete -l 1 -c 1 <filename>\n\n<filename> should be a source file which contains all #include files you want to have in the tags file"); } --- 433,439 ---- else { ! char buf[BUFSIZ]; ! snprintf(buf, BUFSIZ, "Could not open `%s' file. You should be able to build a valid one by running this command:\n\nicomplete -l 1 -c 1 <filename>\n\n<filename> should be a source file which contains all #include files you want to have in the tags file", opt_tagfile); ! bailout(buf); } Index: parse.c =================================================================== RCS file: /cvsroot/icomplete/icomplete/src/parse.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** parse.c 4 Jan 2006 02:10:29 -0000 1.6 --- parse.c 7 Apr 2006 00:15:08 -0000 1.7 *************** *** 137,141 **** tagFileInfo info; tagEntry entry; ! tagFile *tfile = tagsOpen ("tags", &info); if (tfile && info.status.opened) { --- 137,141 ---- tagFileInfo info; tagEntry entry; ! tagFile *tfile = tagsOpen (opt_tagfile, &info); if (tfile && info.status.opened) { Index: main.c =================================================================== RCS file: /cvsroot/icomplete/icomplete/src/main.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** main.c 20 Dec 2005 02:44:36 -0000 1.5 --- main.c 7 Apr 2006 00:15:08 -0000 1.6 *************** *** 122,126 **** /* save the cache information in the tags file */ ! FILE *tags = fopen("tags", "w"); if (tags) { --- 122,126 ---- /* save the cache information in the tags file */ ! FILE *tags = fopen(opt_tagfile, "w"); if (tags) { *************** *** 135,139 **** } ! char **arguments = (char**)malloc(sizeof(char*) * (8 + (config.cpp_macros->size*2))); if (arguments == NULL) bailout ("Could not get memory in build_tags_file() for char **arguments"); --- 135,139 ---- } ! char **arguments = (char**)malloc(sizeof(char*) * (10 + (config.cpp_macros->size*2))); if (arguments == NULL) bailout ("Could not get memory in build_tags_file() for char **arguments"); *************** *** 146,155 **** arguments[5]="-L"; arguments[6]=".icomplete_taglist"; int i = 0; List_item *it=config.cpp_macros->first; while(NULL!=it) { ! arguments[i+7]="-I"; ! arguments[i+8]=it->item; it=it->next; i+=2; --- 146,157 ---- arguments[5]="-L"; arguments[6]=".icomplete_taglist"; + arguments[7]="-f"; + arguments[8]=opt_tagfile; int i = 0; List_item *it=config.cpp_macros->first; while(NULL!=it) { ! arguments[i+9]="-I"; ! arguments[i+10]=it->item; it=it->next; i+=2; *************** *** 207,211 **** if (opt_cache == 1) { ! FILE *fCache = fopen("tags", "r"); bool build_cache = true; if (fCache) --- 209,213 ---- if (opt_cache == 1) { ! FILE *fCache = fopen(opt_tagfile, "r"); bool build_cache = true; if (fCache) *************** *** 220,224 **** { #if DEBUG >= 2 ! fprintf(stderr, "valid tags file found, icomplete will reuse it\n"); #endif build_cache = false; --- 222,226 ---- { #if DEBUG >= 2 ! fprintf(stderr, "valid tags `%s' file found, icomplete will reuse it\n", opt_tagfile); #endif build_cache = false; |