Reimplemented from confStruct. Definition at line 148 of file serverConf.cpp. 00148 { 00149 00150 int c = 0; 00151 while ((c = getopt(argc, argv, confDef)) != -1){ 00152 switch (c){ 00153 case 'p': 00154 intArray[0] = charToInt(0, strlen(optarg) - 1, optarg); 00155 confFound[0] = 1; 00156 break; 00157 case 'i': 00158 charArray[1] = optarg; 00159 confFound[1] = 1; 00160 break; 00161 case 'c': 00162 charArray[2] = optarg; 00163 confFound[2] = 1; 00164 break; 00165 case 'h': 00166 intArray[3] = charToInt(0, strlen(optarg) - 1, optarg); 00167 confFound[3] = 1; 00168 break; 00169 case 'l': 00170 intArray[4] = charToInt(0, strlen(optarg) - 1, optarg); 00171 confFound[4] = 1; 00172 break; 00173 case 'b': 00174 charArray[5] = optarg; 00175 confFound[5] = 1; 00176 break; 00177 case 't': 00178 intArray[6] = charToInt(0, strlen(optarg) - 1, optarg); 00179 confFound[6] = 1; 00180 break; 00181 case '?': 00182 if (optopt == 'p' || optopt == 'i' || optopt == 'm' || optopt == 'h' || optopt == 'l' || optopt == 'b' || optopt == 'l' || optopt == 't') 00183 fprintf (stderr, "Option -%c requires an argument.\n", optopt); 00184 else if (isprint (optopt)) 00185 fprintf (stderr, "Unknown option `-%c'.\n", optopt); 00186 else 00187 fprintf (stderr, "Unknown option character `\\x%x'.\n", optopt); 00188 default: 00189 usage(); 00190 } 00191 } 00192 return 0; 00193 }
|
1.5.1