Changeset 11027
- Timestamp:
- Jan 10, 2007, 6:44:06 PM (19 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
r11005 r11027 7 7 AC_PREREQ(2.59) 8 8 9 AC_INIT([ippdb], [0.0.7 0], [pan-starrs.ifa.hawaii.edu])9 AC_INIT([ippdb], [0.0.71], [pan-starrs.ifa.hawaii.edu]) 10 10 AC_CONFIG_SRCDIR([ippdb.pc.in]) 11 11 -
trunk/ippdb/src/ippdb.c
r11005 r11027 7764 7764 static void p3PendingExpRowFree(p3PendingExpRow *object); 7765 7765 7766 p3PendingExpRow *p3PendingExpRowAlloc(const char *exp_tag, psS32 p2_version, psS32 p3_version, const char *label )7766 p3PendingExpRow *p3PendingExpRowAlloc(const char *exp_tag, psS32 p2_version, psS32 p3_version, const char *label, psS16 fault) 7767 7767 { 7768 7768 p3PendingExpRow *_object; … … 7775 7775 _object->p3_version = p3_version; 7776 7776 _object->label = psStringCopy(label); 7777 _object->fault = fault; 7777 7778 7778 7779 return _object; … … 7808 7809 return false; 7809 7810 } 7811 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) { 7812 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 7813 psFree(md); 7814 return false; 7815 } 7810 7816 7811 7817 bool status = psDBCreateTable(dbh, P3PENDINGEXP_TABLE_NAME, md); … … 7821 7827 } 7822 7828 7823 bool p3PendingExpInsert(psDB * dbh, const char *exp_tag, psS32 p2_version, psS32 p3_version, const char *label )7829 bool p3PendingExpInsert(psDB * dbh, const char *exp_tag, psS32 p2_version, psS32 p3_version, const char *label, psS16 fault) 7824 7830 { 7825 7831 psMetadata *md = psMetadataAlloc(); … … 7841 7847 if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, NULL, label)) { 7842 7848 psError(PS_ERR_UNKNOWN, false, "failed to add item label"); 7849 psFree(md); 7850 return false; 7851 } 7852 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 7853 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 7843 7854 psFree(md); 7844 7855 return false; … … 7867 7878 bool p3PendingExpInsertObject(psDB *dbh, p3PendingExpRow *object) 7868 7879 { 7869 return p3PendingExpInsert(dbh, object->exp_tag, object->p2_version, object->p3_version, object->label );7880 return p3PendingExpInsert(dbh, object->exp_tag, object->p2_version, object->p3_version, object->label, object->fault); 7870 7881 } 7871 7882 … … 7960 7971 return false; 7961 7972 } 7973 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 7974 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 7975 psFree(md); 7976 return false; 7977 } 7962 7978 7963 7979 … … 7989 8005 return false; 7990 8006 } 7991 7992 return p3PendingExpRowAlloc(exp_tag, p2_version, p3_version, label); 8007 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 8008 if (!status) { 8009 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault"); 8010 return false; 8011 } 8012 8013 return p3PendingExpRowAlloc(exp_tag, p2_version, p3_version, label, fault); 7993 8014 } 7994 8015 psArray *p3PendingExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) -
trunk/ippdb/src/ippdb.h
r11005 r11027 4005 4005 psS32 p3_version; 4006 4006 char *label; 4007 psS16 fault; 4007 4008 } p3PendingExpRow; 4008 4009 … … 4016 4017 psS32 p2_version, 4017 4018 psS32 p3_version, 4018 const char *label 4019 const char *label, 4020 psS16 fault 4019 4021 ); 4020 4022 … … 4049 4051 psS32 p2_version, 4050 4052 psS32 p3_version, 4051 const char *label 4053 const char *label, 4054 psS16 fault 4052 4055 ); 4053 4056 -
trunk/ippdb/tests/alloc.c
r11005 r11027 787 787 p3PendingExpRow *object; 788 788 789 object = p3PendingExpRowAlloc("a string", -32, -32, "a string" );789 object = p3PendingExpRowAlloc("a string", -32, -32, "a string", -16 ); 790 790 791 791 if (!object) { … … 806 806 } 807 807 if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) { 808 psFree(object); 809 exit(EXIT_FAILURE); 810 } 808 811 psFree(object); 809 812 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insert.c
r11005 r11027 283 283 } 284 284 285 if (!p3PendingExpInsert(dbh, "a string", -32, -32, "a string" )) {285 if (!p3PendingExpInsert(dbh, "a string", -32, -32, "a string", -16)) { 286 286 exit(EXIT_FAILURE); 287 287 } -
trunk/ippdb/tests/insertobject.c
r11005 r11027 410 410 } 411 411 412 object = p3PendingExpRowAlloc("a string", -32, -32, "a string" );412 object = p3PendingExpRowAlloc("a string", -32, -32, "a string", -16); 413 413 if (!object) { 414 414 exit(EXIT_FAILURE); -
trunk/ippdb/tests/metadatafromobject.c
r11005 r11027 933 933 bool status; 934 934 935 object = p3PendingExpRowAlloc("a string", -32, -32, "a string" );935 object = p3PendingExpRowAlloc("a string", -32, -32, "a string", -16); 936 936 if (!object) { 937 937 exit(EXIT_FAILURE); … … 958 958 } 959 959 if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) { 960 psFree(md); 961 exit(EXIT_FAILURE); 962 } 960 963 psFree(md); 961 964 exit(EXIT_FAILURE); -
trunk/ippdb/tests/objectfrommetadata.c
r11005 r11027 1437 1437 exit(EXIT_FAILURE); 1438 1438 } 1439 psFree(md); 1440 exit(EXIT_FAILURE); 1441 } 1439 1442 1440 1443 object = p3PendingExpObjectFromMetadata(md); … … 1459 1462 } 1460 1463 if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) { 1464 psFree(object); 1465 exit(EXIT_FAILURE); 1466 } 1461 1467 psFree(object); 1462 1468 exit(EXIT_FAILURE);
Note:
See TracChangeset
for help on using the changeset viewer.
