Changeset 17872 for trunk/ippdb
- Timestamp:
- May 30, 2008, 4:19:52 PM (18 years ago)
- Location:
- trunk/ippdb
- Files:
-
- 8 edited
-
configure.ac (modified) (1 diff)
-
src/ippdb.c (modified) (81 diffs)
-
src/ippdb.h (modified) (27 diffs)
-
tests/alloc.c (modified) (18 diffs)
-
tests/insert.c (modified) (1 diff)
-
tests/insertobject.c (modified) (9 diffs)
-
tests/metadatafromobject.c (modified) (18 diffs)
-
tests/objectfrommetadata.c (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/configure.ac
r17833 r17872 7 7 AC_PREREQ(2.61) 8 8 9 AC_INIT([ippdb], [1.1.3 6], [pan-starrs.ifa.hawaii.edu])9 AC_INIT([ippdb], [1.1.37], [pan-starrs.ifa.hawaii.edu]) 10 10 AC_CONFIG_SRCDIR([ippdb.pc.in]) 11 11 -
trunk/ippdb/src/ippdb.c
r17840 r17872 262 262 static void pzDataStoreRowFree(pzDataStoreRow *object); 263 263 264 pzDataStoreRow *pzDataStoreRowAlloc(const char *camera, const char *telescope, const char *uri )264 pzDataStoreRow *pzDataStoreRowAlloc(const char *camera, const char *telescope, const char *uri, psTime* epoch) 265 265 { 266 266 pzDataStoreRow *_object; … … 272 272 _object->telescope = psStringCopy(telescope); 273 273 _object->uri = psStringCopy(uri); 274 _object->epoch = psTimeCopy(epoch); 274 275 275 276 return _object; … … 281 282 psFree(object->telescope); 282 283 psFree(object->uri); 284 psFree(object->epoch); 283 285 } 284 286 … … 301 303 return false; 302 304 } 305 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) { 306 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 307 psFree(md); 308 return false; 309 } 303 310 304 311 bool status = psDBCreateTable(dbh, PZDATASTORE_TABLE_NAME, md); … … 314 321 } 315 322 316 bool pzDataStoreInsert(psDB * dbh, const char *camera, const char *telescope, const char *uri )323 bool pzDataStoreInsert(psDB * dbh, const char *camera, const char *telescope, const char *uri, psTime* epoch) 317 324 { 318 325 psMetadata *md = psMetadataAlloc(); … … 329 336 if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, uri)) { 330 337 psError(PS_ERR_UNKNOWN, false, "failed to add item uri"); 338 psFree(md); 339 return false; 340 } 341 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) { 342 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 331 343 psFree(md); 332 344 return false; … … 355 367 bool pzDataStoreInsertObject(psDB *dbh, pzDataStoreRow *object) 356 368 { 357 return pzDataStoreInsert(dbh, object->camera, object->telescope, object->uri );369 return pzDataStoreInsert(dbh, object->camera, object->telescope, object->uri, object->epoch); 358 370 } 359 371 … … 443 455 return false; 444 456 } 457 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) { 458 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 459 psFree(md); 460 return false; 461 } 445 462 446 463 … … 467 484 return false; 468 485 } 469 470 return pzDataStoreRowAlloc(camera, telescope, uri); 486 psTime* epoch = psMetadataLookupPtr(&status, md, "epoch"); 487 if (!status) { 488 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch"); 489 return false; 490 } 491 492 return pzDataStoreRowAlloc(camera, telescope, uri, epoch); 471 493 } 472 494 psArray *pzDataStoreSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 586 608 static void summitExpRowFree(summitExpRow *object); 587 609 588 summitExpRow *summitExpRowAlloc(const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, const char *uri, psS32 imfiles, psS16 fault )610 summitExpRow *summitExpRowAlloc(const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, const char *uri, psS32 imfiles, psS16 fault, psTime* epoch) 589 611 { 590 612 summitExpRow *_object; … … 601 623 _object->imfiles = imfiles; 602 624 _object->fault = fault; 625 _object->epoch = psTimeCopy(epoch); 603 626 604 627 return _object; … … 613 636 psFree(object->exp_type); 614 637 psFree(object->uri); 638 psFree(object->epoch); 615 639 } 616 640 … … 658 682 return false; 659 683 } 684 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) { 685 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 686 psFree(md); 687 return false; 688 } 660 689 661 690 bool status = psDBCreateTable(dbh, SUMMITEXP_TABLE_NAME, md); … … 671 700 } 672 701 673 bool summitExpInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, const char *uri, psS32 imfiles, psS16 fault )702 bool summitExpInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, const char *uri, psS32 imfiles, psS16 fault, psTime* epoch) 674 703 { 675 704 psMetadata *md = psMetadataAlloc(); … … 711 740 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 712 741 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 742 psFree(md); 743 return false; 744 } 745 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) { 746 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 713 747 psFree(md); 714 748 return false; … … 737 771 bool summitExpInsertObject(psDB *dbh, summitExpRow *object) 738 772 { 739 return summitExpInsert(dbh, object->exp_name, object->camera, object->telescope, object->dateobs, object->exp_type, object->uri, object->imfiles, object->fault );773 return summitExpInsert(dbh, object->exp_name, object->camera, object->telescope, object->dateobs, object->exp_type, object->uri, object->imfiles, object->fault, object->epoch); 740 774 } 741 775 … … 850 884 return false; 851 885 } 886 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) { 887 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 888 psFree(md); 889 return false; 890 } 852 891 853 892 … … 899 938 return false; 900 939 } 901 902 return summitExpRowAlloc(exp_name, camera, telescope, dateobs, exp_type, uri, imfiles, fault); 940 psTime* epoch = psMetadataLookupPtr(&status, md, "epoch"); 941 if (!status) { 942 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch"); 943 return false; 944 } 945 946 return summitExpRowAlloc(exp_name, camera, telescope, dateobs, exp_type, uri, imfiles, fault, epoch); 903 947 } 904 948 psArray *summitExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 1018 1062 static void summitImfileRowFree(summitImfileRow *object); 1019 1063 1020 summitImfileRow *summitImfileRowAlloc(const char *exp_name, 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 )1064 summitImfileRow *summitImfileRowAlloc(const char *exp_name, 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, psTime* epoch) 1021 1065 { 1022 1066 summitImfileRow *_object; … … 1034 1078 _object->class_id = psStringCopy(class_id); 1035 1079 _object->uri = psStringCopy(uri); 1080 _object->epoch = psTimeCopy(epoch); 1036 1081 1037 1082 return _object; … … 1048 1093 psFree(object->class_id); 1049 1094 psFree(object->uri); 1095 psFree(object->epoch); 1050 1096 } 1051 1097 … … 1098 1144 return false; 1099 1145 } 1146 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) { 1147 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 1148 psFree(md); 1149 return false; 1150 } 1100 1151 1101 1152 bool status = psDBCreateTable(dbh, SUMMITIMFILE_TABLE_NAME, md); … … 1111 1162 } 1112 1163 1113 bool summitImfileInsert(psDB * dbh, const char *exp_name, 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 )1164 bool summitImfileInsert(psDB * dbh, const char *exp_name, 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, psTime* epoch) 1114 1165 { 1115 1166 psMetadata *md = psMetadataAlloc(); … … 1156 1207 if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, uri)) { 1157 1208 psError(PS_ERR_UNKNOWN, false, "failed to add item uri"); 1209 psFree(md); 1210 return false; 1211 } 1212 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) { 1213 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 1158 1214 psFree(md); 1159 1215 return false; … … 1182 1238 bool summitImfileInsertObject(psDB *dbh, summitImfileRow *object) 1183 1239 { 1184 return summitImfileInsert(dbh, object->exp_name, object->camera, object->telescope, object->file_id, object->bytes, object->md5sum, object->class, object->class_id, object->uri );1240 return summitImfileInsert(dbh, object->exp_name, object->camera, object->telescope, object->file_id, object->bytes, object->md5sum, object->class, object->class_id, object->uri, object->epoch); 1185 1241 } 1186 1242 … … 1300 1356 return false; 1301 1357 } 1358 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) { 1359 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 1360 psFree(md); 1361 return false; 1362 } 1302 1363 1303 1364 … … 1354 1415 return false; 1355 1416 } 1356 1357 return summitImfileRowAlloc(exp_name, camera, telescope, file_id, bytes, md5sum, class, class_id, uri); 1417 psTime* epoch = psMetadataLookupPtr(&status, md, "epoch"); 1418 if (!status) { 1419 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch"); 1420 return false; 1421 } 1422 1423 return summitImfileRowAlloc(exp_name, camera, telescope, file_id, bytes, md5sum, class, class_id, uri, epoch); 1358 1424 } 1359 1425 psArray *summitImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 1473 1539 static void pzDownloadExpRowFree(pzDownloadExpRow *object); 1474 1540 1475 pzDownloadExpRow *pzDownloadExpRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *state )1541 pzDownloadExpRow *pzDownloadExpRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *state, psTime* epoch) 1476 1542 { 1477 1543 pzDownloadExpRow *_object; … … 1484 1550 _object->telescope = psStringCopy(telescope); 1485 1551 _object->state = psStringCopy(state); 1552 _object->epoch = psTimeCopy(epoch); 1486 1553 1487 1554 return _object; … … 1494 1561 psFree(object->telescope); 1495 1562 psFree(object->state); 1563 psFree(object->epoch); 1496 1564 } 1497 1565 … … 1519 1587 return false; 1520 1588 } 1589 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) { 1590 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 1591 psFree(md); 1592 return false; 1593 } 1521 1594 1522 1595 bool status = psDBCreateTable(dbh, PZDOWNLOADEXP_TABLE_NAME, md); … … 1532 1605 } 1533 1606 1534 bool pzDownloadExpInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *state )1607 bool pzDownloadExpInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *state, psTime* epoch) 1535 1608 { 1536 1609 psMetadata *md = psMetadataAlloc(); … … 1552 1625 if (!psMetadataAdd(md, PS_LIST_TAIL, "state", PS_DATA_STRING, NULL, state)) { 1553 1626 psError(PS_ERR_UNKNOWN, false, "failed to add item state"); 1627 psFree(md); 1628 return false; 1629 } 1630 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) { 1631 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 1554 1632 psFree(md); 1555 1633 return false; … … 1578 1656 bool pzDownloadExpInsertObject(psDB *dbh, pzDownloadExpRow *object) 1579 1657 { 1580 return pzDownloadExpInsert(dbh, object->exp_name, object->camera, object->telescope, object->state );1658 return pzDownloadExpInsert(dbh, object->exp_name, object->camera, object->telescope, object->state, object->epoch); 1581 1659 } 1582 1660 … … 1671 1749 return false; 1672 1750 } 1751 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) { 1752 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 1753 psFree(md); 1754 return false; 1755 } 1673 1756 1674 1757 … … 1700 1783 return false; 1701 1784 } 1702 1703 return pzDownloadExpRowAlloc(exp_name, camera, telescope, state); 1785 psTime* epoch = psMetadataLookupPtr(&status, md, "epoch"); 1786 if (!status) { 1787 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch"); 1788 return false; 1789 } 1790 1791 return pzDownloadExpRowAlloc(exp_name, camera, telescope, state, epoch); 1704 1792 } 1705 1793 psArray *pzDownloadExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 1819 1907 static void pzDownloadImfileRowFree(pzDownloadImfileRow *object); 1820 1908 1821 pzDownloadImfileRow *pzDownloadImfileRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, const char *uri, psS16 fault )1909 pzDownloadImfileRow *pzDownloadImfileRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, const char *uri, psS16 fault, psTime* epoch) 1822 1910 { 1823 1911 pzDownloadImfileRow *_object; … … 1833 1921 _object->uri = psStringCopy(uri); 1834 1922 _object->fault = fault; 1923 _object->epoch = psTimeCopy(epoch); 1835 1924 1836 1925 return _object; … … 1845 1934 psFree(object->class_id); 1846 1935 psFree(object->uri); 1936 psFree(object->epoch); 1847 1937 } 1848 1938 … … 1885 1975 return false; 1886 1976 } 1977 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) { 1978 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 1979 psFree(md); 1980 return false; 1981 } 1887 1982 1888 1983 bool status = psDBCreateTable(dbh, PZDOWNLOADIMFILE_TABLE_NAME, md); … … 1898 1993 } 1899 1994 1900 bool pzDownloadImfileInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, const char *uri, psS16 fault )1995 bool pzDownloadImfileInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, const char *uri, psS16 fault, psTime* epoch) 1901 1996 { 1902 1997 psMetadata *md = psMetadataAlloc(); … … 1933 2028 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 1934 2029 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 2030 psFree(md); 2031 return false; 2032 } 2033 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) { 2034 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 1935 2035 psFree(md); 1936 2036 return false; … … 1959 2059 bool pzDownloadImfileInsertObject(psDB *dbh, pzDownloadImfileRow *object) 1960 2060 { 1961 return pzDownloadImfileInsert(dbh, object->exp_name, object->camera, object->telescope, object->class, object->class_id, object->uri, object->fault );2061 return pzDownloadImfileInsert(dbh, object->exp_name, object->camera, object->telescope, object->class, object->class_id, object->uri, object->fault, object->epoch); 1962 2062 } 1963 2063 … … 2067 2167 return false; 2068 2168 } 2169 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) { 2170 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 2171 psFree(md); 2172 return false; 2173 } 2069 2174 2070 2175 … … 2111 2216 return false; 2112 2217 } 2113 2114 return pzDownloadImfileRowAlloc(exp_name, camera, telescope, class, class_id, uri, fault); 2218 psTime* epoch = psMetadataLookupPtr(&status, md, "epoch"); 2219 if (!status) { 2220 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch"); 2221 return false; 2222 } 2223 2224 return pzDownloadImfileRowAlloc(exp_name, camera, telescope, class, class_id, uri, fault, epoch); 2115 2225 } 2116 2226 psArray *pzDownloadImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 2230 2340 static void newExpRowFree(newExpRow *object); 2231 2341 2232 newExpRow *newExpRowAlloc(psS64 exp_id, const char *tmp_exp_name, const char *tmp_camera, const char *tmp_telescope, const char *state, const char *workdir, const char *workdir_state, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *label )2342 newExpRow *newExpRowAlloc(psS64 exp_id, const char *tmp_exp_name, const char *tmp_camera, const char *tmp_telescope, const char *state, const char *workdir, const char *workdir_state, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *label, psTime* epoch) 2233 2343 { 2234 2344 newExpRow *_object; … … 2249 2359 _object->end_stage = psStringCopy(end_stage); 2250 2360 _object->label = psStringCopy(label); 2361 _object->epoch = psTimeCopy(epoch); 2251 2362 2252 2363 return _object; … … 2266 2377 psFree(object->end_stage); 2267 2378 psFree(object->label); 2379 psFree(object->epoch); 2268 2380 } 2269 2381 … … 2331 2443 return false; 2332 2444 } 2445 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) { 2446 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 2447 psFree(md); 2448 return false; 2449 } 2333 2450 2334 2451 bool status = psDBCreateTable(dbh, NEWEXP_TABLE_NAME, md); … … 2344 2461 } 2345 2462 2346 bool newExpInsert(psDB * dbh, psS64 exp_id, const char *tmp_exp_name, const char *tmp_camera, const char *tmp_telescope, const char *state, const char *workdir, const char *workdir_state, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *label )2463 bool newExpInsert(psDB * dbh, psS64 exp_id, const char *tmp_exp_name, const char *tmp_camera, const char *tmp_telescope, const char *state, const char *workdir, const char *workdir_state, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *label, psTime* epoch) 2347 2464 { 2348 2465 psMetadata *md = psMetadataAlloc(); … … 2404 2521 if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, NULL, label)) { 2405 2522 psError(PS_ERR_UNKNOWN, false, "failed to add item label"); 2523 psFree(md); 2524 return false; 2525 } 2526 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) { 2527 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 2406 2528 psFree(md); 2407 2529 return false; … … 2430 2552 bool newExpInsertObject(psDB *dbh, newExpRow *object) 2431 2553 { 2432 return newExpInsert(dbh, object->exp_id, object->tmp_exp_name, object->tmp_camera, object->tmp_telescope, object->state, object->workdir, object->workdir_state, object->reduction, object->dvodb, object->tess_id, object->end_stage, object->label );2554 return newExpInsert(dbh, object->exp_id, object->tmp_exp_name, object->tmp_camera, object->tmp_telescope, object->state, object->workdir, object->workdir_state, object->reduction, object->dvodb, object->tess_id, object->end_stage, object->label, object->epoch); 2433 2555 } 2434 2556 … … 2563 2685 return false; 2564 2686 } 2687 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) { 2688 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 2689 psFree(md); 2690 return false; 2691 } 2565 2692 2566 2693 … … 2632 2759 return false; 2633 2760 } 2634 2635 return newExpRowAlloc(exp_id, tmp_exp_name, tmp_camera, tmp_telescope, state, workdir, workdir_state, reduction, dvodb, tess_id, end_stage, label); 2761 psTime* epoch = psMetadataLookupPtr(&status, md, "epoch"); 2762 if (!status) { 2763 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch"); 2764 return false; 2765 } 2766 2767 return newExpRowAlloc(exp_id, tmp_exp_name, tmp_camera, tmp_telescope, state, workdir, workdir_state, reduction, dvodb, tess_id, end_stage, label, epoch); 2636 2768 } 2637 2769 psArray *newExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 2751 2883 static void newImfileRowFree(newImfileRow *object); 2752 2884 2753 newImfileRow *newImfileRowAlloc(psS64 exp_id, const char *tmp_class_id, const char *uri )2885 newImfileRow *newImfileRowAlloc(psS64 exp_id, const char *tmp_class_id, const char *uri, psTime* epoch) 2754 2886 { 2755 2887 newImfileRow *_object; … … 2761 2893 _object->tmp_class_id = psStringCopy(tmp_class_id); 2762 2894 _object->uri = psStringCopy(uri); 2895 _object->epoch = psTimeCopy(epoch); 2763 2896 2764 2897 return _object; … … 2769 2902 psFree(object->tmp_class_id); 2770 2903 psFree(object->uri); 2904 psFree(object->epoch); 2771 2905 } 2772 2906 … … 2789 2923 return false; 2790 2924 } 2925 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) { 2926 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 2927 psFree(md); 2928 return false; 2929 } 2791 2930 2792 2931 bool status = psDBCreateTable(dbh, NEWIMFILE_TABLE_NAME, md); … … 2802 2941 } 2803 2942 2804 bool newImfileInsert(psDB * dbh, psS64 exp_id, const char *tmp_class_id, const char *uri )2943 bool newImfileInsert(psDB * dbh, psS64 exp_id, const char *tmp_class_id, const char *uri, psTime* epoch) 2805 2944 { 2806 2945 psMetadata *md = psMetadataAlloc(); … … 2817 2956 if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, uri)) { 2818 2957 psError(PS_ERR_UNKNOWN, false, "failed to add item uri"); 2958 psFree(md); 2959 return false; 2960 } 2961 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) { 2962 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 2819 2963 psFree(md); 2820 2964 return false; … … 2843 2987 bool newImfileInsertObject(psDB *dbh, newImfileRow *object) 2844 2988 { 2845 return newImfileInsert(dbh, object->exp_id, object->tmp_class_id, object->uri );2989 return newImfileInsert(dbh, object->exp_id, object->tmp_class_id, object->uri, object->epoch); 2846 2990 } 2847 2991 … … 2931 3075 return false; 2932 3076 } 3077 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) { 3078 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 3079 psFree(md); 3080 return false; 3081 } 2933 3082 2934 3083 … … 2955 3104 return false; 2956 3105 } 2957 2958 return newImfileRowAlloc(exp_id, tmp_class_id, uri); 3106 psTime* epoch = psMetadataLookupPtr(&status, md, "epoch"); 3107 if (!status) { 3108 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch"); 3109 return false; 3110 } 3111 3112 return newImfileRowAlloc(exp_id, tmp_class_id, uri, epoch); 2959 3113 } 2960 3114 psArray *newImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 3074 3228 static void rawExpRowFree(rawExpRow *object); 3075 3229 3076 rawExpRow *rawExpRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, const char *hostname, psS16 fault )3230 rawExpRow *rawExpRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, const char *hostname, psS16 fault, psTime* epoch) 3077 3231 { 3078 3232 rawExpRow *_object; … … 3138 3292 _object->hostname = psStringCopy(hostname); 3139 3293 _object->fault = fault; 3294 _object->epoch = psTimeCopy(epoch); 3140 3295 3141 3296 return _object; … … 3160 3315 psFree(object->object); 3161 3316 psFree(object->hostname); 3317 psFree(object->epoch); 3162 3318 } 3163 3319 … … 3450 3606 return false; 3451 3607 } 3608 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) { 3609 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 3610 psFree(md); 3611 return false; 3612 } 3452 3613 3453 3614 bool status = psDBCreateTable(dbh, RAWEXP_TABLE_NAME, md); … … 3463 3624 } 3464 3625 3465 bool rawExpInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, const char *hostname, psS16 fault )3626 bool rawExpInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, const char *hostname, psS16 fault, psTime* epoch) 3466 3627 { 3467 3628 psMetadata *md = psMetadataAlloc(); … … 3748 3909 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 3749 3910 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 3911 psFree(md); 3912 return false; 3913 } 3914 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) { 3915 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 3750 3916 psFree(md); 3751 3917 return false; … … 3774 3940 bool rawExpInsertObject(psDB *dbh, rawExpRow *object) 3775 3941 { 3776 return rawExpInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->exp_tag, object->exp_type, object->filelevel, object->workdir, object->reduction, object->dvodb, object->tess_id, object->end_stage, object->filter, object->comment, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->m1_x, object->m1_y, object->m1_z, object->m1_tip, object->m1_tilt, object->m2_x, object->m2_y, object->m2_z, object->m2_tip, object->m2_tilt, object->env_temperature, object->env_humidity, object->env_wind_speed, object->env_wind_dir, object->teltemp_m1, object->teltemp_m1cell, object->teltemp_m2, object->teltemp_spider, object->teltemp_truss, object->teltemp_extra, object->pon_time, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->solang, object->hostname, object->fault );3942 return rawExpInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->exp_tag, object->exp_type, object->filelevel, object->workdir, object->reduction, object->dvodb, object->tess_id, object->end_stage, object->filter, object->comment, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->m1_x, object->m1_y, object->m1_z, object->m1_tip, object->m1_tilt, object->m2_x, object->m2_y, object->m2_z, object->m2_tip, object->m2_tilt, object->env_temperature, object->env_humidity, object->env_wind_speed, object->env_wind_dir, object->teltemp_m1, object->teltemp_m1cell, object->teltemp_m2, object->teltemp_spider, object->teltemp_truss, object->teltemp_extra, object->pon_time, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->solang, object->hostname, object->fault, object->epoch); 3777 3943 } 3778 3944 … … 4132 4298 return false; 4133 4299 } 4300 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) { 4301 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 4302 psFree(md); 4303 return false; 4304 } 4134 4305 4135 4306 … … 4426 4597 return false; 4427 4598 } 4428 4429 return rawExpRowAlloc(exp_id, exp_name, camera, telescope, dateobs, exp_tag, exp_type, filelevel, workdir, reduction, dvodb, tess_id, end_stage, filter, comment, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, m1_x, m1_y, m1_z, m1_tip, m1_tilt, m2_x, m2_y, m2_z, m2_tip, m2_tilt, env_temperature, env_humidity, env_wind_speed, env_wind_dir, teltemp_m1, teltemp_m1cell, teltemp_m2, teltemp_spider, teltemp_truss, teltemp_extra, pon_time, user_1, user_2, user_3, user_4, user_5, object, solang, hostname, fault); 4599 psTime* epoch = psMetadataLookupPtr(&status, md, "epoch"); 4600 if (!status) { 4601 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch"); 4602 return false; 4603 } 4604 4605 return rawExpRowAlloc(exp_id, exp_name, camera, telescope, dateobs, exp_tag, exp_type, filelevel, workdir, reduction, dvodb, tess_id, end_stage, filter, comment, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, m1_x, m1_y, m1_z, m1_tip, m1_tilt, m2_x, m2_y, m2_z, m2_tip, m2_tilt, env_temperature, env_humidity, env_wind_speed, env_wind_dir, teltemp_m1, teltemp_m1cell, teltemp_m2, teltemp_spider, teltemp_truss, teltemp_extra, pon_time, user_1, user_2, user_3, user_4, user_5, object, solang, hostname, fault, epoch); 4430 4606 } 4431 4607 psArray *rawExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 4545 4721 static void rawImfileRowFree(rawImfileRow *object); 4546 4722 4547 rawImfileRow *rawImfileRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *tmp_class_id, const char *class_id, const char *uri, const char *exp_type, const char *filelevel, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, const char *hostname, psS16 fault )4723 rawImfileRow *rawImfileRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *tmp_class_id, const char *class_id, const char *uri, const char *exp_type, const char *filelevel, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, const char *hostname, psS16 fault, psTime* epoch) 4548 4724 { 4549 4725 rawImfileRow *_object; … … 4605 4781 _object->hostname = psStringCopy(hostname); 4606 4782 _object->fault = fault; 4783 _object->epoch = psTimeCopy(epoch); 4607 4784 4608 4785 return _object; … … 4624 4801 psFree(object->object); 4625 4802 psFree(object->hostname); 4803 psFree(object->epoch); 4626 4804 } 4627 4805 … … 4894 5072 return false; 4895 5073 } 5074 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) { 5075 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 5076 psFree(md); 5077 return false; 5078 } 4896 5079 4897 5080 bool status = psDBCreateTable(dbh, RAWIMFILE_TABLE_NAME, md); … … 4907 5090 } 4908 5091 4909 bool rawImfileInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *tmp_class_id, const char *class_id, const char *uri, const char *exp_type, const char *filelevel, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, const char *hostname, psS16 fault )5092 bool rawImfileInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *tmp_class_id, const char *class_id, const char *uri, const char *exp_type, const char *filelevel, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, const char *hostname, psS16 fault, psTime* epoch) 4910 5093 { 4911 5094 psMetadata *md = psMetadataAlloc(); … … 5172 5355 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 5173 5356 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 5357 psFree(md); 5358 return false; 5359 } 5360 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) { 5361 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 5174 5362 psFree(md); 5175 5363 return false; … … 5198 5386 bool rawImfileInsertObject(psDB *dbh, rawImfileRow *object) 5199 5387 { 5200 return rawImfileInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->tmp_class_id, object->class_id, object->uri, object->exp_type, object->filelevel, object->filter, object->comment, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->m1_x, object->m1_y, object->m1_z, object->m1_tip, object->m1_tilt, object->m2_x, object->m2_y, object->m2_z, object->m2_tip, object->m2_tilt, object->env_temperature, object->env_humidity, object->env_wind_speed, object->env_wind_dir, object->teltemp_m1, object->teltemp_m1cell, object->teltemp_m2, object->teltemp_spider, object->teltemp_truss, object->teltemp_extra, object->pon_time, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->hostname, object->fault );5388 return rawImfileInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->tmp_class_id, object->class_id, object->uri, object->exp_type, object->filelevel, object->filter, object->comment, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->m1_x, object->m1_y, object->m1_z, object->m1_tip, object->m1_tilt, object->m2_x, object->m2_y, object->m2_z, object->m2_tip, object->m2_tilt, object->env_temperature, object->env_humidity, object->env_wind_speed, object->env_wind_dir, object->teltemp_m1, object->teltemp_m1cell, object->teltemp_m2, object->teltemp_spider, object->teltemp_truss, object->teltemp_extra, object->pon_time, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->hostname, object->fault, object->epoch); 5201 5389 } 5202 5390 … … 5536 5724 return false; 5537 5725 } 5726 if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) { 5727 psError(PS_ERR_UNKNOWN, false, "failed to add item epoch"); 5728 psFree(md); 5729 return false; 5730 } 5538 5731 5539 5732 … … 5810 6003 return false; 5811 6004 } 5812 5813 return rawImfileRowAlloc(exp_id, exp_name, camera, telescope, dateobs, tmp_class_id, class_id, uri, exp_type, filelevel, filter, comment, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, m1_x, m1_y, m1_z, m1_tip, m1_tilt, m2_x, m2_y, m2_z, m2_tip, m2_tilt, env_temperature, env_humidity, env_wind_speed, env_wind_dir, teltemp_m1, teltemp_m1cell, teltemp_m2, teltemp_spider, teltemp_truss, teltemp_extra, pon_time, user_1, user_2, user_3, user_4, user_5, object, hostname, fault); 6005 psTime* epoch = psMetadataLookupPtr(&status, md, "epoch"); 6006 if (!status) { 6007 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch"); 6008 return false; 6009 } 6010 6011 return rawImfileRowAlloc(exp_id, exp_name, camera, telescope, dateobs, tmp_class_id, class_id, uri, exp_type, filelevel, filter, comment, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, m1_x, m1_y, m1_z, m1_tip, m1_tilt, m2_x, m2_y, m2_z, m2_tip, m2_tilt, env_temperature, env_humidity, env_wind_speed, env_wind_dir, teltemp_m1, teltemp_m1cell, teltemp_m2, teltemp_spider, teltemp_truss, teltemp_extra, pon_time, user_1, user_2, user_3, user_4, user_5, object, hostname, fault, epoch); 5814 6012 } 5815 6013 psArray *rawImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) -
trunk/ippdb/src/ippdb.h
r17833 r17872 134 134 char *telescope; 135 135 char *uri; 136 psTime* epoch; 136 137 } pzDataStoreRow; 137 138 … … 144 145 const char *camera, 145 146 const char *telescope, 146 const char *uri 147 const char *uri, 148 psTime* epoch 147 149 ); 148 150 … … 176 178 const char *camera, 177 179 const char *telescope, 178 const char *uri 180 const char *uri, 181 psTime* epoch 179 182 ); 180 183 … … 340 343 psS32 imfiles; 341 344 psS16 fault; 345 psTime* epoch; 342 346 } summitExpRow; 343 347 … … 355 359 const char *uri, 356 360 psS32 imfiles, 357 psS16 fault 361 psS16 fault, 362 psTime* epoch 358 363 ); 359 364 … … 392 397 const char *uri, 393 398 psS32 imfiles, 394 psS16 fault 399 psS16 fault, 400 psTime* epoch 395 401 ); 396 402 … … 557 563 char *class_id; 558 564 char *uri; 565 psTime* epoch; 559 566 } summitImfileRow; 560 567 … … 573 580 const char *class, 574 581 const char *class_id, 575 const char *uri 582 const char *uri, 583 psTime* epoch 576 584 ); 577 585 … … 611 619 const char *class, 612 620 const char *class_id, 613 const char *uri 621 const char *uri, 622 psTime* epoch 614 623 ); 615 624 … … 771 780 char *telescope; 772 781 char *state; 782 psTime* epoch; 773 783 } pzDownloadExpRow; 774 784 … … 782 792 const char *camera, 783 793 const char *telescope, 784 const char *state 794 const char *state, 795 psTime* epoch 785 796 ); 786 797 … … 815 826 const char *camera, 816 827 const char *telescope, 817 const char *state 828 const char *state, 829 psTime* epoch 818 830 ); 819 831 … … 978 990 char *uri; 979 991 psS16 fault; 992 psTime* epoch; 980 993 } pzDownloadImfileRow; 981 994 … … 992 1005 const char *class_id, 993 1006 const char *uri, 994 psS16 fault 1007 psS16 fault, 1008 psTime* epoch 995 1009 ); 996 1010 … … 1028 1042 const char *class_id, 1029 1043 const char *uri, 1030 psS16 fault 1044 psS16 fault, 1045 psTime* epoch 1031 1046 ); 1032 1047 … … 1196 1211 char *end_stage; 1197 1212 char *label; 1213 psTime* epoch; 1198 1214 } newExpRow; 1199 1215 … … 1215 1231 const char *tess_id, 1216 1232 const char *end_stage, 1217 const char *label 1233 const char *label, 1234 psTime* epoch 1218 1235 ); 1219 1236 … … 1256 1273 const char *tess_id, 1257 1274 const char *end_stage, 1258 const char *label 1275 const char *label, 1276 psTime* epoch 1259 1277 ); 1260 1278 … … 1415 1433 char *tmp_class_id; 1416 1434 char *uri; 1435 psTime* epoch; 1417 1436 } newImfileRow; 1418 1437 … … 1425 1444 psS64 exp_id, 1426 1445 const char *tmp_class_id, 1427 const char *uri 1446 const char *uri, 1447 psTime* epoch 1428 1448 ); 1429 1449 … … 1457 1477 psS64 exp_id, 1458 1478 const char *tmp_class_id, 1459 const char *uri 1479 const char *uri, 1480 psTime* epoch 1460 1481 ); 1461 1482 … … 1670 1691 char *hostname; 1671 1692 psS16 fault; 1693 psTime* epoch; 1672 1694 } rawExpRow; 1673 1695 … … 1734 1756 psF32 solang, 1735 1757 const char *hostname, 1736 psS16 fault 1758 psS16 fault, 1759 psTime* epoch 1737 1760 ); 1738 1761 … … 1820 1843 psF32 solang, 1821 1844 const char *hostname, 1822 psS16 fault 1845 psS16 fault, 1846 psTime* epoch 1823 1847 ); 1824 1848 … … 2029 2053 char *hostname; 2030 2054 psS16 fault; 2055 psTime* epoch; 2031 2056 } rawImfileRow; 2032 2057 … … 2089 2114 const char *object, 2090 2115 const char *hostname, 2091 psS16 fault 2116 psS16 fault, 2117 psTime* epoch 2092 2118 ); 2093 2119 … … 2171 2197 const char *object, 2172 2198 const char *hostname, 2173 psS16 fault 2199 psS16 fault, 2200 psTime* epoch 2174 2201 ); 2175 2202 -
trunk/ippdb/tests/alloc.c
r17833 r17872 11 11 pzDataStoreRow *object; 12 12 13 object = pzDataStoreRowAlloc("a string", "a string", "a string" );13 object = pzDataStoreRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z" ); 14 14 15 15 if (!object) { … … 29 29 exit(EXIT_FAILURE); 30 30 } 31 psFree(object); 32 exit(EXIT_FAILURE); 33 } 31 34 32 35 psFree(object); … … 36 39 summitExpRow *object; 37 40 38 object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16 );41 object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16, "0001-01-01T00:00:00Z" ); 39 42 40 43 if (!object) { … … 73 76 exit(EXIT_FAILURE); 74 77 } 78 psFree(object); 79 exit(EXIT_FAILURE); 80 } 75 81 76 82 psFree(object); … … 80 86 summitImfileRow *object; 81 87 82 object = summitImfileRowAlloc("a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string" );88 object = summitImfileRowAlloc("a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z" ); 83 89 84 90 if (!object) { … … 122 128 exit(EXIT_FAILURE); 123 129 } 130 psFree(object); 131 exit(EXIT_FAILURE); 132 } 124 133 125 134 psFree(object); … … 129 138 pzDownloadExpRow *object; 130 139 131 object = pzDownloadExpRowAlloc("a string", "a string", "a string", "a string" );140 object = pzDownloadExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z" ); 132 141 133 142 if (!object) { … … 151 160 exit(EXIT_FAILURE); 152 161 } 162 psFree(object); 163 exit(EXIT_FAILURE); 164 } 153 165 154 166 psFree(object); … … 158 170 pzDownloadImfileRow *object; 159 171 160 object = pzDownloadImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", -16 );172 object = pzDownloadImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", -16, "0001-01-01T00:00:00Z" ); 161 173 162 174 if (!object) { … … 192 204 exit(EXIT_FAILURE); 193 205 } 206 psFree(object); 207 exit(EXIT_FAILURE); 208 } 194 209 195 210 psFree(object); … … 199 214 newExpRow *object; 200 215 201 object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string" );216 object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z" ); 202 217 203 218 if (!object) { … … 253 268 exit(EXIT_FAILURE); 254 269 } 270 psFree(object); 271 exit(EXIT_FAILURE); 272 } 255 273 256 274 psFree(object); … … 260 278 newImfileRow *object; 261 279 262 object = newImfileRowAlloc(-64, "a string", "a string" );280 object = newImfileRowAlloc(-64, "a string", "a string", "0001-01-01T00:00:00Z" ); 263 281 264 282 if (!object) { … … 278 296 exit(EXIT_FAILURE); 279 297 } 298 psFree(object); 299 exit(EXIT_FAILURE); 300 } 280 301 281 302 psFree(object); … … 285 306 rawExpRow *object; 286 307 287 object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16 );308 object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16, "0001-01-01T00:00:00Z" ); 288 309 289 310 if (!object) { … … 518 539 exit(EXIT_FAILURE); 519 540 } 541 psFree(object); 542 exit(EXIT_FAILURE); 543 } 520 544 521 545 psFree(object); … … 525 549 rawImfileRow *object; 526 550 527 object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16 );551 object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16, "0001-01-01T00:00:00Z" ); 528 552 529 553 if (!object) { … … 739 763 } 740 764 if (!object->fault == -16) { 765 psFree(object); 766 exit(EXIT_FAILURE); 767 } 741 768 psFree(object); 742 769 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insert.c
r17833 r17872 13 13 } 14 14 15 if (!pzDataStoreInsert(dbh, "a string", "a string", "a string" )) {16 exit(EXIT_FAILURE); 17 } 18 19 psDBCleanup(dbh); 20 } 21 22 { 23 psDB *dbh; 24 25 dbh = psDBInit("localhost", "test", NULL, "test"); 26 if (!dbh) { 27 exit(EXIT_FAILURE); 28 } 29 30 if (!summitExpInsert(dbh, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16 )) {31 exit(EXIT_FAILURE); 32 } 33 34 psDBCleanup(dbh); 35 } 36 37 { 38 psDB *dbh; 39 40 dbh = psDBInit("localhost", "test", NULL, "test"); 41 if (!dbh) { 42 exit(EXIT_FAILURE); 43 } 44 45 if (!summitImfileInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string" )) {46 exit(EXIT_FAILURE); 47 } 48 49 psDBCleanup(dbh); 50 } 51 52 { 53 psDB *dbh; 54 55 dbh = psDBInit("localhost", "test", NULL, "test"); 56 if (!dbh) { 57 exit(EXIT_FAILURE); 58 } 59 60 if (!pzDownloadExpInsert(dbh, "a string", "a string", "a string", "a string" )) {61 exit(EXIT_FAILURE); 62 } 63 64 psDBCleanup(dbh); 65 } 66 67 { 68 psDB *dbh; 69 70 dbh = psDBInit("localhost", "test", NULL, "test"); 71 if (!dbh) { 72 exit(EXIT_FAILURE); 73 } 74 75 if (!pzDownloadImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", "a string", -16 )) {76 exit(EXIT_FAILURE); 77 } 78 79 psDBCleanup(dbh); 80 } 81 82 { 83 psDB *dbh; 84 85 dbh = psDBInit("localhost", "test", NULL, "test"); 86 if (!dbh) { 87 exit(EXIT_FAILURE); 88 } 89 90 if (!newExpInsert(dbh, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string" )) {91 exit(EXIT_FAILURE); 92 } 93 94 psDBCleanup(dbh); 95 } 96 97 { 98 psDB *dbh; 99 100 dbh = psDBInit("localhost", "test", NULL, "test"); 101 if (!dbh) { 102 exit(EXIT_FAILURE); 103 } 104 105 if (!newImfileInsert(dbh, -64, "a string", "a string" )) {106 exit(EXIT_FAILURE); 107 } 108 109 psDBCleanup(dbh); 110 } 111 112 { 113 psDB *dbh; 114 115 dbh = psDBInit("localhost", "test", NULL, "test"); 116 if (!dbh) { 117 exit(EXIT_FAILURE); 118 } 119 120 if (!rawExpInsert(dbh, -64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16 )) {121 exit(EXIT_FAILURE); 122 } 123 124 psDBCleanup(dbh); 125 } 126 127 { 128 psDB *dbh; 129 130 dbh = psDBInit("localhost", "test", NULL, "test"); 131 if (!dbh) { 132 exit(EXIT_FAILURE); 133 } 134 135 if (!rawImfileInsert(dbh, -64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16 )) {15 if (!pzDataStoreInsert(dbh, "a string", "a string", "a string", "0001-01-01T00:00:00Z")) { 16 exit(EXIT_FAILURE); 17 } 18 19 psDBCleanup(dbh); 20 } 21 22 { 23 psDB *dbh; 24 25 dbh = psDBInit("localhost", "test", NULL, "test"); 26 if (!dbh) { 27 exit(EXIT_FAILURE); 28 } 29 30 if (!summitExpInsert(dbh, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16, "0001-01-01T00:00:00Z")) { 31 exit(EXIT_FAILURE); 32 } 33 34 psDBCleanup(dbh); 35 } 36 37 { 38 psDB *dbh; 39 40 dbh = psDBInit("localhost", "test", NULL, "test"); 41 if (!dbh) { 42 exit(EXIT_FAILURE); 43 } 44 45 if (!summitImfileInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z")) { 46 exit(EXIT_FAILURE); 47 } 48 49 psDBCleanup(dbh); 50 } 51 52 { 53 psDB *dbh; 54 55 dbh = psDBInit("localhost", "test", NULL, "test"); 56 if (!dbh) { 57 exit(EXIT_FAILURE); 58 } 59 60 if (!pzDownloadExpInsert(dbh, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z")) { 61 exit(EXIT_FAILURE); 62 } 63 64 psDBCleanup(dbh); 65 } 66 67 { 68 psDB *dbh; 69 70 dbh = psDBInit("localhost", "test", NULL, "test"); 71 if (!dbh) { 72 exit(EXIT_FAILURE); 73 } 74 75 if (!pzDownloadImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", "a string", -16, "0001-01-01T00:00:00Z")) { 76 exit(EXIT_FAILURE); 77 } 78 79 psDBCleanup(dbh); 80 } 81 82 { 83 psDB *dbh; 84 85 dbh = psDBInit("localhost", "test", NULL, "test"); 86 if (!dbh) { 87 exit(EXIT_FAILURE); 88 } 89 90 if (!newExpInsert(dbh, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z")) { 91 exit(EXIT_FAILURE); 92 } 93 94 psDBCleanup(dbh); 95 } 96 97 { 98 psDB *dbh; 99 100 dbh = psDBInit("localhost", "test", NULL, "test"); 101 if (!dbh) { 102 exit(EXIT_FAILURE); 103 } 104 105 if (!newImfileInsert(dbh, -64, "a string", "a string", "0001-01-01T00:00:00Z")) { 106 exit(EXIT_FAILURE); 107 } 108 109 psDBCleanup(dbh); 110 } 111 112 { 113 psDB *dbh; 114 115 dbh = psDBInit("localhost", "test", NULL, "test"); 116 if (!dbh) { 117 exit(EXIT_FAILURE); 118 } 119 120 if (!rawExpInsert(dbh, -64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16, "0001-01-01T00:00:00Z")) { 121 exit(EXIT_FAILURE); 122 } 123 124 psDBCleanup(dbh); 125 } 126 127 { 128 psDB *dbh; 129 130 dbh = psDBInit("localhost", "test", NULL, "test"); 131 if (!dbh) { 132 exit(EXIT_FAILURE); 133 } 134 135 if (!rawImfileInsert(dbh, -64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16, "0001-01-01T00:00:00Z")) { 136 136 exit(EXIT_FAILURE); 137 137 } -
trunk/ippdb/tests/insertobject.c
r17833 r17872 14 14 } 15 15 16 object = pzDataStoreRowAlloc("a string", "a string", "a string" );16 object = pzDataStoreRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z"); 17 17 if (!object) { 18 18 exit(EXIT_FAILURE); … … 36 36 } 37 37 38 object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16 );38 object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16, "0001-01-01T00:00:00Z"); 39 39 if (!object) { 40 40 exit(EXIT_FAILURE); … … 58 58 } 59 59 60 object = summitImfileRowAlloc("a string", "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", "0001-01-01T00:00:00Z"); 61 61 if (!object) { 62 62 exit(EXIT_FAILURE); … … 80 80 } 81 81 82 object = pzDownloadExpRowAlloc("a string", "a string", "a string", "a string" );82 object = pzDownloadExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z"); 83 83 if (!object) { 84 84 exit(EXIT_FAILURE); … … 102 102 } 103 103 104 object = pzDownloadImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", -16 );104 object = pzDownloadImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", -16, "0001-01-01T00:00:00Z"); 105 105 if (!object) { 106 106 exit(EXIT_FAILURE); … … 124 124 } 125 125 126 object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string" );126 object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z"); 127 127 if (!object) { 128 128 exit(EXIT_FAILURE); … … 146 146 } 147 147 148 object = newImfileRowAlloc(-64, "a string", "a string" );148 object = newImfileRowAlloc(-64, "a string", "a string", "0001-01-01T00:00:00Z"); 149 149 if (!object) { 150 150 exit(EXIT_FAILURE); … … 168 168 } 169 169 170 object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16 );170 object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16, "0001-01-01T00:00:00Z"); 171 171 if (!object) { 172 172 exit(EXIT_FAILURE); … … 190 190 } 191 191 192 object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16 );192 object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16, "0001-01-01T00:00:00Z"); 193 193 if (!object) { 194 194 exit(EXIT_FAILURE); -
trunk/ippdb/tests/metadatafromobject.c
r17833 r17872 13 13 bool status; 14 14 15 object = pzDataStoreRowAlloc("a string", "a string", "a string" );15 object = pzDataStoreRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z"); 16 16 if (!object) { 17 17 exit(EXIT_FAILURE); … … 37 37 exit(EXIT_FAILURE); 38 38 } 39 psFree(md); 40 exit(EXIT_FAILURE); 41 } 39 42 40 43 psFree(md); … … 46 49 bool status; 47 50 48 object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16 );51 object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16, "0001-01-01T00:00:00Z"); 49 52 if (!object) { 50 53 exit(EXIT_FAILURE); … … 88 91 exit(EXIT_FAILURE); 89 92 } 93 psFree(md); 94 exit(EXIT_FAILURE); 95 } 90 96 91 97 psFree(md); … … 97 103 bool status; 98 104 99 object = summitImfileRowAlloc("a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string" );105 object = summitImfileRowAlloc("a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z"); 100 106 if (!object) { 101 107 exit(EXIT_FAILURE); … … 145 151 exit(EXIT_FAILURE); 146 152 } 153 psFree(md); 154 exit(EXIT_FAILURE); 155 } 147 156 148 157 psFree(md); … … 154 163 bool status; 155 164 156 object = pzDownloadExpRowAlloc("a string", "a string", "a string", "a string" );165 object = pzDownloadExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z"); 157 166 if (!object) { 158 167 exit(EXIT_FAILURE); … … 182 191 exit(EXIT_FAILURE); 183 192 } 193 psFree(md); 194 exit(EXIT_FAILURE); 195 } 184 196 185 197 psFree(md); … … 191 203 bool status; 192 204 193 object = pzDownloadImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", -16 );205 object = pzDownloadImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", -16, "0001-01-01T00:00:00Z"); 194 206 if (!object) { 195 207 exit(EXIT_FAILURE); … … 230 242 exit(EXIT_FAILURE); 231 243 } 244 psFree(md); 245 exit(EXIT_FAILURE); 246 } 232 247 233 248 psFree(md); … … 239 254 bool status; 240 255 241 object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string" );256 object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z"); 242 257 if (!object) { 243 258 exit(EXIT_FAILURE); … … 298 313 exit(EXIT_FAILURE); 299 314 } 315 psFree(md); 316 exit(EXIT_FAILURE); 317 } 300 318 301 319 psFree(md); … … 307 325 bool status; 308 326 309 object = newImfileRowAlloc(-64, "a string", "a string" );327 object = newImfileRowAlloc(-64, "a string", "a string", "0001-01-01T00:00:00Z"); 310 328 if (!object) { 311 329 exit(EXIT_FAILURE); … … 330 348 exit(EXIT_FAILURE); 331 349 } 350 psFree(md); 351 exit(EXIT_FAILURE); 352 } 332 353 333 354 psFree(md); … … 339 360 bool status; 340 361 341 object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16 );362 object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16, "0001-01-01T00:00:00Z"); 342 363 if (!object) { 343 364 exit(EXIT_FAILURE); … … 576 597 exit(EXIT_FAILURE); 577 598 } 599 psFree(md); 600 exit(EXIT_FAILURE); 601 } 578 602 579 603 psFree(md); … … 585 609 bool status; 586 610 587 object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16 );611 object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16, "0001-01-01T00:00:00Z"); 588 612 if (!object) { 589 613 exit(EXIT_FAILURE); … … 800 824 } 801 825 if (strncmp(psMetadataLookupPtr(&status, md, "hostname"), "a string", MAX_STRING_LENGTH)) { 826 psFree(md); 827 exit(EXIT_FAILURE); 828 } 802 829 psFree(md); 803 830 exit(EXIT_FAILURE); -
trunk/ippdb/tests/objectfrommetadata.c
r17833 r17872 25 25 exit(EXIT_FAILURE); 26 26 } 27 psFree(md); 28 exit(EXIT_FAILURE); 29 } 27 30 28 31 object = pzDataStoreObjectFromMetadata(md); … … 43 46 } 44 47 if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) { 48 psFree(object); 49 exit(EXIT_FAILURE); 50 } 45 51 psFree(object); 46 52 exit(EXIT_FAILURE); … … 85 91 exit(EXIT_FAILURE); 86 92 } 93 psFree(md); 94 exit(EXIT_FAILURE); 95 } 87 96 88 97 object = summitExpObjectFromMetadata(md); … … 118 127 } 119 128 if (!object->imfiles == -32) { 129 psFree(object); 130 exit(EXIT_FAILURE); 131 } 120 132 psFree(object); 121 133 exit(EXIT_FAILURE); … … 169 181 exit(EXIT_FAILURE); 170 182 } 183 psFree(md); 184 exit(EXIT_FAILURE); 185 } 171 186 172 187 object = summitImfileObjectFromMetadata(md); … … 211 226 } 212 227 if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) { 228 psFree(object); 229 exit(EXIT_FAILURE); 230 } 213 231 psFree(object); 214 232 exit(EXIT_FAILURE); … … 239 257 exit(EXIT_FAILURE); 240 258 } 259 psFree(md); 260 exit(EXIT_FAILURE); 261 } 241 262 242 263 object = pzDownloadExpObjectFromMetadata(md); … … 261 282 } 262 283 if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) { 284 psFree(object); 285 exit(EXIT_FAILURE); 286 } 263 287 psFree(object); 264 288 exit(EXIT_FAILURE); … … 300 324 exit(EXIT_FAILURE); 301 325 } 326 psFree(md); 327 exit(EXIT_FAILURE); 328 } 302 329 303 330 object = pzDownloadImfileObjectFromMetadata(md); … … 330 357 } 331 358 if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) { 359 psFree(object); 360 exit(EXIT_FAILURE); 361 } 332 362 psFree(object); 333 363 exit(EXIT_FAILURE); … … 392 422 exit(EXIT_FAILURE); 393 423 } 424 psFree(md); 425 exit(EXIT_FAILURE); 426 } 394 427 395 428 object = newExpObjectFromMetadata(md); … … 445 478 } 446 479 if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) { 480 psFree(object); 481 exit(EXIT_FAILURE); 482 } 447 483 psFree(object); 448 484 exit(EXIT_FAILURE); … … 468 504 exit(EXIT_FAILURE); 469 505 } 506 psFree(md); 507 exit(EXIT_FAILURE); 508 } 470 509 471 510 object = newImfileObjectFromMetadata(md); … … 485 524 } 486 525 if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) { 526 psFree(object); 527 exit(EXIT_FAILURE); 528 } 487 529 psFree(object); 488 530 exit(EXIT_FAILURE); … … 722 764 exit(EXIT_FAILURE); 723 765 } 766 psFree(md); 767 exit(EXIT_FAILURE); 768 } 724 769 725 770 object = rawExpObjectFromMetadata(md); … … 950 995 } 951 996 if (strncmp(object->hostname, "a string", MAX_STRING_LENGTH)) { 997 psFree(object); 998 exit(EXIT_FAILURE); 999 } 952 1000 psFree(object); 953 1001 exit(EXIT_FAILURE); … … 1174 1222 exit(EXIT_FAILURE); 1175 1223 } 1224 psFree(md); 1225 exit(EXIT_FAILURE); 1226 } 1176 1227 1177 1228 object = rawImfileObjectFromMetadata(md); … … 1386 1437 } 1387 1438 if (strncmp(object->hostname, "a string", MAX_STRING_LENGTH)) { 1439 psFree(object); 1440 exit(EXIT_FAILURE); 1441 } 1388 1442 psFree(object); 1389 1443 exit(EXIT_FAILURE);
Note:
See TracChangeset
for help on using the changeset viewer.
