Changeset 14061 for trunk/ippdb/src/ippdb.h
- Timestamp:
- Jul 6, 2007, 4:55:04 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippdb/src/ippdb.h (modified) (100 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/src/ippdb.h
r13937 r14061 125 125 ); 126 126 127 /** expTagCounterRow data structure128 * 129 * Structure for representing a single row of expTagCountertable data.127 /** summitExpRow data structure 128 * 129 * Structure for representing a single row of summitExp table data. 130 130 */ 131 131 132 132 typedef struct { 133 psU64 counter; 134 } expTagCounterRow; 135 136 /** Creates a new expTagCounterRow object 137 * 138 * @return A new expTagCounterRow object or NULL on failure. 139 */ 140 141 expTagCounterRow *expTagCounterRowAlloc( 142 psU64 counter 143 ); 144 145 /** Creates a new expTagCounter table 146 * 147 * @return true on success 148 */ 149 150 bool expTagCounterCreateTable( 151 psDB *dbh ///< Database handle 152 ); 153 154 /** Deletes a expTagCounter table 155 * 156 * @return true on success 157 */ 158 159 bool expTagCounterDropTable( 160 psDB *dbh ///< Database handle 161 ); 162 163 /** Insert a single row into a table 164 * 165 * This function constructs and inserts a single row based on it's parameters. 166 * 167 * @return true on success 168 */ 169 170 bool expTagCounterInsert( 171 psDB *dbh, ///< Database handle 172 psU64 counter 173 ); 174 175 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 176 * 177 * @return A The number of rows removed or a negative value on error 178 */ 179 180 long long expTagCounterDelete( 181 psDB *dbh, ///< Database handle 182 const psMetadata *where, ///< Row match criteria 183 unsigned long long limit ///< Maximum number of elements to delete 184 ); 185 186 /** Insert a single expTagCounterRow object into a table 187 * 188 * This function constructs and inserts a single row based on it's parameters. 189 * 190 * @return true on success 191 */ 192 193 bool expTagCounterInsertObject( 194 psDB *dbh, ///< Database handle 195 expTagCounterRow *object ///< expTagCounterRow object 196 ); 197 198 /** Insert an array of expTagCounterRow object into a table 199 * 200 * This function constructs and inserts multiple rows based on it's parameters. 201 * 202 * @return true on success 203 */ 204 205 bool expTagCounterInsertObjects( 206 psDB *dbh, ///< Database handle 207 psArray *objects ///< array of expTagCounterRow objects 208 ); 209 210 /** Insert data from a binary FITS table expTagCounterRow into the database 211 * 212 * This function expects a psFits object with a FITS table as the first 213 * extension. The table must have at least one row of data in it, that is of 214 * the appropriate format (number of columns and their type). All other 215 * extensions are ignored. 216 * 217 * @return true on success 218 */ 219 220 bool expTagCounterInsertFits( 221 psDB *dbh, ///< Database handle 222 const psFits *fits ///< psFits object 223 ); 224 225 /** Selects up to limit from the database and returns them in a binary FITS table 226 * 227 * This function assumes an empty psFits object and will create a FITS table 228 * as the first extension. 229 * 230 * See psDBSelectRows() for documentation on the format of where. 231 * 232 * @return true on success 233 */ 234 235 bool expTagCounterSelectRowsFits( 236 psDB *dbh, ///< Database handle 237 psFits *fits, ///< psFits object 238 const psMetadata *where, ///< Row match criteria 239 unsigned long long limit ///< Maximum number of elements to return 240 ); 241 242 /** Convert a expTagCounterRow into an equivalent psMetadata 243 * 244 * @return A psMetadata pointer or NULL on error 245 */ 246 247 psMetadata *expTagCounterMetadataFromObject( 248 const expTagCounterRow *object ///< fooRow to convert into a psMetadata 249 ); 250 251 /** Convert a psMetadata into an equivalent fooRow 252 * 253 * @return A expTagCounterRow pointer or NULL on error 254 */ 255 256 expTagCounterRow *expTagCounterObjectFromMetadata( 257 psMetadata *md ///< psMetadata to convert into a fooRow 258 ); 259 /** Selects up to limit rows from the database and returns as expTagCounterRow objects in a psArray 260 * 261 * See psDBSelectRows() for documentation on the format of where. 262 * 263 * @return A psArray pointer or NULL on error 264 */ 265 266 psArray *expTagCounterSelectRowObjects( 267 psDB *dbh, ///< Database handle 268 const psMetadata *where, ///< Row match criteria 269 unsigned long long limit ///< Maximum number of elements to return 270 ); 271 /** Deletes a row from the database coresponding to an expTagCounter 272 * 273 * Note that a 'where' search psMetadata is constructed from each object and 274 * used to find rows to delete. 275 * 276 * @return A The number of rows removed or a negative value on error 277 */ 278 279 bool expTagCounterDeleteObject( 280 psDB *dbh, ///< Database handle 281 const expTagCounterRow *object ///< Object to delete 282 ); 283 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 284 * 285 * Note that a 'where' search psMetadata is constructed from each object and 286 * used to find rows to delete. 287 * 288 * @return A The number of rows removed or a negative value on error 289 */ 290 291 long long expTagCounterDeleteRowObjects( 292 psDB *dbh, ///< Database handle 293 const psArray *objects, ///< Array of objects to delete 294 unsigned long long limit ///< Maximum number of elements to delete 295 ); 296 /** Formats and prints an array of expTagCounterRow objects 297 * 298 * When mdcf is set the formated output is in psMetadataConfig 299 * format, otherwise it is in a simple tabular format. 300 * 301 * @return true on success 302 */ 303 304 bool expTagCounterPrintObjects( 305 FILE *stream, ///< a stream 306 psArray *objects, ///< An array of expTagCounterRow objects 307 bool mdcf ///< format as mdconfig or simple 308 ); 309 /** Formats and prints an expTagCounterRow object 310 * 311 * When mdcf is set the formated output is in psMetadataConfig 312 * format, otherwise it is in a simple tabular format. 313 * 314 * @return true on success 315 */ 316 317 bool expTagCounterPrintObject( 318 FILE *stream, ///< a stream 319 expTagCounterRow *object, ///< an expTagCounterRow object 320 bool mdcf ///< format as mdconfig or simple 321 ); 322 /** summitExpRow data structure 323 * 324 * Structure for representing a single row of summitExp table data. 325 */ 326 327 typedef struct { 328 char *exp_id; 133 char *exp_name; 329 134 char *camera; 330 135 char *telescope; … … 341 146 342 147 summitExpRow *summitExpRowAlloc( 343 const char *exp_ id,148 const char *exp_name, 344 149 const char *camera, 345 150 const char *telescope, … … 377 182 bool summitExpInsert( 378 183 psDB *dbh, ///< Database handle 379 const char *exp_ id,184 const char *exp_name, 380 185 const char *camera, 381 186 const char *telescope, … … 539 344 540 345 typedef struct { 541 char *exp_ id;346 char *exp_name; 542 347 char *camera; 543 348 char *telescope; … … 556 361 557 362 summitImfileRow *summitImfileRowAlloc( 558 const char *exp_ id,363 const char *exp_name, 559 364 const char *camera, 560 365 const char *telescope, … … 594 399 bool summitImfileInsert( 595 400 psDB *dbh, ///< Database handle 596 const char *exp_ id,401 const char *exp_name, 597 402 const char *camera, 598 403 const char *telescope, … … 758 563 759 564 typedef struct { 760 char *exp_ id;565 char *exp_name; 761 566 char *camera; 762 567 char *telescope; … … 769 574 770 575 pzPendingExpRow *pzPendingExpRowAlloc( 771 const char *exp_ id,576 const char *exp_name, 772 577 const char *camera, 773 578 const char *telescope … … 801 606 bool pzPendingExpInsert( 802 607 psDB *dbh, ///< Database handle 803 const char *exp_ id,608 const char *exp_name, 804 609 const char *camera, 805 610 const char *telescope … … 959 764 960 765 typedef struct { 961 char *exp_ id;766 char *exp_name; 962 767 char *camera; 963 768 char *telescope; 964 769 char *class; 965 770 char *class_id; 966 char *exp_tag;771 psS64 exp_id; 967 772 } pzPendingImfileRow; 968 773 … … 973 778 974 779 pzPendingImfileRow *pzPendingImfileRowAlloc( 975 const char *exp_ id,780 const char *exp_name, 976 781 const char *camera, 977 782 const char *telescope, 978 783 const char *class, 979 784 const char *class_id, 980 const char *exp_tag785 psS64 exp_id 981 786 ); 982 787 … … 1008 813 bool pzPendingImfileInsert( 1009 814 psDB *dbh, ///< Database handle 1010 const char *exp_ id,815 const char *exp_name, 1011 816 const char *camera, 1012 817 const char *telescope, 1013 818 const char *class, 1014 819 const char *class_id, 1015 const char *exp_tag820 psS64 exp_id 1016 821 ); 1017 822 … … 1169 974 1170 975 typedef struct { 1171 char *exp_ id;976 char *exp_name; 1172 977 char *camera; 1173 978 char *telescope; … … 1180 985 1181 986 pzDoneExpRow *pzDoneExpRowAlloc( 1182 const char *exp_ id,987 const char *exp_name, 1183 988 const char *camera, 1184 989 const char *telescope … … 1212 1017 bool pzDoneExpInsert( 1213 1018 psDB *dbh, ///< Database handle 1214 const char *exp_ id,1019 const char *exp_name, 1215 1020 const char *camera, 1216 1021 const char *telescope … … 1370 1175 1371 1176 typedef struct { 1372 char *exp_ id;1177 char *exp_name; 1373 1178 char *camera; 1374 1179 char *telescope; 1375 1180 char *class; 1376 1181 char *class_id; 1377 char *exp_tag;1182 psS64 exp_id; 1378 1183 char *uri; 1379 1184 } pzDoneImfileRow; … … 1385 1190 1386 1191 pzDoneImfileRow *pzDoneImfileRowAlloc( 1387 const char *exp_ id,1192 const char *exp_name, 1388 1193 const char *camera, 1389 1194 const char *telescope, 1390 1195 const char *class, 1391 1196 const char *class_id, 1392 const char *exp_tag,1197 psS64 exp_id, 1393 1198 const char *uri 1394 1199 ); … … 1421 1226 bool pzDoneImfileInsert( 1422 1227 psDB *dbh, ///< Database handle 1423 const char *exp_ id,1228 const char *exp_name, 1424 1229 const char *camera, 1425 1230 const char *telescope, 1426 1231 const char *class, 1427 1232 const char *class_id, 1428 const char *exp_tag,1233 psS64 exp_id, 1429 1234 const char *uri 1430 1235 ); … … 1583 1388 1584 1389 typedef struct { 1585 char *exp_tag;1586 char * exp_id;1587 char * camera;1588 char *t elescope;1589 psS32 imfiles;1390 psS64 exp_id; 1391 char *tmp_exp_name; 1392 char *tmp_camera; 1393 char *tmp_telescope; 1394 char *state; 1590 1395 char *workdir; 1396 char *workdir_state; 1591 1397 } newExpRow; 1592 1398 … … 1597 1403 1598 1404 newExpRow *newExpRowAlloc( 1599 const char *exp_tag, 1600 const char *exp_id, 1601 const char *camera, 1602 const char *telescope, 1603 psS32 imfiles, 1604 const char *workdir 1405 psS64 exp_id, 1406 const char *tmp_exp_name, 1407 const char *tmp_camera, 1408 const char *tmp_telescope, 1409 const char *state, 1410 const char *workdir, 1411 const char *workdir_state 1605 1412 ); 1606 1413 … … 1632 1439 bool newExpInsert( 1633 1440 psDB *dbh, ///< Database handle 1634 const char *exp_tag, 1635 const char *exp_id, 1636 const char *camera, 1637 const char *telescope, 1638 psS32 imfiles, 1639 const char *workdir 1441 psS64 exp_id, 1442 const char *tmp_exp_name, 1443 const char *tmp_camera, 1444 const char *tmp_telescope, 1445 const char *state, 1446 const char *workdir, 1447 const char *workdir_state 1640 1448 ); 1641 1449 … … 1793 1601 1794 1602 typedef struct { 1795 char *exp_tag; 1796 char *class; 1797 char *class_id; 1603 psS64 exp_id; 1604 char *tmp_class_id; 1798 1605 char *uri; 1799 1606 } newImfileRow; … … 1805 1612 1806 1613 newImfileRow *newImfileRowAlloc( 1807 const char *exp_tag, 1808 const char *class, 1809 const char *class_id, 1614 psS64 exp_id, 1615 const char *tmp_class_id, 1810 1616 const char *uri 1811 1617 ); … … 1838 1644 bool newImfileInsert( 1839 1645 psDB *dbh, ///< Database handle 1840 const char *exp_tag, 1841 const char *class, 1842 const char *class_id, 1646 psS64 exp_id, 1647 const char *tmp_class_id, 1843 1648 const char *uri 1844 1649 ); … … 1997 1802 1998 1803 typedef struct { 1999 char *exp_tag;2000 char *exp_ id;1804 psS64 exp_id; 1805 char *exp_name; 2001 1806 char *camera; 2002 1807 char *telescope; 2003 1808 psTime* dateobs; 1809 char *exp_tag; 2004 1810 char *exp_type; 2005 psS32 imfiles;2006 1811 char *filelevel; 2007 1812 char *workdir; … … 2035 1840 2036 1841 rawExpRow *rawExpRowAlloc( 2037 const char *exp_tag,2038 const char *exp_ id,1842 psS64 exp_id, 1843 const char *exp_name, 2039 1844 const char *camera, 2040 1845 const char *telescope, 2041 1846 psTime* dateobs, 1847 const char *exp_tag, 2042 1848 const char *exp_type, 2043 psS32 imfiles,2044 1849 const char *filelevel, 2045 1850 const char *workdir, … … 2094 1899 bool rawExpInsert( 2095 1900 psDB *dbh, ///< Database handle 2096 const char *exp_tag,2097 const char *exp_ id,1901 psS64 exp_id, 1902 const char *exp_name, 2098 1903 const char *camera, 2099 1904 const char *telescope, 2100 1905 psTime* dateobs, 1906 const char *exp_tag, 2101 1907 const char *exp_type, 2102 psS32 imfiles,2103 1908 const char *filelevel, 2104 1909 const char *workdir, … … 2279 2084 2280 2085 typedef struct { 2281 char *exp_tag; 2086 psS64 exp_id; 2087 char *exp_name; 2088 char *camera; 2089 char *telescope; 2090 psTime* dateobs; 2091 char *tmp_class_id; 2282 2092 char *class_id; 2283 2093 char *uri; … … 2303 2113 psF64 user_5; 2304 2114 char *object; 2305 psTime* dateobs;2306 2115 psS16 fault; 2307 2116 } rawImfileRow; … … 2313 2122 2314 2123 rawImfileRow *rawImfileRowAlloc( 2315 const char *exp_tag, 2124 psS64 exp_id, 2125 const char *exp_name, 2126 const char *camera, 2127 const char *telescope, 2128 psTime* dateobs, 2129 const char *tmp_class_id, 2316 2130 const char *class_id, 2317 2131 const char *uri, … … 2337 2151 psF64 user_5, 2338 2152 const char *object, 2339 psTime* dateobs,2340 2153 psS16 fault 2341 2154 ); … … 2368 2181 bool rawImfileInsert( 2369 2182 psDB *dbh, ///< Database handle 2370 const char *exp_tag, 2183 psS64 exp_id, 2184 const char *exp_name, 2185 const char *camera, 2186 const char *telescope, 2187 psTime* dateobs, 2188 const char *tmp_class_id, 2371 2189 const char *class_id, 2372 2190 const char *uri, … … 2392 2210 psF64 user_5, 2393 2211 const char *object, 2394 psTime* dateobs,2395 2212 psS16 fault 2396 2213 ); … … 2550 2367 typedef struct { 2551 2368 psS64 guide_id; 2552 char *exp_tag;2369 psS64 exp_id; 2553 2370 char *recipe; 2554 2371 } guidePendingExpRow; … … 2561 2378 guidePendingExpRow *guidePendingExpRowAlloc( 2562 2379 psS64 guide_id, 2563 const char *exp_tag,2380 psS64 exp_id, 2564 2381 const char *recipe 2565 2382 ); … … 2593 2410 psDB *dbh, ///< Database handle 2594 2411 psS64 guide_id, 2595 const char *exp_tag,2412 psS64 exp_id, 2596 2413 const char *recipe 2597 2414 ); … … 2744 2561 bool mdcf ///< format as mdconfig or simple 2745 2562 ); 2746 /** chip PendingExpRow data structure2747 * 2748 * Structure for representing a single row of chip PendingExptable data.2563 /** chipRunRow data structure 2564 * 2565 * Structure for representing a single row of chipRun table data. 2749 2566 */ 2750 2567 2751 2568 typedef struct { 2752 2569 psS64 chip_id; 2753 char *exp_tag; 2754 psS64 guide_id; 2570 char *state; 2755 2571 char *workdir; 2572 char *workdir_state; 2756 2573 char *label; 2757 2574 char *reduction; 2758 2575 char *expgroup; 2759 2576 char *dvodb; 2760 } chip PendingExpRow;2761 2762 /** Creates a new chip PendingExpRow object2763 * 2764 * @return A new chip PendingExpRow object or NULL on failure.2765 */ 2766 2767 chip PendingExpRow *chipPendingExpRowAlloc(2577 } chipRunRow; 2578 2579 /** Creates a new chipRunRow object 2580 * 2581 * @return A new chipRunRow object or NULL on failure. 2582 */ 2583 2584 chipRunRow *chipRunRowAlloc( 2768 2585 psS64 chip_id, 2769 const char *exp_tag, 2770 psS64 guide_id, 2586 const char *state, 2771 2587 const char *workdir, 2588 const char *workdir_state, 2772 2589 const char *label, 2773 2590 const char *reduction, … … 2776 2593 ); 2777 2594 2778 /** Creates a new chip PendingExptable2779 * 2780 * @return true on success 2781 */ 2782 2783 bool chip PendingExpCreateTable(2595 /** Creates a new chipRun table 2596 * 2597 * @return true on success 2598 */ 2599 2600 bool chipRunCreateTable( 2784 2601 psDB *dbh ///< Database handle 2785 2602 ); 2786 2603 2787 /** Deletes a chip PendingExptable2788 * 2789 * @return true on success 2790 */ 2791 2792 bool chip PendingExpDropTable(2604 /** Deletes a chipRun table 2605 * 2606 * @return true on success 2607 */ 2608 2609 bool chipRunDropTable( 2793 2610 psDB *dbh ///< Database handle 2794 2611 ); … … 2801 2618 */ 2802 2619 2803 bool chip PendingExpInsert(2620 bool chipRunInsert( 2804 2621 psDB *dbh, ///< Database handle 2805 2622 psS64 chip_id, 2806 const char *exp_tag, 2807 psS64 guide_id, 2623 const char *state, 2808 2624 const char *workdir, 2625 const char *workdir_state, 2809 2626 const char *label, 2810 2627 const char *reduction, … … 2818 2635 */ 2819 2636 2820 long long chip PendingExpDelete(2637 long long chipRunDelete( 2821 2638 psDB *dbh, ///< Database handle 2822 2639 const psMetadata *where, ///< Row match criteria … … 2824 2641 ); 2825 2642 2826 /** Insert a single chip PendingExpRow object into a table2643 /** Insert a single chipRunRow object into a table 2827 2644 * 2828 2645 * This function constructs and inserts a single row based on it's parameters. … … 2831 2648 */ 2832 2649 2833 bool chip PendingExpInsertObject(2834 psDB *dbh, ///< Database handle 2835 chip PendingExpRow *object ///< chipPendingExpRow object2836 ); 2837 2838 /** Insert an array of chip PendingExpRow object into a table2650 bool chipRunInsertObject( 2651 psDB *dbh, ///< Database handle 2652 chipRunRow *object ///< chipRunRow object 2653 ); 2654 2655 /** Insert an array of chipRunRow object into a table 2839 2656 * 2840 2657 * This function constructs and inserts multiple rows based on it's parameters. … … 2843 2660 */ 2844 2661 2845 bool chip PendingExpInsertObjects(2846 psDB *dbh, ///< Database handle 2847 psArray *objects ///< array of chip PendingExpRow objects2848 ); 2849 2850 /** Insert data from a binary FITS table chip PendingExpRow into the database2662 bool chipRunInsertObjects( 2663 psDB *dbh, ///< Database handle 2664 psArray *objects ///< array of chipRunRow objects 2665 ); 2666 2667 /** Insert data from a binary FITS table chipRunRow into the database 2851 2668 * 2852 2669 * This function expects a psFits object with a FITS table as the first … … 2858 2675 */ 2859 2676 2860 bool chip PendingExpInsertFits(2677 bool chipRunInsertFits( 2861 2678 psDB *dbh, ///< Database handle 2862 2679 const psFits *fits ///< psFits object … … 2873 2690 */ 2874 2691 2875 bool chip PendingExpSelectRowsFits(2692 bool chipRunSelectRowsFits( 2876 2693 psDB *dbh, ///< Database handle 2877 2694 psFits *fits, ///< psFits object … … 2880 2697 ); 2881 2698 2882 /** Convert a chip PendingExpRow into an equivalent psMetadata2699 /** Convert a chipRunRow into an equivalent psMetadata 2883 2700 * 2884 2701 * @return A psMetadata pointer or NULL on error 2885 2702 */ 2886 2703 2887 psMetadata *chip PendingExpMetadataFromObject(2888 const chip PendingExpRow *object ///< fooRow to convert into a psMetadata2704 psMetadata *chipRunMetadataFromObject( 2705 const chipRunRow *object ///< fooRow to convert into a psMetadata 2889 2706 ); 2890 2707 2891 2708 /** Convert a psMetadata into an equivalent fooRow 2892 2709 * 2893 * @return A chip PendingExpRow pointer or NULL on error2894 */ 2895 2896 chip PendingExpRow *chipPendingExpObjectFromMetadata(2710 * @return A chipRunRow pointer or NULL on error 2711 */ 2712 2713 chipRunRow *chipRunObjectFromMetadata( 2897 2714 psMetadata *md ///< psMetadata to convert into a fooRow 2898 2715 ); 2899 /** Selects up to limit rows from the database and returns as chip PendingExpRow objects in a psArray2716 /** Selects up to limit rows from the database and returns as chipRunRow objects in a psArray 2900 2717 * 2901 2718 * See psDBSelectRows() for documentation on the format of where. … … 2904 2721 */ 2905 2722 2906 psArray *chip PendingExpSelectRowObjects(2723 psArray *chipRunSelectRowObjects( 2907 2724 psDB *dbh, ///< Database handle 2908 2725 const psMetadata *where, ///< Row match criteria 2909 2726 unsigned long long limit ///< Maximum number of elements to return 2910 2727 ); 2911 /** Deletes a row from the database coresponding to an chip PendingExp2728 /** Deletes a row from the database coresponding to an chipRun 2912 2729 * 2913 2730 * Note that a 'where' search psMetadata is constructed from each object and … … 2917 2734 */ 2918 2735 2919 bool chip PendingExpDeleteObject(2920 psDB *dbh, ///< Database handle 2921 const chip PendingExpRow *object ///< Object to delete2736 bool chipRunDeleteObject( 2737 psDB *dbh, ///< Database handle 2738 const chipRunRow *object ///< Object to delete 2922 2739 ); 2923 2740 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 2929 2746 */ 2930 2747 2931 long long chip PendingExpDeleteRowObjects(2748 long long chipRunDeleteRowObjects( 2932 2749 psDB *dbh, ///< Database handle 2933 2750 const psArray *objects, ///< Array of objects to delete 2934 2751 unsigned long long limit ///< Maximum number of elements to delete 2935 2752 ); 2936 /** Formats and prints an array of chip PendingExpRow objects2753 /** Formats and prints an array of chipRunRow objects 2937 2754 * 2938 2755 * When mdcf is set the formated output is in psMetadataConfig … … 2942 2759 */ 2943 2760 2944 bool chip PendingExpPrintObjects(2761 bool chipRunPrintObjects( 2945 2762 FILE *stream, ///< a stream 2946 psArray *objects, ///< An array of chip PendingExpRow objects2763 psArray *objects, ///< An array of chipRunRow objects 2947 2764 bool mdcf ///< format as mdconfig or simple 2948 2765 ); 2949 /** Formats and prints an chip PendingExpRow object2766 /** Formats and prints an chipRunRow object 2950 2767 * 2951 2768 * When mdcf is set the formated output is in psMetadataConfig … … 2955 2772 */ 2956 2773 2957 bool chip PendingExpPrintObject(2774 bool chipRunPrintObject( 2958 2775 FILE *stream, ///< a stream 2959 chip PendingExpRow *object, ///< an chipPendingExpRow object2776 chipRunRow *object, ///< an chipRunRow object 2960 2777 bool mdcf ///< format as mdconfig or simple 2961 2778 ); 2962 /** chip PendingImfileRow data structure2963 * 2964 * Structure for representing a single row of chip PendingImfile table data.2779 /** chipInputImfileRow data structure 2780 * 2781 * Structure for representing a single row of chipInputImfile table data. 2965 2782 */ 2966 2783 2967 2784 typedef struct { 2968 2785 psS64 chip_id; 2786 psS64 exp_id; 2969 2787 char *class_id; 2970 char *uri; 2971 } chipPendingImfileRow; 2972 2973 /** Creates a new chipPendingImfileRow object 2974 * 2975 * @return A new chipPendingImfileRow object or NULL on failure. 2976 */ 2977 2978 chipPendingImfileRow *chipPendingImfileRowAlloc( 2788 } chipInputImfileRow; 2789 2790 /** Creates a new chipInputImfileRow object 2791 * 2792 * @return A new chipInputImfileRow object or NULL on failure. 2793 */ 2794 2795 chipInputImfileRow *chipInputImfileRowAlloc( 2979 2796 psS64 chip_id, 2980 const char *class_id,2981 const char * uri2982 ); 2983 2984 /** Creates a new chip PendingImfile table2985 * 2986 * @return true on success 2987 */ 2988 2989 bool chip PendingImfileCreateTable(2797 psS64 exp_id, 2798 const char *class_id 2799 ); 2800 2801 /** Creates a new chipInputImfile table 2802 * 2803 * @return true on success 2804 */ 2805 2806 bool chipInputImfileCreateTable( 2990 2807 psDB *dbh ///< Database handle 2991 2808 ); 2992 2809 2993 /** Deletes a chip PendingImfile table2994 * 2995 * @return true on success 2996 */ 2997 2998 bool chip PendingImfileDropTable(2810 /** Deletes a chipInputImfile table 2811 * 2812 * @return true on success 2813 */ 2814 2815 bool chipInputImfileDropTable( 2999 2816 psDB *dbh ///< Database handle 3000 2817 ); … … 3007 2824 */ 3008 2825 3009 bool chip PendingImfileInsert(2826 bool chipInputImfileInsert( 3010 2827 psDB *dbh, ///< Database handle 3011 2828 psS64 chip_id, 3012 const char *class_id,3013 const char * uri2829 psS64 exp_id, 2830 const char *class_id 3014 2831 ); 3015 2832 … … 3019 2836 */ 3020 2837 3021 long long chip PendingImfileDelete(2838 long long chipInputImfileDelete( 3022 2839 psDB *dbh, ///< Database handle 3023 2840 const psMetadata *where, ///< Row match criteria … … 3025 2842 ); 3026 2843 3027 /** Insert a single chip PendingImfileRow object into a table2844 /** Insert a single chipInputImfileRow object into a table 3028 2845 * 3029 2846 * This function constructs and inserts a single row based on it's parameters. … … 3032 2849 */ 3033 2850 3034 bool chip PendingImfileInsertObject(3035 psDB *dbh, ///< Database handle 3036 chip PendingImfileRow *object ///< chipPendingImfileRow object3037 ); 3038 3039 /** Insert an array of chip PendingImfileRow object into a table2851 bool chipInputImfileInsertObject( 2852 psDB *dbh, ///< Database handle 2853 chipInputImfileRow *object ///< chipInputImfileRow object 2854 ); 2855 2856 /** Insert an array of chipInputImfileRow object into a table 3040 2857 * 3041 2858 * This function constructs and inserts multiple rows based on it's parameters. … … 3044 2861 */ 3045 2862 3046 bool chip PendingImfileInsertObjects(3047 psDB *dbh, ///< Database handle 3048 psArray *objects ///< array of chip PendingImfileRow objects3049 ); 3050 3051 /** Insert data from a binary FITS table chip PendingImfileRow into the database2863 bool chipInputImfileInsertObjects( 2864 psDB *dbh, ///< Database handle 2865 psArray *objects ///< array of chipInputImfileRow objects 2866 ); 2867 2868 /** Insert data from a binary FITS table chipInputImfileRow into the database 3052 2869 * 3053 2870 * This function expects a psFits object with a FITS table as the first … … 3059 2876 */ 3060 2877 3061 bool chip PendingImfileInsertFits(2878 bool chipInputImfileInsertFits( 3062 2879 psDB *dbh, ///< Database handle 3063 2880 const psFits *fits ///< psFits object … … 3074 2891 */ 3075 2892 3076 bool chip PendingImfileSelectRowsFits(2893 bool chipInputImfileSelectRowsFits( 3077 2894 psDB *dbh, ///< Database handle 3078 2895 psFits *fits, ///< psFits object … … 3081 2898 ); 3082 2899 3083 /** Convert a chip PendingImfileRow into an equivalent psMetadata2900 /** Convert a chipInputImfileRow into an equivalent psMetadata 3084 2901 * 3085 2902 * @return A psMetadata pointer or NULL on error 3086 2903 */ 3087 2904 3088 psMetadata *chip PendingImfileMetadataFromObject(3089 const chip PendingImfileRow *object ///< fooRow to convert into a psMetadata2905 psMetadata *chipInputImfileMetadataFromObject( 2906 const chipInputImfileRow *object ///< fooRow to convert into a psMetadata 3090 2907 ); 3091 2908 3092 2909 /** Convert a psMetadata into an equivalent fooRow 3093 2910 * 3094 * @return A chip PendingImfileRow pointer or NULL on error3095 */ 3096 3097 chip PendingImfileRow *chipPendingImfileObjectFromMetadata(2911 * @return A chipInputImfileRow pointer or NULL on error 2912 */ 2913 2914 chipInputImfileRow *chipInputImfileObjectFromMetadata( 3098 2915 psMetadata *md ///< psMetadata to convert into a fooRow 3099 2916 ); 3100 /** Selects up to limit rows from the database and returns as chip PendingImfileRow objects in a psArray2917 /** Selects up to limit rows from the database and returns as chipInputImfileRow objects in a psArray 3101 2918 * 3102 2919 * See psDBSelectRows() for documentation on the format of where. … … 3105 2922 */ 3106 2923 3107 psArray *chip PendingImfileSelectRowObjects(2924 psArray *chipInputImfileSelectRowObjects( 3108 2925 psDB *dbh, ///< Database handle 3109 2926 const psMetadata *where, ///< Row match criteria 3110 2927 unsigned long long limit ///< Maximum number of elements to return 3111 2928 ); 3112 /** Deletes a row from the database coresponding to an chip PendingImfile2929 /** Deletes a row from the database coresponding to an chipInputImfile 3113 2930 * 3114 2931 * Note that a 'where' search psMetadata is constructed from each object and … … 3118 2935 */ 3119 2936 3120 bool chip PendingImfileDeleteObject(3121 psDB *dbh, ///< Database handle 3122 const chip PendingImfileRow *object ///< Object to delete2937 bool chipInputImfileDeleteObject( 2938 psDB *dbh, ///< Database handle 2939 const chipInputImfileRow *object ///< Object to delete 3123 2940 ); 3124 2941 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 3130 2947 */ 3131 2948 3132 long long chip PendingImfileDeleteRowObjects(2949 long long chipInputImfileDeleteRowObjects( 3133 2950 psDB *dbh, ///< Database handle 3134 2951 const psArray *objects, ///< Array of objects to delete 3135 2952 unsigned long long limit ///< Maximum number of elements to delete 3136 2953 ); 3137 /** Formats and prints an array of chip PendingImfileRow objects2954 /** Formats and prints an array of chipInputImfileRow objects 3138 2955 * 3139 2956 * When mdcf is set the formated output is in psMetadataConfig … … 3143 2960 */ 3144 2961 3145 bool chip PendingImfilePrintObjects(2962 bool chipInputImfilePrintObjects( 3146 2963 FILE *stream, ///< a stream 3147 psArray *objects, ///< An array of chip PendingImfileRow objects2964 psArray *objects, ///< An array of chipInputImfileRow objects 3148 2965 bool mdcf ///< format as mdconfig or simple 3149 2966 ); 3150 /** Formats and prints an chip PendingImfileRow object2967 /** Formats and prints an chipInputImfileRow object 3151 2968 * 3152 2969 * When mdcf is set the formated output is in psMetadataConfig … … 3156 2973 */ 3157 2974 3158 bool chip PendingImfilePrintObject(2975 bool chipInputImfilePrintObject( 3159 2976 FILE *stream, ///< a stream 3160 chip PendingImfileRow *object, ///< an chipPendingImfileRow object2977 chipInputImfileRow *object, ///< an chipInputImfileRow object 3161 2978 bool mdcf ///< format as mdconfig or simple 3162 2979 ); 3163 /** chipProcessed ExpRow data structure3164 * 3165 * Structure for representing a single row of chipProcessed Exptable data.2980 /** chipProcessedImfileRow data structure 2981 * 2982 * Structure for representing a single row of chipProcessedImfile table data. 3166 2983 */ 3167 2984 3168 2985 typedef struct { 3169 2986 psS64 chip_id; 3170 char *exp_tag; 3171 psS64 guide_id; 3172 char *workdir; 3173 char *label; 3174 char *reduction; 3175 char *expgroup; 3176 char *dvodb; 3177 } chipProcessedExpRow; 3178 3179 /** Creates a new chipProcessedExpRow object 3180 * 3181 * @return A new chipProcessedExpRow object or NULL on failure. 3182 */ 3183 3184 chipProcessedExpRow *chipProcessedExpRowAlloc( 3185 psS64 chip_id, 3186 const char *exp_tag, 3187 psS64 guide_id, 3188 const char *workdir, 3189 const char *label, 3190 const char *reduction, 3191 const char *expgroup, 3192 const char *dvodb 3193 ); 3194 3195 /** Creates a new chipProcessedExp table 3196 * 3197 * @return true on success 3198 */ 3199 3200 bool chipProcessedExpCreateTable( 3201 psDB *dbh ///< Database handle 3202 ); 3203 3204 /** Deletes a chipProcessedExp table 3205 * 3206 * @return true on success 3207 */ 3208 3209 bool chipProcessedExpDropTable( 3210 psDB *dbh ///< Database handle 3211 ); 3212 3213 /** Insert a single row into a table 3214 * 3215 * This function constructs and inserts a single row based on it's parameters. 3216 * 3217 * @return true on success 3218 */ 3219 3220 bool chipProcessedExpInsert( 3221 psDB *dbh, ///< Database handle 3222 psS64 chip_id, 3223 const char *exp_tag, 3224 psS64 guide_id, 3225 const char *workdir, 3226 const char *label, 3227 const char *reduction, 3228 const char *expgroup, 3229 const char *dvodb 3230 ); 3231 3232 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 3233 * 3234 * @return A The number of rows removed or a negative value on error 3235 */ 3236 3237 long long chipProcessedExpDelete( 3238 psDB *dbh, ///< Database handle 3239 const psMetadata *where, ///< Row match criteria 3240 unsigned long long limit ///< Maximum number of elements to delete 3241 ); 3242 3243 /** Insert a single chipProcessedExpRow object into a table 3244 * 3245 * This function constructs and inserts a single row based on it's parameters. 3246 * 3247 * @return true on success 3248 */ 3249 3250 bool chipProcessedExpInsertObject( 3251 psDB *dbh, ///< Database handle 3252 chipProcessedExpRow *object ///< chipProcessedExpRow object 3253 ); 3254 3255 /** Insert an array of chipProcessedExpRow object into a table 3256 * 3257 * This function constructs and inserts multiple rows based on it's parameters. 3258 * 3259 * @return true on success 3260 */ 3261 3262 bool chipProcessedExpInsertObjects( 3263 psDB *dbh, ///< Database handle 3264 psArray *objects ///< array of chipProcessedExpRow objects 3265 ); 3266 3267 /** Insert data from a binary FITS table chipProcessedExpRow into the database 3268 * 3269 * This function expects a psFits object with a FITS table as the first 3270 * extension. The table must have at least one row of data in it, that is of 3271 * the appropriate format (number of columns and their type). All other 3272 * extensions are ignored. 3273 * 3274 * @return true on success 3275 */ 3276 3277 bool chipProcessedExpInsertFits( 3278 psDB *dbh, ///< Database handle 3279 const psFits *fits ///< psFits object 3280 ); 3281 3282 /** Selects up to limit from the database and returns them in a binary FITS table 3283 * 3284 * This function assumes an empty psFits object and will create a FITS table 3285 * as the first extension. 3286 * 3287 * See psDBSelectRows() for documentation on the format of where. 3288 * 3289 * @return true on success 3290 */ 3291 3292 bool chipProcessedExpSelectRowsFits( 3293 psDB *dbh, ///< Database handle 3294 psFits *fits, ///< psFits object 3295 const psMetadata *where, ///< Row match criteria 3296 unsigned long long limit ///< Maximum number of elements to return 3297 ); 3298 3299 /** Convert a chipProcessedExpRow into an equivalent psMetadata 3300 * 3301 * @return A psMetadata pointer or NULL on error 3302 */ 3303 3304 psMetadata *chipProcessedExpMetadataFromObject( 3305 const chipProcessedExpRow *object ///< fooRow to convert into a psMetadata 3306 ); 3307 3308 /** Convert a psMetadata into an equivalent fooRow 3309 * 3310 * @return A chipProcessedExpRow pointer or NULL on error 3311 */ 3312 3313 chipProcessedExpRow *chipProcessedExpObjectFromMetadata( 3314 psMetadata *md ///< psMetadata to convert into a fooRow 3315 ); 3316 /** Selects up to limit rows from the database and returns as chipProcessedExpRow objects in a psArray 3317 * 3318 * See psDBSelectRows() for documentation on the format of where. 3319 * 3320 * @return A psArray pointer or NULL on error 3321 */ 3322 3323 psArray *chipProcessedExpSelectRowObjects( 3324 psDB *dbh, ///< Database handle 3325 const psMetadata *where, ///< Row match criteria 3326 unsigned long long limit ///< Maximum number of elements to return 3327 ); 3328 /** Deletes a row from the database coresponding to an chipProcessedExp 3329 * 3330 * Note that a 'where' search psMetadata is constructed from each object and 3331 * used to find rows to delete. 3332 * 3333 * @return A The number of rows removed or a negative value on error 3334 */ 3335 3336 bool chipProcessedExpDeleteObject( 3337 psDB *dbh, ///< Database handle 3338 const chipProcessedExpRow *object ///< Object to delete 3339 ); 3340 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 3341 * 3342 * Note that a 'where' search psMetadata is constructed from each object and 3343 * used to find rows to delete. 3344 * 3345 * @return A The number of rows removed or a negative value on error 3346 */ 3347 3348 long long chipProcessedExpDeleteRowObjects( 3349 psDB *dbh, ///< Database handle 3350 const psArray *objects, ///< Array of objects to delete 3351 unsigned long long limit ///< Maximum number of elements to delete 3352 ); 3353 /** Formats and prints an array of chipProcessedExpRow objects 3354 * 3355 * When mdcf is set the formated output is in psMetadataConfig 3356 * format, otherwise it is in a simple tabular format. 3357 * 3358 * @return true on success 3359 */ 3360 3361 bool chipProcessedExpPrintObjects( 3362 FILE *stream, ///< a stream 3363 psArray *objects, ///< An array of chipProcessedExpRow objects 3364 bool mdcf ///< format as mdconfig or simple 3365 ); 3366 /** Formats and prints an chipProcessedExpRow object 3367 * 3368 * When mdcf is set the formated output is in psMetadataConfig 3369 * format, otherwise it is in a simple tabular format. 3370 * 3371 * @return true on success 3372 */ 3373 3374 bool chipProcessedExpPrintObject( 3375 FILE *stream, ///< a stream 3376 chipProcessedExpRow *object, ///< an chipProcessedExpRow object 3377 bool mdcf ///< format as mdconfig or simple 3378 ); 3379 /** chipMaskRow data structure 3380 * 3381 * Structure for representing a single row of chipMask table data. 3382 */ 3383 3384 typedef struct { 3385 char *label; 3386 } chipMaskRow; 3387 3388 /** Creates a new chipMaskRow object 3389 * 3390 * @return A new chipMaskRow object or NULL on failure. 3391 */ 3392 3393 chipMaskRow *chipMaskRowAlloc( 3394 const char *label 3395 ); 3396 3397 /** Creates a new chipMask table 3398 * 3399 * @return true on success 3400 */ 3401 3402 bool chipMaskCreateTable( 3403 psDB *dbh ///< Database handle 3404 ); 3405 3406 /** Deletes a chipMask table 3407 * 3408 * @return true on success 3409 */ 3410 3411 bool chipMaskDropTable( 3412 psDB *dbh ///< Database handle 3413 ); 3414 3415 /** Insert a single row into a table 3416 * 3417 * This function constructs and inserts a single row based on it's parameters. 3418 * 3419 * @return true on success 3420 */ 3421 3422 bool chipMaskInsert( 3423 psDB *dbh, ///< Database handle 3424 const char *label 3425 ); 3426 3427 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 3428 * 3429 * @return A The number of rows removed or a negative value on error 3430 */ 3431 3432 long long chipMaskDelete( 3433 psDB *dbh, ///< Database handle 3434 const psMetadata *where, ///< Row match criteria 3435 unsigned long long limit ///< Maximum number of elements to delete 3436 ); 3437 3438 /** Insert a single chipMaskRow object into a table 3439 * 3440 * This function constructs and inserts a single row based on it's parameters. 3441 * 3442 * @return true on success 3443 */ 3444 3445 bool chipMaskInsertObject( 3446 psDB *dbh, ///< Database handle 3447 chipMaskRow *object ///< chipMaskRow object 3448 ); 3449 3450 /** Insert an array of chipMaskRow object into a table 3451 * 3452 * This function constructs and inserts multiple rows based on it's parameters. 3453 * 3454 * @return true on success 3455 */ 3456 3457 bool chipMaskInsertObjects( 3458 psDB *dbh, ///< Database handle 3459 psArray *objects ///< array of chipMaskRow objects 3460 ); 3461 3462 /** Insert data from a binary FITS table chipMaskRow into the database 3463 * 3464 * This function expects a psFits object with a FITS table as the first 3465 * extension. The table must have at least one row of data in it, that is of 3466 * the appropriate format (number of columns and their type). All other 3467 * extensions are ignored. 3468 * 3469 * @return true on success 3470 */ 3471 3472 bool chipMaskInsertFits( 3473 psDB *dbh, ///< Database handle 3474 const psFits *fits ///< psFits object 3475 ); 3476 3477 /** Selects up to limit from the database and returns them in a binary FITS table 3478 * 3479 * This function assumes an empty psFits object and will create a FITS table 3480 * as the first extension. 3481 * 3482 * See psDBSelectRows() for documentation on the format of where. 3483 * 3484 * @return true on success 3485 */ 3486 3487 bool chipMaskSelectRowsFits( 3488 psDB *dbh, ///< Database handle 3489 psFits *fits, ///< psFits object 3490 const psMetadata *where, ///< Row match criteria 3491 unsigned long long limit ///< Maximum number of elements to return 3492 ); 3493 3494 /** Convert a chipMaskRow into an equivalent psMetadata 3495 * 3496 * @return A psMetadata pointer or NULL on error 3497 */ 3498 3499 psMetadata *chipMaskMetadataFromObject( 3500 const chipMaskRow *object ///< fooRow to convert into a psMetadata 3501 ); 3502 3503 /** Convert a psMetadata into an equivalent fooRow 3504 * 3505 * @return A chipMaskRow pointer or NULL on error 3506 */ 3507 3508 chipMaskRow *chipMaskObjectFromMetadata( 3509 psMetadata *md ///< psMetadata to convert into a fooRow 3510 ); 3511 /** Selects up to limit rows from the database and returns as chipMaskRow objects in a psArray 3512 * 3513 * See psDBSelectRows() for documentation on the format of where. 3514 * 3515 * @return A psArray pointer or NULL on error 3516 */ 3517 3518 psArray *chipMaskSelectRowObjects( 3519 psDB *dbh, ///< Database handle 3520 const psMetadata *where, ///< Row match criteria 3521 unsigned long long limit ///< Maximum number of elements to return 3522 ); 3523 /** Deletes a row from the database coresponding to an chipMask 3524 * 3525 * Note that a 'where' search psMetadata is constructed from each object and 3526 * used to find rows to delete. 3527 * 3528 * @return A The number of rows removed or a negative value on error 3529 */ 3530 3531 bool chipMaskDeleteObject( 3532 psDB *dbh, ///< Database handle 3533 const chipMaskRow *object ///< Object to delete 3534 ); 3535 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 3536 * 3537 * Note that a 'where' search psMetadata is constructed from each object and 3538 * used to find rows to delete. 3539 * 3540 * @return A The number of rows removed or a negative value on error 3541 */ 3542 3543 long long chipMaskDeleteRowObjects( 3544 psDB *dbh, ///< Database handle 3545 const psArray *objects, ///< Array of objects to delete 3546 unsigned long long limit ///< Maximum number of elements to delete 3547 ); 3548 /** Formats and prints an array of chipMaskRow objects 3549 * 3550 * When mdcf is set the formated output is in psMetadataConfig 3551 * format, otherwise it is in a simple tabular format. 3552 * 3553 * @return true on success 3554 */ 3555 3556 bool chipMaskPrintObjects( 3557 FILE *stream, ///< a stream 3558 psArray *objects, ///< An array of chipMaskRow objects 3559 bool mdcf ///< format as mdconfig or simple 3560 ); 3561 /** Formats and prints an chipMaskRow object 3562 * 3563 * When mdcf is set the formated output is in psMetadataConfig 3564 * format, otherwise it is in a simple tabular format. 3565 * 3566 * @return true on success 3567 */ 3568 3569 bool chipMaskPrintObject( 3570 FILE *stream, ///< a stream 3571 chipMaskRow *object, ///< an chipMaskRow object 3572 bool mdcf ///< format as mdconfig or simple 3573 ); 3574 /** chipProcessedImfileRow data structure 3575 * 3576 * Structure for representing a single row of chipProcessedImfile table data. 3577 */ 3578 3579 typedef struct { 3580 psS64 chip_id; 2987 psS64 exp_id; 3581 2988 char *class_id; 3582 2989 char *uri; … … 3610 3017 chipProcessedImfileRow *chipProcessedImfileRowAlloc( 3611 3018 psS64 chip_id, 3019 psS64 exp_id, 3612 3020 const char *class_id, 3613 3021 const char *uri, … … 3662 3070 psDB *dbh, ///< Database handle 3663 3071 psS64 chip_id, 3072 psS64 exp_id, 3664 3073 const char *class_id, 3665 3074 const char *uri, … … 3833 3242 bool mdcf ///< format as mdconfig or simple 3834 3243 ); 3835 /** camPendingExpRow data structure 3836 * 3837 * Structure for representing a single row of camPendingExp table data. 3244 /** chipMaskRow data structure 3245 * 3246 * Structure for representing a single row of chipMask table data. 3247 */ 3248 3249 typedef struct { 3250 char *label; 3251 } chipMaskRow; 3252 3253 /** Creates a new chipMaskRow object 3254 * 3255 * @return A new chipMaskRow object or NULL on failure. 3256 */ 3257 3258 chipMaskRow *chipMaskRowAlloc( 3259 const char *label 3260 ); 3261 3262 /** Creates a new chipMask table 3263 * 3264 * @return true on success 3265 */ 3266 3267 bool chipMaskCreateTable( 3268 psDB *dbh ///< Database handle 3269 ); 3270 3271 /** Deletes a chipMask table 3272 * 3273 * @return true on success 3274 */ 3275 3276 bool chipMaskDropTable( 3277 psDB *dbh ///< Database handle 3278 ); 3279 3280 /** Insert a single row into a table 3281 * 3282 * This function constructs and inserts a single row based on it's parameters. 3283 * 3284 * @return true on success 3285 */ 3286 3287 bool chipMaskInsert( 3288 psDB *dbh, ///< Database handle 3289 const char *label 3290 ); 3291 3292 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 3293 * 3294 * @return A The number of rows removed or a negative value on error 3295 */ 3296 3297 long long chipMaskDelete( 3298 psDB *dbh, ///< Database handle 3299 const psMetadata *where, ///< Row match criteria 3300 unsigned long long limit ///< Maximum number of elements to delete 3301 ); 3302 3303 /** Insert a single chipMaskRow object into a table 3304 * 3305 * This function constructs and inserts a single row based on it's parameters. 3306 * 3307 * @return true on success 3308 */ 3309 3310 bool chipMaskInsertObject( 3311 psDB *dbh, ///< Database handle 3312 chipMaskRow *object ///< chipMaskRow object 3313 ); 3314 3315 /** Insert an array of chipMaskRow object into a table 3316 * 3317 * This function constructs and inserts multiple rows based on it's parameters. 3318 * 3319 * @return true on success 3320 */ 3321 3322 bool chipMaskInsertObjects( 3323 psDB *dbh, ///< Database handle 3324 psArray *objects ///< array of chipMaskRow objects 3325 ); 3326 3327 /** Insert data from a binary FITS table chipMaskRow into the database 3328 * 3329 * This function expects a psFits object with a FITS table as the first 3330 * extension. The table must have at least one row of data in it, that is of 3331 * the appropriate format (number of columns and their type). All other 3332 * extensions are ignored. 3333 * 3334 * @return true on success 3335 */ 3336 3337 bool chipMaskInsertFits( 3338 psDB *dbh, ///< Database handle 3339 const psFits *fits ///< psFits object 3340 ); 3341 3342 /** Selects up to limit from the database and returns them in a binary FITS table 3343 * 3344 * This function assumes an empty psFits object and will create a FITS table 3345 * as the first extension. 3346 * 3347 * See psDBSelectRows() for documentation on the format of where. 3348 * 3349 * @return true on success 3350 */ 3351 3352 bool chipMaskSelectRowsFits( 3353 psDB *dbh, ///< Database handle 3354 psFits *fits, ///< psFits object 3355 const psMetadata *where, ///< Row match criteria 3356 unsigned long long limit ///< Maximum number of elements to return 3357 ); 3358 3359 /** Convert a chipMaskRow into an equivalent psMetadata 3360 * 3361 * @return A psMetadata pointer or NULL on error 3362 */ 3363 3364 psMetadata *chipMaskMetadataFromObject( 3365 const chipMaskRow *object ///< fooRow to convert into a psMetadata 3366 ); 3367 3368 /** Convert a psMetadata into an equivalent fooRow 3369 * 3370 * @return A chipMaskRow pointer or NULL on error 3371 */ 3372 3373 chipMaskRow *chipMaskObjectFromMetadata( 3374 psMetadata *md ///< psMetadata to convert into a fooRow 3375 ); 3376 /** Selects up to limit rows from the database and returns as chipMaskRow objects in a psArray 3377 * 3378 * See psDBSelectRows() for documentation on the format of where. 3379 * 3380 * @return A psArray pointer or NULL on error 3381 */ 3382 3383 psArray *chipMaskSelectRowObjects( 3384 psDB *dbh, ///< Database handle 3385 const psMetadata *where, ///< Row match criteria 3386 unsigned long long limit ///< Maximum number of elements to return 3387 ); 3388 /** Deletes a row from the database coresponding to an chipMask 3389 * 3390 * Note that a 'where' search psMetadata is constructed from each object and 3391 * used to find rows to delete. 3392 * 3393 * @return A The number of rows removed or a negative value on error 3394 */ 3395 3396 bool chipMaskDeleteObject( 3397 psDB *dbh, ///< Database handle 3398 const chipMaskRow *object ///< Object to delete 3399 ); 3400 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 3401 * 3402 * Note that a 'where' search psMetadata is constructed from each object and 3403 * used to find rows to delete. 3404 * 3405 * @return A The number of rows removed or a negative value on error 3406 */ 3407 3408 long long chipMaskDeleteRowObjects( 3409 psDB *dbh, ///< Database handle 3410 const psArray *objects, ///< Array of objects to delete 3411 unsigned long long limit ///< Maximum number of elements to delete 3412 ); 3413 /** Formats and prints an array of chipMaskRow objects 3414 * 3415 * When mdcf is set the formated output is in psMetadataConfig 3416 * format, otherwise it is in a simple tabular format. 3417 * 3418 * @return true on success 3419 */ 3420 3421 bool chipMaskPrintObjects( 3422 FILE *stream, ///< a stream 3423 psArray *objects, ///< An array of chipMaskRow objects 3424 bool mdcf ///< format as mdconfig or simple 3425 ); 3426 /** Formats and prints an chipMaskRow object 3427 * 3428 * When mdcf is set the formated output is in psMetadataConfig 3429 * format, otherwise it is in a simple tabular format. 3430 * 3431 * @return true on success 3432 */ 3433 3434 bool chipMaskPrintObject( 3435 FILE *stream, ///< a stream 3436 chipMaskRow *object, ///< an chipMaskRow object 3437 bool mdcf ///< format as mdconfig or simple 3438 ); 3439 /** camRunRow data structure 3440 * 3441 * Structure for representing a single row of camRun table data. 3838 3442 */ 3839 3443 … … 3841 3445 psS64 cam_id; 3842 3446 psS64 chip_id; 3447 char *state; 3843 3448 char *workdir; 3449 char *workdir_state; 3844 3450 char *label; 3845 3451 char *reduction; 3846 3452 char *expgroup; 3847 3453 char *dvodb; 3848 } cam PendingExpRow;3849 3850 /** Creates a new cam PendingExpRow object3851 * 3852 * @return A new cam PendingExpRow object or NULL on failure.3853 */ 3854 3855 cam PendingExpRow *camPendingExpRowAlloc(3454 } camRunRow; 3455 3456 /** Creates a new camRunRow object 3457 * 3458 * @return A new camRunRow object or NULL on failure. 3459 */ 3460 3461 camRunRow *camRunRowAlloc( 3856 3462 psS64 cam_id, 3857 3463 psS64 chip_id, 3464 const char *state, 3858 3465 const char *workdir, 3466 const char *workdir_state, 3859 3467 const char *label, 3860 3468 const char *reduction, … … 3863 3471 ); 3864 3472 3865 /** Creates a new cam PendingExptable3866 * 3867 * @return true on success 3868 */ 3869 3870 bool cam PendingExpCreateTable(3473 /** Creates a new camRun table 3474 * 3475 * @return true on success 3476 */ 3477 3478 bool camRunCreateTable( 3871 3479 psDB *dbh ///< Database handle 3872 3480 ); 3873 3481 3874 /** Deletes a cam PendingExptable3875 * 3876 * @return true on success 3877 */ 3878 3879 bool cam PendingExpDropTable(3482 /** Deletes a camRun table 3483 * 3484 * @return true on success 3485 */ 3486 3487 bool camRunDropTable( 3880 3488 psDB *dbh ///< Database handle 3881 3489 ); … … 3888 3496 */ 3889 3497 3890 bool cam PendingExpInsert(3498 bool camRunInsert( 3891 3499 psDB *dbh, ///< Database handle 3892 3500 psS64 cam_id, 3893 3501 psS64 chip_id, 3502 const char *state, 3894 3503 const char *workdir, 3504 const char *workdir_state, 3895 3505 const char *label, 3896 3506 const char *reduction, … … 3904 3514 */ 3905 3515 3906 long long cam PendingExpDelete(3516 long long camRunDelete( 3907 3517 psDB *dbh, ///< Database handle 3908 3518 const psMetadata *where, ///< Row match criteria … … 3910 3520 ); 3911 3521 3912 /** Insert a single cam PendingExpRow object into a table3522 /** Insert a single camRunRow object into a table 3913 3523 * 3914 3524 * This function constructs and inserts a single row based on it's parameters. … … 3917 3527 */ 3918 3528 3919 bool cam PendingExpInsertObject(3920 psDB *dbh, ///< Database handle 3921 cam PendingExpRow *object ///< camPendingExpRow object3922 ); 3923 3924 /** Insert an array of cam PendingExpRow object into a table3529 bool camRunInsertObject( 3530 psDB *dbh, ///< Database handle 3531 camRunRow *object ///< camRunRow object 3532 ); 3533 3534 /** Insert an array of camRunRow object into a table 3925 3535 * 3926 3536 * This function constructs and inserts multiple rows based on it's parameters. … … 3929 3539 */ 3930 3540 3931 bool cam PendingExpInsertObjects(3932 psDB *dbh, ///< Database handle 3933 psArray *objects ///< array of cam PendingExpRow objects3934 ); 3935 3936 /** Insert data from a binary FITS table cam PendingExpRow into the database3541 bool camRunInsertObjects( 3542 psDB *dbh, ///< Database handle 3543 psArray *objects ///< array of camRunRow objects 3544 ); 3545 3546 /** Insert data from a binary FITS table camRunRow into the database 3937 3547 * 3938 3548 * This function expects a psFits object with a FITS table as the first … … 3944 3554 */ 3945 3555 3946 bool cam PendingExpInsertFits(3556 bool camRunInsertFits( 3947 3557 psDB *dbh, ///< Database handle 3948 3558 const psFits *fits ///< psFits object … … 3959 3569 */ 3960 3570 3961 bool cam PendingExpSelectRowsFits(3571 bool camRunSelectRowsFits( 3962 3572 psDB *dbh, ///< Database handle 3963 3573 psFits *fits, ///< psFits object … … 3966 3576 ); 3967 3577 3968 /** Convert a cam PendingExpRow into an equivalent psMetadata3578 /** Convert a camRunRow into an equivalent psMetadata 3969 3579 * 3970 3580 * @return A psMetadata pointer or NULL on error 3971 3581 */ 3972 3582 3973 psMetadata *cam PendingExpMetadataFromObject(3974 const cam PendingExpRow *object ///< fooRow to convert into a psMetadata3583 psMetadata *camRunMetadataFromObject( 3584 const camRunRow *object ///< fooRow to convert into a psMetadata 3975 3585 ); 3976 3586 3977 3587 /** Convert a psMetadata into an equivalent fooRow 3978 3588 * 3979 * @return A cam PendingExpRow pointer or NULL on error3980 */ 3981 3982 cam PendingExpRow *camPendingExpObjectFromMetadata(3589 * @return A camRunRow pointer or NULL on error 3590 */ 3591 3592 camRunRow *camRunObjectFromMetadata( 3983 3593 psMetadata *md ///< psMetadata to convert into a fooRow 3984 3594 ); 3985 /** Selects up to limit rows from the database and returns as cam PendingExpRow objects in a psArray3595 /** Selects up to limit rows from the database and returns as camRunRow objects in a psArray 3986 3596 * 3987 3597 * See psDBSelectRows() for documentation on the format of where. … … 3990 3600 */ 3991 3601 3992 psArray *cam PendingExpSelectRowObjects(3602 psArray *camRunSelectRowObjects( 3993 3603 psDB *dbh, ///< Database handle 3994 3604 const psMetadata *where, ///< Row match criteria 3995 3605 unsigned long long limit ///< Maximum number of elements to return 3996 3606 ); 3997 /** Deletes a row from the database coresponding to an cam PendingExp3607 /** Deletes a row from the database coresponding to an camRun 3998 3608 * 3999 3609 * Note that a 'where' search psMetadata is constructed from each object and … … 4003 3613 */ 4004 3614 4005 bool cam PendingExpDeleteObject(4006 psDB *dbh, ///< Database handle 4007 const cam PendingExpRow *object ///< Object to delete3615 bool camRunDeleteObject( 3616 psDB *dbh, ///< Database handle 3617 const camRunRow *object ///< Object to delete 4008 3618 ); 4009 3619 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. … … 4015 3625 */ 4016 3626 4017 long long cam PendingExpDeleteRowObjects(3627 long long camRunDeleteRowObjects( 4018 3628 psDB *dbh, ///< Database handle 4019 3629 const psArray *objects, ///< Array of objects to delete 4020 3630 unsigned long long limit ///< Maximum number of elements to delete 4021 3631 ); 4022 /** Formats and prints an array of cam PendingExpRow objects3632 /** Formats and prints an array of camRunRow objects 4023 3633 * 4024 3634 * When mdcf is set the formated output is in psMetadataConfig … … 4028 3638 */ 4029 3639 4030 bool cam PendingExpPrintObjects(3640 bool camRunPrintObjects( 4031 3641 FILE *stream, ///< a stream 4032 psArray *objects, ///< An array of cam PendingExpRow objects3642 psArray *objects, ///< An array of camRunRow objects 4033 3643 bool mdcf ///< format as mdconfig or simple 4034 3644 ); 4035 /** Formats and prints an cam PendingExpRow object3645 /** Formats and prints an camRunRow object 4036 3646 * 4037 3647 * When mdcf is set the formated output is in psMetadataConfig … … 4041 3651 */ 4042 3652 4043 bool cam PendingExpPrintObject(3653 bool camRunPrintObject( 4044 3654 FILE *stream, ///< a stream 4045 cam PendingExpRow *object, ///< an camPendingExpRow object3655 camRunRow *object, ///< an camRunRow object 4046 3656 bool mdcf ///< format as mdconfig or simple 4047 3657 ); … … 4054 3664 psS64 cam_id; 4055 3665 psS64 chip_id; 4056 char *workdir;4057 char *label;4058 char *reduction;4059 char *expgroup;4060 char *dvodb;4061 3666 char *uri; 4062 3667 psF32 bg; … … 4085 3690 psS64 cam_id, 4086 3691 psS64 chip_id, 4087 const char *workdir,4088 const char *label,4089 const char *reduction,4090 const char *expgroup,4091 const char *dvodb,4092 3692 const char *uri, 4093 3693 psF32 bg, … … 4137 3737 psS64 cam_id, 4138 3738 psS64 chip_id, 4139 const char *workdir,4140 const char *label,4141 const char *reduction,4142 const char *expgroup,4143 const char *dvodb,4144 3739 const char *uri, 4145 3740 psF32 bg, … … 6871 6466 psS64 det_id; 6872 6467 psS32 iteration; 6873 char *exp_tag;6468 psS64 exp_id; 6874 6469 bool include; 6875 6470 } detInputExpRow; … … 6883 6478 psS64 det_id, 6884 6479 psS32 iteration, 6885 const char *exp_tag,6480 psS64 exp_id, 6886 6481 bool include 6887 6482 ); … … 6916 6511 psS64 det_id, 6917 6512 psS32 iteration, 6918 const char *exp_tag,6513 psS64 exp_id, 6919 6514 bool include 6920 6515 ); … … 7074 6669 typedef struct { 7075 6670 psS64 det_id; 7076 char *exp_tag;6671 psS64 exp_id; 7077 6672 char *class_id; 7078 6673 char *uri; … … 7100 6695 detProcessedImfileRow *detProcessedImfileRowAlloc( 7101 6696 psS64 det_id, 7102 const char *exp_tag,6697 psS64 exp_id, 7103 6698 const char *class_id, 7104 6699 const char *uri, … … 7147 6742 psDB *dbh, ///< Database handle 7148 6743 psS64 det_id, 7149 const char *exp_tag,6744 psS64 exp_id, 7150 6745 const char *class_id, 7151 6746 const char *uri, … … 7320 6915 typedef struct { 7321 6916 psS64 det_id; 7322 char *exp_tag;6917 psS64 exp_id; 7323 6918 char *recipe; 7324 6919 psF64 bg; … … 7344 6939 detProcessedExpRow *detProcessedExpRowAlloc( 7345 6940 psS64 det_id, 7346 const char *exp_tag,6941 psS64 exp_id, 7347 6942 const char *recipe, 7348 6943 psF64 bg, … … 7389 6984 psDB *dbh, ///< Database handle 7390 6985 psS64 det_id, 7391 const char *exp_tag,6986 psS64 exp_id, 7392 6987 const char *recipe, 7393 6988 psF64 bg, … … 8467 8062 psS64 det_id; 8468 8063 psS32 iteration; 8469 char *exp_tag;8064 psS64 exp_id; 8470 8065 char *class_id; 8471 8066 char *uri; … … 8495 8090 psS64 det_id, 8496 8091 psS32 iteration, 8497 const char *exp_tag,8092 psS64 exp_id, 8498 8093 const char *class_id, 8499 8094 const char *uri, … … 8544 8139 psS64 det_id, 8545 8140 psS32 iteration, 8546 const char *exp_tag,8141 psS64 exp_id, 8547 8142 const char *class_id, 8548 8143 const char *uri, … … 8719 8314 psS64 det_id; 8720 8315 psS32 iteration; 8721 char *exp_tag;8316 psS64 exp_id; 8722 8317 char *recipe; 8723 8318 psF64 bg; … … 8746 8341 psS64 det_id, 8747 8342 psS32 iteration, 8748 const char *exp_tag,8343 psS64 exp_id, 8749 8344 const char *recipe, 8750 8345 psF64 bg, … … 8794 8389 psS64 det_id, 8795 8390 psS32 iteration, 8796 const char *exp_tag,8391 psS64 exp_id, 8797 8392 const char *recipe, 8798 8393 psF64 bg,
Note:
See TracChangeset
for help on using the changeset viewer.
