Changeset 10328 for trunk/ippdb/src/ippdb.c
- Timestamp:
- Nov 30, 2006, 2:46:56 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippdb/src/ippdb.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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)
Note:
See TracChangeset
for help on using the changeset viewer.
