Thread: [Icomplete-general] icomplete/src options.c,1.2,1.3
Brought to you by:
maxauthority
From: MaxAuthority <max...@us...> - 2005-12-22 22:25:44
|
Update of /cvsroot/icomplete/icomplete/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5816 Modified Files: options.c Log Message: indention fixes (uses indention from gg=G of vim with 4 spaces tab size) changed 1 -> CACHE_auto and "icomplete" -> PACKAGE_NAME Index: options.c =================================================================== RCS file: /cvsroot/icomplete/icomplete/src/options.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** options.c 20 Dec 2005 02:44:36 -0000 1.2 --- options.c 22 Dec 2005 22:25:33 -0000 1.3 *************** *** 15,20 **** char *opt_liststatic = NULL; char *opt_lang = "c++"; ! cache_e opt_cache = 1; ! const char *opt_progname = "icomplete"; struct config_s config={NULL,NULL}; --- 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}; *************** *** 23,27 **** int c; ! /* the struct option look like: struct option { const char *name; int has_arg; int *flag; int val; }; */ static struct option long_options[] = { --- 23,27 ---- int c; ! /* the struct option look like: struct option { const char *name; int has_arg; int *flag; int val; }; */ static struct option long_options[] = { *************** *** 37,108 **** }; ! while (1) { ! /* 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; ! switch (c) { ! case 0: ! printf ("option %s", long_options[option_index].name); ! if (optarg) ! printf (" with arg %s", optarg); ! printf ("\n"); ! break; ! case 'a': ! opt_cache = atoi(optarg); ! if(opt_cache<0 || opt_cache>2) ! bailout("Cache must be a number between 0 and 2!"); ! break; ! case 'c': ! opt_column = atoi(optarg); ! break; ! case 'l': ! opt_line = atoi(optarg); ! break; ! case 'g': ! opt_lang = optarg; ! break; ! case 'h': ! usage(); ! break; ! case 'm': ! opt_listmembers = optarg; ! break; ! case 'o': ! opt_output = optarg; ! break; ! case 'v': ! printf(PACKAGE_NAME "\nVersion: " VERSION "\n"); ! break; ! case '?': ! break; ! default: ! printf ("?? getopt returned character code 0%o ??\n", c); ! } ! } // file name given ! if (optind < argc) { opt_filename = argv[optind]; optind++; ! if (optind < argc) bailout("Only one source file allowed.\nSee icomplete --help for a usage description."); ! } // read from stdin else --- 37,108 ---- }; ! while (1) { ! /* 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; ! switch (c) { ! case 0: ! printf ("option %s", long_options[option_index].name); ! if (optarg) ! printf (" with arg %s", optarg); ! printf ("\n"); ! break; ! case 'a': ! opt_cache = atoi(optarg); ! if(opt_cache<0 || opt_cache>2) ! bailout("Cache must be a number between 0 and 2!"); ! break; ! case 'c': ! opt_column = atoi(optarg); ! break; ! case 'l': ! opt_line = atoi(optarg); ! break; ! case 'g': ! opt_lang = optarg; ! break; ! case 'h': ! usage(); ! break; ! case 'm': ! opt_listmembers = optarg; ! break; ! case 'o': ! opt_output = optarg; ! break; ! case 'v': ! printf(PACKAGE_NAME "\nVersion: " VERSION "\n"); ! break; ! case '?': ! break; ! default: ! printf ("?? getopt returned character code 0%o ??\n", c); ! } ! } // file name given ! if (optind < argc) { opt_filename = argv[optind]; optind++; ! if (optind < argc) bailout("Only one source file allowed.\nSee icomplete --help for a usage description."); ! } // read from stdin else *************** *** 115,121 **** /* cur_section points to the vector for the current [section] of the config file */ List* cur_section = NULL; ! ! config.cpp_includes=alloc_list(); ! config.cpp_macros=alloc_list(); char* homedir = getenv("HOME"); --- 115,121 ---- /* cur_section points to the vector for the current [section] of the config file */ List* cur_section = NULL; ! ! config.cpp_includes=alloc_list(); ! config.cpp_macros=alloc_list(); char* homedir = getenv("HOME"); *************** *** 139,144 **** if (file) { ! while (fgets(line, 512, file) != NULL) ! { ptr = line; if (!strcmp(line, "[cpp_include_paths]\n")) --- 139,144 ---- if (file) { ! while (fgets(line, 512, file) != NULL) ! { ptr = line; if (!strcmp(line, "[cpp_include_paths]\n")) *************** *** 175,179 **** } } ! fclose(file); } } --- 175,179 ---- } } ! fclose(file); } } *************** *** 187,196 **** if (config.cpp_includes != NULL) { ! free_list(config.cpp_includes); } if (config.cpp_macros != NULL) { ! free_list(config.cpp_macros); } } --- 187,196 ---- if (config.cpp_includes != NULL) { ! free_list(config.cpp_includes); } if (config.cpp_macros != NULL) { ! free_list(config.cpp_macros); } } |