Changeset 18796
- Timestamp:
- Jul 30, 2008, 2:59:09 PM (18 years ago)
- Location:
- trunk/ippdb
- Files:
-
- 8 edited
-
configure.ac (modified) (1 diff)
-
src/ippdb.c (modified) (8 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/configure.ac
r17878 r18796 7 7 AC_PREREQ(2.61) 8 8 9 AC_INIT([ippdb], [1.1.3 8], [pan-starrs.ifa.hawaii.edu])9 AC_INIT([ippdb], [1.1.39], [pan-starrs.ifa.hawaii.edu]) 10 10 AC_CONFIG_SRCDIR([ippdb.pc.in]) 11 11 -
trunk/ippdb/src/ippdb.c
r18595 r18796 23053 23053 static void magicRunRowFree(magicRunRow *object); 23054 23054 23055 magicRunRow *magicRunRowAlloc(psS64 magic_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *dvodb, psTime* registered, psS16 fault)23055 magicRunRow *magicRunRowAlloc(psS64 magic_id, psS64 exp_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *dvodb, psTime* registered, psS16 fault) 23056 23056 { 23057 23057 magicRunRow *_object; … … 23061 23061 23062 23062 _object->magic_id = magic_id; 23063 _object->exp_id = exp_id; 23063 23064 _object->state = psStringCopy(state); 23064 23065 _object->workdir = psStringCopy(workdir); … … 23090 23091 return false; 23091 23092 } 23093 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, "Key", 0)) { 23094 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 23095 psFree(md); 23096 return false; 23097 } 23092 23098 if (!psMetadataAdd(md, PS_LIST_TAIL, "state", PS_DATA_STRING, "Key", "64")) { 23093 23099 psError(PS_ERR_UNKNOWN, false, "failed to add item state"); … … 23138 23144 } 23139 23145 23140 bool magicRunInsert(psDB * dbh, psS64 magic_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *dvodb, psTime* registered, psS16 fault)23146 bool magicRunInsert(psDB * dbh, psS64 magic_id, psS64 exp_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *dvodb, psTime* registered, psS16 fault) 23141 23147 { 23142 23148 psMetadata *md = psMetadataAlloc(); 23143 23149 if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, magic_id)) { 23144 23150 psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id"); 23151 psFree(md); 23152 return false; 23153 } 23154 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, NULL, exp_id)) { 23155 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 23145 23156 psFree(md); 23146 23157 return false; … … 23204 23215 bool magicRunInsertObject(psDB *dbh, magicRunRow *object) 23205 23216 { 23206 return magicRunInsert(dbh, object->magic_id, object-> state, object->workdir, object->workdir_state, object->label, object->dvodb, object->registered, object->fault);23217 return magicRunInsert(dbh, object->magic_id, object->exp_id, object->state, object->workdir, object->workdir_state, object->label, object->dvodb, object->registered, object->fault); 23207 23218 } 23208 23219 … … 23282 23293 return false; 23283 23294 } 23295 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, NULL, object->exp_id)) { 23296 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 23297 psFree(md); 23298 return false; 23299 } 23284 23300 if (!psMetadataAdd(md, PS_LIST_TAIL, "state", PS_DATA_STRING, NULL, object->state)) { 23285 23301 psError(PS_ERR_UNKNOWN, false, "failed to add item state"); … … 23331 23347 return false; 23332 23348 } 23349 psS64 exp_id = psMetadataLookupS64(&status, md, "exp_id"); 23350 if (!status) { 23351 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item exp_id"); 23352 return false; 23353 } 23333 23354 char* state = psMetadataLookupPtr(&status, md, "state"); 23334 23355 if (!status) { … … 23367 23388 } 23368 23389 23369 return magicRunRowAlloc(magic_id, state, workdir, workdir_state, label, dvodb, registered, fault);23390 return magicRunRowAlloc(magic_id, exp_id, state, workdir, workdir_state, label, dvodb, registered, fault); 23370 23391 } 23371 23392 psArray *magicRunSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) -
trunk/ippdb/src/ippdb.h
r18595 r18796 10029 10029 typedef struct { 10030 10030 psS64 magic_id; 10031 psS64 exp_id; 10031 10032 char *state; 10032 10033 char *workdir; … … 10045 10046 magicRunRow *magicRunRowAlloc( 10046 10047 psS64 magic_id, 10048 psS64 exp_id, 10047 10049 const char *state, 10048 10050 const char *workdir, … … 10082 10084 psDB *dbh, ///< Database handle 10083 10085 psS64 magic_id, 10086 psS64 exp_id, 10084 10087 const char *state, 10085 10088 const char *workdir, -
trunk/ippdb/tests/alloc.c
r18595 r18796 2736 2736 magicRunRow *object; 2737 2737 2738 object = magicRunRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", -16 );2738 object = magicRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", -16 ); 2739 2739 2740 2740 if (!object) { … … 2743 2743 2744 2744 if (!object->magic_id == -64) { 2745 psFree(object); 2746 exit(EXIT_FAILURE); 2747 } 2748 if (!object->exp_id == -64) { 2745 2749 psFree(object); 2746 2750 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insert.c
r18595 r18796 658 658 } 659 659 660 if (!magicRunInsert(dbh, -64, "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", -16)) {660 if (!magicRunInsert(dbh, -64, -64, "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", -16)) { 661 661 exit(EXIT_FAILURE); 662 662 } -
trunk/ippdb/tests/insertobject.c
r18595 r18796 960 960 } 961 961 962 object = magicRunRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", -16);962 object = magicRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", -16); 963 963 if (!object) { 964 964 exit(EXIT_FAILURE); -
trunk/ippdb/tests/metadatafromobject.c
r18595 r18796 3007 3007 bool status; 3008 3008 3009 object = magicRunRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", -16);3009 object = magicRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", -16); 3010 3010 if (!object) { 3011 3011 exit(EXIT_FAILURE); … … 3019 3019 psFree(object); 3020 3020 3021 psFree(md); 3022 exit(EXIT_FAILURE); 3023 } 3021 3024 psFree(md); 3022 3025 exit(EXIT_FAILURE); -
trunk/ippdb/tests/objectfrommetadata.c
r18595 r18796 4972 4972 exit(EXIT_FAILURE); 4973 4973 } 4974 psFree(md); 4975 exit(EXIT_FAILURE); 4976 } 4974 4977 if (!psMetadataAddStr(md, PS_LIST_TAIL, "state", 0, NULL, "a string")) { 4975 4978 psFree(md); … … 5007 5010 psFree(md); 5008 5011 5012 psFree(object); 5013 exit(EXIT_FAILURE); 5014 } 5009 5015 psFree(object); 5010 5016 exit(EXIT_FAILURE);
Note:
See TracChangeset
for help on using the changeset viewer.
