Changeset 15421 for trunk/ippdb/src/ippdb.h
- Timestamp:
- Oct 30, 2007, 4:45:31 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippdb/src/ippdb.h (modified) (37 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/src/ippdb.h
r15420 r15421 125 125 ); 126 126 127 /** pzDataStoreRow data structure 128 * 129 * Structure for representing a single row of pzDataStore table data. 130 */ 131 132 typedef struct { 133 char *camera; 134 char *telescope; 135 char *uri; 136 } pzDataStoreRow; 137 138 /** Creates a new pzDataStoreRow object 139 * 140 * @return A new pzDataStoreRow object or NULL on failure. 141 */ 142 143 pzDataStoreRow *pzDataStoreRowAlloc( 144 const char *camera, 145 const char *telescope, 146 const char *uri 147 ); 148 149 /** Creates a new pzDataStore table 150 * 151 * @return true on success 152 */ 153 154 bool pzDataStoreCreateTable( 155 psDB *dbh ///< Database handle 156 ); 157 158 /** Deletes a pzDataStore table 159 * 160 * @return true on success 161 */ 162 163 bool pzDataStoreDropTable( 164 psDB *dbh ///< Database handle 165 ); 166 167 /** Insert a single row into a table 168 * 169 * This function constructs and inserts a single row based on it's parameters. 170 * 171 * @return true on success 172 */ 173 174 bool pzDataStoreInsert( 175 psDB *dbh, ///< Database handle 176 const char *camera, 177 const char *telescope, 178 const char *uri 179 ); 180 181 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 182 * 183 * @return A The number of rows removed or a negative value on error 184 */ 185 186 long long pzDataStoreDelete( 187 psDB *dbh, ///< Database handle 188 const psMetadata *where, ///< Row match criteria 189 unsigned long long limit ///< Maximum number of elements to delete 190 ); 191 192 /** Insert a single pzDataStoreRow object into a table 193 * 194 * This function constructs and inserts a single row based on it's parameters. 195 * 196 * @return true on success 197 */ 198 199 bool pzDataStoreInsertObject( 200 psDB *dbh, ///< Database handle 201 pzDataStoreRow *object ///< pzDataStoreRow object 202 ); 203 204 /** Insert an array of pzDataStoreRow object into a table 205 * 206 * This function constructs and inserts multiple rows based on it's parameters. 207 * 208 * @return true on success 209 */ 210 211 bool pzDataStoreInsertObjects( 212 psDB *dbh, ///< Database handle 213 psArray *objects ///< array of pzDataStoreRow objects 214 ); 215 216 /** Insert data from a binary FITS table pzDataStoreRow into the database 217 * 218 * This function expects a psFits object with a FITS table as the first 219 * extension. The table must have at least one row of data in it, that is of 220 * the appropriate format (number of columns and their type). All other 221 * extensions are ignored. 222 * 223 * @return true on success 224 */ 225 226 bool pzDataStoreInsertFits( 227 psDB *dbh, ///< Database handle 228 const psFits *fits ///< psFits object 229 ); 230 231 /** Selects up to limit from the database and returns them in a binary FITS table 232 * 233 * This function assumes an empty psFits object and will create a FITS table 234 * as the first extension. 235 * 236 * See psDBSelectRows() for documentation on the format of where. 237 * 238 * @return true on success 239 */ 240 241 bool pzDataStoreSelectRowsFits( 242 psDB *dbh, ///< Database handle 243 psFits *fits, ///< psFits object 244 const psMetadata *where, ///< Row match criteria 245 unsigned long long limit ///< Maximum number of elements to return 246 ); 247 248 /** Convert a pzDataStoreRow into an equivalent psMetadata 249 * 250 * @return A psMetadata pointer or NULL on error 251 */ 252 253 psMetadata *pzDataStoreMetadataFromObject( 254 const pzDataStoreRow *object ///< fooRow to convert into a psMetadata 255 ); 256 257 /** Convert a psMetadata into an equivalent fooRow 258 * 259 * @return A pzDataStoreRow pointer or NULL on error 260 */ 261 262 pzDataStoreRow *pzDataStoreObjectFromMetadata( 263 psMetadata *md ///< psMetadata to convert into a fooRow 264 ); 265 /** Selects up to limit rows from the database and returns as pzDataStoreRow objects in a psArray 266 * 267 * See psDBSelectRows() for documentation on the format of where. 268 * 269 * @return A psArray pointer or NULL on error 270 */ 271 272 psArray *pzDataStoreSelectRowObjects( 273 psDB *dbh, ///< Database handle 274 const psMetadata *where, ///< Row match criteria 275 unsigned long long limit ///< Maximum number of elements to return 276 ); 277 /** Deletes a row from the database coresponding to an pzDataStore 278 * 279 * Note that a 'where' search psMetadata is constructed from each object and 280 * used to find rows to delete. 281 * 282 * @return A The number of rows removed or a negative value on error 283 */ 284 285 bool pzDataStoreDeleteObject( 286 psDB *dbh, ///< Database handle 287 const pzDataStoreRow *object ///< Object to delete 288 ); 289 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 290 * 291 * Note that a 'where' search psMetadata is constructed from each object and 292 * used to find rows to delete. 293 * 294 * @return A The number of rows removed or a negative value on error 295 */ 296 297 long long pzDataStoreDeleteRowObjects( 298 psDB *dbh, ///< Database handle 299 const psArray *objects, ///< Array of objects to delete 300 unsigned long long limit ///< Maximum number of elements to delete 301 ); 302 /** Formats and prints an array of pzDataStoreRow objects 303 * 304 * When mdcf is set the formated output is in psMetadataConfig 305 * format, otherwise it is in a simple tabular format. 306 * 307 * @return true on success 308 */ 309 310 bool pzDataStorePrintObjects( 311 FILE *stream, ///< a stream 312 psArray *objects, ///< An array of pzDataStoreRow objects 313 bool mdcf ///< format as mdconfig or simple 314 ); 315 /** Formats and prints an pzDataStoreRow object 316 * 317 * When mdcf is set the formated output is in psMetadataConfig 318 * format, otherwise it is in a simple tabular format. 319 * 320 * @return true on success 321 */ 322 323 bool pzDataStorePrintObject( 324 FILE *stream, ///< a stream 325 pzDataStoreRow *object, ///< an pzDataStoreRow object 326 bool mdcf ///< format as mdconfig or simple 327 ); 127 328 /** summitExpRow data structure 128 329 * … … 769 970 char *class; 770 971 char *class_id; 771 psS64 exp_id;772 972 } pzPendingImfileRow; 773 973 … … 782 982 const char *telescope, 783 983 const char *class, 784 const char *class_id, 785 psS64 exp_id 984 const char *class_id 786 985 ); 787 986 … … 817 1016 const char *telescope, 818 1017 const char *class, 819 const char *class_id, 820 psS64 exp_id 1018 const char *class_id 821 1019 ); 822 1020 … … 1180 1378 char *class; 1181 1379 char *class_id; 1182 psS64 exp_id;1183 1380 char *uri; 1184 1381 } pzDoneImfileRow; … … 1195 1392 const char *class, 1196 1393 const char *class_id, 1197 psS64 exp_id,1198 1394 const char *uri 1199 1395 ); … … 1231 1427 const char *class, 1232 1428 const char *class_id, 1233 psS64 exp_id,1234 1429 const char *uri 1235 1430 ); … … 1393 1588 char *tmp_telescope; 1394 1589 char *state; 1395 psS32 imfiles;1396 1590 char *workdir; 1397 1591 char *workdir_state; 1592 char *reduction; 1398 1593 } newExpRow; 1399 1594 … … 1409 1604 const char *tmp_telescope, 1410 1605 const char *state, 1411 psS32 imfiles,1412 1606 const char *workdir, 1413 const char *workdir_state 1607 const char *workdir_state, 1608 const char *reduction 1414 1609 ); 1415 1610 … … 1446 1641 const char *tmp_telescope, 1447 1642 const char *state, 1448 psS32 imfiles,1449 1643 const char *workdir, 1450 const char *workdir_state 1644 const char *workdir_state, 1645 const char *reduction 1451 1646 ); 1452 1647 … … 1812 2007 char *exp_tag; 1813 2008 char *exp_type; 1814 psS32 imfiles;1815 2009 char *filelevel; 1816 2010 char *workdir; 2011 char *reduction; 1817 2012 char *filter; 1818 2013 psF32 airmass; … … 1851 2046 const char *exp_tag, 1852 2047 const char *exp_type, 1853 psS32 imfiles,1854 2048 const char *filelevel, 1855 2049 const char *workdir, 2050 const char *reduction, 1856 2051 const char *filter, 1857 2052 psF32 airmass, … … 1911 2106 const char *exp_tag, 1912 2107 const char *exp_type, 1913 psS32 imfiles,1914 2108 const char *filelevel, 1915 2109 const char *workdir, 2110 const char *reduction, 1916 2111 const char *filter, 1917 2112 psF32 airmass, … … 2574 2769 typedef struct { 2575 2770 psS64 chip_id; 2771 psS64 exp_id; 2576 2772 char *state; 2577 2773 char *workdir; … … 2590 2786 chipRunRow *chipRunRowAlloc( 2591 2787 psS64 chip_id, 2788 psS64 exp_id, 2592 2789 const char *state, 2593 2790 const char *workdir, … … 2627 2824 psDB *dbh, ///< Database handle 2628 2825 psS64 chip_id, 2826 psS64 exp_id, 2629 2827 const char *state, 2630 2828 const char *workdir, … … 2781 2979 FILE *stream, ///< a stream 2782 2980 chipRunRow *object, ///< an chipRunRow object 2783 bool mdcf ///< format as mdconfig or simple2784 );2785 /** chipInputImfileRow data structure2786 *2787 * Structure for representing a single row of chipInputImfile table data.2788 */2789 2790 typedef struct {2791 psS64 chip_id;2792 psS64 exp_id;2793 char *class_id;2794 } chipInputImfileRow;2795 2796 /** Creates a new chipInputImfileRow object2797 *2798 * @return A new chipInputImfileRow object or NULL on failure.2799 */2800 2801 chipInputImfileRow *chipInputImfileRowAlloc(2802 psS64 chip_id,2803 psS64 exp_id,2804 const char *class_id2805 );2806 2807 /** Creates a new chipInputImfile table2808 *2809 * @return true on success2810 */2811 2812 bool chipInputImfileCreateTable(2813 psDB *dbh ///< Database handle2814 );2815 2816 /** Deletes a chipInputImfile table2817 *2818 * @return true on success2819 */2820 2821 bool chipInputImfileDropTable(2822 psDB *dbh ///< Database handle2823 );2824 2825 /** Insert a single row into a table2826 *2827 * This function constructs and inserts a single row based on it's parameters.2828 *2829 * @return true on success2830 */2831 2832 bool chipInputImfileInsert(2833 psDB *dbh, ///< Database handle2834 psS64 chip_id,2835 psS64 exp_id,2836 const char *class_id2837 );2838 2839 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.2840 *2841 * @return A The number of rows removed or a negative value on error2842 */2843 2844 long long chipInputImfileDelete(2845 psDB *dbh, ///< Database handle2846 const psMetadata *where, ///< Row match criteria2847 unsigned long long limit ///< Maximum number of elements to delete2848 );2849 2850 /** Insert a single chipInputImfileRow object into a table2851 *2852 * This function constructs and inserts a single row based on it's parameters.2853 *2854 * @return true on success2855 */2856 2857 bool chipInputImfileInsertObject(2858 psDB *dbh, ///< Database handle2859 chipInputImfileRow *object ///< chipInputImfileRow object2860 );2861 2862 /** Insert an array of chipInputImfileRow object into a table2863 *2864 * This function constructs and inserts multiple rows based on it's parameters.2865 *2866 * @return true on success2867 */2868 2869 bool chipInputImfileInsertObjects(2870 psDB *dbh, ///< Database handle2871 psArray *objects ///< array of chipInputImfileRow objects2872 );2873 2874 /** Insert data from a binary FITS table chipInputImfileRow into the database2875 *2876 * This function expects a psFits object with a FITS table as the first2877 * extension. The table must have at least one row of data in it, that is of2878 * the appropriate format (number of columns and their type). All other2879 * extensions are ignored.2880 *2881 * @return true on success2882 */2883 2884 bool chipInputImfileInsertFits(2885 psDB *dbh, ///< Database handle2886 const psFits *fits ///< psFits object2887 );2888 2889 /** Selects up to limit from the database and returns them in a binary FITS table2890 *2891 * This function assumes an empty psFits object and will create a FITS table2892 * as the first extension.2893 *2894 * See psDBSelectRows() for documentation on the format of where.2895 *2896 * @return true on success2897 */2898 2899 bool chipInputImfileSelectRowsFits(2900 psDB *dbh, ///< Database handle2901 psFits *fits, ///< psFits object2902 const psMetadata *where, ///< Row match criteria2903 unsigned long long limit ///< Maximum number of elements to return2904 );2905 2906 /** Convert a chipInputImfileRow into an equivalent psMetadata2907 *2908 * @return A psMetadata pointer or NULL on error2909 */2910 2911 psMetadata *chipInputImfileMetadataFromObject(2912 const chipInputImfileRow *object ///< fooRow to convert into a psMetadata2913 );2914 2915 /** Convert a psMetadata into an equivalent fooRow2916 *2917 * @return A chipInputImfileRow pointer or NULL on error2918 */2919 2920 chipInputImfileRow *chipInputImfileObjectFromMetadata(2921 psMetadata *md ///< psMetadata to convert into a fooRow2922 );2923 /** Selects up to limit rows from the database and returns as chipInputImfileRow objects in a psArray2924 *2925 * See psDBSelectRows() for documentation on the format of where.2926 *2927 * @return A psArray pointer or NULL on error2928 */2929 2930 psArray *chipInputImfileSelectRowObjects(2931 psDB *dbh, ///< Database handle2932 const psMetadata *where, ///< Row match criteria2933 unsigned long long limit ///< Maximum number of elements to return2934 );2935 /** Deletes a row from the database coresponding to an chipInputImfile2936 *2937 * Note that a 'where' search psMetadata is constructed from each object and2938 * used to find rows to delete.2939 *2940 * @return A The number of rows removed or a negative value on error2941 */2942 2943 bool chipInputImfileDeleteObject(2944 psDB *dbh, ///< Database handle2945 const chipInputImfileRow *object ///< Object to delete2946 );2947 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.2948 *2949 * Note that a 'where' search psMetadata is constructed from each object and2950 * used to find rows to delete.2951 *2952 * @return A The number of rows removed or a negative value on error2953 */2954 2955 long long chipInputImfileDeleteRowObjects(2956 psDB *dbh, ///< Database handle2957 const psArray *objects, ///< Array of objects to delete2958 unsigned long long limit ///< Maximum number of elements to delete2959 );2960 /** Formats and prints an array of chipInputImfileRow objects2961 *2962 * When mdcf is set the formated output is in psMetadataConfig2963 * format, otherwise it is in a simple tabular format.2964 *2965 * @return true on success2966 */2967 2968 bool chipInputImfilePrintObjects(2969 FILE *stream, ///< a stream2970 psArray *objects, ///< An array of chipInputImfileRow objects2971 bool mdcf ///< format as mdconfig or simple2972 );2973 /** Formats and prints an chipInputImfileRow object2974 *2975 * When mdcf is set the formated output is in psMetadataConfig2976 * format, otherwise it is in a simple tabular format.2977 *2978 * @return true on success2979 */2980 2981 bool chipInputImfilePrintObject(2982 FILE *stream, ///< a stream2983 chipInputImfileRow *object, ///< an chipInputImfileRow object2984 2981 bool mdcf ///< format as mdconfig or simple 2985 2982 ); … … 4737 4734 psF64 bg; 4738 4735 psF64 bg_stdev; 4736 psF64 good_frac; 4737 psS16 fault; 4739 4738 } warpSkyfileRow; 4740 4739 … … 4751 4750 const char *path_base, 4752 4751 psF64 bg, 4753 psF64 bg_stdev 4752 psF64 bg_stdev, 4753 psF64 good_frac, 4754 psS16 fault 4754 4755 ); 4755 4756 … … 4787 4788 const char *path_base, 4788 4789 psF64 bg, 4789 psF64 bg_stdev 4790 psF64 bg_stdev, 4791 psF64 good_frac, 4792 psS16 fault 4790 4793 ); 4791 4794 … … 5157 5160 typedef struct { 5158 5161 psS64 diff_id; 5162 bool template; 5163 psS64 stack_id; 5159 5164 psS64 warp_id; 5160 5165 char *skycell_id; 5161 5166 char *tess_id; 5162 5167 char *kind; 5163 bool template;5164 5168 } diffInputSkyfileRow; 5165 5169 … … 5171 5175 diffInputSkyfileRow *diffInputSkyfileRowAlloc( 5172 5176 psS64 diff_id, 5177 bool template, 5178 psS64 stack_id, 5173 5179 psS64 warp_id, 5174 5180 const char *skycell_id, 5175 5181 const char *tess_id, 5176 const char *kind, 5177 bool template 5182 const char *kind 5178 5183 ); 5179 5184 … … 5206 5211 psDB *dbh, ///< Database handle 5207 5212 psS64 diff_id, 5213 bool template, 5214 psS64 stack_id, 5208 5215 psS64 warp_id, 5209 5216 const char *skycell_id, 5210 5217 const char *tess_id, 5211 const char *kind, 5212 bool template 5218 const char *kind 5213 5219 ); 5214 5220 … … 5371 5377 psF64 bg; 5372 5378 psF64 bg_stdev; 5379 psF64 good_frac; 5380 psS16 fault; 5373 5381 } diffSkyfileRow; 5374 5382 … … 5383 5391 const char *path_base, 5384 5392 psF64 bg, 5385 psF64 bg_stdev 5393 psF64 bg_stdev, 5394 psF64 good_frac, 5395 psS16 fault 5386 5396 ); 5387 5397 … … 5417 5427 const char *path_base, 5418 5428 psF64 bg, 5419 psF64 bg_stdev 5429 psF64 bg_stdev, 5430 psF64 good_frac, 5431 psS16 fault 5420 5432 ); 5421 5433 … … 5989 6001 psF64 bg; 5990 6002 psF64 bg_stdev; 6003 psF64 good_frac; 6004 psS16 fault; 5991 6005 } stackSumSkyfileRow; 5992 6006 … … 6001 6015 const char *path_base, 6002 6016 psF64 bg, 6003 psF64 bg_stdev 6017 psF64 bg_stdev, 6018 psF64 good_frac, 6019 psS16 fault 6004 6020 ); 6005 6021 … … 6035 6051 const char *path_base, 6036 6052 psF64 bg, 6037 psF64 bg_stdev 6053 psF64 bg_stdev, 6054 psF64 good_frac, 6055 psS16 fault 6038 6056 ); 6039 6057 … … 8075 8093 psF64 bg_stdev; 8076 8094 psF64 bg_mean_stdev; 8095 psF64 bg_skewness; 8096 psF64 bg_kurtosis; 8077 8097 psF64 bin_stdev; 8078 8098 psF64 fringe_0; 8079 8099 psF64 fringe_1; 8080 8100 psF64 fringe_2; 8101 psF64 fringe_resid_0; 8102 psF64 fringe_resid_1; 8103 psF64 fringe_resid_2; 8081 8104 psF64 user_1; 8082 8105 psF64 user_2; … … 8103 8126 psF64 bg_stdev, 8104 8127 psF64 bg_mean_stdev, 8128 psF64 bg_skewness, 8129 psF64 bg_kurtosis, 8105 8130 psF64 bin_stdev, 8106 8131 psF64 fringe_0, 8107 8132 psF64 fringe_1, 8108 8133 psF64 fringe_2, 8134 psF64 fringe_resid_0, 8135 psF64 fringe_resid_1, 8136 psF64 fringe_resid_2, 8109 8137 psF64 user_1, 8110 8138 psF64 user_2, … … 8152 8180 psF64 bg_stdev, 8153 8181 psF64 bg_mean_stdev, 8182 psF64 bg_skewness, 8183 psF64 bg_kurtosis, 8154 8184 psF64 bin_stdev, 8155 8185 psF64 fringe_0, 8156 8186 psF64 fringe_1, 8157 8187 psF64 fringe_2, 8188 psF64 fringe_resid_0, 8189 psF64 fringe_resid_1, 8190 psF64 fringe_resid_2, 8158 8191 psF64 user_1, 8159 8192 psF64 user_2, … … 8325 8358 psF64 bg_stdev; 8326 8359 psF64 bg_mean_stdev; 8360 psF64 bg_skewness; 8361 psF64 bg_kurtosis; 8327 8362 psF64 bin_stdev; 8328 8363 psF64 fringe_0; 8329 8364 psF64 fringe_1; 8330 8365 psF64 fringe_2; 8366 psF64 fringe_resid_0; 8367 psF64 fringe_resid_1; 8368 psF64 fringe_resid_2; 8331 8369 psF64 user_1; 8332 8370 psF64 user_2; … … 8352 8390 psF64 bg_stdev, 8353 8391 psF64 bg_mean_stdev, 8392 psF64 bg_skewness, 8393 psF64 bg_kurtosis, 8354 8394 psF64 bin_stdev, 8355 8395 psF64 fringe_0, 8356 8396 psF64 fringe_1, 8357 8397 psF64 fringe_2, 8398 psF64 fringe_resid_0, 8399 psF64 fringe_resid_1, 8400 psF64 fringe_resid_2, 8358 8401 psF64 user_1, 8359 8402 psF64 user_2, … … 8400 8443 psF64 bg_stdev, 8401 8444 psF64 bg_mean_stdev, 8445 psF64 bg_skewness, 8446 psF64 bg_kurtosis, 8402 8447 psF64 bin_stdev, 8403 8448 psF64 fringe_0, 8404 8449 psF64 fringe_1, 8405 8450 psF64 fringe_2, 8451 psF64 fringe_resid_0, 8452 psF64 fringe_resid_1, 8453 psF64 fringe_resid_2, 8406 8454 psF64 user_1, 8407 8455 psF64 user_2, … … 8774 8822 bool mdcf ///< format as mdconfig or simple 8775 8823 ); 8824 /** detRegisteredImfileRow data structure 8825 * 8826 * Structure for representing a single row of detRegisteredImfile table data. 8827 */ 8828 8829 typedef struct { 8830 psS64 det_id; 8831 psS32 iteration; 8832 char *class_id; 8833 char *uri; 8834 psF64 bg; 8835 psF64 bg_stdev; 8836 psF64 bg_mean_stdev; 8837 psF64 user_1; 8838 psF64 user_2; 8839 psF64 user_3; 8840 psF64 user_4; 8841 psF64 user_5; 8842 char *path_base; 8843 psS16 fault; 8844 } detRegisteredImfileRow; 8845 8846 /** Creates a new detRegisteredImfileRow object 8847 * 8848 * @return A new detRegisteredImfileRow object or NULL on failure. 8849 */ 8850 8851 detRegisteredImfileRow *detRegisteredImfileRowAlloc( 8852 psS64 det_id, 8853 psS32 iteration, 8854 const char *class_id, 8855 const char *uri, 8856 psF64 bg, 8857 psF64 bg_stdev, 8858 psF64 bg_mean_stdev, 8859 psF64 user_1, 8860 psF64 user_2, 8861 psF64 user_3, 8862 psF64 user_4, 8863 psF64 user_5, 8864 const char *path_base, 8865 psS16 fault 8866 ); 8867 8868 /** Creates a new detRegisteredImfile table 8869 * 8870 * @return true on success 8871 */ 8872 8873 bool detRegisteredImfileCreateTable( 8874 psDB *dbh ///< Database handle 8875 ); 8876 8877 /** Deletes a detRegisteredImfile table 8878 * 8879 * @return true on success 8880 */ 8881 8882 bool detRegisteredImfileDropTable( 8883 psDB *dbh ///< Database handle 8884 ); 8885 8886 /** Insert a single row into a table 8887 * 8888 * This function constructs and inserts a single row based on it's parameters. 8889 * 8890 * @return true on success 8891 */ 8892 8893 bool detRegisteredImfileInsert( 8894 psDB *dbh, ///< Database handle 8895 psS64 det_id, 8896 psS32 iteration, 8897 const char *class_id, 8898 const char *uri, 8899 psF64 bg, 8900 psF64 bg_stdev, 8901 psF64 bg_mean_stdev, 8902 psF64 user_1, 8903 psF64 user_2, 8904 psF64 user_3, 8905 psF64 user_4, 8906 psF64 user_5, 8907 const char *path_base, 8908 psS16 fault 8909 ); 8910 8911 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 8912 * 8913 * @return A The number of rows removed or a negative value on error 8914 */ 8915 8916 long long detRegisteredImfileDelete( 8917 psDB *dbh, ///< Database handle 8918 const psMetadata *where, ///< Row match criteria 8919 unsigned long long limit ///< Maximum number of elements to delete 8920 ); 8921 8922 /** Insert a single detRegisteredImfileRow object into a table 8923 * 8924 * This function constructs and inserts a single row based on it's parameters. 8925 * 8926 * @return true on success 8927 */ 8928 8929 bool detRegisteredImfileInsertObject( 8930 psDB *dbh, ///< Database handle 8931 detRegisteredImfileRow *object ///< detRegisteredImfileRow object 8932 ); 8933 8934 /** Insert an array of detRegisteredImfileRow object into a table 8935 * 8936 * This function constructs and inserts multiple rows based on it's parameters. 8937 * 8938 * @return true on success 8939 */ 8940 8941 bool detRegisteredImfileInsertObjects( 8942 psDB *dbh, ///< Database handle 8943 psArray *objects ///< array of detRegisteredImfileRow objects 8944 ); 8945 8946 /** Insert data from a binary FITS table detRegisteredImfileRow into the database 8947 * 8948 * This function expects a psFits object with a FITS table as the first 8949 * extension. The table must have at least one row of data in it, that is of 8950 * the appropriate format (number of columns and their type). All other 8951 * extensions are ignored. 8952 * 8953 * @return true on success 8954 */ 8955 8956 bool detRegisteredImfileInsertFits( 8957 psDB *dbh, ///< Database handle 8958 const psFits *fits ///< psFits object 8959 ); 8960 8961 /** Selects up to limit from the database and returns them in a binary FITS table 8962 * 8963 * This function assumes an empty psFits object and will create a FITS table 8964 * as the first extension. 8965 * 8966 * See psDBSelectRows() for documentation on the format of where. 8967 * 8968 * @return true on success 8969 */ 8970 8971 bool detRegisteredImfileSelectRowsFits( 8972 psDB *dbh, ///< Database handle 8973 psFits *fits, ///< psFits object 8974 const psMetadata *where, ///< Row match criteria 8975 unsigned long long limit ///< Maximum number of elements to return 8976 ); 8977 8978 /** Convert a detRegisteredImfileRow into an equivalent psMetadata 8979 * 8980 * @return A psMetadata pointer or NULL on error 8981 */ 8982 8983 psMetadata *detRegisteredImfileMetadataFromObject( 8984 const detRegisteredImfileRow *object ///< fooRow to convert into a psMetadata 8985 ); 8986 8987 /** Convert a psMetadata into an equivalent fooRow 8988 * 8989 * @return A detRegisteredImfileRow pointer or NULL on error 8990 */ 8991 8992 detRegisteredImfileRow *detRegisteredImfileObjectFromMetadata( 8993 psMetadata *md ///< psMetadata to convert into a fooRow 8994 ); 8995 /** Selects up to limit rows from the database and returns as detRegisteredImfileRow objects in a psArray 8996 * 8997 * See psDBSelectRows() for documentation on the format of where. 8998 * 8999 * @return A psArray pointer or NULL on error 9000 */ 9001 9002 psArray *detRegisteredImfileSelectRowObjects( 9003 psDB *dbh, ///< Database handle 9004 const psMetadata *where, ///< Row match criteria 9005 unsigned long long limit ///< Maximum number of elements to return 9006 ); 9007 /** Deletes a row from the database coresponding to an detRegisteredImfile 9008 * 9009 * Note that a 'where' search psMetadata is constructed from each object and 9010 * used to find rows to delete. 9011 * 9012 * @return A The number of rows removed or a negative value on error 9013 */ 9014 9015 bool detRegisteredImfileDeleteObject( 9016 psDB *dbh, ///< Database handle 9017 const detRegisteredImfileRow *object ///< Object to delete 9018 ); 9019 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 9020 * 9021 * Note that a 'where' search psMetadata is constructed from each object and 9022 * used to find rows to delete. 9023 * 9024 * @return A The number of rows removed or a negative value on error 9025 */ 9026 9027 long long detRegisteredImfileDeleteRowObjects( 9028 psDB *dbh, ///< Database handle 9029 const psArray *objects, ///< Array of objects to delete 9030 unsigned long long limit ///< Maximum number of elements to delete 9031 ); 9032 /** Formats and prints an array of detRegisteredImfileRow objects 9033 * 9034 * When mdcf is set the formated output is in psMetadataConfig 9035 * format, otherwise it is in a simple tabular format. 9036 * 9037 * @return true on success 9038 */ 9039 9040 bool detRegisteredImfilePrintObjects( 9041 FILE *stream, ///< a stream 9042 psArray *objects, ///< An array of detRegisteredImfileRow objects 9043 bool mdcf ///< format as mdconfig or simple 9044 ); 9045 /** Formats and prints an detRegisteredImfileRow object 9046 * 9047 * When mdcf is set the formated output is in psMetadataConfig 9048 * format, otherwise it is in a simple tabular format. 9049 * 9050 * @return true on success 9051 */ 9052 9053 bool detRegisteredImfilePrintObject( 9054 FILE *stream, ///< a stream 9055 detRegisteredImfileRow *object, ///< an detRegisteredImfileRow object 9056 bool mdcf ///< format as mdconfig or simple 9057 ); 9058 /** detCorrectedExpRow data structure 9059 * 9060 * Structure for representing a single row of detCorrectedExp table data. 9061 */ 9062 9063 typedef struct { 9064 psS64 det_id; 9065 psS64 exp_id; 9066 char *uri; 9067 psS64 corr_id; 9068 char *corr_type; 9069 char *recipe; 9070 char *path_base; 9071 psS16 fault; 9072 } detCorrectedExpRow; 9073 9074 /** Creates a new detCorrectedExpRow object 9075 * 9076 * @return A new detCorrectedExpRow object or NULL on failure. 9077 */ 9078 9079 detCorrectedExpRow *detCorrectedExpRowAlloc( 9080 psS64 det_id, 9081 psS64 exp_id, 9082 const char *uri, 9083 psS64 corr_id, 9084 const char *corr_type, 9085 const char *recipe, 9086 const char *path_base, 9087 psS16 fault 9088 ); 9089 9090 /** Creates a new detCorrectedExp table 9091 * 9092 * @return true on success 9093 */ 9094 9095 bool detCorrectedExpCreateTable( 9096 psDB *dbh ///< Database handle 9097 ); 9098 9099 /** Deletes a detCorrectedExp table 9100 * 9101 * @return true on success 9102 */ 9103 9104 bool detCorrectedExpDropTable( 9105 psDB *dbh ///< Database handle 9106 ); 9107 9108 /** Insert a single row into a table 9109 * 9110 * This function constructs and inserts a single row based on it's parameters. 9111 * 9112 * @return true on success 9113 */ 9114 9115 bool detCorrectedExpInsert( 9116 psDB *dbh, ///< Database handle 9117 psS64 det_id, 9118 psS64 exp_id, 9119 const char *uri, 9120 psS64 corr_id, 9121 const char *corr_type, 9122 const char *recipe, 9123 const char *path_base, 9124 psS16 fault 9125 ); 9126 9127 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 9128 * 9129 * @return A The number of rows removed or a negative value on error 9130 */ 9131 9132 long long detCorrectedExpDelete( 9133 psDB *dbh, ///< Database handle 9134 const psMetadata *where, ///< Row match criteria 9135 unsigned long long limit ///< Maximum number of elements to delete 9136 ); 9137 9138 /** Insert a single detCorrectedExpRow object into a table 9139 * 9140 * This function constructs and inserts a single row based on it's parameters. 9141 * 9142 * @return true on success 9143 */ 9144 9145 bool detCorrectedExpInsertObject( 9146 psDB *dbh, ///< Database handle 9147 detCorrectedExpRow *object ///< detCorrectedExpRow object 9148 ); 9149 9150 /** Insert an array of detCorrectedExpRow object into a table 9151 * 9152 * This function constructs and inserts multiple rows based on it's parameters. 9153 * 9154 * @return true on success 9155 */ 9156 9157 bool detCorrectedExpInsertObjects( 9158 psDB *dbh, ///< Database handle 9159 psArray *objects ///< array of detCorrectedExpRow objects 9160 ); 9161 9162 /** Insert data from a binary FITS table detCorrectedExpRow into the database 9163 * 9164 * This function expects a psFits object with a FITS table as the first 9165 * extension. The table must have at least one row of data in it, that is of 9166 * the appropriate format (number of columns and their type). All other 9167 * extensions are ignored. 9168 * 9169 * @return true on success 9170 */ 9171 9172 bool detCorrectedExpInsertFits( 9173 psDB *dbh, ///< Database handle 9174 const psFits *fits ///< psFits object 9175 ); 9176 9177 /** Selects up to limit from the database and returns them in a binary FITS table 9178 * 9179 * This function assumes an empty psFits object and will create a FITS table 9180 * as the first extension. 9181 * 9182 * See psDBSelectRows() for documentation on the format of where. 9183 * 9184 * @return true on success 9185 */ 9186 9187 bool detCorrectedExpSelectRowsFits( 9188 psDB *dbh, ///< Database handle 9189 psFits *fits, ///< psFits object 9190 const psMetadata *where, ///< Row match criteria 9191 unsigned long long limit ///< Maximum number of elements to return 9192 ); 9193 9194 /** Convert a detCorrectedExpRow into an equivalent psMetadata 9195 * 9196 * @return A psMetadata pointer or NULL on error 9197 */ 9198 9199 psMetadata *detCorrectedExpMetadataFromObject( 9200 const detCorrectedExpRow *object ///< fooRow to convert into a psMetadata 9201 ); 9202 9203 /** Convert a psMetadata into an equivalent fooRow 9204 * 9205 * @return A detCorrectedExpRow pointer or NULL on error 9206 */ 9207 9208 detCorrectedExpRow *detCorrectedExpObjectFromMetadata( 9209 psMetadata *md ///< psMetadata to convert into a fooRow 9210 ); 9211 /** Selects up to limit rows from the database and returns as detCorrectedExpRow objects in a psArray 9212 * 9213 * See psDBSelectRows() for documentation on the format of where. 9214 * 9215 * @return A psArray pointer or NULL on error 9216 */ 9217 9218 psArray *detCorrectedExpSelectRowObjects( 9219 psDB *dbh, ///< Database handle 9220 const psMetadata *where, ///< Row match criteria 9221 unsigned long long limit ///< Maximum number of elements to return 9222 ); 9223 /** Deletes a row from the database coresponding to an detCorrectedExp 9224 * 9225 * Note that a 'where' search psMetadata is constructed from each object and 9226 * used to find rows to delete. 9227 * 9228 * @return A The number of rows removed or a negative value on error 9229 */ 9230 9231 bool detCorrectedExpDeleteObject( 9232 psDB *dbh, ///< Database handle 9233 const detCorrectedExpRow *object ///< Object to delete 9234 ); 9235 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 9236 * 9237 * Note that a 'where' search psMetadata is constructed from each object and 9238 * used to find rows to delete. 9239 * 9240 * @return A The number of rows removed or a negative value on error 9241 */ 9242 9243 long long detCorrectedExpDeleteRowObjects( 9244 psDB *dbh, ///< Database handle 9245 const psArray *objects, ///< Array of objects to delete 9246 unsigned long long limit ///< Maximum number of elements to delete 9247 ); 9248 /** Formats and prints an array of detCorrectedExpRow objects 9249 * 9250 * When mdcf is set the formated output is in psMetadataConfig 9251 * format, otherwise it is in a simple tabular format. 9252 * 9253 * @return true on success 9254 */ 9255 9256 bool detCorrectedExpPrintObjects( 9257 FILE *stream, ///< a stream 9258 psArray *objects, ///< An array of detCorrectedExpRow objects 9259 bool mdcf ///< format as mdconfig or simple 9260 ); 9261 /** Formats and prints an detCorrectedExpRow object 9262 * 9263 * When mdcf is set the formated output is in psMetadataConfig 9264 * format, otherwise it is in a simple tabular format. 9265 * 9266 * @return true on success 9267 */ 9268 9269 bool detCorrectedExpPrintObject( 9270 FILE *stream, ///< a stream 9271 detCorrectedExpRow *object, ///< an detCorrectedExpRow object 9272 bool mdcf ///< format as mdconfig or simple 9273 ); 9274 /** detCorrectedImfileRow data structure 9275 * 9276 * Structure for representing a single row of detCorrectedImfile table data. 9277 */ 9278 9279 typedef struct { 9280 psS64 det_id; 9281 psS64 exp_id; 9282 char *class_id; 9283 char *uri; 9284 char *path_base; 9285 psS16 fault; 9286 } detCorrectedImfileRow; 9287 9288 /** Creates a new detCorrectedImfileRow object 9289 * 9290 * @return A new detCorrectedImfileRow object or NULL on failure. 9291 */ 9292 9293 detCorrectedImfileRow *detCorrectedImfileRowAlloc( 9294 psS64 det_id, 9295 psS64 exp_id, 9296 const char *class_id, 9297 const char *uri, 9298 const char *path_base, 9299 psS16 fault 9300 ); 9301 9302 /** Creates a new detCorrectedImfile table 9303 * 9304 * @return true on success 9305 */ 9306 9307 bool detCorrectedImfileCreateTable( 9308 psDB *dbh ///< Database handle 9309 ); 9310 9311 /** Deletes a detCorrectedImfile table 9312 * 9313 * @return true on success 9314 */ 9315 9316 bool detCorrectedImfileDropTable( 9317 psDB *dbh ///< Database handle 9318 ); 9319 9320 /** Insert a single row into a table 9321 * 9322 * This function constructs and inserts a single row based on it's parameters. 9323 * 9324 * @return true on success 9325 */ 9326 9327 bool detCorrectedImfileInsert( 9328 psDB *dbh, ///< Database handle 9329 psS64 det_id, 9330 psS64 exp_id, 9331 const char *class_id, 9332 const char *uri, 9333 const char *path_base, 9334 psS16 fault 9335 ); 9336 9337 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 9338 * 9339 * @return A The number of rows removed or a negative value on error 9340 */ 9341 9342 long long detCorrectedImfileDelete( 9343 psDB *dbh, ///< Database handle 9344 const psMetadata *where, ///< Row match criteria 9345 unsigned long long limit ///< Maximum number of elements to delete 9346 ); 9347 9348 /** Insert a single detCorrectedImfileRow object into a table 9349 * 9350 * This function constructs and inserts a single row based on it's parameters. 9351 * 9352 * @return true on success 9353 */ 9354 9355 bool detCorrectedImfileInsertObject( 9356 psDB *dbh, ///< Database handle 9357 detCorrectedImfileRow *object ///< detCorrectedImfileRow object 9358 ); 9359 9360 /** Insert an array of detCorrectedImfileRow object into a table 9361 * 9362 * This function constructs and inserts multiple rows based on it's parameters. 9363 * 9364 * @return true on success 9365 */ 9366 9367 bool detCorrectedImfileInsertObjects( 9368 psDB *dbh, ///< Database handle 9369 psArray *objects ///< array of detCorrectedImfileRow objects 9370 ); 9371 9372 /** Insert data from a binary FITS table detCorrectedImfileRow into the database 9373 * 9374 * This function expects a psFits object with a FITS table as the first 9375 * extension. The table must have at least one row of data in it, that is of 9376 * the appropriate format (number of columns and their type). All other 9377 * extensions are ignored. 9378 * 9379 * @return true on success 9380 */ 9381 9382 bool detCorrectedImfileInsertFits( 9383 psDB *dbh, ///< Database handle 9384 const psFits *fits ///< psFits object 9385 ); 9386 9387 /** Selects up to limit from the database and returns them in a binary FITS table 9388 * 9389 * This function assumes an empty psFits object and will create a FITS table 9390 * as the first extension. 9391 * 9392 * See psDBSelectRows() for documentation on the format of where. 9393 * 9394 * @return true on success 9395 */ 9396 9397 bool detCorrectedImfileSelectRowsFits( 9398 psDB *dbh, ///< Database handle 9399 psFits *fits, ///< psFits object 9400 const psMetadata *where, ///< Row match criteria 9401 unsigned long long limit ///< Maximum number of elements to return 9402 ); 9403 9404 /** Convert a detCorrectedImfileRow into an equivalent psMetadata 9405 * 9406 * @return A psMetadata pointer or NULL on error 9407 */ 9408 9409 psMetadata *detCorrectedImfileMetadataFromObject( 9410 const detCorrectedImfileRow *object ///< fooRow to convert into a psMetadata 9411 ); 9412 9413 /** Convert a psMetadata into an equivalent fooRow 9414 * 9415 * @return A detCorrectedImfileRow pointer or NULL on error 9416 */ 9417 9418 detCorrectedImfileRow *detCorrectedImfileObjectFromMetadata( 9419 psMetadata *md ///< psMetadata to convert into a fooRow 9420 ); 9421 /** Selects up to limit rows from the database and returns as detCorrectedImfileRow objects in a psArray 9422 * 9423 * See psDBSelectRows() for documentation on the format of where. 9424 * 9425 * @return A psArray pointer or NULL on error 9426 */ 9427 9428 psArray *detCorrectedImfileSelectRowObjects( 9429 psDB *dbh, ///< Database handle 9430 const psMetadata *where, ///< Row match criteria 9431 unsigned long long limit ///< Maximum number of elements to return 9432 ); 9433 /** Deletes a row from the database coresponding to an detCorrectedImfile 9434 * 9435 * Note that a 'where' search psMetadata is constructed from each object and 9436 * used to find rows to delete. 9437 * 9438 * @return A The number of rows removed or a negative value on error 9439 */ 9440 9441 bool detCorrectedImfileDeleteObject( 9442 psDB *dbh, ///< Database handle 9443 const detCorrectedImfileRow *object ///< Object to delete 9444 ); 9445 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 9446 * 9447 * Note that a 'where' search psMetadata is constructed from each object and 9448 * used to find rows to delete. 9449 * 9450 * @return A The number of rows removed or a negative value on error 9451 */ 9452 9453 long long detCorrectedImfileDeleteRowObjects( 9454 psDB *dbh, ///< Database handle 9455 const psArray *objects, ///< Array of objects to delete 9456 unsigned long long limit ///< Maximum number of elements to delete 9457 ); 9458 /** Formats and prints an array of detCorrectedImfileRow objects 9459 * 9460 * When mdcf is set the formated output is in psMetadataConfig 9461 * format, otherwise it is in a simple tabular format. 9462 * 9463 * @return true on success 9464 */ 9465 9466 bool detCorrectedImfilePrintObjects( 9467 FILE *stream, ///< a stream 9468 psArray *objects, ///< An array of detCorrectedImfileRow objects 9469 bool mdcf ///< format as mdconfig or simple 9470 ); 9471 /** Formats and prints an detCorrectedImfileRow object 9472 * 9473 * When mdcf is set the formated output is in psMetadataConfig 9474 * format, otherwise it is in a simple tabular format. 9475 * 9476 * @return true on success 9477 */ 9478 9479 bool detCorrectedImfilePrintObject( 9480 FILE *stream, ///< a stream 9481 detCorrectedImfileRow *object, ///< an detCorrectedImfileRow object 9482 bool mdcf ///< format as mdconfig or simple 9483 ); 9484 /** magicRunRow data structure 9485 * 9486 * Structure for representing a single row of magicRun table data. 9487 */ 9488 9489 typedef struct { 9490 psS64 magic_id; 9491 char *state; 9492 char *workdir; 9493 char *workdir_state; 9494 char *label; 9495 char *dvodb; 9496 psTime* registered; 9497 } magicRunRow; 9498 9499 /** Creates a new magicRunRow object 9500 * 9501 * @return A new magicRunRow object or NULL on failure. 9502 */ 9503 9504 magicRunRow *magicRunRowAlloc( 9505 psS64 magic_id, 9506 const char *state, 9507 const char *workdir, 9508 const char *workdir_state, 9509 const char *label, 9510 const char *dvodb, 9511 psTime* registered 9512 ); 9513 9514 /** Creates a new magicRun table 9515 * 9516 * @return true on success 9517 */ 9518 9519 bool magicRunCreateTable( 9520 psDB *dbh ///< Database handle 9521 ); 9522 9523 /** Deletes a magicRun table 9524 * 9525 * @return true on success 9526 */ 9527 9528 bool magicRunDropTable( 9529 psDB *dbh ///< Database handle 9530 ); 9531 9532 /** Insert a single row into a table 9533 * 9534 * This function constructs and inserts a single row based on it's parameters. 9535 * 9536 * @return true on success 9537 */ 9538 9539 bool magicRunInsert( 9540 psDB *dbh, ///< Database handle 9541 psS64 magic_id, 9542 const char *state, 9543 const char *workdir, 9544 const char *workdir_state, 9545 const char *label, 9546 const char *dvodb, 9547 psTime* registered 9548 ); 9549 9550 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 9551 * 9552 * @return A The number of rows removed or a negative value on error 9553 */ 9554 9555 long long magicRunDelete( 9556 psDB *dbh, ///< Database handle 9557 const psMetadata *where, ///< Row match criteria 9558 unsigned long long limit ///< Maximum number of elements to delete 9559 ); 9560 9561 /** Insert a single magicRunRow object into a table 9562 * 9563 * This function constructs and inserts a single row based on it's parameters. 9564 * 9565 * @return true on success 9566 */ 9567 9568 bool magicRunInsertObject( 9569 psDB *dbh, ///< Database handle 9570 magicRunRow *object ///< magicRunRow object 9571 ); 9572 9573 /** Insert an array of magicRunRow object into a table 9574 * 9575 * This function constructs and inserts multiple rows based on it's parameters. 9576 * 9577 * @return true on success 9578 */ 9579 9580 bool magicRunInsertObjects( 9581 psDB *dbh, ///< Database handle 9582 psArray *objects ///< array of magicRunRow objects 9583 ); 9584 9585 /** Insert data from a binary FITS table magicRunRow into the database 9586 * 9587 * This function expects a psFits object with a FITS table as the first 9588 * extension. The table must have at least one row of data in it, that is of 9589 * the appropriate format (number of columns and their type). All other 9590 * extensions are ignored. 9591 * 9592 * @return true on success 9593 */ 9594 9595 bool magicRunInsertFits( 9596 psDB *dbh, ///< Database handle 9597 const psFits *fits ///< psFits object 9598 ); 9599 9600 /** Selects up to limit from the database and returns them in a binary FITS table 9601 * 9602 * This function assumes an empty psFits object and will create a FITS table 9603 * as the first extension. 9604 * 9605 * See psDBSelectRows() for documentation on the format of where. 9606 * 9607 * @return true on success 9608 */ 9609 9610 bool magicRunSelectRowsFits( 9611 psDB *dbh, ///< Database handle 9612 psFits *fits, ///< psFits object 9613 const psMetadata *where, ///< Row match criteria 9614 unsigned long long limit ///< Maximum number of elements to return 9615 ); 9616 9617 /** Convert a magicRunRow into an equivalent psMetadata 9618 * 9619 * @return A psMetadata pointer or NULL on error 9620 */ 9621 9622 psMetadata *magicRunMetadataFromObject( 9623 const magicRunRow *object ///< fooRow to convert into a psMetadata 9624 ); 9625 9626 /** Convert a psMetadata into an equivalent fooRow 9627 * 9628 * @return A magicRunRow pointer or NULL on error 9629 */ 9630 9631 magicRunRow *magicRunObjectFromMetadata( 9632 psMetadata *md ///< psMetadata to convert into a fooRow 9633 ); 9634 /** Selects up to limit rows from the database and returns as magicRunRow objects in a psArray 9635 * 9636 * See psDBSelectRows() for documentation on the format of where. 9637 * 9638 * @return A psArray pointer or NULL on error 9639 */ 9640 9641 psArray *magicRunSelectRowObjects( 9642 psDB *dbh, ///< Database handle 9643 const psMetadata *where, ///< Row match criteria 9644 unsigned long long limit ///< Maximum number of elements to return 9645 ); 9646 /** Deletes a row from the database coresponding to an magicRun 9647 * 9648 * Note that a 'where' search psMetadata is constructed from each object and 9649 * used to find rows to delete. 9650 * 9651 * @return A The number of rows removed or a negative value on error 9652 */ 9653 9654 bool magicRunDeleteObject( 9655 psDB *dbh, ///< Database handle 9656 const magicRunRow *object ///< Object to delete 9657 ); 9658 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 9659 * 9660 * Note that a 'where' search psMetadata is constructed from each object and 9661 * used to find rows to delete. 9662 * 9663 * @return A The number of rows removed or a negative value on error 9664 */ 9665 9666 long long magicRunDeleteRowObjects( 9667 psDB *dbh, ///< Database handle 9668 const psArray *objects, ///< Array of objects to delete 9669 unsigned long long limit ///< Maximum number of elements to delete 9670 ); 9671 /** Formats and prints an array of magicRunRow objects 9672 * 9673 * When mdcf is set the formated output is in psMetadataConfig 9674 * format, otherwise it is in a simple tabular format. 9675 * 9676 * @return true on success 9677 */ 9678 9679 bool magicRunPrintObjects( 9680 FILE *stream, ///< a stream 9681 psArray *objects, ///< An array of magicRunRow objects 9682 bool mdcf ///< format as mdconfig or simple 9683 ); 9684 /** Formats and prints an magicRunRow object 9685 * 9686 * When mdcf is set the formated output is in psMetadataConfig 9687 * format, otherwise it is in a simple tabular format. 9688 * 9689 * @return true on success 9690 */ 9691 9692 bool magicRunPrintObject( 9693 FILE *stream, ///< a stream 9694 magicRunRow *object, ///< an magicRunRow object 9695 bool mdcf ///< format as mdconfig or simple 9696 ); 9697 /** magicInputSkyfileRow data structure 9698 * 9699 * Structure for representing a single row of magicInputSkyfile table data. 9700 */ 9701 9702 typedef struct { 9703 psS64 magic_id; 9704 psS64 diff_id; 9705 char *node; 9706 } magicInputSkyfileRow; 9707 9708 /** Creates a new magicInputSkyfileRow object 9709 * 9710 * @return A new magicInputSkyfileRow object or NULL on failure. 9711 */ 9712 9713 magicInputSkyfileRow *magicInputSkyfileRowAlloc( 9714 psS64 magic_id, 9715 psS64 diff_id, 9716 const char *node 9717 ); 9718 9719 /** Creates a new magicInputSkyfile table 9720 * 9721 * @return true on success 9722 */ 9723 9724 bool magicInputSkyfileCreateTable( 9725 psDB *dbh ///< Database handle 9726 ); 9727 9728 /** Deletes a magicInputSkyfile table 9729 * 9730 * @return true on success 9731 */ 9732 9733 bool magicInputSkyfileDropTable( 9734 psDB *dbh ///< Database handle 9735 ); 9736 9737 /** Insert a single row into a table 9738 * 9739 * This function constructs and inserts a single row based on it's parameters. 9740 * 9741 * @return true on success 9742 */ 9743 9744 bool magicInputSkyfileInsert( 9745 psDB *dbh, ///< Database handle 9746 psS64 magic_id, 9747 psS64 diff_id, 9748 const char *node 9749 ); 9750 9751 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 9752 * 9753 * @return A The number of rows removed or a negative value on error 9754 */ 9755 9756 long long magicInputSkyfileDelete( 9757 psDB *dbh, ///< Database handle 9758 const psMetadata *where, ///< Row match criteria 9759 unsigned long long limit ///< Maximum number of elements to delete 9760 ); 9761 9762 /** Insert a single magicInputSkyfileRow object into a table 9763 * 9764 * This function constructs and inserts a single row based on it's parameters. 9765 * 9766 * @return true on success 9767 */ 9768 9769 bool magicInputSkyfileInsertObject( 9770 psDB *dbh, ///< Database handle 9771 magicInputSkyfileRow *object ///< magicInputSkyfileRow object 9772 ); 9773 9774 /** Insert an array of magicInputSkyfileRow object into a table 9775 * 9776 * This function constructs and inserts multiple rows based on it's parameters. 9777 * 9778 * @return true on success 9779 */ 9780 9781 bool magicInputSkyfileInsertObjects( 9782 psDB *dbh, ///< Database handle 9783 psArray *objects ///< array of magicInputSkyfileRow objects 9784 ); 9785 9786 /** Insert data from a binary FITS table magicInputSkyfileRow into the database 9787 * 9788 * This function expects a psFits object with a FITS table as the first 9789 * extension. The table must have at least one row of data in it, that is of 9790 * the appropriate format (number of columns and their type). All other 9791 * extensions are ignored. 9792 * 9793 * @return true on success 9794 */ 9795 9796 bool magicInputSkyfileInsertFits( 9797 psDB *dbh, ///< Database handle 9798 const psFits *fits ///< psFits object 9799 ); 9800 9801 /** Selects up to limit from the database and returns them in a binary FITS table 9802 * 9803 * This function assumes an empty psFits object and will create a FITS table 9804 * as the first extension. 9805 * 9806 * See psDBSelectRows() for documentation on the format of where. 9807 * 9808 * @return true on success 9809 */ 9810 9811 bool magicInputSkyfileSelectRowsFits( 9812 psDB *dbh, ///< Database handle 9813 psFits *fits, ///< psFits object 9814 const psMetadata *where, ///< Row match criteria 9815 unsigned long long limit ///< Maximum number of elements to return 9816 ); 9817 9818 /** Convert a magicInputSkyfileRow into an equivalent psMetadata 9819 * 9820 * @return A psMetadata pointer or NULL on error 9821 */ 9822 9823 psMetadata *magicInputSkyfileMetadataFromObject( 9824 const magicInputSkyfileRow *object ///< fooRow to convert into a psMetadata 9825 ); 9826 9827 /** Convert a psMetadata into an equivalent fooRow 9828 * 9829 * @return A magicInputSkyfileRow pointer or NULL on error 9830 */ 9831 9832 magicInputSkyfileRow *magicInputSkyfileObjectFromMetadata( 9833 psMetadata *md ///< psMetadata to convert into a fooRow 9834 ); 9835 /** Selects up to limit rows from the database and returns as magicInputSkyfileRow objects in a psArray 9836 * 9837 * See psDBSelectRows() for documentation on the format of where. 9838 * 9839 * @return A psArray pointer or NULL on error 9840 */ 9841 9842 psArray *magicInputSkyfileSelectRowObjects( 9843 psDB *dbh, ///< Database handle 9844 const psMetadata *where, ///< Row match criteria 9845 unsigned long long limit ///< Maximum number of elements to return 9846 ); 9847 /** Deletes a row from the database coresponding to an magicInputSkyfile 9848 * 9849 * Note that a 'where' search psMetadata is constructed from each object and 9850 * used to find rows to delete. 9851 * 9852 * @return A The number of rows removed or a negative value on error 9853 */ 9854 9855 bool magicInputSkyfileDeleteObject( 9856 psDB *dbh, ///< Database handle 9857 const magicInputSkyfileRow *object ///< Object to delete 9858 ); 9859 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 9860 * 9861 * Note that a 'where' search psMetadata is constructed from each object and 9862 * used to find rows to delete. 9863 * 9864 * @return A The number of rows removed or a negative value on error 9865 */ 9866 9867 long long magicInputSkyfileDeleteRowObjects( 9868 psDB *dbh, ///< Database handle 9869 const psArray *objects, ///< Array of objects to delete 9870 unsigned long long limit ///< Maximum number of elements to delete 9871 ); 9872 /** Formats and prints an array of magicInputSkyfileRow objects 9873 * 9874 * When mdcf is set the formated output is in psMetadataConfig 9875 * format, otherwise it is in a simple tabular format. 9876 * 9877 * @return true on success 9878 */ 9879 9880 bool magicInputSkyfilePrintObjects( 9881 FILE *stream, ///< a stream 9882 psArray *objects, ///< An array of magicInputSkyfileRow objects 9883 bool mdcf ///< format as mdconfig or simple 9884 ); 9885 /** Formats and prints an magicInputSkyfileRow object 9886 * 9887 * When mdcf is set the formated output is in psMetadataConfig 9888 * format, otherwise it is in a simple tabular format. 9889 * 9890 * @return true on success 9891 */ 9892 9893 bool magicInputSkyfilePrintObject( 9894 FILE *stream, ///< a stream 9895 magicInputSkyfileRow *object, ///< an magicInputSkyfileRow object 9896 bool mdcf ///< format as mdconfig or simple 9897 ); 9898 /** magicTreeRow data structure 9899 * 9900 * Structure for representing a single row of magicTree table data. 9901 */ 9902 9903 typedef struct { 9904 psS64 magic_id; 9905 char *node; 9906 char *dep; 9907 } magicTreeRow; 9908 9909 /** Creates a new magicTreeRow object 9910 * 9911 * @return A new magicTreeRow object or NULL on failure. 9912 */ 9913 9914 magicTreeRow *magicTreeRowAlloc( 9915 psS64 magic_id, 9916 const char *node, 9917 const char *dep 9918 ); 9919 9920 /** Creates a new magicTree table 9921 * 9922 * @return true on success 9923 */ 9924 9925 bool magicTreeCreateTable( 9926 psDB *dbh ///< Database handle 9927 ); 9928 9929 /** Deletes a magicTree table 9930 * 9931 * @return true on success 9932 */ 9933 9934 bool magicTreeDropTable( 9935 psDB *dbh ///< Database handle 9936 ); 9937 9938 /** Insert a single row into a table 9939 * 9940 * This function constructs and inserts a single row based on it's parameters. 9941 * 9942 * @return true on success 9943 */ 9944 9945 bool magicTreeInsert( 9946 psDB *dbh, ///< Database handle 9947 psS64 magic_id, 9948 const char *node, 9949 const char *dep 9950 ); 9951 9952 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 9953 * 9954 * @return A The number of rows removed or a negative value on error 9955 */ 9956 9957 long long magicTreeDelete( 9958 psDB *dbh, ///< Database handle 9959 const psMetadata *where, ///< Row match criteria 9960 unsigned long long limit ///< Maximum number of elements to delete 9961 ); 9962 9963 /** Insert a single magicTreeRow object into a table 9964 * 9965 * This function constructs and inserts a single row based on it's parameters. 9966 * 9967 * @return true on success 9968 */ 9969 9970 bool magicTreeInsertObject( 9971 psDB *dbh, ///< Database handle 9972 magicTreeRow *object ///< magicTreeRow object 9973 ); 9974 9975 /** Insert an array of magicTreeRow object into a table 9976 * 9977 * This function constructs and inserts multiple rows based on it's parameters. 9978 * 9979 * @return true on success 9980 */ 9981 9982 bool magicTreeInsertObjects( 9983 psDB *dbh, ///< Database handle 9984 psArray *objects ///< array of magicTreeRow objects 9985 ); 9986 9987 /** Insert data from a binary FITS table magicTreeRow into the database 9988 * 9989 * This function expects a psFits object with a FITS table as the first 9990 * extension. The table must have at least one row of data in it, that is of 9991 * the appropriate format (number of columns and their type). All other 9992 * extensions are ignored. 9993 * 9994 * @return true on success 9995 */ 9996 9997 bool magicTreeInsertFits( 9998 psDB *dbh, ///< Database handle 9999 const psFits *fits ///< psFits object 10000 ); 10001 10002 /** Selects up to limit from the database and returns them in a binary FITS table 10003 * 10004 * This function assumes an empty psFits object and will create a FITS table 10005 * as the first extension. 10006 * 10007 * See psDBSelectRows() for documentation on the format of where. 10008 * 10009 * @return true on success 10010 */ 10011 10012 bool magicTreeSelectRowsFits( 10013 psDB *dbh, ///< Database handle 10014 psFits *fits, ///< psFits object 10015 const psMetadata *where, ///< Row match criteria 10016 unsigned long long limit ///< Maximum number of elements to return 10017 ); 10018 10019 /** Convert a magicTreeRow into an equivalent psMetadata 10020 * 10021 * @return A psMetadata pointer or NULL on error 10022 */ 10023 10024 psMetadata *magicTreeMetadataFromObject( 10025 const magicTreeRow *object ///< fooRow to convert into a psMetadata 10026 ); 10027 10028 /** Convert a psMetadata into an equivalent fooRow 10029 * 10030 * @return A magicTreeRow pointer or NULL on error 10031 */ 10032 10033 magicTreeRow *magicTreeObjectFromMetadata( 10034 psMetadata *md ///< psMetadata to convert into a fooRow 10035 ); 10036 /** Selects up to limit rows from the database and returns as magicTreeRow objects in a psArray 10037 * 10038 * See psDBSelectRows() for documentation on the format of where. 10039 * 10040 * @return A psArray pointer or NULL on error 10041 */ 10042 10043 psArray *magicTreeSelectRowObjects( 10044 psDB *dbh, ///< Database handle 10045 const psMetadata *where, ///< Row match criteria 10046 unsigned long long limit ///< Maximum number of elements to return 10047 ); 10048 /** Deletes a row from the database coresponding to an magicTree 10049 * 10050 * Note that a 'where' search psMetadata is constructed from each object and 10051 * used to find rows to delete. 10052 * 10053 * @return A The number of rows removed or a negative value on error 10054 */ 10055 10056 bool magicTreeDeleteObject( 10057 psDB *dbh, ///< Database handle 10058 const magicTreeRow *object ///< Object to delete 10059 ); 10060 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 10061 * 10062 * Note that a 'where' search psMetadata is constructed from each object and 10063 * used to find rows to delete. 10064 * 10065 * @return A The number of rows removed or a negative value on error 10066 */ 10067 10068 long long magicTreeDeleteRowObjects( 10069 psDB *dbh, ///< Database handle 10070 const psArray *objects, ///< Array of objects to delete 10071 unsigned long long limit ///< Maximum number of elements to delete 10072 ); 10073 /** Formats and prints an array of magicTreeRow objects 10074 * 10075 * When mdcf is set the formated output is in psMetadataConfig 10076 * format, otherwise it is in a simple tabular format. 10077 * 10078 * @return true on success 10079 */ 10080 10081 bool magicTreePrintObjects( 10082 FILE *stream, ///< a stream 10083 psArray *objects, ///< An array of magicTreeRow objects 10084 bool mdcf ///< format as mdconfig or simple 10085 ); 10086 /** Formats and prints an magicTreeRow object 10087 * 10088 * When mdcf is set the formated output is in psMetadataConfig 10089 * format, otherwise it is in a simple tabular format. 10090 * 10091 * @return true on success 10092 */ 10093 10094 bool magicTreePrintObject( 10095 FILE *stream, ///< a stream 10096 magicTreeRow *object, ///< an magicTreeRow object 10097 bool mdcf ///< format as mdconfig or simple 10098 ); 10099 /** magicNodeResultRow data structure 10100 * 10101 * Structure for representing a single row of magicNodeResult table data. 10102 */ 10103 10104 typedef struct { 10105 psS64 magic_id; 10106 char *node; 10107 char *uri; 10108 } magicNodeResultRow; 10109 10110 /** Creates a new magicNodeResultRow object 10111 * 10112 * @return A new magicNodeResultRow object or NULL on failure. 10113 */ 10114 10115 magicNodeResultRow *magicNodeResultRowAlloc( 10116 psS64 magic_id, 10117 const char *node, 10118 const char *uri 10119 ); 10120 10121 /** Creates a new magicNodeResult table 10122 * 10123 * @return true on success 10124 */ 10125 10126 bool magicNodeResultCreateTable( 10127 psDB *dbh ///< Database handle 10128 ); 10129 10130 /** Deletes a magicNodeResult table 10131 * 10132 * @return true on success 10133 */ 10134 10135 bool magicNodeResultDropTable( 10136 psDB *dbh ///< Database handle 10137 ); 10138 10139 /** Insert a single row into a table 10140 * 10141 * This function constructs and inserts a single row based on it's parameters. 10142 * 10143 * @return true on success 10144 */ 10145 10146 bool magicNodeResultInsert( 10147 psDB *dbh, ///< Database handle 10148 psS64 magic_id, 10149 const char *node, 10150 const char *uri 10151 ); 10152 10153 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 10154 * 10155 * @return A The number of rows removed or a negative value on error 10156 */ 10157 10158 long long magicNodeResultDelete( 10159 psDB *dbh, ///< Database handle 10160 const psMetadata *where, ///< Row match criteria 10161 unsigned long long limit ///< Maximum number of elements to delete 10162 ); 10163 10164 /** Insert a single magicNodeResultRow object into a table 10165 * 10166 * This function constructs and inserts a single row based on it's parameters. 10167 * 10168 * @return true on success 10169 */ 10170 10171 bool magicNodeResultInsertObject( 10172 psDB *dbh, ///< Database handle 10173 magicNodeResultRow *object ///< magicNodeResultRow object 10174 ); 10175 10176 /** Insert an array of magicNodeResultRow object into a table 10177 * 10178 * This function constructs and inserts multiple rows based on it's parameters. 10179 * 10180 * @return true on success 10181 */ 10182 10183 bool magicNodeResultInsertObjects( 10184 psDB *dbh, ///< Database handle 10185 psArray *objects ///< array of magicNodeResultRow objects 10186 ); 10187 10188 /** Insert data from a binary FITS table magicNodeResultRow into the database 10189 * 10190 * This function expects a psFits object with a FITS table as the first 10191 * extension. The table must have at least one row of data in it, that is of 10192 * the appropriate format (number of columns and their type). All other 10193 * extensions are ignored. 10194 * 10195 * @return true on success 10196 */ 10197 10198 bool magicNodeResultInsertFits( 10199 psDB *dbh, ///< Database handle 10200 const psFits *fits ///< psFits object 10201 ); 10202 10203 /** Selects up to limit from the database and returns them in a binary FITS table 10204 * 10205 * This function assumes an empty psFits object and will create a FITS table 10206 * as the first extension. 10207 * 10208 * See psDBSelectRows() for documentation on the format of where. 10209 * 10210 * @return true on success 10211 */ 10212 10213 bool magicNodeResultSelectRowsFits( 10214 psDB *dbh, ///< Database handle 10215 psFits *fits, ///< psFits object 10216 const psMetadata *where, ///< Row match criteria 10217 unsigned long long limit ///< Maximum number of elements to return 10218 ); 10219 10220 /** Convert a magicNodeResultRow into an equivalent psMetadata 10221 * 10222 * @return A psMetadata pointer or NULL on error 10223 */ 10224 10225 psMetadata *magicNodeResultMetadataFromObject( 10226 const magicNodeResultRow *object ///< fooRow to convert into a psMetadata 10227 ); 10228 10229 /** Convert a psMetadata into an equivalent fooRow 10230 * 10231 * @return A magicNodeResultRow pointer or NULL on error 10232 */ 10233 10234 magicNodeResultRow *magicNodeResultObjectFromMetadata( 10235 psMetadata *md ///< psMetadata to convert into a fooRow 10236 ); 10237 /** Selects up to limit rows from the database and returns as magicNodeResultRow objects in a psArray 10238 * 10239 * See psDBSelectRows() for documentation on the format of where. 10240 * 10241 * @return A psArray pointer or NULL on error 10242 */ 10243 10244 psArray *magicNodeResultSelectRowObjects( 10245 psDB *dbh, ///< Database handle 10246 const psMetadata *where, ///< Row match criteria 10247 unsigned long long limit ///< Maximum number of elements to return 10248 ); 10249 /** Deletes a row from the database coresponding to an magicNodeResult 10250 * 10251 * Note that a 'where' search psMetadata is constructed from each object and 10252 * used to find rows to delete. 10253 * 10254 * @return A The number of rows removed or a negative value on error 10255 */ 10256 10257 bool magicNodeResultDeleteObject( 10258 psDB *dbh, ///< Database handle 10259 const magicNodeResultRow *object ///< Object to delete 10260 ); 10261 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 10262 * 10263 * Note that a 'where' search psMetadata is constructed from each object and 10264 * used to find rows to delete. 10265 * 10266 * @return A The number of rows removed or a negative value on error 10267 */ 10268 10269 long long magicNodeResultDeleteRowObjects( 10270 psDB *dbh, ///< Database handle 10271 const psArray *objects, ///< Array of objects to delete 10272 unsigned long long limit ///< Maximum number of elements to delete 10273 ); 10274 /** Formats and prints an array of magicNodeResultRow objects 10275 * 10276 * When mdcf is set the formated output is in psMetadataConfig 10277 * format, otherwise it is in a simple tabular format. 10278 * 10279 * @return true on success 10280 */ 10281 10282 bool magicNodeResultPrintObjects( 10283 FILE *stream, ///< a stream 10284 psArray *objects, ///< An array of magicNodeResultRow objects 10285 bool mdcf ///< format as mdconfig or simple 10286 ); 10287 /** Formats and prints an magicNodeResultRow object 10288 * 10289 * When mdcf is set the formated output is in psMetadataConfig 10290 * format, otherwise it is in a simple tabular format. 10291 * 10292 * @return true on success 10293 */ 10294 10295 bool magicNodeResultPrintObject( 10296 FILE *stream, ///< a stream 10297 magicNodeResultRow *object, ///< an magicNodeResultRow object 10298 bool mdcf ///< format as mdconfig or simple 10299 ); 10300 /** magicMaskRow data structure 10301 * 10302 * Structure for representing a single row of magicMask table data. 10303 */ 10304 10305 typedef struct { 10306 psS64 magic_id; 10307 char *uri; 10308 } magicMaskRow; 10309 10310 /** Creates a new magicMaskRow object 10311 * 10312 * @return A new magicMaskRow object or NULL on failure. 10313 */ 10314 10315 magicMaskRow *magicMaskRowAlloc( 10316 psS64 magic_id, 10317 const char *uri 10318 ); 10319 10320 /** Creates a new magicMask table 10321 * 10322 * @return true on success 10323 */ 10324 10325 bool magicMaskCreateTable( 10326 psDB *dbh ///< Database handle 10327 ); 10328 10329 /** Deletes a magicMask table 10330 * 10331 * @return true on success 10332 */ 10333 10334 bool magicMaskDropTable( 10335 psDB *dbh ///< Database handle 10336 ); 10337 10338 /** Insert a single row into a table 10339 * 10340 * This function constructs and inserts a single row based on it's parameters. 10341 * 10342 * @return true on success 10343 */ 10344 10345 bool magicMaskInsert( 10346 psDB *dbh, ///< Database handle 10347 psS64 magic_id, 10348 const char *uri 10349 ); 10350 10351 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 10352 * 10353 * @return A The number of rows removed or a negative value on error 10354 */ 10355 10356 long long magicMaskDelete( 10357 psDB *dbh, ///< Database handle 10358 const psMetadata *where, ///< Row match criteria 10359 unsigned long long limit ///< Maximum number of elements to delete 10360 ); 10361 10362 /** Insert a single magicMaskRow object into a table 10363 * 10364 * This function constructs and inserts a single row based on it's parameters. 10365 * 10366 * @return true on success 10367 */ 10368 10369 bool magicMaskInsertObject( 10370 psDB *dbh, ///< Database handle 10371 magicMaskRow *object ///< magicMaskRow object 10372 ); 10373 10374 /** Insert an array of magicMaskRow object into a table 10375 * 10376 * This function constructs and inserts multiple rows based on it's parameters. 10377 * 10378 * @return true on success 10379 */ 10380 10381 bool magicMaskInsertObjects( 10382 psDB *dbh, ///< Database handle 10383 psArray *objects ///< array of magicMaskRow objects 10384 ); 10385 10386 /** Insert data from a binary FITS table magicMaskRow into the database 10387 * 10388 * This function expects a psFits object with a FITS table as the first 10389 * extension. The table must have at least one row of data in it, that is of 10390 * the appropriate format (number of columns and their type). All other 10391 * extensions are ignored. 10392 * 10393 * @return true on success 10394 */ 10395 10396 bool magicMaskInsertFits( 10397 psDB *dbh, ///< Database handle 10398 const psFits *fits ///< psFits object 10399 ); 10400 10401 /** Selects up to limit from the database and returns them in a binary FITS table 10402 * 10403 * This function assumes an empty psFits object and will create a FITS table 10404 * as the first extension. 10405 * 10406 * See psDBSelectRows() for documentation on the format of where. 10407 * 10408 * @return true on success 10409 */ 10410 10411 bool magicMaskSelectRowsFits( 10412 psDB *dbh, ///< Database handle 10413 psFits *fits, ///< psFits object 10414 const psMetadata *where, ///< Row match criteria 10415 unsigned long long limit ///< Maximum number of elements to return 10416 ); 10417 10418 /** Convert a magicMaskRow into an equivalent psMetadata 10419 * 10420 * @return A psMetadata pointer or NULL on error 10421 */ 10422 10423 psMetadata *magicMaskMetadataFromObject( 10424 const magicMaskRow *object ///< fooRow to convert into a psMetadata 10425 ); 10426 10427 /** Convert a psMetadata into an equivalent fooRow 10428 * 10429 * @return A magicMaskRow pointer or NULL on error 10430 */ 10431 10432 magicMaskRow *magicMaskObjectFromMetadata( 10433 psMetadata *md ///< psMetadata to convert into a fooRow 10434 ); 10435 /** Selects up to limit rows from the database and returns as magicMaskRow objects in a psArray 10436 * 10437 * See psDBSelectRows() for documentation on the format of where. 10438 * 10439 * @return A psArray pointer or NULL on error 10440 */ 10441 10442 psArray *magicMaskSelectRowObjects( 10443 psDB *dbh, ///< Database handle 10444 const psMetadata *where, ///< Row match criteria 10445 unsigned long long limit ///< Maximum number of elements to return 10446 ); 10447 /** Deletes a row from the database coresponding to an magicMask 10448 * 10449 * Note that a 'where' search psMetadata is constructed from each object and 10450 * used to find rows to delete. 10451 * 10452 * @return A The number of rows removed or a negative value on error 10453 */ 10454 10455 bool magicMaskDeleteObject( 10456 psDB *dbh, ///< Database handle 10457 const magicMaskRow *object ///< Object to delete 10458 ); 10459 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 10460 * 10461 * Note that a 'where' search psMetadata is constructed from each object and 10462 * used to find rows to delete. 10463 * 10464 * @return A The number of rows removed or a negative value on error 10465 */ 10466 10467 long long magicMaskDeleteRowObjects( 10468 psDB *dbh, ///< Database handle 10469 const psArray *objects, ///< Array of objects to delete 10470 unsigned long long limit ///< Maximum number of elements to delete 10471 ); 10472 /** Formats and prints an array of magicMaskRow objects 10473 * 10474 * When mdcf is set the formated output is in psMetadataConfig 10475 * format, otherwise it is in a simple tabular format. 10476 * 10477 * @return true on success 10478 */ 10479 10480 bool magicMaskPrintObjects( 10481 FILE *stream, ///< a stream 10482 psArray *objects, ///< An array of magicMaskRow objects 10483 bool mdcf ///< format as mdconfig or simple 10484 ); 10485 /** Formats and prints an magicMaskRow object 10486 * 10487 * When mdcf is set the formated output is in psMetadataConfig 10488 * format, otherwise it is in a simple tabular format. 10489 * 10490 * @return true on success 10491 */ 10492 10493 bool magicMaskPrintObject( 10494 FILE *stream, ///< a stream 10495 magicMaskRow *object, ///< an magicMaskRow object 10496 bool mdcf ///< format as mdconfig or simple 10497 ); 10498 /** magicSkyfileMaskRow data structure 10499 * 10500 * Structure for representing a single row of magicSkyfileMask table data. 10501 */ 10502 10503 typedef struct { 10504 psS64 magic_id; 10505 psS64 diff_id; 10506 char *uri; 10507 } magicSkyfileMaskRow; 10508 10509 /** Creates a new magicSkyfileMaskRow object 10510 * 10511 * @return A new magicSkyfileMaskRow object or NULL on failure. 10512 */ 10513 10514 magicSkyfileMaskRow *magicSkyfileMaskRowAlloc( 10515 psS64 magic_id, 10516 psS64 diff_id, 10517 const char *uri 10518 ); 10519 10520 /** Creates a new magicSkyfileMask table 10521 * 10522 * @return true on success 10523 */ 10524 10525 bool magicSkyfileMaskCreateTable( 10526 psDB *dbh ///< Database handle 10527 ); 10528 10529 /** Deletes a magicSkyfileMask table 10530 * 10531 * @return true on success 10532 */ 10533 10534 bool magicSkyfileMaskDropTable( 10535 psDB *dbh ///< Database handle 10536 ); 10537 10538 /** Insert a single row into a table 10539 * 10540 * This function constructs and inserts a single row based on it's parameters. 10541 * 10542 * @return true on success 10543 */ 10544 10545 bool magicSkyfileMaskInsert( 10546 psDB *dbh, ///< Database handle 10547 psS64 magic_id, 10548 psS64 diff_id, 10549 const char *uri 10550 ); 10551 10552 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 10553 * 10554 * @return A The number of rows removed or a negative value on error 10555 */ 10556 10557 long long magicSkyfileMaskDelete( 10558 psDB *dbh, ///< Database handle 10559 const psMetadata *where, ///< Row match criteria 10560 unsigned long long limit ///< Maximum number of elements to delete 10561 ); 10562 10563 /** Insert a single magicSkyfileMaskRow object into a table 10564 * 10565 * This function constructs and inserts a single row based on it's parameters. 10566 * 10567 * @return true on success 10568 */ 10569 10570 bool magicSkyfileMaskInsertObject( 10571 psDB *dbh, ///< Database handle 10572 magicSkyfileMaskRow *object ///< magicSkyfileMaskRow object 10573 ); 10574 10575 /** Insert an array of magicSkyfileMaskRow object into a table 10576 * 10577 * This function constructs and inserts multiple rows based on it's parameters. 10578 * 10579 * @return true on success 10580 */ 10581 10582 bool magicSkyfileMaskInsertObjects( 10583 psDB *dbh, ///< Database handle 10584 psArray *objects ///< array of magicSkyfileMaskRow objects 10585 ); 10586 10587 /** Insert data from a binary FITS table magicSkyfileMaskRow into the database 10588 * 10589 * This function expects a psFits object with a FITS table as the first 10590 * extension. The table must have at least one row of data in it, that is of 10591 * the appropriate format (number of columns and their type). All other 10592 * extensions are ignored. 10593 * 10594 * @return true on success 10595 */ 10596 10597 bool magicSkyfileMaskInsertFits( 10598 psDB *dbh, ///< Database handle 10599 const psFits *fits ///< psFits object 10600 ); 10601 10602 /** Selects up to limit from the database and returns them in a binary FITS table 10603 * 10604 * This function assumes an empty psFits object and will create a FITS table 10605 * as the first extension. 10606 * 10607 * See psDBSelectRows() for documentation on the format of where. 10608 * 10609 * @return true on success 10610 */ 10611 10612 bool magicSkyfileMaskSelectRowsFits( 10613 psDB *dbh, ///< Database handle 10614 psFits *fits, ///< psFits object 10615 const psMetadata *where, ///< Row match criteria 10616 unsigned long long limit ///< Maximum number of elements to return 10617 ); 10618 10619 /** Convert a magicSkyfileMaskRow into an equivalent psMetadata 10620 * 10621 * @return A psMetadata pointer or NULL on error 10622 */ 10623 10624 psMetadata *magicSkyfileMaskMetadataFromObject( 10625 const magicSkyfileMaskRow *object ///< fooRow to convert into a psMetadata 10626 ); 10627 10628 /** Convert a psMetadata into an equivalent fooRow 10629 * 10630 * @return A magicSkyfileMaskRow pointer or NULL on error 10631 */ 10632 10633 magicSkyfileMaskRow *magicSkyfileMaskObjectFromMetadata( 10634 psMetadata *md ///< psMetadata to convert into a fooRow 10635 ); 10636 /** Selects up to limit rows from the database and returns as magicSkyfileMaskRow objects in a psArray 10637 * 10638 * See psDBSelectRows() for documentation on the format of where. 10639 * 10640 * @return A psArray pointer or NULL on error 10641 */ 10642 10643 psArray *magicSkyfileMaskSelectRowObjects( 10644 psDB *dbh, ///< Database handle 10645 const psMetadata *where, ///< Row match criteria 10646 unsigned long long limit ///< Maximum number of elements to return 10647 ); 10648 /** Deletes a row from the database coresponding to an magicSkyfileMask 10649 * 10650 * Note that a 'where' search psMetadata is constructed from each object and 10651 * used to find rows to delete. 10652 * 10653 * @return A The number of rows removed or a negative value on error 10654 */ 10655 10656 bool magicSkyfileMaskDeleteObject( 10657 psDB *dbh, ///< Database handle 10658 const magicSkyfileMaskRow *object ///< Object to delete 10659 ); 10660 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 10661 * 10662 * Note that a 'where' search psMetadata is constructed from each object and 10663 * used to find rows to delete. 10664 * 10665 * @return A The number of rows removed or a negative value on error 10666 */ 10667 10668 long long magicSkyfileMaskDeleteRowObjects( 10669 psDB *dbh, ///< Database handle 10670 const psArray *objects, ///< Array of objects to delete 10671 unsigned long long limit ///< Maximum number of elements to delete 10672 ); 10673 /** Formats and prints an array of magicSkyfileMaskRow objects 10674 * 10675 * When mdcf is set the formated output is in psMetadataConfig 10676 * format, otherwise it is in a simple tabular format. 10677 * 10678 * @return true on success 10679 */ 10680 10681 bool magicSkyfileMaskPrintObjects( 10682 FILE *stream, ///< a stream 10683 psArray *objects, ///< An array of magicSkyfileMaskRow objects 10684 bool mdcf ///< format as mdconfig or simple 10685 ); 10686 /** Formats and prints an magicSkyfileMaskRow object 10687 * 10688 * When mdcf is set the formated output is in psMetadataConfig 10689 * format, otherwise it is in a simple tabular format. 10690 * 10691 * @return true on success 10692 */ 10693 10694 bool magicSkyfileMaskPrintObject( 10695 FILE *stream, ///< a stream 10696 magicSkyfileMaskRow *object, ///< an magicSkyfileMaskRow object 10697 bool mdcf ///< format as mdconfig or simple 10698 ); 8776 10699 8777 10700 /// @} … … 8781 10704 #endif 8782 10705 8783 #endif // DETRUNSUMMARY_DB_H10706 #endif // MAGICSKYFILEMASK_DB_H
Note:
See TracChangeset
for help on using the changeset viewer.
