Changeset 16170 for trunk/ippTools/src/caltool.c
- Timestamp:
- Jan 20, 2008, 3:48:37 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/caltool.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/caltool.c
r15570 r16170 85 85 PS_ASSERT_PTR_NON_NULL(config, false); 86 86 87 // required options 88 bool status = false; 89 psString dvodb = psMetadataLookupStr(&status, config->args, "-dvodb"); 90 if (!status) { 91 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -dvodb"); 92 return false; 93 } 94 if (!dvodb) { 95 psError(PS_ERR_UNKNOWN, true, "-dvodb is required"); 96 return false; 97 } 87 // required 88 PXOPT_LOOKUP_STR(dvodb, config->args, "-set_dvodb", true, false); 98 89 99 90 if (!calDBInsert(config->dbh, … … 115 106 PS_ASSERT_PTR_NON_NULL(config, false); 116 107 117 bool status = false; 118 psU64 limit = psMetadataLookupU64(&status, config->args, "-limit"); 119 if (!status) { 120 psError(PXTOOLS_ERR_PROG, false, "failed to lookup value for -limit"); 121 return false; 122 } 108 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 109 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 123 110 124 111 psString query = psStringCopy("SELECT * FROM calDB"); … … 164 151 } 165 152 166 bool simple = false;167 {168 bool status = false;169 simple = psMetadataLookupBool(&status, config->args, "-simple");170 if (!status) {171 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");172 return false;173 }174 }175 176 153 if (psArrayLength(output)) { 177 154 if (!convertIdToStr(output)) { … … 199 176 PS_ASSERT_PTR_NON_NULL(config, false); 200 177 201 // required options 202 bool status = false; 203 psString cal_id = psMetadataLookupStr(&status, config->args, "-cal_id"); 204 if (!status) { 205 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -cal_id"); 206 return false; 207 } 208 if (!cal_id) { 209 psError(PS_ERR_UNKNOWN, true, "-cal_id is required"); 210 return false; 211 } 212 213 psString region = psMetadataLookupStr(&status, config->args, "-region"); 214 if (!status) { 215 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -region"); 216 return false; 217 } 218 if (!region) { 219 psError(PS_ERR_UNKNOWN, true, "-region is required"); 220 return false; 221 } 222 223 psString last_step = psMetadataLookupStr(&status, config->args, "-last_step"); 224 if (!status) { 225 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -last_step"); 226 return false; 227 } 228 if (!last_step) { 229 psError(PS_ERR_UNKNOWN, true, "-last_step is required"); 230 return false; 231 } 232 233 psString state = psMetadataLookupStr(&status, config->args, "-state"); 234 if (!status) { 235 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -state"); 236 return false; 237 } 238 if (!state) { 239 psError(PS_ERR_UNKNOWN, true, "-state is required"); 240 return false; 241 } 178 // required 179 PXOPT_LOOKUP_STR(cal_id, config->args, "-cal_id", true, false); 180 PXOPT_LOOKUP_STR(region, config->args, "-region", true, false); 181 PXOPT_LOOKUP_STR(last_step, config->args, "-last_step", true, false); 182 PXOPT_LOOKUP_STR(state, config->args, "-state", true, false); 242 183 243 184 if (!calRunInsert(config->dbh, … … 260 201 PS_ASSERT_PTR_NON_NULL(config, false); 261 202 262 bool status = false; 263 psU64 limit = psMetadataLookupU64(&status, config->args, "-limit"); 264 if (!status) { 265 psError(PXTOOLS_ERR_PROG, false, "failed to lookup value for -limit"); 266 return false; 267 } 203 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 204 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 268 205 269 206 psString query = psStringCopy("SELECT * FROM calRun"); … … 309 246 } 310 247 311 bool simple = false;312 {313 bool status = false;314 simple = psMetadataLookupBool(&status, config->args, "-simple");315 if (!status) {316 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");317 return false;318 }319 }320 321 248 if (psArrayLength(output)) { 322 249 if (!convertIdToStr(output)) {
Note:
See TracChangeset
for help on using the changeset viewer.
