Changeset 10150 for trunk/ippTools/src/dettool.c
- Timestamp:
- Nov 22, 2006, 3:41:55 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r10124 r10150 80 80 static psS32 incrementIteration(pxConfig *config, const char *det_id); 81 81 static bool setDetRunState(pxConfig *config, const char *det_id, const char *state); 82 static bool isValidMode(pxConfig *config, const char *mode); 82 83 83 84 # define MODECASE(caseName, func) \ … … 232 233 233 234 // optional 235 psString det_mode = psMetadataLookupStr(&status, config->args, "-det_mode"); 236 if (!status) { 237 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -det_mode"); 238 return false; 239 } 240 // check det_mode 241 if (det_mode && !isValidMode(config, det_mode)) { 242 psError(PS_ERR_UNKNOWN, false, "invalud det_mode"); 243 return false; 244 } 245 234 246 psString exp_type = psMetadataLookupStr(&status, config->args, "-exp_type"); 235 247 if (!status) { … … 392 404 0, 393 405 det_type, 406 det_mode, 394 407 "run", 395 408 exp_type, … … 601 614 602 615 // optional 616 psString det_mode = psMetadataLookupStr(&status, config->args, "-det_mode"); 617 if (!status) { 618 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -det_mode"); 619 return false; 620 } 621 // check det_mode 622 if (det_mode && !isValidMode(config, det_mode)) { 623 psError(PS_ERR_UNKNOWN, false, "invalud det_mode"); 624 return false; 625 } 626 603 627 psString exp_type = psMetadataLookupStr(&status, config->args, "-set_exp_type"); 604 628 if (!status) { … … 709 733 0, 710 734 det_type, 735 det_mode, 711 736 "run", 712 737 exp_type, … … 856 881 857 882 // walk through the optional values and update the detRun as required 883 psString det_type = psMetadataLookupStr(&status, config->args, "-set_det_type"); 884 if (!status) { 885 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -set_det_type"); 886 return false; 887 } 888 if (det_type) { 889 psFree(detRun->det_type); 890 detRun->det_type = psStringCopy(det_type); 891 } 892 893 psString det_mode = psMetadataLookupStr(&status, config->args, "-set_det_mode"); 894 if (!status) { 895 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -set_det_mode"); 896 return false; 897 } 898 // check det_mode 899 if (det_mode && !isValidMode(config, det_mode)) { 900 psError(PS_ERR_UNKNOWN, false, "invalud det_mode"); 901 return false; 902 } 903 if (det_mode) { 904 psFree(detRun->det_mode); 905 detRun->det_mode = psStringCopy(det_mode); 906 } 907 858 908 psString exp_type = psMetadataLookupStr(&status, config->args, "-set_exp_type"); 859 909 if (!status) { … … 4973 5023 4974 5024 // everything else is optional 5025 psString det_mode = psMetadataLookupStr(&status, config->args, "-det_mode"); 5026 if (!status) { 5027 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -det_mode"); 5028 return false; 5029 } 5030 // check det_mode 5031 if (det_mode && !isValidMode(config, det_mode)) { 5032 psError(PS_ERR_UNKNOWN, false, "invalud det_mode"); 5033 return false; 5034 } 5035 4975 5036 psString exp_type = psMetadataLookupStr(&status, config->args, "-exp_type"); 4976 5037 if (!status) { … … 5087 5148 0, // the iteration is fixed at 0 5088 5149 det_type, 5150 det_mode, 5089 5151 "reg", 5090 5152 exp_type, … … 5289 5351 return true; 5290 5352 } 5353 5354 static bool isValidMode(pxConfig *config, const char *mode) 5355 { 5356 PS_ASSERT_PTR_NON_NULL(config, false); 5357 PS_ASSERT_PTR_NON_NULL(mode, false); 5358 5359 // check that state is a valid string value 5360 if (!( 5361 (strncmp(mode, "create", 7) == 0) 5362 || (strncmp(mode, "verify", 7) == 0) 5363 ) 5364 ) { 5365 psError(PS_ERR_UNKNOWN, false, 5366 "invalid detRun mode: %s", mode); 5367 return false; 5368 } 5369 5370 return true; 5371 }
Note:
See TracChangeset
for help on using the changeset viewer.
