Changeset 8094 for branches/jhoblitt/ippdb/src/ippdb.c
- Timestamp:
- Aug 2, 2006, 4:55:32 PM (20 years ago)
- File:
-
- 1 edited
-
branches/jhoblitt/ippdb/src/ippdb.c (modified) (112 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/jhoblitt/ippdb/src/ippdb.c
r8089 r8094 8929 8929 static void p2PendingImfileRowFree(p2PendingImfileRow *object); 8930 8930 8931 p2PendingImfileRow *p2PendingImfileRowAlloc(const char *exp_id, const char *class_id, const char *uri, const char * stats, const char *recipe, psS32 p1_version, psS32 p2_version)8931 p2PendingImfileRow *p2PendingImfileRowAlloc(const char *exp_id, const char *class_id, const char *uri, const char *recipe, psS32 p1_version, psS32 p2_version) 8932 8932 { 8933 8933 p2PendingImfileRow *object; … … 8939 8939 object->class_id = psStringCopy(class_id); 8940 8940 object->uri = psStringCopy(uri); 8941 object->stats = psStringCopy(stats);8942 8941 object->recipe = psStringCopy(recipe); 8943 8942 object->p1_version = p1_version; … … 8952 8951 psFree(object->class_id); 8953 8952 psFree(object->uri); 8954 psFree(object->stats);8955 8953 psFree(object->recipe); 8956 8954 } … … 8982 8980 return false; 8983 8981 } 8984 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "255")) {8985 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");8986 psFree(md);8987 return false;8988 }8989 8982 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "64")) { 8990 8983 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 9015 9008 } 9016 9009 9017 bool p2PendingImfileInsert(psDB * dbh, const char *exp_id, const char *class_id, const char *uri, const char * stats, const char *recipe, psS32 p1_version, psS32 p2_version)9010 bool p2PendingImfileInsert(psDB * dbh, const char *exp_id, const char *class_id, const char *uri, const char *recipe, psS32 p1_version, psS32 p2_version) 9018 9011 { 9019 9012 psMetadata *md; … … 9036 9029 return false; 9037 9030 } 9038 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, stats)) {9039 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");9040 psFree(md);9041 return false;9042 }9043 9031 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, recipe)) { 9044 9032 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 9063 9051 } 9064 9052 9065 bool p2PendingImfilePop(psDB *dbh, char **exp_id, char **class_id, char **uri, char ** stats, char **recipe, psS32 *p1_version, psS32 *p2_version)9053 bool p2PendingImfilePop(psDB *dbh, char **exp_id, char **class_id, char **uri, char **recipe, psS32 *p1_version, psS32 *p2_version) 9066 9054 { 9067 9055 psArray *rowSet; … … 9125 9113 return false; 9126 9114 } 9127 *stats = psMetadataLookupPtr(&status, row, "stats");9128 if (!status) {9129 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stats");9130 psFree(row);9131 return false;9132 }9133 9115 *recipe = psMetadataLookupPtr(&status, row, "recipe"); 9134 9116 if (!status) { … … 9157 9139 bool p2PendingImfileInsertObject(psDB *dbh, p2PendingImfileRow *object) 9158 9140 { 9159 return p2PendingImfileInsert(dbh, object->exp_id, object->class_id, object->uri, object-> stats, object->recipe, object->p1_version, object->p2_version);9141 return p2PendingImfileInsert(dbh, object->exp_id, object->class_id, object->uri, object->recipe, object->p1_version, object->p2_version); 9160 9142 } 9161 9143 … … 9165 9147 char class_id[256]; 9166 9148 char uri[256]; 9167 char stats[256];9168 9149 char recipe[256]; 9169 9150 psS32 p1_version; 9170 9151 psS32 p2_version; 9171 9152 9172 if (!p2PendingImfilePop(dbh, (char **)&exp_id, (char **)&class_id, (char **)&uri, (char **)& stats, (char **)&recipe, &p1_version, &p2_version)) {9153 if (!p2PendingImfilePop(dbh, (char **)&exp_id, (char **)&class_id, (char **)&uri, (char **)&recipe, &p1_version, &p2_version)) { 9173 9154 psError(PS_ERR_UNKNOWN, false, "failed to pop a database row"); 9174 9155 return NULL; 9175 9156 } 9176 9157 9177 return p2PendingImfileRowAlloc(exp_id, class_id, uri, stats,recipe, p1_version, p2_version);9158 return p2PendingImfileRowAlloc(exp_id, class_id, uri, recipe, p1_version, p2_version); 9178 9159 } 9179 9160 … … 9289 9270 return NULL; 9290 9271 } 9291 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, object->stats)) {9292 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");9293 psFree(md);9294 return NULL;9295 }9296 9272 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, object->recipe)) { 9297 9273 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 9319 9295 char *class_id; 9320 9296 char *uri; 9321 char *stats;9322 9297 char *recipe; 9323 9298 psS32 p1_version; … … 9339 9314 return false; 9340 9315 } 9341 stats = psMetadataLookupPtr(&status, md, "stats");9342 if (!status) {9343 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stats");9344 return false;9345 }9346 9316 recipe = psMetadataLookupPtr(&status, md, "recipe"); 9347 9317 if (!status) { … … 9360 9330 } 9361 9331 9362 return p2PendingImfileRowAlloc(exp_id, class_id, uri, stats,recipe, p1_version, p2_version);9332 return p2PendingImfileRowAlloc(exp_id, class_id, uri, recipe, p1_version, p2_version); 9363 9333 } 9364 9334 psArray *p2PendingImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 10111 10081 static void p2DoneImfileRowFree(p2DoneImfileRow *object); 10112 10082 10113 p2DoneImfileRow *p2DoneImfileRowAlloc(const char *exp_id, const char *class_id, const char *uri, const char * stats, const char *recipe, psS32 p1_version, psS32 p2_version)10083 p2DoneImfileRow *p2DoneImfileRowAlloc(const char *exp_id, const char *class_id, const char *uri, const char *recipe, psS32 p1_version, psS32 p2_version) 10114 10084 { 10115 10085 p2DoneImfileRow *object; … … 10121 10091 object->class_id = psStringCopy(class_id); 10122 10092 object->uri = psStringCopy(uri); 10123 object->stats = psStringCopy(stats);10124 10093 object->recipe = psStringCopy(recipe); 10125 10094 object->p1_version = p1_version; … … 10134 10103 psFree(object->class_id); 10135 10104 psFree(object->uri); 10136 psFree(object->stats);10137 10105 psFree(object->recipe); 10138 10106 } … … 10164 10132 return false; 10165 10133 } 10166 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "255")) {10167 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");10168 psFree(md);10169 return false;10170 }10171 10134 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "64")) { 10172 10135 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 10197 10160 } 10198 10161 10199 bool p2DoneImfileInsert(psDB * dbh, const char *exp_id, const char *class_id, const char *uri, const char * stats, const char *recipe, psS32 p1_version, psS32 p2_version)10162 bool p2DoneImfileInsert(psDB * dbh, const char *exp_id, const char *class_id, const char *uri, const char *recipe, psS32 p1_version, psS32 p2_version) 10200 10163 { 10201 10164 psMetadata *md; … … 10218 10181 return false; 10219 10182 } 10220 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, stats)) {10221 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");10222 psFree(md);10223 return false;10224 }10225 10183 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, recipe)) { 10226 10184 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 10245 10203 } 10246 10204 10247 bool p2DoneImfilePop(psDB *dbh, char **exp_id, char **class_id, char **uri, char ** stats, char **recipe, psS32 *p1_version, psS32 *p2_version)10205 bool p2DoneImfilePop(psDB *dbh, char **exp_id, char **class_id, char **uri, char **recipe, psS32 *p1_version, psS32 *p2_version) 10248 10206 { 10249 10207 psArray *rowSet; … … 10307 10265 return false; 10308 10266 } 10309 *stats = psMetadataLookupPtr(&status, row, "stats");10310 if (!status) {10311 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stats");10312 psFree(row);10313 return false;10314 }10315 10267 *recipe = psMetadataLookupPtr(&status, row, "recipe"); 10316 10268 if (!status) { … … 10339 10291 bool p2DoneImfileInsertObject(psDB *dbh, p2DoneImfileRow *object) 10340 10292 { 10341 return p2DoneImfileInsert(dbh, object->exp_id, object->class_id, object->uri, object-> stats, object->recipe, object->p1_version, object->p2_version);10293 return p2DoneImfileInsert(dbh, object->exp_id, object->class_id, object->uri, object->recipe, object->p1_version, object->p2_version); 10342 10294 } 10343 10295 … … 10347 10299 char class_id[256]; 10348 10300 char uri[256]; 10349 char stats[256];10350 10301 char recipe[256]; 10351 10302 psS32 p1_version; 10352 10303 psS32 p2_version; 10353 10304 10354 if (!p2DoneImfilePop(dbh, (char **)&exp_id, (char **)&class_id, (char **)&uri, (char **)& stats, (char **)&recipe, &p1_version, &p2_version)) {10305 if (!p2DoneImfilePop(dbh, (char **)&exp_id, (char **)&class_id, (char **)&uri, (char **)&recipe, &p1_version, &p2_version)) { 10355 10306 psError(PS_ERR_UNKNOWN, false, "failed to pop a database row"); 10356 10307 return NULL; 10357 10308 } 10358 10309 10359 return p2DoneImfileRowAlloc(exp_id, class_id, uri, stats,recipe, p1_version, p2_version);10310 return p2DoneImfileRowAlloc(exp_id, class_id, uri, recipe, p1_version, p2_version); 10360 10311 } 10361 10312 … … 10471 10422 return NULL; 10472 10423 } 10473 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, object->stats)) {10474 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");10475 psFree(md);10476 return NULL;10477 }10478 10424 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, object->recipe)) { 10479 10425 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 10501 10447 char *class_id; 10502 10448 char *uri; 10503 char *stats;10504 10449 char *recipe; 10505 10450 psS32 p1_version; … … 10521 10466 return false; 10522 10467 } 10523 stats = psMetadataLookupPtr(&status, md, "stats");10524 if (!status) {10525 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stats");10526 return false;10527 }10528 10468 recipe = psMetadataLookupPtr(&status, md, "recipe"); 10529 10469 if (!status) { … … 10542 10482 } 10543 10483 10544 return p2DoneImfileRowAlloc(exp_id, class_id, uri, stats,recipe, p1_version, p2_version);10484 return p2DoneImfileRowAlloc(exp_id, class_id, uri, recipe, p1_version, p2_version); 10545 10485 } 10546 10486 psArray *p2DoneImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 12266 12206 static void detProcessedImfileRowFree(detProcessedImfileRow *object); 12267 12207 12268 detProcessedImfileRow *detProcessedImfileRowAlloc(psS32 det_id, const char *exp_id, const char *class_id, const char *uri, const char * stats, const char *recipe)12208 detProcessedImfileRow *detProcessedImfileRowAlloc(psS32 det_id, const char *exp_id, const char *class_id, const char *uri, const char *recipe) 12269 12209 { 12270 12210 detProcessedImfileRow *object; … … 12277 12217 object->class_id = psStringCopy(class_id); 12278 12218 object->uri = psStringCopy(uri); 12279 object->stats = psStringCopy(stats);12280 12219 object->recipe = psStringCopy(recipe); 12281 12220 … … 12288 12227 psFree(object->class_id); 12289 12228 psFree(object->uri); 12290 psFree(object->stats);12291 12229 psFree(object->recipe); 12292 12230 } … … 12323 12261 return false; 12324 12262 } 12325 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "255")) {12326 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");12327 psFree(md);12328 return false;12329 }12330 12263 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "64")) { 12331 12264 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 12346 12279 } 12347 12280 12348 bool detProcessedImfileInsert(psDB * dbh, psS32 det_id, const char *exp_id, const char *class_id, const char *uri, const char * stats, const char *recipe)12281 bool detProcessedImfileInsert(psDB * dbh, psS32 det_id, const char *exp_id, const char *class_id, const char *uri, const char *recipe) 12349 12282 { 12350 12283 psMetadata *md; … … 12372 12305 return false; 12373 12306 } 12374 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, stats)) {12375 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");12376 psFree(md);12377 return false;12378 }12379 12307 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, recipe)) { 12380 12308 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 12389 12317 } 12390 12318 12391 bool detProcessedImfilePop(psDB *dbh, psS32 *det_id, char **exp_id, char **class_id, char **uri, char ** stats, char **recipe)12319 bool detProcessedImfilePop(psDB *dbh, psS32 *det_id, char **exp_id, char **class_id, char **uri, char **recipe) 12392 12320 { 12393 12321 psArray *rowSet; … … 12457 12385 return false; 12458 12386 } 12459 *stats = psMetadataLookupPtr(&status, row, "stats");12460 if (!status) {12461 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stats");12462 psFree(row);12463 return false;12464 }12465 12387 *recipe = psMetadataLookupPtr(&status, row, "recipe"); 12466 12388 if (!status) { … … 12477 12399 bool detProcessedImfileInsertObject(psDB *dbh, detProcessedImfileRow *object) 12478 12400 { 12479 return detProcessedImfileInsert(dbh, object->det_id, object->exp_id, object->class_id, object->uri, object-> stats, object->recipe);12401 return detProcessedImfileInsert(dbh, object->det_id, object->exp_id, object->class_id, object->uri, object->recipe); 12480 12402 } 12481 12403 … … 12486 12408 char class_id[256]; 12487 12409 char uri[256]; 12488 char stats[256];12489 12410 char recipe[256]; 12490 12411 12491 if (!detProcessedImfilePop(dbh, &det_id, (char **)&exp_id, (char **)&class_id, (char **)&uri, (char **)& stats, (char **)&recipe)) {12412 if (!detProcessedImfilePop(dbh, &det_id, (char **)&exp_id, (char **)&class_id, (char **)&uri, (char **)&recipe)) { 12492 12413 psError(PS_ERR_UNKNOWN, false, "failed to pop a database row"); 12493 12414 return NULL; 12494 12415 } 12495 12416 12496 return detProcessedImfileRowAlloc(det_id, exp_id, class_id, uri, stats,recipe);12417 return detProcessedImfileRowAlloc(det_id, exp_id, class_id, uri, recipe); 12497 12418 } 12498 12419 … … 12613 12534 return NULL; 12614 12535 } 12615 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, object->stats)) {12616 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");12617 psFree(md);12618 return NULL;12619 }12620 12536 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, object->recipe)) { 12621 12537 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 12634 12550 char *class_id; 12635 12551 char *uri; 12636 char *stats;12637 12552 char *recipe; 12638 12553 … … 12657 12572 return false; 12658 12573 } 12659 stats = psMetadataLookupPtr(&status, md, "stats");12660 if (!status) {12661 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stats");12662 return false;12663 }12664 12574 recipe = psMetadataLookupPtr(&status, md, "recipe"); 12665 12575 if (!status) { … … 12668 12578 } 12669 12579 12670 return detProcessedImfileRowAlloc(det_id, exp_id, class_id, uri, stats,recipe);12580 return detProcessedImfileRowAlloc(det_id, exp_id, class_id, uri, recipe); 12671 12581 } 12672 12582 psArray *detProcessedImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 12726 12636 static void detStackedImfileRowFree(detStackedImfileRow *object); 12727 12637 12728 detStackedImfileRow *detStackedImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char * stats, const char *recipe)12638 detStackedImfileRow *detStackedImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char *recipe) 12729 12639 { 12730 12640 detStackedImfileRow *object; … … 12737 12647 object->class_id = psStringCopy(class_id); 12738 12648 object->uri = psStringCopy(uri); 12739 object->stats = psStringCopy(stats);12740 12649 object->recipe = psStringCopy(recipe); 12741 12650 … … 12747 12656 psFree(object->class_id); 12748 12657 psFree(object->uri); 12749 psFree(object->stats);12750 12658 psFree(object->recipe); 12751 12659 } … … 12782 12690 return false; 12783 12691 } 12784 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "255")) {12785 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");12786 psFree(md);12787 return false;12788 }12789 12692 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "64")) { 12790 12693 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 12805 12708 } 12806 12709 12807 bool detStackedImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char * stats, const char *recipe)12710 bool detStackedImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char *recipe) 12808 12711 { 12809 12712 psMetadata *md; … … 12831 12734 return false; 12832 12735 } 12833 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, stats)) {12834 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");12835 psFree(md);12836 return false;12837 }12838 12736 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, recipe)) { 12839 12737 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 12848 12746 } 12849 12747 12850 bool detStackedImfilePop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **class_id, char **uri, char ** stats, char **recipe)12748 bool detStackedImfilePop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **class_id, char **uri, char **recipe) 12851 12749 { 12852 12750 psArray *rowSet; … … 12916 12814 return false; 12917 12815 } 12918 *stats = psMetadataLookupPtr(&status, row, "stats");12919 if (!status) {12920 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stats");12921 psFree(row);12922 return false;12923 }12924 12816 *recipe = psMetadataLookupPtr(&status, row, "recipe"); 12925 12817 if (!status) { … … 12936 12828 bool detStackedImfileInsertObject(psDB *dbh, detStackedImfileRow *object) 12937 12829 { 12938 return detStackedImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->uri, object-> stats, object->recipe);12830 return detStackedImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->uri, object->recipe); 12939 12831 } 12940 12832 … … 12945 12837 char class_id[256]; 12946 12838 char uri[256]; 12947 char stats[256];12948 12839 char recipe[256]; 12949 12840 12950 if (!detStackedImfilePop(dbh, &det_id, &iteration, (char **)&class_id, (char **)&uri, (char **)& stats, (char **)&recipe)) {12841 if (!detStackedImfilePop(dbh, &det_id, &iteration, (char **)&class_id, (char **)&uri, (char **)&recipe)) { 12951 12842 psError(PS_ERR_UNKNOWN, false, "failed to pop a database row"); 12952 12843 return NULL; 12953 12844 } 12954 12845 12955 return detStackedImfileRowAlloc(det_id, iteration, class_id, uri, stats,recipe);12846 return detStackedImfileRowAlloc(det_id, iteration, class_id, uri, recipe); 12956 12847 } 12957 12848 … … 13072 12963 return NULL; 13073 12964 } 13074 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, object->stats)) {13075 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");13076 psFree(md);13077 return NULL;13078 }13079 12965 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, object->recipe)) { 13080 12966 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 13093 12979 char *class_id; 13094 12980 char *uri; 13095 char *stats;13096 12981 char *recipe; 13097 12982 … … 13116 13001 return false; 13117 13002 } 13118 stats = psMetadataLookupPtr(&status, md, "stats");13119 if (!status) {13120 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stats");13121 return false;13122 }13123 13003 recipe = psMetadataLookupPtr(&status, md, "recipe"); 13124 13004 if (!status) { … … 13127 13007 } 13128 13008 13129 return detStackedImfileRowAlloc(det_id, iteration, class_id, uri, stats,recipe);13009 return detStackedImfileRowAlloc(det_id, iteration, class_id, uri, recipe); 13130 13010 } 13131 13011 psArray *detStackedImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 13185 13065 static void detNormalizedImfileRowFree(detNormalizedImfileRow *object); 13186 13066 13187 detNormalizedImfileRow *detNormalizedImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char * stats, const char *recipe)13067 detNormalizedImfileRow *detNormalizedImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char *recipe) 13188 13068 { 13189 13069 detNormalizedImfileRow *object; … … 13196 13076 object->class_id = psStringCopy(class_id); 13197 13077 object->uri = psStringCopy(uri); 13198 object->stats = psStringCopy(stats);13199 13078 object->recipe = psStringCopy(recipe); 13200 13079 … … 13206 13085 psFree(object->class_id); 13207 13086 psFree(object->uri); 13208 psFree(object->stats);13209 13087 psFree(object->recipe); 13210 13088 } … … 13241 13119 return false; 13242 13120 } 13243 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "255")) {13244 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");13245 psFree(md);13246 return false;13247 }13248 13121 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "64")) { 13249 13122 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 13264 13137 } 13265 13138 13266 bool detNormalizedImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char * stats, const char *recipe)13139 bool detNormalizedImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char *recipe) 13267 13140 { 13268 13141 psMetadata *md; … … 13290 13163 return false; 13291 13164 } 13292 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, stats)) {13293 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");13294 psFree(md);13295 return false;13296 }13297 13165 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, recipe)) { 13298 13166 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 13307 13175 } 13308 13176 13309 bool detNormalizedImfilePop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **class_id, char **uri, char ** stats, char **recipe)13177 bool detNormalizedImfilePop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **class_id, char **uri, char **recipe) 13310 13178 { 13311 13179 psArray *rowSet; … … 13375 13243 return false; 13376 13244 } 13377 *stats = psMetadataLookupPtr(&status, row, "stats");13378 if (!status) {13379 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stats");13380 psFree(row);13381 return false;13382 }13383 13245 *recipe = psMetadataLookupPtr(&status, row, "recipe"); 13384 13246 if (!status) { … … 13395 13257 bool detNormalizedImfileInsertObject(psDB *dbh, detNormalizedImfileRow *object) 13396 13258 { 13397 return detNormalizedImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->uri, object-> stats, object->recipe);13259 return detNormalizedImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->uri, object->recipe); 13398 13260 } 13399 13261 … … 13404 13266 char class_id[256]; 13405 13267 char uri[256]; 13406 char stats[256];13407 13268 char recipe[256]; 13408 13269 13409 if (!detNormalizedImfilePop(dbh, &det_id, &iteration, (char **)&class_id, (char **)&uri, (char **)& stats, (char **)&recipe)) {13270 if (!detNormalizedImfilePop(dbh, &det_id, &iteration, (char **)&class_id, (char **)&uri, (char **)&recipe)) { 13410 13271 psError(PS_ERR_UNKNOWN, false, "failed to pop a database row"); 13411 13272 return NULL; 13412 13273 } 13413 13274 13414 return detNormalizedImfileRowAlloc(det_id, iteration, class_id, uri, stats,recipe);13275 return detNormalizedImfileRowAlloc(det_id, iteration, class_id, uri, recipe); 13415 13276 } 13416 13277 … … 13531 13392 return NULL; 13532 13393 } 13533 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, object->stats)) {13534 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");13535 psFree(md);13536 return NULL;13537 }13538 13394 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, object->recipe)) { 13539 13395 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 13552 13408 char *class_id; 13553 13409 char *uri; 13554 char *stats;13555 13410 char *recipe; 13556 13411 … … 13575 13430 return false; 13576 13431 } 13577 stats = psMetadataLookupPtr(&status, md, "stats");13578 if (!status) {13579 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stats");13580 return false;13581 }13582 13432 recipe = psMetadataLookupPtr(&status, md, "recipe"); 13583 13433 if (!status) { … … 13586 13436 } 13587 13437 13588 return detNormalizedImfileRowAlloc(det_id, iteration, class_id, uri, stats,recipe);13438 return detNormalizedImfileRowAlloc(det_id, iteration, class_id, uri, recipe); 13589 13439 } 13590 13440 psArray *detNormalizedImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 14013 13863 static void detMasterImfileRowFree(detMasterImfileRow *object); 14014 13864 14015 detMasterImfileRow *detMasterImfileRowAlloc(psS32 det_id, const char *class_id, const char *uri, const char * stats, const char *recipe)13865 detMasterImfileRow *detMasterImfileRowAlloc(psS32 det_id, const char *class_id, const char *uri, const char *recipe) 14016 13866 { 14017 13867 detMasterImfileRow *object; … … 14023 13873 object->class_id = psStringCopy(class_id); 14024 13874 object->uri = psStringCopy(uri); 14025 object->stats = psStringCopy(stats);14026 13875 object->recipe = psStringCopy(recipe); 14027 13876 … … 14033 13882 psFree(object->class_id); 14034 13883 psFree(object->uri); 14035 psFree(object->stats);14036 13884 psFree(object->recipe); 14037 13885 } … … 14063 13911 return false; 14064 13912 } 14065 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "255")) {14066 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");14067 psFree(md);14068 return false;14069 }14070 13913 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "64")) { 14071 13914 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 14086 13929 } 14087 13930 14088 bool detMasterImfileInsert(psDB * dbh, psS32 det_id, const char *class_id, const char *uri, const char * stats, const char *recipe)13931 bool detMasterImfileInsert(psDB * dbh, psS32 det_id, const char *class_id, const char *uri, const char *recipe) 14089 13932 { 14090 13933 psMetadata *md; … … 14107 13950 return false; 14108 13951 } 14109 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, stats)) {14110 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");14111 psFree(md);14112 return false;14113 }14114 13952 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, recipe)) { 14115 13953 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 14124 13962 } 14125 13963 14126 bool detMasterImfilePop(psDB *dbh, psS32 *det_id, char **class_id, char **uri, char ** stats, char **recipe)13964 bool detMasterImfilePop(psDB *dbh, psS32 *det_id, char **class_id, char **uri, char **recipe) 14127 13965 { 14128 13966 psArray *rowSet; … … 14186 14024 return false; 14187 14025 } 14188 *stats = psMetadataLookupPtr(&status, row, "stats");14189 if (!status) {14190 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stats");14191 psFree(row);14192 return false;14193 }14194 14026 *recipe = psMetadataLookupPtr(&status, row, "recipe"); 14195 14027 if (!status) { … … 14206 14038 bool detMasterImfileInsertObject(psDB *dbh, detMasterImfileRow *object) 14207 14039 { 14208 return detMasterImfileInsert(dbh, object->det_id, object->class_id, object->uri, object-> stats, object->recipe);14040 return detMasterImfileInsert(dbh, object->det_id, object->class_id, object->uri, object->recipe); 14209 14041 } 14210 14042 … … 14214 14046 char class_id[256]; 14215 14047 char uri[256]; 14216 char stats[256];14217 14048 char recipe[256]; 14218 14049 14219 if (!detMasterImfilePop(dbh, &det_id, (char **)&class_id, (char **)&uri, (char **)& stats, (char **)&recipe)) {14050 if (!detMasterImfilePop(dbh, &det_id, (char **)&class_id, (char **)&uri, (char **)&recipe)) { 14220 14051 psError(PS_ERR_UNKNOWN, false, "failed to pop a database row"); 14221 14052 return NULL; 14222 14053 } 14223 14054 14224 return detMasterImfileRowAlloc(det_id, class_id, uri, stats,recipe);14055 return detMasterImfileRowAlloc(det_id, class_id, uri, recipe); 14225 14056 } 14226 14057 … … 14336 14167 return NULL; 14337 14168 } 14338 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, object->stats)) {14339 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");14340 psFree(md);14341 return NULL;14342 }14343 14169 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, object->recipe)) { 14344 14170 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 14356 14182 char *class_id; 14357 14183 char *uri; 14358 char *stats;14359 14184 char *recipe; 14360 14185 … … 14374 14199 return false; 14375 14200 } 14376 stats = psMetadataLookupPtr(&status, md, "stats");14377 if (!status) {14378 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stats");14379 return false;14380 }14381 14201 recipe = psMetadataLookupPtr(&status, md, "recipe"); 14382 14202 if (!status) { … … 14385 14205 } 14386 14206 14387 return detMasterImfileRowAlloc(det_id, class_id, uri, stats,recipe);14207 return detMasterImfileRowAlloc(det_id, class_id, uri, recipe); 14388 14208 } 14389 14209 psArray *detMasterImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 14443 14263 static void detResidImfileAnalysisRowFree(detResidImfileAnalysisRow *object); 14444 14264 14445 detResidImfileAnalysisRow *detResidImfileAnalysisRowAlloc(psS32 det_id, psS32 iteration, const char *exp_id, const char *class_id, const char * stats, const char *recipe)14265 detResidImfileAnalysisRow *detResidImfileAnalysisRowAlloc(psS32 det_id, psS32 iteration, const char *exp_id, const char *class_id, const char *recipe) 14446 14266 { 14447 14267 detResidImfileAnalysisRow *object; … … 14454 14274 object->exp_id = psStringCopy(exp_id); 14455 14275 object->class_id = psStringCopy(class_id); 14456 object->stats = psStringCopy(stats);14457 14276 object->recipe = psStringCopy(recipe); 14458 14277 … … 14464 14283 psFree(object->exp_id); 14465 14284 psFree(object->class_id); 14466 psFree(object->stats);14467 14285 psFree(object->recipe); 14468 14286 } … … 14499 14317 return false; 14500 14318 } 14501 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "255")) {14502 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");14503 psFree(md);14504 return false;14505 }14506 14319 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "64")) { 14507 14320 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 14522 14335 } 14523 14336 14524 bool detResidImfileAnalysisInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_id, const char *class_id, const char * stats, const char *recipe)14337 bool detResidImfileAnalysisInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_id, const char *class_id, const char *recipe) 14525 14338 { 14526 14339 psMetadata *md; … … 14548 14361 return false; 14549 14362 } 14550 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, stats)) {14551 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");14552 psFree(md);14553 return false;14554 }14555 14363 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, recipe)) { 14556 14364 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 14565 14373 } 14566 14374 14567 bool detResidImfileAnalysisPop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **exp_id, char **class_id, char ** stats, char **recipe)14375 bool detResidImfileAnalysisPop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **exp_id, char **class_id, char **recipe) 14568 14376 { 14569 14377 psArray *rowSet; … … 14633 14441 return false; 14634 14442 } 14635 *stats = psMetadataLookupPtr(&status, row, "stats");14636 if (!status) {14637 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stats");14638 psFree(row);14639 return false;14640 }14641 14443 *recipe = psMetadataLookupPtr(&status, row, "recipe"); 14642 14444 if (!status) { … … 14653 14455 bool detResidImfileAnalysisInsertObject(psDB *dbh, detResidImfileAnalysisRow *object) 14654 14456 { 14655 return detResidImfileAnalysisInsert(dbh, object->det_id, object->iteration, object->exp_id, object->class_id, object-> stats, object->recipe);14457 return detResidImfileAnalysisInsert(dbh, object->det_id, object->iteration, object->exp_id, object->class_id, object->recipe); 14656 14458 } 14657 14459 … … 14662 14464 char exp_id[256]; 14663 14465 char class_id[256]; 14664 char stats[256];14665 14466 char recipe[256]; 14666 14467 14667 if (!detResidImfileAnalysisPop(dbh, &det_id, &iteration, (char **)&exp_id, (char **)&class_id, (char **)& stats, (char **)&recipe)) {14468 if (!detResidImfileAnalysisPop(dbh, &det_id, &iteration, (char **)&exp_id, (char **)&class_id, (char **)&recipe)) { 14668 14469 psError(PS_ERR_UNKNOWN, false, "failed to pop a database row"); 14669 14470 return NULL; 14670 14471 } 14671 14472 14672 return detResidImfileAnalysisRowAlloc(det_id, iteration, exp_id, class_id, stats,recipe);14473 return detResidImfileAnalysisRowAlloc(det_id, iteration, exp_id, class_id, recipe); 14673 14474 } 14674 14475 … … 14789 14590 return NULL; 14790 14591 } 14791 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, object->stats)) {14792 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");14793 psFree(md);14794 return NULL;14795 }14796 14592 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, object->recipe)) { 14797 14593 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 14810 14606 char *exp_id; 14811 14607 char *class_id; 14812 char *stats;14813 14608 char *recipe; 14814 14609 … … 14833 14628 return false; 14834 14629 } 14835 stats = psMetadataLookupPtr(&status, md, "stats");14836 if (!status) {14837 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stats");14838 return false;14839 }14840 14630 recipe = psMetadataLookupPtr(&status, md, "recipe"); 14841 14631 if (!status) { … … 14844 14634 } 14845 14635 14846 return detResidImfileAnalysisRowAlloc(det_id, iteration, exp_id, class_id, stats,recipe);14636 return detResidImfileAnalysisRowAlloc(det_id, iteration, exp_id, class_id, recipe); 14847 14637 } 14848 14638 psArray *detResidImfileAnalysisSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 14902 14692 static void detResidExpAnalysisRowFree(detResidExpAnalysisRow *object); 14903 14693 14904 detResidExpAnalysisRow *detResidExpAnalysisRowAlloc(psS32 det_id, psS32 iteration, const char *exp_id, const char * stats, const char *recipe, bool accept)14694 detResidExpAnalysisRow *detResidExpAnalysisRowAlloc(psS32 det_id, psS32 iteration, const char *exp_id, const char *recipe, bool accept) 14905 14695 { 14906 14696 detResidExpAnalysisRow *object; … … 14912 14702 object->iteration = iteration; 14913 14703 object->exp_id = psStringCopy(exp_id); 14914 object->stats = psStringCopy(stats);14915 14704 object->recipe = psStringCopy(recipe); 14916 14705 object->accept = accept; … … 14922 14711 { 14923 14712 psFree(object->exp_id); 14924 psFree(object->stats);14925 14713 psFree(object->recipe); 14926 14714 } … … 14952 14740 return false; 14953 14741 } 14954 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "255")) {14955 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");14956 psFree(md);14957 return false;14958 }14959 14742 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "64")) { 14960 14743 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 14980 14763 } 14981 14764 14982 bool detResidExpAnalysisInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_id, const char * stats, const char *recipe, bool accept)14765 bool detResidExpAnalysisInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_id, const char *recipe, bool accept) 14983 14766 { 14984 14767 psMetadata *md; … … 15001 14784 return false; 15002 14785 } 15003 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, stats)) {15004 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");15005 psFree(md);15006 return false;15007 }15008 14786 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, recipe)) { 15009 14787 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 15023 14801 } 15024 14802 15025 bool detResidExpAnalysisPop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **exp_id, char ** stats, char **recipe, bool *accept)14803 bool detResidExpAnalysisPop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **exp_id, char **recipe, bool *accept) 15026 14804 { 15027 14805 psArray *rowSet; … … 15085 14863 return false; 15086 14864 } 15087 *stats = psMetadataLookupPtr(&status, row, "stats");15088 if (!status) {15089 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stats");15090 psFree(row);15091 return false;15092 }15093 14865 *recipe = psMetadataLookupPtr(&status, row, "recipe"); 15094 14866 if (!status) { … … 15111 14883 bool detResidExpAnalysisInsertObject(psDB *dbh, detResidExpAnalysisRow *object) 15112 14884 { 15113 return detResidExpAnalysisInsert(dbh, object->det_id, object->iteration, object->exp_id, object-> stats, object->recipe, object->accept);14885 return detResidExpAnalysisInsert(dbh, object->det_id, object->iteration, object->exp_id, object->recipe, object->accept); 15114 14886 } 15115 14887 … … 15119 14891 psS32 iteration; 15120 14892 char exp_id[256]; 15121 char stats[256];15122 14893 char recipe[256]; 15123 14894 bool accept; 15124 14895 15125 if (!detResidExpAnalysisPop(dbh, &det_id, &iteration, (char **)&exp_id, (char **)& stats, (char **)&recipe, &accept)) {14896 if (!detResidExpAnalysisPop(dbh, &det_id, &iteration, (char **)&exp_id, (char **)&recipe, &accept)) { 15126 14897 psError(PS_ERR_UNKNOWN, false, "failed to pop a database row"); 15127 14898 return NULL; 15128 14899 } 15129 14900 15130 return detResidExpAnalysisRowAlloc(det_id, iteration, exp_id, stats,recipe, accept);14901 return detResidExpAnalysisRowAlloc(det_id, iteration, exp_id, recipe, accept); 15131 14902 } 15132 14903 … … 15242 15013 return NULL; 15243 15014 } 15244 if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, object->stats)) {15245 psError(PS_ERR_UNKNOWN, false, "failed to add item stats");15246 psFree(md);15247 return NULL;15248 }15249 15015 if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, object->recipe)) { 15250 15016 psError(PS_ERR_UNKNOWN, false, "failed to add item recipe"); … … 15267 15033 psS32 iteration; 15268 15034 char *exp_id; 15269 char *stats;15270 15035 char *recipe; 15271 15036 bool accept; … … 15286 15051 return false; 15287 15052 } 15288 stats = psMetadataLookupPtr(&status, md, "stats");15289 if (!status) {15290 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stats");15291 return false;15292 }15293 15053 recipe = psMetadataLookupPtr(&status, md, "recipe"); 15294 15054 if (!status) { … … 15302 15062 } 15303 15063 15304 return detResidExpAnalysisRowAlloc(det_id, iteration, exp_id, stats,recipe, accept);15064 return detResidExpAnalysisRowAlloc(det_id, iteration, exp_id, recipe, accept); 15305 15065 } 15306 15066 psArray *detResidExpAnalysisSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
Note:
See TracChangeset
for help on using the changeset viewer.
