Changeset 8460 for trunk/ippTools/src/dettool.c
- Timestamp:
- Aug 21, 2006, 4:19:19 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r8459 r8460 35 35 static bool addresidexpMode(pxConfig *config); 36 36 static bool residexpMode(pxConfig *config); 37 static bool residdetrunMode(pxConfig *config); 37 38 static bool declaremasterframeMode(pxConfig *config); 38 39 static bool masterframeMode(pxConfig *config); … … 91 92 MODECASE(DETTOOL_MODE_ADDRESIDEXP, addresidexpMode); 92 93 MODECASE(DETTOOL_MODE_RESIDEXP, residexpMode); 94 MODECASE(DETTOOL_MODE_RESIDDETRUN, residdetrunMode); 93 95 MODECASE(DETTOOL_MODE_DECLAREMASTERFRAME, declaremasterframeMode); 94 96 MODECASE(DETTOOL_MODE_MASTERFRAME, masterframeMode); … … 3178 3180 } 3179 3181 3180 #if 03181 PS_ASSERT_PTR_NON_NULL(config, false);3182 3183 // det_id, exp_id, & recipe are required3184 3185 bool status = false;3186 psString det_id = psMetadataLookupStr(&status, config->args, "-det_id");3187 if (!status) {3188 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -det_id");3189 return false;3190 }3191 if (!det_id) {3192 psError(PS_ERR_UNKNOWN, true, "-det_id is required");3193 return false;3194 }3195 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");3196 if (!status) {3197 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");3198 return false;3199 }3200 if (!exp_id) {3201 psError(PS_ERR_UNKNOWN, true, "-exp_id is required");3202 return false;3203 }3204 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");3205 if (!status) {3206 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");3207 return false;3208 }3209 if (!exp_id) {3210 psError(PS_ERR_UNKNOWN, true, "-exp_id is required");3211 return false;3212 }3213 psString recipe = psMetadataLookupStr(&status, config->args, "-recip");3214 if (!status) {3215 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -recip");3216 return false;3217 }3218 if (!recipe) {3219 psError(PS_ERR_UNKNOWN, true, "-recip is required");3220 return false;3221 }3222 3223 // iteration has a default value3224 psS32 iteration = psMetadataLookupS32(&status, config->args, "-iteration");3225 if (!status) {3226 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -iteration");3227 return false;3228 }3229 // accept is optional3230 bool accept = psMetadataLookupBool(&status, config->args, "-accept");3231 if (!status) {3232 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -recip");3233 return false;3234 }3235 3236 // check det_id, exp_id against detInputExp3237 3238 // we have to generate our own where clause as we want to exclude -stats3239 // from the search3240 psMetadata *where = psMetadataAlloc();3241 if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==",3242 (psS32)atoi(det_id))) {3243 psError(PS_ERR_UNKNOWN, false, "failed to add item det_id");3244 psFree(where);3245 return false;3246 }3247 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", exp_id)) {3248 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");3249 psFree(where);3250 return false;3251 }3252 3253 psArray *inputExp = detInputExpSelectRowObjects(config->dbh, where, 0);3254 psFree(where);3255 if (!inputExp) {3256 psError(PS_ERR_UNKNOWN, true,3257 "det_id %s, exp_id %s does not corespond to an input exp", det_id, exp_id);3258 return false;3259 }3260 3261 // if we've made it this far then we must have found a match3262 psFree(inputExp);3263 3264 // create a new detResidExpg row and insert it3265 detResidExpRow *residExp = detResidExpRowAlloc(3266 (psS32)atol(det_id),3267 iteration,3268 exp_id,3269 class_id,3270 recipe,3271 accept3272 );3273 3274 if (!detResidExpInsertObject(config->dbh, residExp)) {3275 psError(PS_ERR_UNKNOWN, false, "database error");3276 psFree(residExp);3277 return false;3278 }3279 3280 psFree(residExp);3281 3282 return true;3283 }3284 #endif3285 3286 3182 static bool residexpMode(pxConfig *config) 3287 3183 { … … 3316 3212 3317 3213 psFree(residExps); 3214 3215 return true; 3216 } 3217 3218 static bool residdetrunMode(pxConfig *config) 3219 { 3220 PS_ASSERT_PTR_NON_NULL(config, false); 3318 3221 3319 3222 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
