Changeset 19988
- Timestamp:
- Oct 8, 2008, 8:51:40 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r19812 r19988 280 280 PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false); 281 281 282 // we have to support multip e exp_ids282 // we have to support multiple exp_ids 283 283 psMetadataItem *item = psMetadataLookup(config->args, "-exp_id"); 284 284 if (!item) { 285 285 // this shouldn't actually happen when using psArgs 286 psError(PS_ERR_UNKNOWN, true, " -exp_id is required");286 psError(PS_ERR_UNKNOWN, true, "at least one -exp_id is required"); 287 287 return false; 288 288 } 289 289 psMetadata *where = psMetadataAlloc(); 290 290 291 if ((item->type != PS_DATA_METADATA_MULTI) && (item->type != PS_DATA_S64)) { 292 psAbort("-exp_id was not parsed correctly (this should not happen"); 293 } 294 291 295 // make sure that -exp_id was parsed correctly 292 // XXX this can be removed someday293 // XXX Special case for a multi : move into a macro?294 296 if (item->type == PS_DATA_METADATA_MULTI) { 295 297 psListIterator *iter = psListIteratorAlloc(item->data.list, 0, false); 296 298 psMetadataItem *mItem = NULL; 297 299 while ((mItem = psListGetAndIncrement(iter))) { 298 psString exp_id = mItem->data.V; 299 // if exp_id is NULL then it means that -exp_id has not been 300 // specified 301 if (!exp_id) { 302 psError(PS_ERR_UNKNOWN, true, 303 "at least one -exp_id is required"); 304 psFree(where); 305 return false; 306 } 307 308 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 309 PS_META_DUPLICATE_OK, "==", exp_id)) { 300 psS64 exp_id = mItem->data.S64; 301 if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", PS_META_DUPLICATE_OK, "==", exp_id)) { 310 302 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 311 303 psFree(iter); … … 315 307 } 316 308 psFree(iter); 317 } else { 318 psAbort( "-exp_id was not parsed correctly (this should not happen"); 319 } 309 } 310 if (item->type == PS_DATA_S64) { 311 psS64 exp_id = item->data.S64; 312 if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", PS_META_DUPLICATE_OK, "==", exp_id)) { 313 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 314 psFree(where); 315 return false; 316 } 317 } 320 318 321 319 if (psListLength(where->list) < 1) {
Note:
See TracChangeset
for help on using the changeset viewer.
