Changeset 18796 for trunk/ippdb/src
- Timestamp:
- Jul 30, 2008, 2:59:09 PM (18 years ago)
- Location:
- trunk/ippdb/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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,
Note:
See TracChangeset
for help on using the changeset viewer.
