IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

update

File:
1 edited

Legend:

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

    r15343 r15420  
    2020/*
    2121 *
    22  * This file was generated by glueforge 1.01
     22 * This file was generated by glueforge 1.03
    2323 *
    2424 * Do NOT directly edit this file.
     
    125125);
    126126
    127 /** pzDataStoreRow data structure
    128  *
    129  * Structure for representing a single row of pzDataStore table data.
    130  */
    131 
    132 typedef struct {
    133     char            *camera;
    134     char            *telescope;
    135     char            *uri;
    136 } pzDataStoreRow;
    137 
    138 /** Creates a new pzDataStoreRow object
    139  *
    140  *  @return A new pzDataStoreRow object or NULL on failure.
    141  */
    142 
    143 pzDataStoreRow *pzDataStoreRowAlloc(
    144     const char      *camera,
    145     const char      *telescope,
    146     const char      *uri
    147 );
    148 
    149 /** Creates a new pzDataStore table
    150  *
    151  * @return true on success
    152  */
    153 
    154 bool pzDataStoreCreateTable(
    155     psDB            *dbh                ///< Database handle
    156 );
    157 
    158 /** Deletes a pzDataStore table
    159  *
    160  * @return true on success
    161  */
    162 
    163 bool pzDataStoreDropTable(
    164     psDB            *dbh                ///< Database handle
    165 );
    166 
    167 /** Insert a single row into a table
    168  *
    169  * This function constructs and inserts a single row based on it's parameters.
    170  *
    171  * @return true on success
    172  */
    173 
    174 bool pzDataStoreInsert(
    175     psDB            *dbh,               ///< Database handle
    176     const char      *camera,
    177     const char      *telescope,
    178     const char      *uri
    179 );
    180 
    181 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    182  *
    183  * @return A The number of rows removed or a negative value on error
    184  */
    185 
    186 long long pzDataStoreDelete(
    187     psDB            *dbh,               ///< Database handle
    188     const psMetadata *where,            ///< Row match criteria
    189     unsigned long long limit            ///< Maximum number of elements to delete
    190 );
    191 
    192 /** Insert a single pzDataStoreRow object into a table
    193  *
    194  * This function constructs and inserts a single row based on it's parameters.
    195  *
    196  * @return true on success
    197  */
    198 
    199 bool pzDataStoreInsertObject(
    200     psDB            *dbh,               ///< Database handle
    201     pzDataStoreRow  *object             ///< pzDataStoreRow object
    202 );
    203 
    204 /** Insert an array of pzDataStoreRow object into a table
    205  *
    206  * This function constructs and inserts multiple rows based on it's parameters.
    207  *
    208  * @return true on success
    209  */
    210 
    211 bool pzDataStoreInsertObjects(
    212     psDB            *dbh,               ///< Database handle
    213     psArray         *objects            ///< array of pzDataStoreRow objects
    214 );
    215 
    216 /** Insert data from a binary FITS table pzDataStoreRow into the database
    217  *
    218  * This function expects a psFits object with a FITS table as the first
    219  * extension.  The table must have at least one row of data in it, that is of
    220  * the appropriate format (number of columns and their type).  All other
    221  * extensions are ignored.
    222  *
    223  * @return true on success
    224  */
    225 
    226 bool pzDataStoreInsertFits(
    227     psDB            *dbh,               ///< Database handle
    228     const psFits    *fits               ///< psFits object
    229 );
    230 
    231 /** Selects up to limit from the database and returns them in a binary FITS table
    232  *
    233  * This function assumes an empty psFits object and will create a FITS table
    234  * as the first extension.
    235  *
    236  *  See psDBSelectRows() for documentation on the format of where.
    237  *
    238  * @return true on success
    239  */
    240 
    241 bool pzDataStoreSelectRowsFits(
    242     psDB            *dbh,               ///< Database handle
    243     psFits          *fits,              ///< psFits object
    244     const psMetadata *where,            ///< Row match criteria
    245     unsigned long long limit            ///< Maximum number of elements to return
    246 );
    247 
    248 /** Convert a pzDataStoreRow into an equivalent psMetadata
    249  *
    250  * @return A psMetadata pointer or NULL on error
    251  */
    252 
    253 psMetadata *pzDataStoreMetadataFromObject(
    254     const pzDataStoreRow *object             ///< fooRow to convert into a psMetadata
    255 );
    256 
    257 /** Convert a psMetadata into an equivalent fooRow
    258  *
    259  * @return A pzDataStoreRow pointer or NULL on error
    260  */
    261 
    262 pzDataStoreRow *pzDataStoreObjectFromMetadata(
    263     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    264 );
    265 /** Selects up to limit rows from the database and returns as pzDataStoreRow objects in a psArray
    266  *
    267  *  See psDBSelectRows() for documentation on the format of where.
    268  *
    269  * @return A psArray pointer or NULL on error
    270  */
    271 
    272 psArray *pzDataStoreSelectRowObjects(
    273     psDB            *dbh,               ///< Database handle
    274     const psMetadata *where,            ///< Row match criteria
    275     unsigned long long limit            ///< Maximum number of elements to return
    276 );
    277 /** Deletes a row from the database coresponding to an pzDataStore
    278  *
    279  *  Note that a 'where' search psMetadata is constructed from each object and
    280  *  used to find rows to delete.
    281  *
    282  * @return A The number of rows removed or a negative value on error
    283  */
    284 
    285 bool pzDataStoreDeleteObject(
    286     psDB            *dbh,               ///< Database handle
    287     const pzDataStoreRow *object    ///< Object to delete
    288 );
    289 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    290  *
    291  *  Note that a 'where' search psMetadata is constructed from each object and
    292  *  used to find rows to delete.
    293  *
    294  * @return A The number of rows removed or a negative value on error
    295  */
    296 
    297 long long pzDataStoreDeleteRowObjects(
    298     psDB            *dbh,               ///< Database handle
    299     const psArray   *objects,           ///< Array of objects to delete
    300     unsigned long long limit            ///< Maximum number of elements to delete
    301 );
    302 /** Formats and prints an array of pzDataStoreRow objects
    303  *
    304  * When mdcf is set the formated output is in psMetadataConfig
    305  * format, otherwise it is in a simple tabular format.
    306  *
    307  * @return true on success
    308  */
    309 
    310 bool pzDataStorePrintObjects(
    311     FILE            *stream,            ///< a stream
    312     psArray         *objects,           ///< An array of pzDataStoreRow objects
    313     bool            mdcf                ///< format as mdconfig or simple
    314 );
    315 /** Formats and prints an pzDataStoreRow object
    316  *
    317  * When mdcf is set the formated output is in psMetadataConfig
    318  * format, otherwise it is in a simple tabular format.
    319  *
    320  * @return true on success
    321  */
    322 
    323 bool pzDataStorePrintObject(
    324     FILE            *stream,            ///< a stream
    325     pzDataStoreRow *object,    ///< an pzDataStoreRow object
    326     bool            mdcf                ///< format as mdconfig or simple
    327 );
    328127/** summitExpRow data structure
    329128 *
     
    970769    char            *class;
    971770    char            *class_id;
     771    psS64           exp_id;
    972772} pzPendingImfileRow;
    973773
     
    982782    const char      *telescope,
    983783    const char      *class,
    984     const char      *class_id
     784    const char      *class_id,
     785    psS64           exp_id
    985786);
    986787
     
    1016817    const char      *telescope,
    1017818    const char      *class,
    1018     const char      *class_id
     819    const char      *class_id,
     820    psS64           exp_id
    1019821);
    1020822
     
    13781180    char            *class;
    13791181    char            *class_id;
     1182    psS64           exp_id;
    13801183    char            *uri;
    13811184} pzDoneImfileRow;
     
    13921195    const char      *class,
    13931196    const char      *class_id,
     1197    psS64           exp_id,
    13941198    const char      *uri
    13951199);
     
    14271231    const char      *class,
    14281232    const char      *class_id,
     1233    psS64           exp_id,
    14291234    const char      *uri
    14301235);
     
    15881393    char            *tmp_telescope;
    15891394    char            *state;
     1395    psS32           imfiles;
    15901396    char            *workdir;
    15911397    char            *workdir_state;
    1592     char            *reduction;
    15931398} newExpRow;
    15941399
     
    16041409    const char      *tmp_telescope,
    16051410    const char      *state,
     1411    psS32           imfiles,
    16061412    const char      *workdir,
    1607     const char      *workdir_state,
    1608     const char      *reduction
     1413    const char      *workdir_state
    16091414);
    16101415
     
    16411446    const char      *tmp_telescope,
    16421447    const char      *state,
     1448    psS32           imfiles,
    16431449    const char      *workdir,
    1644     const char      *workdir_state,
    1645     const char      *reduction
     1450    const char      *workdir_state
    16461451);
    16471452
     
    20071812    char            *exp_tag;
    20081813    char            *exp_type;
     1814    psS32           imfiles;
    20091815    char            *filelevel;
    20101816    char            *workdir;
    2011     char            *reduction;
    20121817    char            *filter;
    20131818    psF32           airmass;
     
    20461851    const char      *exp_tag,
    20471852    const char      *exp_type,
     1853    psS32           imfiles,
    20481854    const char      *filelevel,
    20491855    const char      *workdir,
    2050     const char      *reduction,
    20511856    const char      *filter,
    20521857    psF32           airmass,
     
    21061911    const char      *exp_tag,
    21071912    const char      *exp_type,
     1913    psS32           imfiles,
    21081914    const char      *filelevel,
    21091915    const char      *workdir,
    2110     const char      *reduction,
    21111916    const char      *filter,
    21121917    psF32           airmass,
     
    27692574typedef struct {
    27702575    psS64           chip_id;
    2771     psS64           exp_id;
    27722576    char            *state;
    27732577    char            *workdir;
     
    27862590chipRunRow *chipRunRowAlloc(
    27872591    psS64           chip_id,
    2788     psS64           exp_id,
    27892592    const char      *state,
    27902593    const char      *workdir,
     
    28242627    psDB            *dbh,               ///< Database handle
    28252628    psS64           chip_id,
    2826     psS64           exp_id,
    28272629    const char      *state,
    28282630    const char      *workdir,
     
    29792781    FILE            *stream,            ///< a stream
    29802782    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
     2790typedef 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
     2801chipInputImfileRow *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
     2812bool chipInputImfileCreateTable(
     2813    psDB            *dbh                ///< Database handle
     2814);
     2815
     2816/** Deletes a chipInputImfile table
     2817 *
     2818 * @return true on success
     2819 */
     2820
     2821bool 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
     2832bool 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
     2844long 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
     2857bool 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
     2869bool 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
     2884bool 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
     2899bool 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
     2911psMetadata *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
     2920chipInputImfileRow *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
     2930psArray *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
     2943bool 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
     2955long 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
     2968bool 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
     2981bool chipInputImfilePrintObject(
     2982    FILE            *stream,            ///< a stream
     2983    chipInputImfileRow *object,    ///< an chipInputImfileRow object
    29812984    bool            mdcf                ///< format as mdconfig or simple
    29822985);
     
    47344737    psF64           bg;
    47354738    psF64           bg_stdev;
    4736     psF64           pixel_fill;
    4737     psS16           fault;
    47384739} warpSkyfileRow;
    47394740
     
    47504751    const char      *path_base,
    47514752    psF64           bg,
    4752     psF64           bg_stdev,
    4753     psF64           pixel_fill,
    4754     psS16           fault
     4753    psF64           bg_stdev
    47554754);
    47564755
     
    47884787    const char      *path_base,
    47894788    psF64           bg,
    4790     psF64           bg_stdev,
    4791     psF64           pixel_fill,
    4792     psS16           fault
     4789    psF64           bg_stdev
    47934790);
    47944791
     
    51605157typedef struct {
    51615158    psS64           diff_id;
    5162     bool            template;
    5163     psS64           stack_id;
    51645159    psS64           warp_id;
    51655160    char            *skycell_id;
    51665161    char            *tess_id;
    51675162    char            *kind;
     5163    bool            template;
    51685164} diffInputSkyfileRow;
    51695165
     
    51755171diffInputSkyfileRow *diffInputSkyfileRowAlloc(
    51765172    psS64           diff_id,
    5177     bool            template,
    5178     psS64           stack_id,
    51795173    psS64           warp_id,
    51805174    const char      *skycell_id,
    51815175    const char      *tess_id,
    5182     const char      *kind
     5176    const char      *kind,
     5177    bool            template
    51835178);
    51845179
     
    52115206    psDB            *dbh,               ///< Database handle
    52125207    psS64           diff_id,
    5213     bool            template,
    5214     psS64           stack_id,
    52155208    psS64           warp_id,
    52165209    const char      *skycell_id,
    52175210    const char      *tess_id,
    5218     const char      *kind
     5211    const char      *kind,
     5212    bool            template
    52195213);
    52205214
     
    53775371    psF64           bg;
    53785372    psF64           bg_stdev;
    5379     psS16           fault;
    53805373} diffSkyfileRow;
    53815374
     
    53905383    const char      *path_base,
    53915384    psF64           bg,
    5392     psF64           bg_stdev,
    5393     psS16           fault
     5385    psF64           bg_stdev
    53945386);
    53955387
     
    54255417    const char      *path_base,
    54265418    psF64           bg,
    5427     psF64           bg_stdev,
    5428     psS16           fault
     5419    psF64           bg_stdev
    54295420);
    54305421
     
    59985989    psF64           bg;
    59995990    psF64           bg_stdev;
    6000     psS16           fault;
    60015991} stackSumSkyfileRow;
    60025992
     
    60116001    const char      *path_base,
    60126002    psF64           bg,
    6013     psF64           bg_stdev,
    6014     psS16           fault
     6003    psF64           bg_stdev
    60156004);
    60166005
     
    60466035    const char      *path_base,
    60476036    psF64           bg,
    6048     psF64           bg_stdev,
    6049     psS16           fault
     6037    psF64           bg_stdev
    60506038);
    60516039
     
    80878075    psF64           bg_stdev;
    80888076    psF64           bg_mean_stdev;
    8089     psF64           bg_skewness;
    8090     psF64           bg_kurtosis;
    80918077    psF64           bin_stdev;
    80928078    psF64           fringe_0;
    80938079    psF64           fringe_1;
    80948080    psF64           fringe_2;
    8095     psF64           fringe_resid_0;
    8096     psF64           fringe_resid_1;
    8097     psF64           fringe_resid_2;
    80988081    psF64           user_1;
    80998082    psF64           user_2;
     
    81208103    psF64           bg_stdev,
    81218104    psF64           bg_mean_stdev,
    8122     psF64           bg_skewness,
    8123     psF64           bg_kurtosis,
    81248105    psF64           bin_stdev,
    81258106    psF64           fringe_0,
    81268107    psF64           fringe_1,
    81278108    psF64           fringe_2,
    8128     psF64           fringe_resid_0,
    8129     psF64           fringe_resid_1,
    8130     psF64           fringe_resid_2,
    81318109    psF64           user_1,
    81328110    psF64           user_2,
     
    81748152    psF64           bg_stdev,
    81758153    psF64           bg_mean_stdev,
    8176     psF64           bg_skewness,
    8177     psF64           bg_kurtosis,
    81788154    psF64           bin_stdev,
    81798155    psF64           fringe_0,
    81808156    psF64           fringe_1,
    81818157    psF64           fringe_2,
    8182     psF64           fringe_resid_0,
    8183     psF64           fringe_resid_1,
    8184     psF64           fringe_resid_2,
    81858158    psF64           user_1,
    81868159    psF64           user_2,
     
    83528325    psF64           bg_stdev;
    83538326    psF64           bg_mean_stdev;
    8354     psF64           bg_skewness;
    8355     psF64           bg_kurtosis;
    83568327    psF64           bin_stdev;
    83578328    psF64           fringe_0;
    83588329    psF64           fringe_1;
    83598330    psF64           fringe_2;
    8360     psF64           fringe_resid_0;
    8361     psF64           fringe_resid_1;
    8362     psF64           fringe_resid_2;
    83638331    psF64           user_1;
    83648332    psF64           user_2;
     
    83848352    psF64           bg_stdev,
    83858353    psF64           bg_mean_stdev,
    8386     psF64           bg_skewness,
    8387     psF64           bg_kurtosis,
    83888354    psF64           bin_stdev,
    83898355    psF64           fringe_0,
    83908356    psF64           fringe_1,
    83918357    psF64           fringe_2,
    8392     psF64           fringe_resid_0,
    8393     psF64           fringe_resid_1,
    8394     psF64           fringe_resid_2,
    83958358    psF64           user_1,
    83968359    psF64           user_2,
     
    84378400    psF64           bg_stdev,
    84388401    psF64           bg_mean_stdev,
    8439     psF64           bg_skewness,
    8440     psF64           bg_kurtosis,
    84418402    psF64           bin_stdev,
    84428403    psF64           fringe_0,
    84438404    psF64           fringe_1,
    84448405    psF64           fringe_2,
    8445     psF64           fringe_resid_0,
    8446     psF64           fringe_resid_1,
    8447     psF64           fringe_resid_2,
    84488406    psF64           user_1,
    84498407    psF64           user_2,
     
    88168774    bool            mdcf                ///< format as mdconfig or simple
    88178775);
    8818 /** detRegisteredImfileRow data structure
    8819  *
    8820  * Structure for representing a single row of detRegisteredImfile table data.
    8821  */
    8822 
    8823 typedef struct {
    8824     psS64           det_id;
    8825     psS32           iteration;
    8826     char            *class_id;
    8827     char            *uri;
    8828     psF64           bg;
    8829     psF64           bg_stdev;
    8830     psF64           bg_mean_stdev;
    8831     psF64           user_1;
    8832     psF64           user_2;
    8833     psF64           user_3;
    8834     psF64           user_4;
    8835     psF64           user_5;
    8836     char            *path_base;
    8837     psS16           fault;
    8838 } detRegisteredImfileRow;
    8839 
    8840 /** Creates a new detRegisteredImfileRow object
    8841  *
    8842  *  @return A new detRegisteredImfileRow object or NULL on failure.
    8843  */
    8844 
    8845 detRegisteredImfileRow *detRegisteredImfileRowAlloc(
    8846     psS64           det_id,
    8847     psS32           iteration,
    8848     const char      *class_id,
    8849     const char      *uri,
    8850     psF64           bg,
    8851     psF64           bg_stdev,
    8852     psF64           bg_mean_stdev,
    8853     psF64           user_1,
    8854     psF64           user_2,
    8855     psF64           user_3,
    8856     psF64           user_4,
    8857     psF64           user_5,
    8858     const char      *path_base,
    8859     psS16           fault
    8860 );
    8861 
    8862 /** Creates a new detRegisteredImfile table
    8863  *
    8864  * @return true on success
    8865  */
    8866 
    8867 bool detRegisteredImfileCreateTable(
    8868     psDB            *dbh                ///< Database handle
    8869 );
    8870 
    8871 /** Deletes a detRegisteredImfile table
    8872  *
    8873  * @return true on success
    8874  */
    8875 
    8876 bool detRegisteredImfileDropTable(
    8877     psDB            *dbh                ///< Database handle
    8878 );
    8879 
    8880 /** Insert a single row into a table
    8881  *
    8882  * This function constructs and inserts a single row based on it's parameters.
    8883  *
    8884  * @return true on success
    8885  */
    8886 
    8887 bool detRegisteredImfileInsert(
    8888     psDB            *dbh,               ///< Database handle
    8889     psS64           det_id,
    8890     psS32           iteration,
    8891     const char      *class_id,
    8892     const char      *uri,
    8893     psF64           bg,
    8894     psF64           bg_stdev,
    8895     psF64           bg_mean_stdev,
    8896     psF64           user_1,
    8897     psF64           user_2,
    8898     psF64           user_3,
    8899     psF64           user_4,
    8900     psF64           user_5,
    8901     const char      *path_base,
    8902     psS16           fault
    8903 );
    8904 
    8905 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    8906  *
    8907  * @return A The number of rows removed or a negative value on error
    8908  */
    8909 
    8910 long long detRegisteredImfileDelete(
    8911     psDB            *dbh,               ///< Database handle
    8912     const psMetadata *where,            ///< Row match criteria
    8913     unsigned long long limit            ///< Maximum number of elements to delete
    8914 );
    8915 
    8916 /** Insert a single detRegisteredImfileRow object into a table
    8917  *
    8918  * This function constructs and inserts a single row based on it's parameters.
    8919  *
    8920  * @return true on success
    8921  */
    8922 
    8923 bool detRegisteredImfileInsertObject(
    8924     psDB            *dbh,               ///< Database handle
    8925     detRegisteredImfileRow *object             ///< detRegisteredImfileRow object
    8926 );
    8927 
    8928 /** Insert an array of detRegisteredImfileRow object into a table
    8929  *
    8930  * This function constructs and inserts multiple rows based on it's parameters.
    8931  *
    8932  * @return true on success
    8933  */
    8934 
    8935 bool detRegisteredImfileInsertObjects(
    8936     psDB            *dbh,               ///< Database handle
    8937     psArray         *objects            ///< array of detRegisteredImfileRow objects
    8938 );
    8939 
    8940 /** Insert data from a binary FITS table detRegisteredImfileRow into the database
    8941  *
    8942  * This function expects a psFits object with a FITS table as the first
    8943  * extension.  The table must have at least one row of data in it, that is of
    8944  * the appropriate format (number of columns and their type).  All other
    8945  * extensions are ignored.
    8946  *
    8947  * @return true on success
    8948  */
    8949 
    8950 bool detRegisteredImfileInsertFits(
    8951     psDB            *dbh,               ///< Database handle
    8952     const psFits    *fits               ///< psFits object
    8953 );
    8954 
    8955 /** Selects up to limit from the database and returns them in a binary FITS table
    8956  *
    8957  * This function assumes an empty psFits object and will create a FITS table
    8958  * as the first extension.
    8959  *
    8960  *  See psDBSelectRows() for documentation on the format of where.
    8961  *
    8962  * @return true on success
    8963  */
    8964 
    8965 bool detRegisteredImfileSelectRowsFits(
    8966     psDB            *dbh,               ///< Database handle
    8967     psFits          *fits,              ///< psFits object
    8968     const psMetadata *where,            ///< Row match criteria
    8969     unsigned long long limit            ///< Maximum number of elements to return
    8970 );
    8971 
    8972 /** Convert a detRegisteredImfileRow into an equivalent psMetadata
    8973  *
    8974  * @return A psMetadata pointer or NULL on error
    8975  */
    8976 
    8977 psMetadata *detRegisteredImfileMetadataFromObject(
    8978     const detRegisteredImfileRow *object             ///< fooRow to convert into a psMetadata
    8979 );
    8980 
    8981 /** Convert a psMetadata into an equivalent fooRow
    8982  *
    8983  * @return A detRegisteredImfileRow pointer or NULL on error
    8984  */
    8985 
    8986 detRegisteredImfileRow *detRegisteredImfileObjectFromMetadata(
    8987     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    8988 );
    8989 /** Selects up to limit rows from the database and returns as detRegisteredImfileRow objects in a psArray
    8990  *
    8991  *  See psDBSelectRows() for documentation on the format of where.
    8992  *
    8993  * @return A psArray pointer or NULL on error
    8994  */
    8995 
    8996 psArray *detRegisteredImfileSelectRowObjects(
    8997     psDB            *dbh,               ///< Database handle
    8998     const psMetadata *where,            ///< Row match criteria
    8999     unsigned long long limit            ///< Maximum number of elements to return
    9000 );
    9001 /** Deletes a row from the database coresponding to an detRegisteredImfile
    9002  *
    9003  *  Note that a 'where' search psMetadata is constructed from each object and
    9004  *  used to find rows to delete.
    9005  *
    9006  * @return A The number of rows removed or a negative value on error
    9007  */
    9008 
    9009 bool detRegisteredImfileDeleteObject(
    9010     psDB            *dbh,               ///< Database handle
    9011     const detRegisteredImfileRow *object    ///< Object to delete
    9012 );
    9013 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    9014  *
    9015  *  Note that a 'where' search psMetadata is constructed from each object and
    9016  *  used to find rows to delete.
    9017  *
    9018  * @return A The number of rows removed or a negative value on error
    9019  */
    9020 
    9021 long long detRegisteredImfileDeleteRowObjects(
    9022     psDB            *dbh,               ///< Database handle
    9023     const psArray   *objects,           ///< Array of objects to delete
    9024     unsigned long long limit            ///< Maximum number of elements to delete
    9025 );
    9026 /** Formats and prints an array of detRegisteredImfileRow objects
    9027  *
    9028  * When mdcf is set the formated output is in psMetadataConfig
    9029  * format, otherwise it is in a simple tabular format.
    9030  *
    9031  * @return true on success
    9032  */
    9033 
    9034 bool detRegisteredImfilePrintObjects(
    9035     FILE            *stream,            ///< a stream
    9036     psArray         *objects,           ///< An array of detRegisteredImfileRow objects
    9037     bool            mdcf                ///< format as mdconfig or simple
    9038 );
    9039 /** Formats and prints an detRegisteredImfileRow object
    9040  *
    9041  * When mdcf is set the formated output is in psMetadataConfig
    9042  * format, otherwise it is in a simple tabular format.
    9043  *
    9044  * @return true on success
    9045  */
    9046 
    9047 bool detRegisteredImfilePrintObject(
    9048     FILE            *stream,            ///< a stream
    9049     detRegisteredImfileRow *object,    ///< an detRegisteredImfileRow object
    9050     bool            mdcf                ///< format as mdconfig or simple
    9051 );
    9052 /** detCorrectedExpRow data structure
    9053  *
    9054  * Structure for representing a single row of detCorrectedExp table data.
    9055  */
    9056 
    9057 typedef struct {
    9058     psS64           det_id;
    9059     psS64           exp_id;
    9060     char            *uri;
    9061     psS64           corr_id;
    9062     char            *corr_type;
    9063     char            *recipe;
    9064     char            *path_base;
    9065     psS16           fault;
    9066 } detCorrectedExpRow;
    9067 
    9068 /** Creates a new detCorrectedExpRow object
    9069  *
    9070  *  @return A new detCorrectedExpRow object or NULL on failure.
    9071  */
    9072 
    9073 detCorrectedExpRow *detCorrectedExpRowAlloc(
    9074     psS64           det_id,
    9075     psS64           exp_id,
    9076     const char      *uri,
    9077     psS64           corr_id,
    9078     const char      *corr_type,
    9079     const char      *recipe,
    9080     const char      *path_base,
    9081     psS16           fault
    9082 );
    9083 
    9084 /** Creates a new detCorrectedExp table
    9085  *
    9086  * @return true on success
    9087  */
    9088 
    9089 bool detCorrectedExpCreateTable(
    9090     psDB            *dbh                ///< Database handle
    9091 );
    9092 
    9093 /** Deletes a detCorrectedExp table
    9094  *
    9095  * @return true on success
    9096  */
    9097 
    9098 bool detCorrectedExpDropTable(
    9099     psDB            *dbh                ///< Database handle
    9100 );
    9101 
    9102 /** Insert a single row into a table
    9103  *
    9104  * This function constructs and inserts a single row based on it's parameters.
    9105  *
    9106  * @return true on success
    9107  */
    9108 
    9109 bool detCorrectedExpInsert(
    9110     psDB            *dbh,               ///< Database handle
    9111     psS64           det_id,
    9112     psS64           exp_id,
    9113     const char      *uri,
    9114     psS64           corr_id,
    9115     const char      *corr_type,
    9116     const char      *recipe,
    9117     const char      *path_base,
    9118     psS16           fault
    9119 );
    9120 
    9121 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    9122  *
    9123  * @return A The number of rows removed or a negative value on error
    9124  */
    9125 
    9126 long long detCorrectedExpDelete(
    9127     psDB            *dbh,               ///< Database handle
    9128     const psMetadata *where,            ///< Row match criteria
    9129     unsigned long long limit            ///< Maximum number of elements to delete
    9130 );
    9131 
    9132 /** Insert a single detCorrectedExpRow object into a table
    9133  *
    9134  * This function constructs and inserts a single row based on it's parameters.
    9135  *
    9136  * @return true on success
    9137  */
    9138 
    9139 bool detCorrectedExpInsertObject(
    9140     psDB            *dbh,               ///< Database handle
    9141     detCorrectedExpRow *object             ///< detCorrectedExpRow object
    9142 );
    9143 
    9144 /** Insert an array of detCorrectedExpRow object into a table
    9145  *
    9146  * This function constructs and inserts multiple rows based on it's parameters.
    9147  *
    9148  * @return true on success
    9149  */
    9150 
    9151 bool detCorrectedExpInsertObjects(
    9152     psDB            *dbh,               ///< Database handle
    9153     psArray         *objects            ///< array of detCorrectedExpRow objects
    9154 );
    9155 
    9156 /** Insert data from a binary FITS table detCorrectedExpRow into the database
    9157  *
    9158  * This function expects a psFits object with a FITS table as the first
    9159  * extension.  The table must have at least one row of data in it, that is of
    9160  * the appropriate format (number of columns and their type).  All other
    9161  * extensions are ignored.
    9162  *
    9163  * @return true on success
    9164  */
    9165 
    9166 bool detCorrectedExpInsertFits(
    9167     psDB            *dbh,               ///< Database handle
    9168     const psFits    *fits               ///< psFits object
    9169 );
    9170 
    9171 /** Selects up to limit from the database and returns them in a binary FITS table
    9172  *
    9173  * This function assumes an empty psFits object and will create a FITS table
    9174  * as the first extension.
    9175  *
    9176  *  See psDBSelectRows() for documentation on the format of where.
    9177  *
    9178  * @return true on success
    9179  */
    9180 
    9181 bool detCorrectedExpSelectRowsFits(
    9182     psDB            *dbh,               ///< Database handle
    9183     psFits          *fits,              ///< psFits object
    9184     const psMetadata *where,            ///< Row match criteria
    9185     unsigned long long limit            ///< Maximum number of elements to return
    9186 );
    9187 
    9188 /** Convert a detCorrectedExpRow into an equivalent psMetadata
    9189  *
    9190  * @return A psMetadata pointer or NULL on error
    9191  */
    9192 
    9193 psMetadata *detCorrectedExpMetadataFromObject(
    9194     const detCorrectedExpRow *object             ///< fooRow to convert into a psMetadata
    9195 );
    9196 
    9197 /** Convert a psMetadata into an equivalent fooRow
    9198  *
    9199  * @return A detCorrectedExpRow pointer or NULL on error
    9200  */
    9201 
    9202 detCorrectedExpRow *detCorrectedExpObjectFromMetadata(
    9203     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    9204 );
    9205 /** Selects up to limit rows from the database and returns as detCorrectedExpRow objects in a psArray
    9206  *
    9207  *  See psDBSelectRows() for documentation on the format of where.
    9208  *
    9209  * @return A psArray pointer or NULL on error
    9210  */
    9211 
    9212 psArray *detCorrectedExpSelectRowObjects(
    9213     psDB            *dbh,               ///< Database handle
    9214     const psMetadata *where,            ///< Row match criteria
    9215     unsigned long long limit            ///< Maximum number of elements to return
    9216 );
    9217 /** Deletes a row from the database coresponding to an detCorrectedExp
    9218  *
    9219  *  Note that a 'where' search psMetadata is constructed from each object and
    9220  *  used to find rows to delete.
    9221  *
    9222  * @return A The number of rows removed or a negative value on error
    9223  */
    9224 
    9225 bool detCorrectedExpDeleteObject(
    9226     psDB            *dbh,               ///< Database handle
    9227     const detCorrectedExpRow *object    ///< Object to delete
    9228 );
    9229 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    9230  *
    9231  *  Note that a 'where' search psMetadata is constructed from each object and
    9232  *  used to find rows to delete.
    9233  *
    9234  * @return A The number of rows removed or a negative value on error
    9235  */
    9236 
    9237 long long detCorrectedExpDeleteRowObjects(
    9238     psDB            *dbh,               ///< Database handle
    9239     const psArray   *objects,           ///< Array of objects to delete
    9240     unsigned long long limit            ///< Maximum number of elements to delete
    9241 );
    9242 /** Formats and prints an array of detCorrectedExpRow objects
    9243  *
    9244  * When mdcf is set the formated output is in psMetadataConfig
    9245  * format, otherwise it is in a simple tabular format.
    9246  *
    9247  * @return true on success
    9248  */
    9249 
    9250 bool detCorrectedExpPrintObjects(
    9251     FILE            *stream,            ///< a stream
    9252     psArray         *objects,           ///< An array of detCorrectedExpRow objects
    9253     bool            mdcf                ///< format as mdconfig or simple
    9254 );
    9255 /** Formats and prints an detCorrectedExpRow object
    9256  *
    9257  * When mdcf is set the formated output is in psMetadataConfig
    9258  * format, otherwise it is in a simple tabular format.
    9259  *
    9260  * @return true on success
    9261  */
    9262 
    9263 bool detCorrectedExpPrintObject(
    9264     FILE            *stream,            ///< a stream
    9265     detCorrectedExpRow *object,    ///< an detCorrectedExpRow object
    9266     bool            mdcf                ///< format as mdconfig or simple
    9267 );
    9268 /** detCorrectedImfileRow data structure
    9269  *
    9270  * Structure for representing a single row of detCorrectedImfile table data.
    9271  */
    9272 
    9273 typedef struct {
    9274     psS64           det_id;
    9275     psS64           exp_id;
    9276     char            *class_id;
    9277     char            *uri;
    9278     char            *path_base;
    9279     psS16           fault;
    9280 } detCorrectedImfileRow;
    9281 
    9282 /** Creates a new detCorrectedImfileRow object
    9283  *
    9284  *  @return A new detCorrectedImfileRow object or NULL on failure.
    9285  */
    9286 
    9287 detCorrectedImfileRow *detCorrectedImfileRowAlloc(
    9288     psS64           det_id,
    9289     psS64           exp_id,
    9290     const char      *class_id,
    9291     const char      *uri,
    9292     const char      *path_base,
    9293     psS16           fault
    9294 );
    9295 
    9296 /** Creates a new detCorrectedImfile table
    9297  *
    9298  * @return true on success
    9299  */
    9300 
    9301 bool detCorrectedImfileCreateTable(
    9302     psDB            *dbh                ///< Database handle
    9303 );
    9304 
    9305 /** Deletes a detCorrectedImfile table
    9306  *
    9307  * @return true on success
    9308  */
    9309 
    9310 bool detCorrectedImfileDropTable(
    9311     psDB            *dbh                ///< Database handle
    9312 );
    9313 
    9314 /** Insert a single row into a table
    9315  *
    9316  * This function constructs and inserts a single row based on it's parameters.
    9317  *
    9318  * @return true on success
    9319  */
    9320 
    9321 bool detCorrectedImfileInsert(
    9322     psDB            *dbh,               ///< Database handle
    9323     psS64           det_id,
    9324     psS64           exp_id,
    9325     const char      *class_id,
    9326     const char      *uri,
    9327     const char      *path_base,
    9328     psS16           fault
    9329 );
    9330 
    9331 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    9332  *
    9333  * @return A The number of rows removed or a negative value on error
    9334  */
    9335 
    9336 long long detCorrectedImfileDelete(
    9337     psDB            *dbh,               ///< Database handle
    9338     const psMetadata *where,            ///< Row match criteria
    9339     unsigned long long limit            ///< Maximum number of elements to delete
    9340 );
    9341 
    9342 /** Insert a single detCorrectedImfileRow object into a table
    9343  *
    9344  * This function constructs and inserts a single row based on it's parameters.
    9345  *
    9346  * @return true on success
    9347  */
    9348 
    9349 bool detCorrectedImfileInsertObject(
    9350     psDB            *dbh,               ///< Database handle
    9351     detCorrectedImfileRow *object             ///< detCorrectedImfileRow object
    9352 );
    9353 
    9354 /** Insert an array of detCorrectedImfileRow object into a table
    9355  *
    9356  * This function constructs and inserts multiple rows based on it's parameters.
    9357  *
    9358  * @return true on success
    9359  */
    9360 
    9361 bool detCorrectedImfileInsertObjects(
    9362     psDB            *dbh,               ///< Database handle
    9363     psArray         *objects            ///< array of detCorrectedImfileRow objects
    9364 );
    9365 
    9366 /** Insert data from a binary FITS table detCorrectedImfileRow into the database
    9367  *
    9368  * This function expects a psFits object with a FITS table as the first
    9369  * extension.  The table must have at least one row of data in it, that is of
    9370  * the appropriate format (number of columns and their type).  All other
    9371  * extensions are ignored.
    9372  *
    9373  * @return true on success
    9374  */
    9375 
    9376 bool detCorrectedImfileInsertFits(
    9377     psDB            *dbh,               ///< Database handle
    9378     const psFits    *fits               ///< psFits object
    9379 );
    9380 
    9381 /** Selects up to limit from the database and returns them in a binary FITS table
    9382  *
    9383  * This function assumes an empty psFits object and will create a FITS table
    9384  * as the first extension.
    9385  *
    9386  *  See psDBSelectRows() for documentation on the format of where.
    9387  *
    9388  * @return true on success
    9389  */
    9390 
    9391 bool detCorrectedImfileSelectRowsFits(
    9392     psDB            *dbh,               ///< Database handle
    9393     psFits          *fits,              ///< psFits object
    9394     const psMetadata *where,            ///< Row match criteria
    9395     unsigned long long limit            ///< Maximum number of elements to return
    9396 );
    9397 
    9398 /** Convert a detCorrectedImfileRow into an equivalent psMetadata
    9399  *
    9400  * @return A psMetadata pointer or NULL on error
    9401  */
    9402 
    9403 psMetadata *detCorrectedImfileMetadataFromObject(
    9404     const detCorrectedImfileRow *object             ///< fooRow to convert into a psMetadata
    9405 );
    9406 
    9407 /** Convert a psMetadata into an equivalent fooRow
    9408  *
    9409  * @return A detCorrectedImfileRow pointer or NULL on error
    9410  */
    9411 
    9412 detCorrectedImfileRow *detCorrectedImfileObjectFromMetadata(
    9413     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    9414 );
    9415 /** Selects up to limit rows from the database and returns as detCorrectedImfileRow objects in a psArray
    9416  *
    9417  *  See psDBSelectRows() for documentation on the format of where.
    9418  *
    9419  * @return A psArray pointer or NULL on error
    9420  */
    9421 
    9422 psArray *detCorrectedImfileSelectRowObjects(
    9423     psDB            *dbh,               ///< Database handle
    9424     const psMetadata *where,            ///< Row match criteria
    9425     unsigned long long limit            ///< Maximum number of elements to return
    9426 );
    9427 /** Deletes a row from the database coresponding to an detCorrectedImfile
    9428  *
    9429  *  Note that a 'where' search psMetadata is constructed from each object and
    9430  *  used to find rows to delete.
    9431  *
    9432  * @return A The number of rows removed or a negative value on error
    9433  */
    9434 
    9435 bool detCorrectedImfileDeleteObject(
    9436     psDB            *dbh,               ///< Database handle
    9437     const detCorrectedImfileRow *object    ///< Object to delete
    9438 );
    9439 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    9440  *
    9441  *  Note that a 'where' search psMetadata is constructed from each object and
    9442  *  used to find rows to delete.
    9443  *
    9444  * @return A The number of rows removed or a negative value on error
    9445  */
    9446 
    9447 long long detCorrectedImfileDeleteRowObjects(
    9448     psDB            *dbh,               ///< Database handle
    9449     const psArray   *objects,           ///< Array of objects to delete
    9450     unsigned long long limit            ///< Maximum number of elements to delete
    9451 );
    9452 /** Formats and prints an array of detCorrectedImfileRow objects
    9453  *
    9454  * When mdcf is set the formated output is in psMetadataConfig
    9455  * format, otherwise it is in a simple tabular format.
    9456  *
    9457  * @return true on success
    9458  */
    9459 
    9460 bool detCorrectedImfilePrintObjects(
    9461     FILE            *stream,            ///< a stream
    9462     psArray         *objects,           ///< An array of detCorrectedImfileRow objects
    9463     bool            mdcf                ///< format as mdconfig or simple
    9464 );
    9465 /** Formats and prints an detCorrectedImfileRow object
    9466  *
    9467  * When mdcf is set the formated output is in psMetadataConfig
    9468  * format, otherwise it is in a simple tabular format.
    9469  *
    9470  * @return true on success
    9471  */
    9472 
    9473 bool detCorrectedImfilePrintObject(
    9474     FILE            *stream,            ///< a stream
    9475     detCorrectedImfileRow *object,    ///< an detCorrectedImfileRow object
    9476     bool            mdcf                ///< format as mdconfig or simple
    9477 );
    9478 /** magicRunRow data structure
    9479  *
    9480  * Structure for representing a single row of magicRun table data.
    9481  */
    9482 
    9483 typedef struct {
    9484     psS64           magic_id;
    9485     char            *state;
    9486     char            *workdir;
    9487     char            *workdir_state;
    9488     char            *label;
    9489     char            *dvodb;
    9490     psTime*         registered;
    9491 } magicRunRow;
    9492 
    9493 /** Creates a new magicRunRow object
    9494  *
    9495  *  @return A new magicRunRow object or NULL on failure.
    9496  */
    9497 
    9498 magicRunRow *magicRunRowAlloc(
    9499     psS64           magic_id,
    9500     const char      *state,
    9501     const char      *workdir,
    9502     const char      *workdir_state,
    9503     const char      *label,
    9504     const char      *dvodb,
    9505     psTime*         registered
    9506 );
    9507 
    9508 /** Creates a new magicRun table
    9509  *
    9510  * @return true on success
    9511  */
    9512 
    9513 bool magicRunCreateTable(
    9514     psDB            *dbh                ///< Database handle
    9515 );
    9516 
    9517 /** Deletes a magicRun table
    9518  *
    9519  * @return true on success
    9520  */
    9521 
    9522 bool magicRunDropTable(
    9523     psDB            *dbh                ///< Database handle
    9524 );
    9525 
    9526 /** Insert a single row into a table
    9527  *
    9528  * This function constructs and inserts a single row based on it's parameters.
    9529  *
    9530  * @return true on success
    9531  */
    9532 
    9533 bool magicRunInsert(
    9534     psDB            *dbh,               ///< Database handle
    9535     psS64           magic_id,
    9536     const char      *state,
    9537     const char      *workdir,
    9538     const char      *workdir_state,
    9539     const char      *label,
    9540     const char      *dvodb,
    9541     psTime*         registered
    9542 );
    9543 
    9544 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    9545  *
    9546  * @return A The number of rows removed or a negative value on error
    9547  */
    9548 
    9549 long long magicRunDelete(
    9550     psDB            *dbh,               ///< Database handle
    9551     const psMetadata *where,            ///< Row match criteria
    9552     unsigned long long limit            ///< Maximum number of elements to delete
    9553 );
    9554 
    9555 /** Insert a single magicRunRow object into a table
    9556  *
    9557  * This function constructs and inserts a single row based on it's parameters.
    9558  *
    9559  * @return true on success
    9560  */
    9561 
    9562 bool magicRunInsertObject(
    9563     psDB            *dbh,               ///< Database handle
    9564     magicRunRow     *object             ///< magicRunRow object
    9565 );
    9566 
    9567 /** Insert an array of magicRunRow object into a table
    9568  *
    9569  * This function constructs and inserts multiple rows based on it's parameters.
    9570  *
    9571  * @return true on success
    9572  */
    9573 
    9574 bool magicRunInsertObjects(
    9575     psDB            *dbh,               ///< Database handle
    9576     psArray         *objects            ///< array of magicRunRow objects
    9577 );
    9578 
    9579 /** Insert data from a binary FITS table magicRunRow into the database
    9580  *
    9581  * This function expects a psFits object with a FITS table as the first
    9582  * extension.  The table must have at least one row of data in it, that is of
    9583  * the appropriate format (number of columns and their type).  All other
    9584  * extensions are ignored.
    9585  *
    9586  * @return true on success
    9587  */
    9588 
    9589 bool magicRunInsertFits(
    9590     psDB            *dbh,               ///< Database handle
    9591     const psFits    *fits               ///< psFits object
    9592 );
    9593 
    9594 /** Selects up to limit from the database and returns them in a binary FITS table
    9595  *
    9596  * This function assumes an empty psFits object and will create a FITS table
    9597  * as the first extension.
    9598  *
    9599  *  See psDBSelectRows() for documentation on the format of where.
    9600  *
    9601  * @return true on success
    9602  */
    9603 
    9604 bool magicRunSelectRowsFits(
    9605     psDB            *dbh,               ///< Database handle
    9606     psFits          *fits,              ///< psFits object
    9607     const psMetadata *where,            ///< Row match criteria
    9608     unsigned long long limit            ///< Maximum number of elements to return
    9609 );
    9610 
    9611 /** Convert a magicRunRow into an equivalent psMetadata
    9612  *
    9613  * @return A psMetadata pointer or NULL on error
    9614  */
    9615 
    9616 psMetadata *magicRunMetadataFromObject(
    9617     const magicRunRow *object             ///< fooRow to convert into a psMetadata
    9618 );
    9619 
    9620 /** Convert a psMetadata into an equivalent fooRow
    9621  *
    9622  * @return A magicRunRow pointer or NULL on error
    9623  */
    9624 
    9625 magicRunRow *magicRunObjectFromMetadata(
    9626     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    9627 );
    9628 /** Selects up to limit rows from the database and returns as magicRunRow objects in a psArray
    9629  *
    9630  *  See psDBSelectRows() for documentation on the format of where.
    9631  *
    9632  * @return A psArray pointer or NULL on error
    9633  */
    9634 
    9635 psArray *magicRunSelectRowObjects(
    9636     psDB            *dbh,               ///< Database handle
    9637     const psMetadata *where,            ///< Row match criteria
    9638     unsigned long long limit            ///< Maximum number of elements to return
    9639 );
    9640 /** Deletes a row from the database coresponding to an magicRun
    9641  *
    9642  *  Note that a 'where' search psMetadata is constructed from each object and
    9643  *  used to find rows to delete.
    9644  *
    9645  * @return A The number of rows removed or a negative value on error
    9646  */
    9647 
    9648 bool magicRunDeleteObject(
    9649     psDB            *dbh,               ///< Database handle
    9650     const magicRunRow *object    ///< Object to delete
    9651 );
    9652 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    9653  *
    9654  *  Note that a 'where' search psMetadata is constructed from each object and
    9655  *  used to find rows to delete.
    9656  *
    9657  * @return A The number of rows removed or a negative value on error
    9658  */
    9659 
    9660 long long magicRunDeleteRowObjects(
    9661     psDB            *dbh,               ///< Database handle
    9662     const psArray   *objects,           ///< Array of objects to delete
    9663     unsigned long long limit            ///< Maximum number of elements to delete
    9664 );
    9665 /** Formats and prints an array of magicRunRow objects
    9666  *
    9667  * When mdcf is set the formated output is in psMetadataConfig
    9668  * format, otherwise it is in a simple tabular format.
    9669  *
    9670  * @return true on success
    9671  */
    9672 
    9673 bool magicRunPrintObjects(
    9674     FILE            *stream,            ///< a stream
    9675     psArray         *objects,           ///< An array of magicRunRow objects
    9676     bool            mdcf                ///< format as mdconfig or simple
    9677 );
    9678 /** Formats and prints an magicRunRow object
    9679  *
    9680  * When mdcf is set the formated output is in psMetadataConfig
    9681  * format, otherwise it is in a simple tabular format.
    9682  *
    9683  * @return true on success
    9684  */
    9685 
    9686 bool magicRunPrintObject(
    9687     FILE            *stream,            ///< a stream
    9688     magicRunRow *object,    ///< an magicRunRow object
    9689     bool            mdcf                ///< format as mdconfig or simple
    9690 );
    9691 /** magicInputSkyfileRow data structure
    9692  *
    9693  * Structure for representing a single row of magicInputSkyfile table data.
    9694  */
    9695 
    9696 typedef struct {
    9697     psS64           magic_id;
    9698     psS64           diff_id;
    9699     char            *node;
    9700 } magicInputSkyfileRow;
    9701 
    9702 /** Creates a new magicInputSkyfileRow object
    9703  *
    9704  *  @return A new magicInputSkyfileRow object or NULL on failure.
    9705  */
    9706 
    9707 magicInputSkyfileRow *magicInputSkyfileRowAlloc(
    9708     psS64           magic_id,
    9709     psS64           diff_id,
    9710     const char      *node
    9711 );
    9712 
    9713 /** Creates a new magicInputSkyfile table
    9714  *
    9715  * @return true on success
    9716  */
    9717 
    9718 bool magicInputSkyfileCreateTable(
    9719     psDB            *dbh                ///< Database handle
    9720 );
    9721 
    9722 /** Deletes a magicInputSkyfile table
    9723  *
    9724  * @return true on success
    9725  */
    9726 
    9727 bool magicInputSkyfileDropTable(
    9728     psDB            *dbh                ///< Database handle
    9729 );
    9730 
    9731 /** Insert a single row into a table
    9732  *
    9733  * This function constructs and inserts a single row based on it's parameters.
    9734  *
    9735  * @return true on success
    9736  */
    9737 
    9738 bool magicInputSkyfileInsert(
    9739     psDB            *dbh,               ///< Database handle
    9740     psS64           magic_id,
    9741     psS64           diff_id,
    9742     const char      *node
    9743 );
    9744 
    9745 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    9746  *
    9747  * @return A The number of rows removed or a negative value on error
    9748  */
    9749 
    9750 long long magicInputSkyfileDelete(
    9751     psDB            *dbh,               ///< Database handle
    9752     const psMetadata *where,            ///< Row match criteria
    9753     unsigned long long limit            ///< Maximum number of elements to delete
    9754 );
    9755 
    9756 /** Insert a single magicInputSkyfileRow object into a table
    9757  *
    9758  * This function constructs and inserts a single row based on it's parameters.
    9759  *
    9760  * @return true on success
    9761  */
    9762 
    9763 bool magicInputSkyfileInsertObject(
    9764     psDB            *dbh,               ///< Database handle
    9765     magicInputSkyfileRow *object             ///< magicInputSkyfileRow object
    9766 );
    9767 
    9768 /** Insert an array of magicInputSkyfileRow object into a table
    9769  *
    9770  * This function constructs and inserts multiple rows based on it's parameters.
    9771  *
    9772  * @return true on success
    9773  */
    9774 
    9775 bool magicInputSkyfileInsertObjects(
    9776     psDB            *dbh,               ///< Database handle
    9777     psArray         *objects            ///< array of magicInputSkyfileRow objects
    9778 );
    9779 
    9780 /** Insert data from a binary FITS table magicInputSkyfileRow into the database
    9781  *
    9782  * This function expects a psFits object with a FITS table as the first
    9783  * extension.  The table must have at least one row of data in it, that is of
    9784  * the appropriate format (number of columns and their type).  All other
    9785  * extensions are ignored.
    9786  *
    9787  * @return true on success
    9788  */
    9789 
    9790 bool magicInputSkyfileInsertFits(
    9791     psDB            *dbh,               ///< Database handle
    9792     const psFits    *fits               ///< psFits object
    9793 );
    9794 
    9795 /** Selects up to limit from the database and returns them in a binary FITS table
    9796  *
    9797  * This function assumes an empty psFits object and will create a FITS table
    9798  * as the first extension.
    9799  *
    9800  *  See psDBSelectRows() for documentation on the format of where.
    9801  *
    9802  * @return true on success
    9803  */
    9804 
    9805 bool magicInputSkyfileSelectRowsFits(
    9806     psDB            *dbh,               ///< Database handle
    9807     psFits          *fits,              ///< psFits object
    9808     const psMetadata *where,            ///< Row match criteria
    9809     unsigned long long limit            ///< Maximum number of elements to return
    9810 );
    9811 
    9812 /** Convert a magicInputSkyfileRow into an equivalent psMetadata
    9813  *
    9814  * @return A psMetadata pointer or NULL on error
    9815  */
    9816 
    9817 psMetadata *magicInputSkyfileMetadataFromObject(
    9818     const magicInputSkyfileRow *object             ///< fooRow to convert into a psMetadata
    9819 );
    9820 
    9821 /** Convert a psMetadata into an equivalent fooRow
    9822  *
    9823  * @return A magicInputSkyfileRow pointer or NULL on error
    9824  */
    9825 
    9826 magicInputSkyfileRow *magicInputSkyfileObjectFromMetadata(
    9827     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    9828 );
    9829 /** Selects up to limit rows from the database and returns as magicInputSkyfileRow objects in a psArray
    9830  *
    9831  *  See psDBSelectRows() for documentation on the format of where.
    9832  *
    9833  * @return A psArray pointer or NULL on error
    9834  */
    9835 
    9836 psArray *magicInputSkyfileSelectRowObjects(
    9837     psDB            *dbh,               ///< Database handle
    9838     const psMetadata *where,            ///< Row match criteria
    9839     unsigned long long limit            ///< Maximum number of elements to return
    9840 );
    9841 /** Deletes a row from the database coresponding to an magicInputSkyfile
    9842  *
    9843  *  Note that a 'where' search psMetadata is constructed from each object and
    9844  *  used to find rows to delete.
    9845  *
    9846  * @return A The number of rows removed or a negative value on error
    9847  */
    9848 
    9849 bool magicInputSkyfileDeleteObject(
    9850     psDB            *dbh,               ///< Database handle
    9851     const magicInputSkyfileRow *object    ///< Object to delete
    9852 );
    9853 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    9854  *
    9855  *  Note that a 'where' search psMetadata is constructed from each object and
    9856  *  used to find rows to delete.
    9857  *
    9858  * @return A The number of rows removed or a negative value on error
    9859  */
    9860 
    9861 long long magicInputSkyfileDeleteRowObjects(
    9862     psDB            *dbh,               ///< Database handle
    9863     const psArray   *objects,           ///< Array of objects to delete
    9864     unsigned long long limit            ///< Maximum number of elements to delete
    9865 );
    9866 /** Formats and prints an array of magicInputSkyfileRow objects
    9867  *
    9868  * When mdcf is set the formated output is in psMetadataConfig
    9869  * format, otherwise it is in a simple tabular format.
    9870  *
    9871  * @return true on success
    9872  */
    9873 
    9874 bool magicInputSkyfilePrintObjects(
    9875     FILE            *stream,            ///< a stream
    9876     psArray         *objects,           ///< An array of magicInputSkyfileRow objects
    9877     bool            mdcf                ///< format as mdconfig or simple
    9878 );
    9879 /** Formats and prints an magicInputSkyfileRow object
    9880  *
    9881  * When mdcf is set the formated output is in psMetadataConfig
    9882  * format, otherwise it is in a simple tabular format.
    9883  *
    9884  * @return true on success
    9885  */
    9886 
    9887 bool magicInputSkyfilePrintObject(
    9888     FILE            *stream,            ///< a stream
    9889     magicInputSkyfileRow *object,    ///< an magicInputSkyfileRow object
    9890     bool            mdcf                ///< format as mdconfig or simple
    9891 );
    9892 /** magicTreeRow data structure
    9893  *
    9894  * Structure for representing a single row of magicTree table data.
    9895  */
    9896 
    9897 typedef struct {
    9898     psS64           magic_id;
    9899     char            *node;
    9900     char            *dep;
    9901 } magicTreeRow;
    9902 
    9903 /** Creates a new magicTreeRow object
    9904  *
    9905  *  @return A new magicTreeRow object or NULL on failure.
    9906  */
    9907 
    9908 magicTreeRow *magicTreeRowAlloc(
    9909     psS64           magic_id,
    9910     const char      *node,
    9911     const char      *dep
    9912 );
    9913 
    9914 /** Creates a new magicTree table
    9915  *
    9916  * @return true on success
    9917  */
    9918 
    9919 bool magicTreeCreateTable(
    9920     psDB            *dbh                ///< Database handle
    9921 );
    9922 
    9923 /** Deletes a magicTree table
    9924  *
    9925  * @return true on success
    9926  */
    9927 
    9928 bool magicTreeDropTable(
    9929     psDB            *dbh                ///< Database handle
    9930 );
    9931 
    9932 /** Insert a single row into a table
    9933  *
    9934  * This function constructs and inserts a single row based on it's parameters.
    9935  *
    9936  * @return true on success
    9937  */
    9938 
    9939 bool magicTreeInsert(
    9940     psDB            *dbh,               ///< Database handle
    9941     psS64           magic_id,
    9942     const char      *node,
    9943     const char      *dep
    9944 );
    9945 
    9946 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    9947  *
    9948  * @return A The number of rows removed or a negative value on error
    9949  */
    9950 
    9951 long long magicTreeDelete(
    9952     psDB            *dbh,               ///< Database handle
    9953     const psMetadata *where,            ///< Row match criteria
    9954     unsigned long long limit            ///< Maximum number of elements to delete
    9955 );
    9956 
    9957 /** Insert a single magicTreeRow object into a table
    9958  *
    9959  * This function constructs and inserts a single row based on it's parameters.
    9960  *
    9961  * @return true on success
    9962  */
    9963 
    9964 bool magicTreeInsertObject(
    9965     psDB            *dbh,               ///< Database handle
    9966     magicTreeRow    *object             ///< magicTreeRow object
    9967 );
    9968 
    9969 /** Insert an array of magicTreeRow object into a table
    9970  *
    9971  * This function constructs and inserts multiple rows based on it's parameters.
    9972  *
    9973  * @return true on success
    9974  */
    9975 
    9976 bool magicTreeInsertObjects(
    9977     psDB            *dbh,               ///< Database handle
    9978     psArray         *objects            ///< array of magicTreeRow objects
    9979 );
    9980 
    9981 /** Insert data from a binary FITS table magicTreeRow into the database
    9982  *
    9983  * This function expects a psFits object with a FITS table as the first
    9984  * extension.  The table must have at least one row of data in it, that is of
    9985  * the appropriate format (number of columns and their type).  All other
    9986  * extensions are ignored.
    9987  *
    9988  * @return true on success
    9989  */
    9990 
    9991 bool magicTreeInsertFits(
    9992     psDB            *dbh,               ///< Database handle
    9993     const psFits    *fits               ///< psFits object
    9994 );
    9995 
    9996 /** Selects up to limit from the database and returns them in a binary FITS table
    9997  *
    9998  * This function assumes an empty psFits object and will create a FITS table
    9999  * as the first extension.
    10000  *
    10001  *  See psDBSelectRows() for documentation on the format of where.
    10002  *
    10003  * @return true on success
    10004  */
    10005 
    10006 bool magicTreeSelectRowsFits(
    10007     psDB            *dbh,               ///< Database handle
    10008     psFits          *fits,              ///< psFits object
    10009     const psMetadata *where,            ///< Row match criteria
    10010     unsigned long long limit            ///< Maximum number of elements to return
    10011 );
    10012 
    10013 /** Convert a magicTreeRow into an equivalent psMetadata
    10014  *
    10015  * @return A psMetadata pointer or NULL on error
    10016  */
    10017 
    10018 psMetadata *magicTreeMetadataFromObject(
    10019     const magicTreeRow *object             ///< fooRow to convert into a psMetadata
    10020 );
    10021 
    10022 /** Convert a psMetadata into an equivalent fooRow
    10023  *
    10024  * @return A magicTreeRow pointer or NULL on error
    10025  */
    10026 
    10027 magicTreeRow *magicTreeObjectFromMetadata(
    10028     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    10029 );
    10030 /** Selects up to limit rows from the database and returns as magicTreeRow objects in a psArray
    10031  *
    10032  *  See psDBSelectRows() for documentation on the format of where.
    10033  *
    10034  * @return A psArray pointer or NULL on error
    10035  */
    10036 
    10037 psArray *magicTreeSelectRowObjects(
    10038     psDB            *dbh,               ///< Database handle
    10039     const psMetadata *where,            ///< Row match criteria
    10040     unsigned long long limit            ///< Maximum number of elements to return
    10041 );
    10042 /** Deletes a row from the database coresponding to an magicTree
    10043  *
    10044  *  Note that a 'where' search psMetadata is constructed from each object and
    10045  *  used to find rows to delete.
    10046  *
    10047  * @return A The number of rows removed or a negative value on error
    10048  */
    10049 
    10050 bool magicTreeDeleteObject(
    10051     psDB            *dbh,               ///< Database handle
    10052     const magicTreeRow *object    ///< Object to delete
    10053 );
    10054 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    10055  *
    10056  *  Note that a 'where' search psMetadata is constructed from each object and
    10057  *  used to find rows to delete.
    10058  *
    10059  * @return A The number of rows removed or a negative value on error
    10060  */
    10061 
    10062 long long magicTreeDeleteRowObjects(
    10063     psDB            *dbh,               ///< Database handle
    10064     const psArray   *objects,           ///< Array of objects to delete
    10065     unsigned long long limit            ///< Maximum number of elements to delete
    10066 );
    10067 /** Formats and prints an array of magicTreeRow objects
    10068  *
    10069  * When mdcf is set the formated output is in psMetadataConfig
    10070  * format, otherwise it is in a simple tabular format.
    10071  *
    10072  * @return true on success
    10073  */
    10074 
    10075 bool magicTreePrintObjects(
    10076     FILE            *stream,            ///< a stream
    10077     psArray         *objects,           ///< An array of magicTreeRow objects
    10078     bool            mdcf                ///< format as mdconfig or simple
    10079 );
    10080 /** Formats and prints an magicTreeRow object
    10081  *
    10082  * When mdcf is set the formated output is in psMetadataConfig
    10083  * format, otherwise it is in a simple tabular format.
    10084  *
    10085  * @return true on success
    10086  */
    10087 
    10088 bool magicTreePrintObject(
    10089     FILE            *stream,            ///< a stream
    10090     magicTreeRow *object,    ///< an magicTreeRow object
    10091     bool            mdcf                ///< format as mdconfig or simple
    10092 );
    10093 /** magicNodeResultRow data structure
    10094  *
    10095  * Structure for representing a single row of magicNodeResult table data.
    10096  */
    10097 
    10098 typedef struct {
    10099     psS64           magic_id;
    10100     char            *node;
    10101     char            *uri;
    10102 } magicNodeResultRow;
    10103 
    10104 /** Creates a new magicNodeResultRow object
    10105  *
    10106  *  @return A new magicNodeResultRow object or NULL on failure.
    10107  */
    10108 
    10109 magicNodeResultRow *magicNodeResultRowAlloc(
    10110     psS64           magic_id,
    10111     const char      *node,
    10112     const char      *uri
    10113 );
    10114 
    10115 /** Creates a new magicNodeResult table
    10116  *
    10117  * @return true on success
    10118  */
    10119 
    10120 bool magicNodeResultCreateTable(
    10121     psDB            *dbh                ///< Database handle
    10122 );
    10123 
    10124 /** Deletes a magicNodeResult table
    10125  *
    10126  * @return true on success
    10127  */
    10128 
    10129 bool magicNodeResultDropTable(
    10130     psDB            *dbh                ///< Database handle
    10131 );
    10132 
    10133 /** Insert a single row into a table
    10134  *
    10135  * This function constructs and inserts a single row based on it's parameters.
    10136  *
    10137  * @return true on success
    10138  */
    10139 
    10140 bool magicNodeResultInsert(
    10141     psDB            *dbh,               ///< Database handle
    10142     psS64           magic_id,
    10143     const char      *node,
    10144     const char      *uri
    10145 );
    10146 
    10147 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    10148  *
    10149  * @return A The number of rows removed or a negative value on error
    10150  */
    10151 
    10152 long long magicNodeResultDelete(
    10153     psDB            *dbh,               ///< Database handle
    10154     const psMetadata *where,            ///< Row match criteria
    10155     unsigned long long limit            ///< Maximum number of elements to delete
    10156 );
    10157 
    10158 /** Insert a single magicNodeResultRow object into a table
    10159  *
    10160  * This function constructs and inserts a single row based on it's parameters.
    10161  *
    10162  * @return true on success
    10163  */
    10164 
    10165 bool magicNodeResultInsertObject(
    10166     psDB            *dbh,               ///< Database handle
    10167     magicNodeResultRow *object             ///< magicNodeResultRow object
    10168 );
    10169 
    10170 /** Insert an array of magicNodeResultRow object into a table
    10171  *
    10172  * This function constructs and inserts multiple rows based on it's parameters.
    10173  *
    10174  * @return true on success
    10175  */
    10176 
    10177 bool magicNodeResultInsertObjects(
    10178     psDB            *dbh,               ///< Database handle
    10179     psArray         *objects            ///< array of magicNodeResultRow objects
    10180 );
    10181 
    10182 /** Insert data from a binary FITS table magicNodeResultRow into the database
    10183  *
    10184  * This function expects a psFits object with a FITS table as the first
    10185  * extension.  The table must have at least one row of data in it, that is of
    10186  * the appropriate format (number of columns and their type).  All other
    10187  * extensions are ignored.
    10188  *
    10189  * @return true on success
    10190  */
    10191 
    10192 bool magicNodeResultInsertFits(
    10193     psDB            *dbh,               ///< Database handle
    10194     const psFits    *fits               ///< psFits object
    10195 );
    10196 
    10197 /** Selects up to limit from the database and returns them in a binary FITS table
    10198  *
    10199  * This function assumes an empty psFits object and will create a FITS table
    10200  * as the first extension.
    10201  *
    10202  *  See psDBSelectRows() for documentation on the format of where.
    10203  *
    10204  * @return true on success
    10205  */
    10206 
    10207 bool magicNodeResultSelectRowsFits(
    10208     psDB            *dbh,               ///< Database handle
    10209     psFits          *fits,              ///< psFits object
    10210     const psMetadata *where,            ///< Row match criteria
    10211     unsigned long long limit            ///< Maximum number of elements to return
    10212 );
    10213 
    10214 /** Convert a magicNodeResultRow into an equivalent psMetadata
    10215  *
    10216  * @return A psMetadata pointer or NULL on error
    10217  */
    10218 
    10219 psMetadata *magicNodeResultMetadataFromObject(
    10220     const magicNodeResultRow *object             ///< fooRow to convert into a psMetadata
    10221 );
    10222 
    10223 /** Convert a psMetadata into an equivalent fooRow
    10224  *
    10225  * @return A magicNodeResultRow pointer or NULL on error
    10226  */
    10227 
    10228 magicNodeResultRow *magicNodeResultObjectFromMetadata(
    10229     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    10230 );
    10231 /** Selects up to limit rows from the database and returns as magicNodeResultRow objects in a psArray
    10232  *
    10233  *  See psDBSelectRows() for documentation on the format of where.
    10234  *
    10235  * @return A psArray pointer or NULL on error
    10236  */
    10237 
    10238 psArray *magicNodeResultSelectRowObjects(
    10239     psDB            *dbh,               ///< Database handle
    10240     const psMetadata *where,            ///< Row match criteria
    10241     unsigned long long limit            ///< Maximum number of elements to return
    10242 );
    10243 /** Deletes a row from the database coresponding to an magicNodeResult
    10244  *
    10245  *  Note that a 'where' search psMetadata is constructed from each object and
    10246  *  used to find rows to delete.
    10247  *
    10248  * @return A The number of rows removed or a negative value on error
    10249  */
    10250 
    10251 bool magicNodeResultDeleteObject(
    10252     psDB            *dbh,               ///< Database handle
    10253     const magicNodeResultRow *object    ///< Object to delete
    10254 );
    10255 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    10256  *
    10257  *  Note that a 'where' search psMetadata is constructed from each object and
    10258  *  used to find rows to delete.
    10259  *
    10260  * @return A The number of rows removed or a negative value on error
    10261  */
    10262 
    10263 long long magicNodeResultDeleteRowObjects(
    10264     psDB            *dbh,               ///< Database handle
    10265     const psArray   *objects,           ///< Array of objects to delete
    10266     unsigned long long limit            ///< Maximum number of elements to delete
    10267 );
    10268 /** Formats and prints an array of magicNodeResultRow objects
    10269  *
    10270  * When mdcf is set the formated output is in psMetadataConfig
    10271  * format, otherwise it is in a simple tabular format.
    10272  *
    10273  * @return true on success
    10274  */
    10275 
    10276 bool magicNodeResultPrintObjects(
    10277     FILE            *stream,            ///< a stream
    10278     psArray         *objects,           ///< An array of magicNodeResultRow objects
    10279     bool            mdcf                ///< format as mdconfig or simple
    10280 );
    10281 /** Formats and prints an magicNodeResultRow object
    10282  *
    10283  * When mdcf is set the formated output is in psMetadataConfig
    10284  * format, otherwise it is in a simple tabular format.
    10285  *
    10286  * @return true on success
    10287  */
    10288 
    10289 bool magicNodeResultPrintObject(
    10290     FILE            *stream,            ///< a stream
    10291     magicNodeResultRow *object,    ///< an magicNodeResultRow object
    10292     bool            mdcf                ///< format as mdconfig or simple
    10293 );
    10294 /** magicMaskRow data structure
    10295  *
    10296  * Structure for representing a single row of magicMask table data.
    10297  */
    10298 
    10299 typedef struct {
    10300     psS64           magic_id;
    10301     char            *uri;
    10302 } magicMaskRow;
    10303 
    10304 /** Creates a new magicMaskRow object
    10305  *
    10306  *  @return A new magicMaskRow object or NULL on failure.
    10307  */
    10308 
    10309 magicMaskRow *magicMaskRowAlloc(
    10310     psS64           magic_id,
    10311     const char      *uri
    10312 );
    10313 
    10314 /** Creates a new magicMask table
    10315  *
    10316  * @return true on success
    10317  */
    10318 
    10319 bool magicMaskCreateTable(
    10320     psDB            *dbh                ///< Database handle
    10321 );
    10322 
    10323 /** Deletes a magicMask table
    10324  *
    10325  * @return true on success
    10326  */
    10327 
    10328 bool magicMaskDropTable(
    10329     psDB            *dbh                ///< Database handle
    10330 );
    10331 
    10332 /** Insert a single row into a table
    10333  *
    10334  * This function constructs and inserts a single row based on it's parameters.
    10335  *
    10336  * @return true on success
    10337  */
    10338 
    10339 bool magicMaskInsert(
    10340     psDB            *dbh,               ///< Database handle
    10341     psS64           magic_id,
    10342     const char      *uri
    10343 );
    10344 
    10345 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    10346  *
    10347  * @return A The number of rows removed or a negative value on error
    10348  */
    10349 
    10350 long long magicMaskDelete(
    10351     psDB            *dbh,               ///< Database handle
    10352     const psMetadata *where,            ///< Row match criteria
    10353     unsigned long long limit            ///< Maximum number of elements to delete
    10354 );
    10355 
    10356 /** Insert a single magicMaskRow object into a table
    10357  *
    10358  * This function constructs and inserts a single row based on it's parameters.
    10359  *
    10360  * @return true on success
    10361  */
    10362 
    10363 bool magicMaskInsertObject(
    10364     psDB            *dbh,               ///< Database handle
    10365     magicMaskRow    *object             ///< magicMaskRow object
    10366 );
    10367 
    10368 /** Insert an array of magicMaskRow object into a table
    10369  *
    10370  * This function constructs and inserts multiple rows based on it's parameters.
    10371  *
    10372  * @return true on success
    10373  */
    10374 
    10375 bool magicMaskInsertObjects(
    10376     psDB            *dbh,               ///< Database handle
    10377     psArray         *objects            ///< array of magicMaskRow objects
    10378 );
    10379 
    10380 /** Insert data from a binary FITS table magicMaskRow into the database
    10381  *
    10382  * This function expects a psFits object with a FITS table as the first
    10383  * extension.  The table must have at least one row of data in it, that is of
    10384  * the appropriate format (number of columns and their type).  All other
    10385  * extensions are ignored.
    10386  *
    10387  * @return true on success
    10388  */
    10389 
    10390 bool magicMaskInsertFits(
    10391     psDB            *dbh,               ///< Database handle
    10392     const psFits    *fits               ///< psFits object
    10393 );
    10394 
    10395 /** Selects up to limit from the database and returns them in a binary FITS table
    10396  *
    10397  * This function assumes an empty psFits object and will create a FITS table
    10398  * as the first extension.
    10399  *
    10400  *  See psDBSelectRows() for documentation on the format of where.
    10401  *
    10402  * @return true on success
    10403  */
    10404 
    10405 bool magicMaskSelectRowsFits(
    10406     psDB            *dbh,               ///< Database handle
    10407     psFits          *fits,              ///< psFits object
    10408     const psMetadata *where,            ///< Row match criteria
    10409     unsigned long long limit            ///< Maximum number of elements to return
    10410 );
    10411 
    10412 /** Convert a magicMaskRow into an equivalent psMetadata
    10413  *
    10414  * @return A psMetadata pointer or NULL on error
    10415  */
    10416 
    10417 psMetadata *magicMaskMetadataFromObject(
    10418     const magicMaskRow *object             ///< fooRow to convert into a psMetadata
    10419 );
    10420 
    10421 /** Convert a psMetadata into an equivalent fooRow
    10422  *
    10423  * @return A magicMaskRow pointer or NULL on error
    10424  */
    10425 
    10426 magicMaskRow *magicMaskObjectFromMetadata(
    10427     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    10428 );
    10429 /** Selects up to limit rows from the database and returns as magicMaskRow objects in a psArray
    10430  *
    10431  *  See psDBSelectRows() for documentation on the format of where.
    10432  *
    10433  * @return A psArray pointer or NULL on error
    10434  */
    10435 
    10436 psArray *magicMaskSelectRowObjects(
    10437     psDB            *dbh,               ///< Database handle
    10438     const psMetadata *where,            ///< Row match criteria
    10439     unsigned long long limit            ///< Maximum number of elements to return
    10440 );
    10441 /** Deletes a row from the database coresponding to an magicMask
    10442  *
    10443  *  Note that a 'where' search psMetadata is constructed from each object and
    10444  *  used to find rows to delete.
    10445  *
    10446  * @return A The number of rows removed or a negative value on error
    10447  */
    10448 
    10449 bool magicMaskDeleteObject(
    10450     psDB            *dbh,               ///< Database handle
    10451     const magicMaskRow *object    ///< Object to delete
    10452 );
    10453 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    10454  *
    10455  *  Note that a 'where' search psMetadata is constructed from each object and
    10456  *  used to find rows to delete.
    10457  *
    10458  * @return A The number of rows removed or a negative value on error
    10459  */
    10460 
    10461 long long magicMaskDeleteRowObjects(
    10462     psDB            *dbh,               ///< Database handle
    10463     const psArray   *objects,           ///< Array of objects to delete
    10464     unsigned long long limit            ///< Maximum number of elements to delete
    10465 );
    10466 /** Formats and prints an array of magicMaskRow objects
    10467  *
    10468  * When mdcf is set the formated output is in psMetadataConfig
    10469  * format, otherwise it is in a simple tabular format.
    10470  *
    10471  * @return true on success
    10472  */
    10473 
    10474 bool magicMaskPrintObjects(
    10475     FILE            *stream,            ///< a stream
    10476     psArray         *objects,           ///< An array of magicMaskRow objects
    10477     bool            mdcf                ///< format as mdconfig or simple
    10478 );
    10479 /** Formats and prints an magicMaskRow object
    10480  *
    10481  * When mdcf is set the formated output is in psMetadataConfig
    10482  * format, otherwise it is in a simple tabular format.
    10483  *
    10484  * @return true on success
    10485  */
    10486 
    10487 bool magicMaskPrintObject(
    10488     FILE            *stream,            ///< a stream
    10489     magicMaskRow *object,    ///< an magicMaskRow object
    10490     bool            mdcf                ///< format as mdconfig or simple
    10491 );
    10492 /** magicSkyfileMaskRow data structure
    10493  *
    10494  * Structure for representing a single row of magicSkyfileMask table data.
    10495  */
    10496 
    10497 typedef struct {
    10498     psS64           magic_id;
    10499     psS64           diff_id;
    10500     char            *uri;
    10501 } magicSkyfileMaskRow;
    10502 
    10503 /** Creates a new magicSkyfileMaskRow object
    10504  *
    10505  *  @return A new magicSkyfileMaskRow object or NULL on failure.
    10506  */
    10507 
    10508 magicSkyfileMaskRow *magicSkyfileMaskRowAlloc(
    10509     psS64           magic_id,
    10510     psS64           diff_id,
    10511     const char      *uri
    10512 );
    10513 
    10514 /** Creates a new magicSkyfileMask table
    10515  *
    10516  * @return true on success
    10517  */
    10518 
    10519 bool magicSkyfileMaskCreateTable(
    10520     psDB            *dbh                ///< Database handle
    10521 );
    10522 
    10523 /** Deletes a magicSkyfileMask table
    10524  *
    10525  * @return true on success
    10526  */
    10527 
    10528 bool magicSkyfileMaskDropTable(
    10529     psDB            *dbh                ///< Database handle
    10530 );
    10531 
    10532 /** Insert a single row into a table
    10533  *
    10534  * This function constructs and inserts a single row based on it's parameters.
    10535  *
    10536  * @return true on success
    10537  */
    10538 
    10539 bool magicSkyfileMaskInsert(
    10540     psDB            *dbh,               ///< Database handle
    10541     psS64           magic_id,
    10542     psS64           diff_id,
    10543     const char      *uri
    10544 );
    10545 
    10546 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    10547  *
    10548  * @return A The number of rows removed or a negative value on error
    10549  */
    10550 
    10551 long long magicSkyfileMaskDelete(
    10552     psDB            *dbh,               ///< Database handle
    10553     const psMetadata *where,            ///< Row match criteria
    10554     unsigned long long limit            ///< Maximum number of elements to delete
    10555 );
    10556 
    10557 /** Insert a single magicSkyfileMaskRow object into a table
    10558  *
    10559  * This function constructs and inserts a single row based on it's parameters.
    10560  *
    10561  * @return true on success
    10562  */
    10563 
    10564 bool magicSkyfileMaskInsertObject(
    10565     psDB            *dbh,               ///< Database handle
    10566     magicSkyfileMaskRow *object             ///< magicSkyfileMaskRow object
    10567 );
    10568 
    10569 /** Insert an array of magicSkyfileMaskRow object into a table
    10570  *
    10571  * This function constructs and inserts multiple rows based on it's parameters.
    10572  *
    10573  * @return true on success
    10574  */
    10575 
    10576 bool magicSkyfileMaskInsertObjects(
    10577     psDB            *dbh,               ///< Database handle
    10578     psArray         *objects            ///< array of magicSkyfileMaskRow objects
    10579 );
    10580 
    10581 /** Insert data from a binary FITS table magicSkyfileMaskRow into the database
    10582  *
    10583  * This function expects a psFits object with a FITS table as the first
    10584  * extension.  The table must have at least one row of data in it, that is of
    10585  * the appropriate format (number of columns and their type).  All other
    10586  * extensions are ignored.
    10587  *
    10588  * @return true on success
    10589  */
    10590 
    10591 bool magicSkyfileMaskInsertFits(
    10592     psDB            *dbh,               ///< Database handle
    10593     const psFits    *fits               ///< psFits object
    10594 );
    10595 
    10596 /** Selects up to limit from the database and returns them in a binary FITS table
    10597  *
    10598  * This function assumes an empty psFits object and will create a FITS table
    10599  * as the first extension.
    10600  *
    10601  *  See psDBSelectRows() for documentation on the format of where.
    10602  *
    10603  * @return true on success
    10604  */
    10605 
    10606 bool magicSkyfileMaskSelectRowsFits(
    10607     psDB            *dbh,               ///< Database handle
    10608     psFits          *fits,              ///< psFits object
    10609     const psMetadata *where,            ///< Row match criteria
    10610     unsigned long long limit            ///< Maximum number of elements to return
    10611 );
    10612 
    10613 /** Convert a magicSkyfileMaskRow into an equivalent psMetadata
    10614  *
    10615  * @return A psMetadata pointer or NULL on error
    10616  */
    10617 
    10618 psMetadata *magicSkyfileMaskMetadataFromObject(
    10619     const magicSkyfileMaskRow *object             ///< fooRow to convert into a psMetadata
    10620 );
    10621 
    10622 /** Convert a psMetadata into an equivalent fooRow
    10623  *
    10624  * @return A magicSkyfileMaskRow pointer or NULL on error
    10625  */
    10626 
    10627 magicSkyfileMaskRow *magicSkyfileMaskObjectFromMetadata(
    10628     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    10629 );
    10630 /** Selects up to limit rows from the database and returns as magicSkyfileMaskRow objects in a psArray
    10631  *
    10632  *  See psDBSelectRows() for documentation on the format of where.
    10633  *
    10634  * @return A psArray pointer or NULL on error
    10635  */
    10636 
    10637 psArray *magicSkyfileMaskSelectRowObjects(
    10638     psDB            *dbh,               ///< Database handle
    10639     const psMetadata *where,            ///< Row match criteria
    10640     unsigned long long limit            ///< Maximum number of elements to return
    10641 );
    10642 /** Deletes a row from the database coresponding to an magicSkyfileMask
    10643  *
    10644  *  Note that a 'where' search psMetadata is constructed from each object and
    10645  *  used to find rows to delete.
    10646  *
    10647  * @return A The number of rows removed or a negative value on error
    10648  */
    10649 
    10650 bool magicSkyfileMaskDeleteObject(
    10651     psDB            *dbh,               ///< Database handle
    10652     const magicSkyfileMaskRow *object    ///< Object to delete
    10653 );
    10654 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    10655  *
    10656  *  Note that a 'where' search psMetadata is constructed from each object and
    10657  *  used to find rows to delete.
    10658  *
    10659  * @return A The number of rows removed or a negative value on error
    10660  */
    10661 
    10662 long long magicSkyfileMaskDeleteRowObjects(
    10663     psDB            *dbh,               ///< Database handle
    10664     const psArray   *objects,           ///< Array of objects to delete
    10665     unsigned long long limit            ///< Maximum number of elements to delete
    10666 );
    10667 /** Formats and prints an array of magicSkyfileMaskRow objects
    10668  *
    10669  * When mdcf is set the formated output is in psMetadataConfig
    10670  * format, otherwise it is in a simple tabular format.
    10671  *
    10672  * @return true on success
    10673  */
    10674 
    10675 bool magicSkyfileMaskPrintObjects(
    10676     FILE            *stream,            ///< a stream
    10677     psArray         *objects,           ///< An array of magicSkyfileMaskRow objects
    10678     bool            mdcf                ///< format as mdconfig or simple
    10679 );
    10680 /** Formats and prints an magicSkyfileMaskRow object
    10681  *
    10682  * When mdcf is set the formated output is in psMetadataConfig
    10683  * format, otherwise it is in a simple tabular format.
    10684  *
    10685  * @return true on success
    10686  */
    10687 
    10688 bool magicSkyfileMaskPrintObject(
    10689     FILE            *stream,            ///< a stream
    10690     magicSkyfileMaskRow *object,    ///< an magicSkyfileMaskRow object
    10691     bool            mdcf                ///< format as mdconfig or simple
    10692 );
    106938776
    106948777/// @}
     
    106988781#endif
    106998782
    10700 #endif // MAGICSKYFILEMASK_DB_H
     8783#endif // DETRUNSUMMARY_DB_H
Note: See TracChangeset for help on using the changeset viewer.