IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 30, 2007, 4:45:31 PM (19 years ago)
Author:
jhoblitt
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/src/ippdb.h

    r15420 r15421  
    125125);
    126126
     127/** pzDataStoreRow data structure
     128 *
     129 * Structure for representing a single row of pzDataStore table data.
     130 */
     131
     132typedef 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
     143pzDataStoreRow *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
     154bool pzDataStoreCreateTable(
     155    psDB            *dbh                ///< Database handle
     156);
     157
     158/** Deletes a pzDataStore table
     159 *
     160 * @return true on success
     161 */
     162
     163bool 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
     174bool 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
     186long 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
     199bool 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
     211bool 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
     226bool 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
     241bool 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
     253psMetadata *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
     262pzDataStoreRow *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
     272psArray *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
     285bool 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
     297long 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
     310bool 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
     323bool pzDataStorePrintObject(
     324    FILE            *stream,            ///< a stream
     325    pzDataStoreRow *object,    ///< an pzDataStoreRow object
     326    bool            mdcf                ///< format as mdconfig or simple
     327);
    127328/** summitExpRow data structure
    128329 *
     
    769970    char            *class;
    770971    char            *class_id;
    771     psS64           exp_id;
    772972} pzPendingImfileRow;
    773973
     
    782982    const char      *telescope,
    783983    const char      *class,
    784     const char      *class_id,
    785     psS64           exp_id
     984    const char      *class_id
    786985);
    787986
     
    8171016    const char      *telescope,
    8181017    const char      *class,
    819     const char      *class_id,
    820     psS64           exp_id
     1018    const char      *class_id
    8211019);
    8221020
     
    11801378    char            *class;
    11811379    char            *class_id;
    1182     psS64           exp_id;
    11831380    char            *uri;
    11841381} pzDoneImfileRow;
     
    11951392    const char      *class,
    11961393    const char      *class_id,
    1197     psS64           exp_id,
    11981394    const char      *uri
    11991395);
     
    12311427    const char      *class,
    12321428    const char      *class_id,
    1233     psS64           exp_id,
    12341429    const char      *uri
    12351430);
     
    13931588    char            *tmp_telescope;
    13941589    char            *state;
    1395     psS32           imfiles;
    13961590    char            *workdir;
    13971591    char            *workdir_state;
     1592    char            *reduction;
    13981593} newExpRow;
    13991594
     
    14091604    const char      *tmp_telescope,
    14101605    const char      *state,
    1411     psS32           imfiles,
    14121606    const char      *workdir,
    1413     const char      *workdir_state
     1607    const char      *workdir_state,
     1608    const char      *reduction
    14141609);
    14151610
     
    14461641    const char      *tmp_telescope,
    14471642    const char      *state,
    1448     psS32           imfiles,
    14491643    const char      *workdir,
    1450     const char      *workdir_state
     1644    const char      *workdir_state,
     1645    const char      *reduction
    14511646);
    14521647
     
    18122007    char            *exp_tag;
    18132008    char            *exp_type;
    1814     psS32           imfiles;
    18152009    char            *filelevel;
    18162010    char            *workdir;
     2011    char            *reduction;
    18172012    char            *filter;
    18182013    psF32           airmass;
     
    18512046    const char      *exp_tag,
    18522047    const char      *exp_type,
    1853     psS32           imfiles,
    18542048    const char      *filelevel,
    18552049    const char      *workdir,
     2050    const char      *reduction,
    18562051    const char      *filter,
    18572052    psF32           airmass,
     
    19112106    const char      *exp_tag,
    19122107    const char      *exp_type,
    1913     psS32           imfiles,
    19142108    const char      *filelevel,
    19152109    const char      *workdir,
     2110    const char      *reduction,
    19162111    const char      *filter,
    19172112    psF32           airmass,
     
    25742769typedef struct {
    25752770    psS64           chip_id;
     2771    psS64           exp_id;
    25762772    char            *state;
    25772773    char            *workdir;
     
    25902786chipRunRow *chipRunRowAlloc(
    25912787    psS64           chip_id,
     2788    psS64           exp_id,
    25922789    const char      *state,
    25932790    const char      *workdir,
     
    26272824    psDB            *dbh,               ///< Database handle
    26282825    psS64           chip_id,
     2826    psS64           exp_id,
    26292827    const char      *state,
    26302828    const char      *workdir,
     
    27812979    FILE            *stream,            ///< a stream
    27822980    chipRunRow *object,    ///< an chipRunRow object
    2783     bool            mdcf                ///< format as mdconfig or simple
    2784 );
    2785 /** chipInputImfileRow data structure
    2786  *
    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 object
    2797  *
    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_id
    2805 );
    2806 
    2807 /** Creates a new chipInputImfile table
    2808  *
    2809  * @return true on success
    2810  */
    2811 
    2812 bool chipInputImfileCreateTable(
    2813     psDB            *dbh                ///< Database handle
    2814 );
    2815 
    2816 /** Deletes a chipInputImfile table
    2817  *
    2818  * @return true on success
    2819  */
    2820 
    2821 bool chipInputImfileDropTable(
    2822     psDB            *dbh                ///< Database handle
    2823 );
    2824 
    2825 /** Insert a single row into a table
    2826  *
    2827  * This function constructs and inserts a single row based on it's parameters.
    2828  *
    2829  * @return true on success
    2830  */
    2831 
    2832 bool chipInputImfileInsert(
    2833     psDB            *dbh,               ///< Database handle
    2834     psS64           chip_id,
    2835     psS64           exp_id,
    2836     const char      *class_id
    2837 );
    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 error
    2842  */
    2843 
    2844 long long chipInputImfileDelete(
    2845     psDB            *dbh,               ///< Database handle
    2846     const psMetadata *where,            ///< Row match criteria
    2847     unsigned long long limit            ///< Maximum number of elements to delete
    2848 );
    2849 
    2850 /** Insert a single chipInputImfileRow object into a table
    2851  *
    2852  * This function constructs and inserts a single row based on it's parameters.
    2853  *
    2854  * @return true on success
    2855  */
    2856 
    2857 bool chipInputImfileInsertObject(
    2858     psDB            *dbh,               ///< Database handle
    2859     chipInputImfileRow *object             ///< chipInputImfileRow object
    2860 );
    2861 
    2862 /** Insert an array of chipInputImfileRow object into a table
    2863  *
    2864  * This function constructs and inserts multiple rows based on it's parameters.
    2865  *
    2866  * @return true on success
    2867  */
    2868 
    2869 bool chipInputImfileInsertObjects(
    2870     psDB            *dbh,               ///< Database handle
    2871     psArray         *objects            ///< array of chipInputImfileRow objects
    2872 );
    2873 
    2874 /** Insert data from a binary FITS table chipInputImfileRow into the database
    2875  *
    2876  * This function expects a psFits object with a FITS table as the first
    2877  * extension.  The table must have at least one row of data in it, that is of
    2878  * the appropriate format (number of columns and their type).  All other
    2879  * extensions are ignored.
    2880  *
    2881  * @return true on success
    2882  */
    2883 
    2884 bool chipInputImfileInsertFits(
    2885     psDB            *dbh,               ///< Database handle
    2886     const psFits    *fits               ///< psFits object
    2887 );
    2888 
    2889 /** Selects up to limit from the database and returns them in a binary FITS table
    2890  *
    2891  * This function assumes an empty psFits object and will create a FITS table
    2892  * as the first extension.
    2893  *
    2894  *  See psDBSelectRows() for documentation on the format of where.
    2895  *
    2896  * @return true on success
    2897  */
    2898 
    2899 bool chipInputImfileSelectRowsFits(
    2900     psDB            *dbh,               ///< Database handle
    2901     psFits          *fits,              ///< psFits object
    2902     const psMetadata *where,            ///< Row match criteria
    2903     unsigned long long limit            ///< Maximum number of elements to return
    2904 );
    2905 
    2906 /** Convert a chipInputImfileRow into an equivalent psMetadata
    2907  *
    2908  * @return A psMetadata pointer or NULL on error
    2909  */
    2910 
    2911 psMetadata *chipInputImfileMetadataFromObject(
    2912     const chipInputImfileRow *object             ///< fooRow to convert into a psMetadata
    2913 );
    2914 
    2915 /** Convert a psMetadata into an equivalent fooRow
    2916  *
    2917  * @return A chipInputImfileRow pointer or NULL on error
    2918  */
    2919 
    2920 chipInputImfileRow *chipInputImfileObjectFromMetadata(
    2921     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    2922 );
    2923 /** Selects up to limit rows from the database and returns as chipInputImfileRow objects in a psArray
    2924  *
    2925  *  See psDBSelectRows() for documentation on the format of where.
    2926  *
    2927  * @return A psArray pointer or NULL on error
    2928  */
    2929 
    2930 psArray *chipInputImfileSelectRowObjects(
    2931     psDB            *dbh,               ///< Database handle
    2932     const psMetadata *where,            ///< Row match criteria
    2933     unsigned long long limit            ///< Maximum number of elements to return
    2934 );
    2935 /** Deletes a row from the database coresponding to an chipInputImfile
    2936  *
    2937  *  Note that a 'where' search psMetadata is constructed from each object and
    2938  *  used to find rows to delete.
    2939  *
    2940  * @return A The number of rows removed or a negative value on error
    2941  */
    2942 
    2943 bool chipInputImfileDeleteObject(
    2944     psDB            *dbh,               ///< Database handle
    2945     const chipInputImfileRow *object    ///< Object to delete
    2946 );
    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 and
    2950  *  used to find rows to delete.
    2951  *
    2952  * @return A The number of rows removed or a negative value on error
    2953  */
    2954 
    2955 long long chipInputImfileDeleteRowObjects(
    2956     psDB            *dbh,               ///< Database handle
    2957     const psArray   *objects,           ///< Array of objects to delete
    2958     unsigned long long limit            ///< Maximum number of elements to delete
    2959 );
    2960 /** Formats and prints an array of chipInputImfileRow objects
    2961  *
    2962  * When mdcf is set the formated output is in psMetadataConfig
    2963  * format, otherwise it is in a simple tabular format.
    2964  *
    2965  * @return true on success
    2966  */
    2967 
    2968 bool chipInputImfilePrintObjects(
    2969     FILE            *stream,            ///< a stream
    2970     psArray         *objects,           ///< An array of chipInputImfileRow objects
    2971     bool            mdcf                ///< format as mdconfig or simple
    2972 );
    2973 /** Formats and prints an chipInputImfileRow object
    2974  *
    2975  * When mdcf is set the formated output is in psMetadataConfig
    2976  * format, otherwise it is in a simple tabular format.
    2977  *
    2978  * @return true on success
    2979  */
    2980 
    2981 bool chipInputImfilePrintObject(
    2982     FILE            *stream,            ///< a stream
    2983     chipInputImfileRow *object,    ///< an chipInputImfileRow object
    29842981    bool            mdcf                ///< format as mdconfig or simple
    29852982);
     
    47374734    psF64           bg;
    47384735    psF64           bg_stdev;
     4736    psF64           good_frac;
     4737    psS16           fault;
    47394738} warpSkyfileRow;
    47404739
     
    47514750    const char      *path_base,
    47524751    psF64           bg,
    4753     psF64           bg_stdev
     4752    psF64           bg_stdev,
     4753    psF64           good_frac,
     4754    psS16           fault
    47544755);
    47554756
     
    47874788    const char      *path_base,
    47884789    psF64           bg,
    4789     psF64           bg_stdev
     4790    psF64           bg_stdev,
     4791    psF64           good_frac,
     4792    psS16           fault
    47904793);
    47914794
     
    51575160typedef struct {
    51585161    psS64           diff_id;
     5162    bool            template;
     5163    psS64           stack_id;
    51595164    psS64           warp_id;
    51605165    char            *skycell_id;
    51615166    char            *tess_id;
    51625167    char            *kind;
    5163     bool            template;
    51645168} diffInputSkyfileRow;
    51655169
     
    51715175diffInputSkyfileRow *diffInputSkyfileRowAlloc(
    51725176    psS64           diff_id,
     5177    bool            template,
     5178    psS64           stack_id,
    51735179    psS64           warp_id,
    51745180    const char      *skycell_id,
    51755181    const char      *tess_id,
    5176     const char      *kind,
    5177     bool            template
     5182    const char      *kind
    51785183);
    51795184
     
    52065211    psDB            *dbh,               ///< Database handle
    52075212    psS64           diff_id,
     5213    bool            template,
     5214    psS64           stack_id,
    52085215    psS64           warp_id,
    52095216    const char      *skycell_id,
    52105217    const char      *tess_id,
    5211     const char      *kind,
    5212     bool            template
     5218    const char      *kind
    52135219);
    52145220
     
    53715377    psF64           bg;
    53725378    psF64           bg_stdev;
     5379    psF64           good_frac;
     5380    psS16           fault;
    53735381} diffSkyfileRow;
    53745382
     
    53835391    const char      *path_base,
    53845392    psF64           bg,
    5385     psF64           bg_stdev
     5393    psF64           bg_stdev,
     5394    psF64           good_frac,
     5395    psS16           fault
    53865396);
    53875397
     
    54175427    const char      *path_base,
    54185428    psF64           bg,
    5419     psF64           bg_stdev
     5429    psF64           bg_stdev,
     5430    psF64           good_frac,
     5431    psS16           fault
    54205432);
    54215433
     
    59896001    psF64           bg;
    59906002    psF64           bg_stdev;
     6003    psF64           good_frac;
     6004    psS16           fault;
    59916005} stackSumSkyfileRow;
    59926006
     
    60016015    const char      *path_base,
    60026016    psF64           bg,
    6003     psF64           bg_stdev
     6017    psF64           bg_stdev,
     6018    psF64           good_frac,
     6019    psS16           fault
    60046020);
    60056021
     
    60356051    const char      *path_base,
    60366052    psF64           bg,
    6037     psF64           bg_stdev
     6053    psF64           bg_stdev,
     6054    psF64           good_frac,
     6055    psS16           fault
    60386056);
    60396057
     
    80758093    psF64           bg_stdev;
    80768094    psF64           bg_mean_stdev;
     8095    psF64           bg_skewness;
     8096    psF64           bg_kurtosis;
    80778097    psF64           bin_stdev;
    80788098    psF64           fringe_0;
    80798099    psF64           fringe_1;
    80808100    psF64           fringe_2;
     8101    psF64           fringe_resid_0;
     8102    psF64           fringe_resid_1;
     8103    psF64           fringe_resid_2;
    80818104    psF64           user_1;
    80828105    psF64           user_2;
     
    81038126    psF64           bg_stdev,
    81048127    psF64           bg_mean_stdev,
     8128    psF64           bg_skewness,
     8129    psF64           bg_kurtosis,
    81058130    psF64           bin_stdev,
    81068131    psF64           fringe_0,
    81078132    psF64           fringe_1,
    81088133    psF64           fringe_2,
     8134    psF64           fringe_resid_0,
     8135    psF64           fringe_resid_1,
     8136    psF64           fringe_resid_2,
    81098137    psF64           user_1,
    81108138    psF64           user_2,
     
    81528180    psF64           bg_stdev,
    81538181    psF64           bg_mean_stdev,
     8182    psF64           bg_skewness,
     8183    psF64           bg_kurtosis,
    81548184    psF64           bin_stdev,
    81558185    psF64           fringe_0,
    81568186    psF64           fringe_1,
    81578187    psF64           fringe_2,
     8188    psF64           fringe_resid_0,
     8189    psF64           fringe_resid_1,
     8190    psF64           fringe_resid_2,
    81588191    psF64           user_1,
    81598192    psF64           user_2,
     
    83258358    psF64           bg_stdev;
    83268359    psF64           bg_mean_stdev;
     8360    psF64           bg_skewness;
     8361    psF64           bg_kurtosis;
    83278362    psF64           bin_stdev;
    83288363    psF64           fringe_0;
    83298364    psF64           fringe_1;
    83308365    psF64           fringe_2;
     8366    psF64           fringe_resid_0;
     8367    psF64           fringe_resid_1;
     8368    psF64           fringe_resid_2;
    83318369    psF64           user_1;
    83328370    psF64           user_2;
     
    83528390    psF64           bg_stdev,
    83538391    psF64           bg_mean_stdev,
     8392    psF64           bg_skewness,
     8393    psF64           bg_kurtosis,
    83548394    psF64           bin_stdev,
    83558395    psF64           fringe_0,
    83568396    psF64           fringe_1,
    83578397    psF64           fringe_2,
     8398    psF64           fringe_resid_0,
     8399    psF64           fringe_resid_1,
     8400    psF64           fringe_resid_2,
    83588401    psF64           user_1,
    83598402    psF64           user_2,
     
    84008443    psF64           bg_stdev,
    84018444    psF64           bg_mean_stdev,
     8445    psF64           bg_skewness,
     8446    psF64           bg_kurtosis,
    84028447    psF64           bin_stdev,
    84038448    psF64           fringe_0,
    84048449    psF64           fringe_1,
    84058450    psF64           fringe_2,
     8451    psF64           fringe_resid_0,
     8452    psF64           fringe_resid_1,
     8453    psF64           fringe_resid_2,
    84068454    psF64           user_1,
    84078455    psF64           user_2,
     
    87748822    bool            mdcf                ///< format as mdconfig or simple
    87758823);
     8824/** detRegisteredImfileRow data structure
     8825 *
     8826 * Structure for representing a single row of detRegisteredImfile table data.
     8827 */
     8828
     8829typedef 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
     8851detRegisteredImfileRow *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
     8873bool detRegisteredImfileCreateTable(
     8874    psDB            *dbh                ///< Database handle
     8875);
     8876
     8877/** Deletes a detRegisteredImfile table
     8878 *
     8879 * @return true on success
     8880 */
     8881
     8882bool 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
     8893bool 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
     8916long 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
     8929bool 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
     8941bool 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
     8956bool 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
     8971bool 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
     8983psMetadata *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
     8992detRegisteredImfileRow *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
     9002psArray *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
     9015bool 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
     9027long 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
     9040bool 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
     9053bool 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
     9063typedef 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
     9079detCorrectedExpRow *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
     9095bool detCorrectedExpCreateTable(
     9096    psDB            *dbh                ///< Database handle
     9097);
     9098
     9099/** Deletes a detCorrectedExp table
     9100 *
     9101 * @return true on success
     9102 */
     9103
     9104bool 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
     9115bool 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
     9132long 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
     9145bool 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
     9157bool 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
     9172bool 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
     9187bool 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
     9199psMetadata *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
     9208detCorrectedExpRow *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
     9218psArray *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
     9231bool 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
     9243long 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
     9256bool 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
     9269bool 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
     9279typedef 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
     9293detCorrectedImfileRow *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
     9307bool detCorrectedImfileCreateTable(
     9308    psDB            *dbh                ///< Database handle
     9309);
     9310
     9311/** Deletes a detCorrectedImfile table
     9312 *
     9313 * @return true on success
     9314 */
     9315
     9316bool 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
     9327bool 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
     9342long 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
     9355bool 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
     9367bool 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
     9382bool 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
     9397bool 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
     9409psMetadata *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
     9418detCorrectedImfileRow *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
     9428psArray *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
     9441bool 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
     9453long 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
     9466bool 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
     9479bool 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
     9489typedef 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
     9504magicRunRow *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
     9519bool magicRunCreateTable(
     9520    psDB            *dbh                ///< Database handle
     9521);
     9522
     9523/** Deletes a magicRun table
     9524 *
     9525 * @return true on success
     9526 */
     9527
     9528bool 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
     9539bool 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
     9555long 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
     9568bool 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
     9580bool 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
     9595bool 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
     9610bool 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
     9622psMetadata *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
     9631magicRunRow *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
     9641psArray *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
     9654bool 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
     9666long 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
     9679bool 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
     9692bool 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
     9702typedef 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
     9713magicInputSkyfileRow *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
     9724bool magicInputSkyfileCreateTable(
     9725    psDB            *dbh                ///< Database handle
     9726);
     9727
     9728/** Deletes a magicInputSkyfile table
     9729 *
     9730 * @return true on success
     9731 */
     9732
     9733bool 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
     9744bool 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
     9756long 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
     9769bool 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
     9781bool 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
     9796bool 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
     9811bool 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
     9823psMetadata *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
     9832magicInputSkyfileRow *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
     9842psArray *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
     9855bool 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
     9867long 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
     9880bool 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
     9893bool 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
     9903typedef 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
     9914magicTreeRow *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
     9925bool magicTreeCreateTable(
     9926    psDB            *dbh                ///< Database handle
     9927);
     9928
     9929/** Deletes a magicTree table
     9930 *
     9931 * @return true on success
     9932 */
     9933
     9934bool 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
     9945bool 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
     9957long 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
     9970bool 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
     9982bool 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
     9997bool 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
     10012bool 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
     10024psMetadata *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
     10033magicTreeRow *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
     10043psArray *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
     10056bool 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
     10068long 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
     10081bool 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
     10094bool 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
     10104typedef 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
     10115magicNodeResultRow *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
     10126bool magicNodeResultCreateTable(
     10127    psDB            *dbh                ///< Database handle
     10128);
     10129
     10130/** Deletes a magicNodeResult table
     10131 *
     10132 * @return true on success
     10133 */
     10134
     10135bool 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
     10146bool 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
     10158long 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
     10171bool 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
     10183bool 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
     10198bool 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
     10213bool 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
     10225psMetadata *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
     10234magicNodeResultRow *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
     10244psArray *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
     10257bool 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
     10269long 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
     10282bool 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
     10295bool 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
     10305typedef 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
     10315magicMaskRow *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
     10325bool magicMaskCreateTable(
     10326    psDB            *dbh                ///< Database handle
     10327);
     10328
     10329/** Deletes a magicMask table
     10330 *
     10331 * @return true on success
     10332 */
     10333
     10334bool 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
     10345bool 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
     10356long 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
     10369bool 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
     10381bool 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
     10396bool 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
     10411bool 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
     10423psMetadata *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
     10432magicMaskRow *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
     10442psArray *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
     10455bool 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
     10467long 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
     10480bool 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
     10493bool 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
     10503typedef 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
     10514magicSkyfileMaskRow *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
     10525bool magicSkyfileMaskCreateTable(
     10526    psDB            *dbh                ///< Database handle
     10527);
     10528
     10529/** Deletes a magicSkyfileMask table
     10530 *
     10531 * @return true on success
     10532 */
     10533
     10534bool 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
     10545bool 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
     10557long 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
     10570bool 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
     10582bool 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
     10597bool 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
     10612bool 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
     10624psMetadata *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
     10633magicSkyfileMaskRow *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
     10643psArray *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
     10656bool 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
     10668long 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
     10681bool 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
     10694bool magicSkyfileMaskPrintObject(
     10695    FILE            *stream,            ///< a stream
     10696    magicSkyfileMaskRow *object,    ///< an magicSkyfileMaskRow object
     10697    bool            mdcf                ///< format as mdconfig or simple
     10698);
    877610699
    877710700/// @}
     
    878110704#endif
    878210705
    8783 #endif // DETRUNSUMMARY_DB_H
     10706#endif // MAGICSKYFILEMASK_DB_H
Note: See TracChangeset for help on using the changeset viewer.