Changeset 12231
- Timestamp:
- Mar 5, 2007, 12:04:47 PM (19 years ago)
- Location:
- trunk/ippdb
- Files:
-
- 7 edited
-
src/ippdb.c (modified) (10 diffs)
-
src/ippdb.h (modified) (3 diffs)
-
tests/alloc.c (modified) (2 diffs)
-
tests/insert.c (modified) (1 diff)
-
tests/insertobject.c (modified) (1 diff)
-
tests/metadatafromobject.c (modified) (2 diffs)
-
tests/objectfrommetadata.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/src/ippdb.c
r12202 r12231 5267 5267 static void chipPendingExpRowFree(chipPendingExpRow *object); 5268 5268 5269 chipPendingExpRow *chipPendingExpRowAlloc(psS64 chip_id, const char *exp_tag, psS64 guide_id, const char * label, const char *recipe, const char *expgroup, const char *dvodb)5269 chipPendingExpRow *chipPendingExpRowAlloc(psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *recipe, const char *expgroup, const char *dvodb) 5270 5270 { 5271 5271 chipPendingExpRow *_object; … … 5277 5277 _object->exp_tag = psStringCopy(exp_tag); 5278 5278 _object->guide_id = guide_id; 5279 _object->workdir = psStringCopy(workdir); 5279 5280 _object->label = psStringCopy(label); 5280 5281 _object->recipe = psStringCopy(recipe); … … 5288 5289 { 5289 5290 psFree(object->exp_tag); 5291 psFree(object->workdir); 5290 5292 psFree(object->label); 5291 5293 psFree(object->recipe); … … 5312 5314 return false; 5313 5315 } 5316 if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, "255")) { 5317 psError(PS_ERR_UNKNOWN, false, "failed to add item workdir"); 5318 psFree(md); 5319 return false; 5320 } 5314 5321 if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, "key", "64")) { 5315 5322 psError(PS_ERR_UNKNOWN, false, "failed to add item label"); … … 5345 5352 } 5346 5353 5347 bool chipPendingExpInsert(psDB * dbh, psS64 chip_id, const char *exp_tag, psS64 guide_id, const char * label, const char *recipe, const char *expgroup, const char *dvodb)5354 bool chipPendingExpInsert(psDB * dbh, psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *recipe, const char *expgroup, const char *dvodb) 5348 5355 { 5349 5356 psMetadata *md = psMetadataAlloc(); … … 5360 5367 if (!psMetadataAdd(md, PS_LIST_TAIL, "guide_id", PS_DATA_S64, NULL, guide_id)) { 5361 5368 psError(PS_ERR_UNKNOWN, false, "failed to add item guide_id"); 5369 psFree(md); 5370 return false; 5371 } 5372 if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, workdir)) { 5373 psError(PS_ERR_UNKNOWN, false, "failed to add item workdir"); 5362 5374 psFree(md); 5363 5375 return false; … … 5406 5418 bool chipPendingExpInsertObject(psDB *dbh, chipPendingExpRow *object) 5407 5419 { 5408 return chipPendingExpInsert(dbh, object->chip_id, object->exp_tag, object->guide_id, object-> label, object->recipe, object->expgroup, object->dvodb);5420 return chipPendingExpInsert(dbh, object->chip_id, object->exp_tag, object->guide_id, object->workdir, object->label, object->recipe, object->expgroup, object->dvodb); 5409 5421 } 5410 5422 … … 5494 5506 return false; 5495 5507 } 5508 if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, object->workdir)) { 5509 psError(PS_ERR_UNKNOWN, false, "failed to add item workdir"); 5510 psFree(md); 5511 return false; 5512 } 5496 5513 if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, NULL, object->label)) { 5497 5514 psError(PS_ERR_UNKNOWN, false, "failed to add item label"); … … 5538 5555 return false; 5539 5556 } 5557 char* workdir = psMetadataLookupPtr(&status, md, "workdir"); 5558 if (!status) { 5559 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item workdir"); 5560 return false; 5561 } 5540 5562 char* label = psMetadataLookupPtr(&status, md, "label"); 5541 5563 if (!status) { … … 5559 5581 } 5560 5582 5561 return chipPendingExpRowAlloc(chip_id, exp_tag, guide_id, label, recipe, expgroup, dvodb);5583 return chipPendingExpRowAlloc(chip_id, exp_tag, guide_id, workdir, label, recipe, expgroup, dvodb); 5562 5584 } 5563 5585 psArray *chipPendingExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) -
trunk/ippdb/src/ippdb.h
r12202 r12231 2714 2714 char *exp_tag; 2715 2715 psS64 guide_id; 2716 char *workdir; 2716 2717 char *label; 2717 2718 char *recipe; … … 2729 2730 const char *exp_tag, 2730 2731 psS64 guide_id, 2732 const char *workdir, 2731 2733 const char *label, 2732 2734 const char *recipe, … … 2765 2767 const char *exp_tag, 2766 2768 psS64 guide_id, 2769 const char *workdir, 2767 2770 const char *label, 2768 2771 const char *recipe, -
trunk/ippdb/tests/alloc.c
r12202 r12231 532 532 chipPendingExpRow *object; 533 533 534 object = chipPendingExpRowAlloc(-64, "a string", -64, "a string", "a string", "a string", "a string" );534 object = chipPendingExpRowAlloc(-64, "a string", -64, "a string", "a string", "a string", "a string", "a string" ); 535 535 536 536 if (!object) { … … 547 547 } 548 548 if (!object->guide_id == -64) { 549 psFree(object); 550 exit(EXIT_FAILURE); 551 } 552 if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) { 549 553 psFree(object); 550 554 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insert.c
r12202 r12231 193 193 } 194 194 195 if (!chipPendingExpInsert(dbh, -64, "a string", -64, "a string", "a string", "a string", "a string" )) {195 if (!chipPendingExpInsert(dbh, -64, "a string", -64, "a string", "a string", "a string", "a string", "a string")) { 196 196 exit(EXIT_FAILURE); 197 197 } -
trunk/ippdb/tests/insertobject.c
r12202 r12231 278 278 } 279 279 280 object = chipPendingExpRowAlloc(-64, "a string", -64, "a string", "a string", "a string", "a string" );280 object = chipPendingExpRowAlloc(-64, "a string", -64, "a string", "a string", "a string", "a string", "a string"); 281 281 if (!object) { 282 282 exit(EXIT_FAILURE); -
trunk/ippdb/tests/metadatafromobject.c
r12202 r12231 626 626 bool status; 627 627 628 object = chipPendingExpRowAlloc(-64, "a string", -64, "a string", "a string", "a string", "a string" );628 object = chipPendingExpRowAlloc(-64, "a string", -64, "a string", "a string", "a string", "a string", "a string"); 629 629 if (!object) { 630 630 exit(EXIT_FAILURE); … … 645 645 exit(EXIT_FAILURE); 646 646 } 647 psFree(md); 648 exit(EXIT_FAILURE); 649 } 650 if (strncmp(psMetadataLookupPtr(&status, md, "workdir"), "a string", MAX_STRING_LENGTH)) { 647 651 psFree(md); 648 652 exit(EXIT_FAILURE); -
trunk/ippdb/tests/objectfrommetadata.c
r12202 r12231 961 961 exit(EXIT_FAILURE); 962 962 } 963 if (!psMetadataAddStr(md, PS_LIST_TAIL, "workdir", 0, NULL, "a string")) { 964 psFree(md); 965 exit(EXIT_FAILURE); 966 } 963 967 if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) { 964 968 psFree(md); … … 993 997 exit(EXIT_FAILURE); 994 998 } 999 psFree(object); 1000 exit(EXIT_FAILURE); 1001 } 1002 if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) { 995 1003 psFree(object); 996 1004 exit(EXIT_FAILURE);
Note:
See TracChangeset
for help on using the changeset viewer.
