Changeset 10328
- Timestamp:
- Nov 30, 2006, 2:46:56 PM (20 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
dbconfig/config.md (modified) (1 diff)
-
ippdb/configure.ac (modified) (2 diffs)
-
ippdb/src/ippdb.c (modified) (12 diffs)
-
ippdb/src/ippdb.h (modified) (4 diffs)
-
ippdb/tests/alloc.c (modified) (2 diffs)
-
ippdb/tests/insert.c (modified) (1 diff)
-
ippdb/tests/insertobject.c (modified) (1 diff)
-
ippdb/tests/metadatafromobject.c (modified) (2 diffs)
-
ippdb/tests/objectfrommetadata.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dbconfig/config.md
r10237 r10328 2 2 pkg_name STR ippdb 3 3 pkg_namespace STR ippdb 4 pkg_version STR 0.0.6 04 pkg_version STR 0.0.62 5 5 END -
trunk/ippdb/configure.ac
r10238 r10328 1 1 dnl 2 dnl This file was generated by glueforge 0.3 22 dnl This file was generated by glueforge 0.33 3 3 dnl 4 4 dnl Do NOT directly edit this file. … … 7 7 AC_PREREQ(2.59) 8 8 9 AC_INIT([ippdb], [0.0.6 0], [pan-starrs.ifa.hawaii.edu])9 AC_INIT([ippdb], [0.0.62], [pan-starrs.ifa.hawaii.edu]) 10 10 AC_CONFIG_SRCDIR([ippdb.pc.in]) 11 11 -
trunk/ippdb/src/ippdb.c
r10238 r10328 20 20 /* 21 21 * 22 * This file was generated by glueforge 0.3 222 * This file was generated by glueforge 0.33 23 23 * 24 24 * Do NOT directly edit this file. … … 131 131 METADATAITEM_STRIFY_CASE(PS_DATA_F64, "%f", F64); 132 132 case PS_DATA_STRING: 133 psStringSubstitute(str, " ", "_"); 133 134 psStringAppend(&str, "%s", item->data.str); 134 135 break; … … 884 885 static void summitImfileRowFree(summitImfileRow *object); 885 886 886 summitImfileRow *summitImfileRowAlloc(const char *exp_id, const char *camera, const char *telescope, psS32 bytes, const char *md5sum, const char *class, const char *class_id, const char *uri)887 summitImfileRow *summitImfileRowAlloc(const char *exp_id, const char *camera, const char *telescope, const char *file_id, psS32 bytes, const char *md5sum, const char *class, const char *class_id, const char *uri) 887 888 { 888 889 summitImfileRow *_object; … … 894 895 _object->camera = psStringCopy(camera); 895 896 _object->telescope = psStringCopy(telescope); 897 _object->file_id = psStringCopy(file_id); 896 898 _object->bytes = bytes; 897 899 _object->md5sum = psStringCopy(md5sum); … … 908 910 psFree(object->camera); 909 911 psFree(object->telescope); 912 psFree(object->file_id); 910 913 psFree(object->md5sum); 911 914 psFree(object->class); … … 932 935 return false; 933 936 } 937 if (!psMetadataAdd(md, PS_LIST_TAIL, "file_id", PS_DATA_STRING, "Key", "64")) { 938 psError(PS_ERR_UNKNOWN, false, "failed to add item file_id"); 939 psFree(md); 940 return false; 941 } 934 942 if (!psMetadataAdd(md, PS_LIST_TAIL, "bytes", PS_DATA_S32, NULL, 0)) { 935 943 psError(PS_ERR_UNKNOWN, false, "failed to add item bytes"); … … 970 978 } 971 979 972 bool summitImfileInsert(psDB * dbh, const char *exp_id, const char *camera, const char *telescope, psS32 bytes, const char *md5sum, const char *class, const char *class_id, const char *uri)980 bool summitImfileInsert(psDB * dbh, const char *exp_id, const char *camera, const char *telescope, const char *file_id, psS32 bytes, const char *md5sum, const char *class, const char *class_id, const char *uri) 973 981 { 974 982 psMetadata *md = psMetadataAlloc(); … … 985 993 if (!psMetadataAdd(md, PS_LIST_TAIL, "telescope", PS_DATA_STRING, NULL, telescope)) { 986 994 psError(PS_ERR_UNKNOWN, false, "failed to add item telescope"); 995 psFree(md); 996 return false; 997 } 998 if (!psMetadataAdd(md, PS_LIST_TAIL, "file_id", PS_DATA_STRING, NULL, file_id)) { 999 psError(PS_ERR_UNKNOWN, false, "failed to add item file_id"); 987 1000 psFree(md); 988 1001 return false; … … 1036 1049 bool summitImfileInsertObject(psDB *dbh, summitImfileRow *object) 1037 1050 { 1038 return summitImfileInsert(dbh, object->exp_id, object->camera, object->telescope, object-> bytes, object->md5sum, object->class, object->class_id, object->uri);1051 return summitImfileInsert(dbh, object->exp_id, object->camera, object->telescope, object->file_id, object->bytes, object->md5sum, object->class, object->class_id, object->uri); 1039 1052 } 1040 1053 … … 1124 1137 return false; 1125 1138 } 1139 if (!psMetadataAdd(md, PS_LIST_TAIL, "file_id", PS_DATA_STRING, NULL, object->file_id)) { 1140 psError(PS_ERR_UNKNOWN, false, "failed to add item file_id"); 1141 psFree(md); 1142 return false; 1143 } 1126 1144 if (!psMetadataAdd(md, PS_LIST_TAIL, "bytes", PS_DATA_S32, NULL, object->bytes)) { 1127 1145 psError(PS_ERR_UNKNOWN, false, "failed to add item bytes"); … … 1173 1191 return false; 1174 1192 } 1193 char* file_id = psMetadataLookupPtr(&status, md, "file_id"); 1194 if (!status) { 1195 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item file_id"); 1196 return false; 1197 } 1175 1198 psS32 bytes = psMetadataLookupS32(&status, md, "bytes"); 1176 1199 if (!status) { … … 1199 1222 } 1200 1223 1201 return summitImfileRowAlloc(exp_id, camera, telescope, bytes, md5sum, class, class_id, uri);1224 return summitImfileRowAlloc(exp_id, camera, telescope, file_id, bytes, md5sum, class, class_id, uri); 1202 1225 } 1203 1226 psArray *summitImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) -
trunk/ippdb/src/ippdb.h
r10238 r10328 20 20 /* 21 21 * 22 * This file was generated by glueforge 0.3 222 * This file was generated by glueforge 0.33 23 23 * 24 24 * Do NOT directly edit this file. … … 516 516 char *camera; 517 517 char *telescope; 518 char *file_id; 518 519 psS32 bytes; 519 520 char *md5sum; … … 532 533 const char *camera, 533 534 const char *telescope, 535 const char *file_id, 534 536 psS32 bytes, 535 537 const char *md5sum, … … 569 571 const char *camera, 570 572 const char *telescope, 573 const char *file_id, 571 574 psS32 bytes, 572 575 const char *md5sum, -
trunk/ippdb/tests/alloc.c
r10238 r10328 67 67 summitImfileRow *object; 68 68 69 object = summitImfileRowAlloc("a string", "a string", "a string", -32, "a string", "a string", "a string", "a string" );69 object = summitImfileRowAlloc("a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string" ); 70 70 71 71 if (!object) { … … 82 82 } 83 83 if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) { 84 psFree(object); 85 exit(EXIT_FAILURE); 86 } 87 if (strncmp(object->file_id, "a string", MAX_STRING_LENGTH)) { 84 88 psFree(object); 85 89 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insert.c
r10238 r10328 43 43 } 44 44 45 if (!summitImfileInsert(dbh, "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string")) {45 if (!summitImfileInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string")) { 46 46 exit(EXIT_FAILURE); 47 47 } -
trunk/ippdb/tests/insertobject.c
r10238 r10328 58 58 } 59 59 60 object = summitImfileRowAlloc("a string", "a string", "a string", -32, "a string", "a string", "a string", "a string");60 object = summitImfileRowAlloc("a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string"); 61 61 if (!object) { 62 62 exit(EXIT_FAILURE); -
trunk/ippdb/tests/metadatafromobject.c
r10238 r10328 85 85 bool status; 86 86 87 object = summitImfileRowAlloc("a string", "a string", "a string", -32, "a string", "a string", "a string", "a string");87 object = summitImfileRowAlloc("a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string"); 88 88 if (!object) { 89 89 exit(EXIT_FAILURE); … … 106 106 } 107 107 if (strncmp(psMetadataLookupPtr(&status, md, "telescope"), "a string", MAX_STRING_LENGTH)) { 108 psFree(md); 109 exit(EXIT_FAILURE); 110 } 111 if (strncmp(psMetadataLookupPtr(&status, md, "file_id"), "a string", MAX_STRING_LENGTH)) { 108 112 psFree(md); 109 113 exit(EXIT_FAILURE); -
trunk/ippdb/tests/objectfrommetadata.c
r10238 r10328 121 121 exit(EXIT_FAILURE); 122 122 } 123 if (!psMetadataAddStr(md, PS_LIST_TAIL, "file_id", 0, NULL, "a string")) { 124 psFree(md); 125 exit(EXIT_FAILURE); 126 } 123 127 if (!psMetadataAddS32(md, PS_LIST_TAIL, "bytes", 0, NULL, -32)) { 124 128 psFree(md); … … 159 163 } 160 164 if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) { 165 psFree(object); 166 exit(EXIT_FAILURE); 167 } 168 if (strncmp(object->file_id, "a string", MAX_STRING_LENGTH)) { 161 169 psFree(object); 162 170 exit(EXIT_FAILURE);
Note:
See TracChangeset
for help on using the changeset viewer.
