IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 6, 2007, 4:55:04 PM (19 years ago)
Author:
jhoblitt
Message:

ippdb 1.2.24

File:
1 edited

Legend:

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

    r13937 r14061  
    125125);
    126126
    127 /** expTagCounterRow data structure
    128  *
    129  * Structure for representing a single row of expTagCounter table data.
     127/** summitExpRow data structure
     128 *
     129 * Structure for representing a single row of summitExp table data.
    130130 */
    131131
    132132typedef struct {
    133     psU64           counter;
    134 } expTagCounterRow;
    135 
    136 /** Creates a new expTagCounterRow object
    137  *
    138  *  @return A new expTagCounterRow object or NULL on failure.
    139  */
    140 
    141 expTagCounterRow *expTagCounterRowAlloc(
    142     psU64           counter
    143 );
    144 
    145 /** Creates a new expTagCounter table
    146  *
    147  * @return true on success
    148  */
    149 
    150 bool expTagCounterCreateTable(
    151     psDB            *dbh                ///< Database handle
    152 );
    153 
    154 /** Deletes a expTagCounter table
    155  *
    156  * @return true on success
    157  */
    158 
    159 bool expTagCounterDropTable(
    160     psDB            *dbh                ///< Database handle
    161 );
    162 
    163 /** Insert a single row into a table
    164  *
    165  * This function constructs and inserts a single row based on it's parameters.
    166  *
    167  * @return true on success
    168  */
    169 
    170 bool expTagCounterInsert(
    171     psDB            *dbh,               ///< Database handle
    172     psU64           counter
    173 );
    174 
    175 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    176  *
    177  * @return A The number of rows removed or a negative value on error
    178  */
    179 
    180 long long expTagCounterDelete(
    181     psDB            *dbh,               ///< Database handle
    182     const psMetadata *where,            ///< Row match criteria
    183     unsigned long long limit            ///< Maximum number of elements to delete
    184 );
    185 
    186 /** Insert a single expTagCounterRow object into a table
    187  *
    188  * This function constructs and inserts a single row based on it's parameters.
    189  *
    190  * @return true on success
    191  */
    192 
    193 bool expTagCounterInsertObject(
    194     psDB            *dbh,               ///< Database handle
    195     expTagCounterRow *object             ///< expTagCounterRow object
    196 );
    197 
    198 /** Insert an array of expTagCounterRow object into a table
    199  *
    200  * This function constructs and inserts multiple rows based on it's parameters.
    201  *
    202  * @return true on success
    203  */
    204 
    205 bool expTagCounterInsertObjects(
    206     psDB            *dbh,               ///< Database handle
    207     psArray         *objects            ///< array of expTagCounterRow objects
    208 );
    209 
    210 /** Insert data from a binary FITS table expTagCounterRow into the database
    211  *
    212  * This function expects a psFits object with a FITS table as the first
    213  * extension.  The table must have at least one row of data in it, that is of
    214  * the appropriate format (number of columns and their type).  All other
    215  * extensions are ignored.
    216  *
    217  * @return true on success
    218  */
    219 
    220 bool expTagCounterInsertFits(
    221     psDB            *dbh,               ///< Database handle
    222     const psFits    *fits               ///< psFits object
    223 );
    224 
    225 /** Selects up to limit from the database and returns them in a binary FITS table
    226  *
    227  * This function assumes an empty psFits object and will create a FITS table
    228  * as the first extension.
    229  *
    230  *  See psDBSelectRows() for documentation on the format of where.
    231  *
    232  * @return true on success
    233  */
    234 
    235 bool expTagCounterSelectRowsFits(
    236     psDB            *dbh,               ///< Database handle
    237     psFits          *fits,              ///< psFits object
    238     const psMetadata *where,            ///< Row match criteria
    239     unsigned long long limit            ///< Maximum number of elements to return
    240 );
    241 
    242 /** Convert a expTagCounterRow into an equivalent psMetadata
    243  *
    244  * @return A psMetadata pointer or NULL on error
    245  */
    246 
    247 psMetadata *expTagCounterMetadataFromObject(
    248     const expTagCounterRow *object             ///< fooRow to convert into a psMetadata
    249 );
    250 
    251 /** Convert a psMetadata into an equivalent fooRow
    252  *
    253  * @return A expTagCounterRow pointer or NULL on error
    254  */
    255 
    256 expTagCounterRow *expTagCounterObjectFromMetadata(
    257     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    258 );
    259 /** Selects up to limit rows from the database and returns as expTagCounterRow objects in a psArray
    260  *
    261  *  See psDBSelectRows() for documentation on the format of where.
    262  *
    263  * @return A psArray pointer or NULL on error
    264  */
    265 
    266 psArray *expTagCounterSelectRowObjects(
    267     psDB            *dbh,               ///< Database handle
    268     const psMetadata *where,            ///< Row match criteria
    269     unsigned long long limit            ///< Maximum number of elements to return
    270 );
    271 /** Deletes a row from the database coresponding to an expTagCounter
    272  *
    273  *  Note that a 'where' search psMetadata is constructed from each object and
    274  *  used to find rows to delete.
    275  *
    276  * @return A The number of rows removed or a negative value on error
    277  */
    278 
    279 bool expTagCounterDeleteObject(
    280     psDB            *dbh,               ///< Database handle
    281     const expTagCounterRow *object    ///< Object to delete
    282 );
    283 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    284  *
    285  *  Note that a 'where' search psMetadata is constructed from each object and
    286  *  used to find rows to delete.
    287  *
    288  * @return A The number of rows removed or a negative value on error
    289  */
    290 
    291 long long expTagCounterDeleteRowObjects(
    292     psDB            *dbh,               ///< Database handle
    293     const psArray   *objects,           ///< Array of objects to delete
    294     unsigned long long limit            ///< Maximum number of elements to delete
    295 );
    296 /** Formats and prints an array of expTagCounterRow objects
    297  *
    298  * When mdcf is set the formated output is in psMetadataConfig
    299  * format, otherwise it is in a simple tabular format.
    300  *
    301  * @return true on success
    302  */
    303 
    304 bool expTagCounterPrintObjects(
    305     FILE            *stream,            ///< a stream
    306     psArray         *objects,           ///< An array of expTagCounterRow objects
    307     bool            mdcf                ///< format as mdconfig or simple
    308 );
    309 /** Formats and prints an expTagCounterRow object
    310  *
    311  * When mdcf is set the formated output is in psMetadataConfig
    312  * format, otherwise it is in a simple tabular format.
    313  *
    314  * @return true on success
    315  */
    316 
    317 bool expTagCounterPrintObject(
    318     FILE            *stream,            ///< a stream
    319     expTagCounterRow *object,    ///< an expTagCounterRow object
    320     bool            mdcf                ///< format as mdconfig or simple
    321 );
    322 /** summitExpRow data structure
    323  *
    324  * Structure for representing a single row of summitExp table data.
    325  */
    326 
    327 typedef struct {
    328     char            *exp_id;
     133    char            *exp_name;
    329134    char            *camera;
    330135    char            *telescope;
     
    341146
    342147summitExpRow *summitExpRowAlloc(
    343     const char      *exp_id,
     148    const char      *exp_name,
    344149    const char      *camera,
    345150    const char      *telescope,
     
    377182bool summitExpInsert(
    378183    psDB            *dbh,               ///< Database handle
    379     const char      *exp_id,
     184    const char      *exp_name,
    380185    const char      *camera,
    381186    const char      *telescope,
     
    539344
    540345typedef struct {
    541     char            *exp_id;
     346    char            *exp_name;
    542347    char            *camera;
    543348    char            *telescope;
     
    556361
    557362summitImfileRow *summitImfileRowAlloc(
    558     const char      *exp_id,
     363    const char      *exp_name,
    559364    const char      *camera,
    560365    const char      *telescope,
     
    594399bool summitImfileInsert(
    595400    psDB            *dbh,               ///< Database handle
    596     const char      *exp_id,
     401    const char      *exp_name,
    597402    const char      *camera,
    598403    const char      *telescope,
     
    758563
    759564typedef struct {
    760     char            *exp_id;
     565    char            *exp_name;
    761566    char            *camera;
    762567    char            *telescope;
     
    769574
    770575pzPendingExpRow *pzPendingExpRowAlloc(
    771     const char      *exp_id,
     576    const char      *exp_name,
    772577    const char      *camera,
    773578    const char      *telescope
     
    801606bool pzPendingExpInsert(
    802607    psDB            *dbh,               ///< Database handle
    803     const char      *exp_id,
     608    const char      *exp_name,
    804609    const char      *camera,
    805610    const char      *telescope
     
    959764
    960765typedef struct {
    961     char            *exp_id;
     766    char            *exp_name;
    962767    char            *camera;
    963768    char            *telescope;
    964769    char            *class;
    965770    char            *class_id;
    966     char            *exp_tag;
     771    psS64           exp_id;
    967772} pzPendingImfileRow;
    968773
     
    973778
    974779pzPendingImfileRow *pzPendingImfileRowAlloc(
    975     const char      *exp_id,
     780    const char      *exp_name,
    976781    const char      *camera,
    977782    const char      *telescope,
    978783    const char      *class,
    979784    const char      *class_id,
    980     const char      *exp_tag
     785    psS64           exp_id
    981786);
    982787
     
    1008813bool pzPendingImfileInsert(
    1009814    psDB            *dbh,               ///< Database handle
    1010     const char      *exp_id,
     815    const char      *exp_name,
    1011816    const char      *camera,
    1012817    const char      *telescope,
    1013818    const char      *class,
    1014819    const char      *class_id,
    1015     const char      *exp_tag
     820    psS64           exp_id
    1016821);
    1017822
     
    1169974
    1170975typedef struct {
    1171     char            *exp_id;
     976    char            *exp_name;
    1172977    char            *camera;
    1173978    char            *telescope;
     
    1180985
    1181986pzDoneExpRow *pzDoneExpRowAlloc(
    1182     const char      *exp_id,
     987    const char      *exp_name,
    1183988    const char      *camera,
    1184989    const char      *telescope
     
    12121017bool pzDoneExpInsert(
    12131018    psDB            *dbh,               ///< Database handle
    1214     const char      *exp_id,
     1019    const char      *exp_name,
    12151020    const char      *camera,
    12161021    const char      *telescope
     
    13701175
    13711176typedef struct {
    1372     char            *exp_id;
     1177    char            *exp_name;
    13731178    char            *camera;
    13741179    char            *telescope;
    13751180    char            *class;
    13761181    char            *class_id;
    1377     char            *exp_tag;
     1182    psS64           exp_id;
    13781183    char            *uri;
    13791184} pzDoneImfileRow;
     
    13851190
    13861191pzDoneImfileRow *pzDoneImfileRowAlloc(
    1387     const char      *exp_id,
     1192    const char      *exp_name,
    13881193    const char      *camera,
    13891194    const char      *telescope,
    13901195    const char      *class,
    13911196    const char      *class_id,
    1392     const char      *exp_tag,
     1197    psS64           exp_id,
    13931198    const char      *uri
    13941199);
     
    14211226bool pzDoneImfileInsert(
    14221227    psDB            *dbh,               ///< Database handle
    1423     const char      *exp_id,
     1228    const char      *exp_name,
    14241229    const char      *camera,
    14251230    const char      *telescope,
    14261231    const char      *class,
    14271232    const char      *class_id,
    1428     const char      *exp_tag,
     1233    psS64           exp_id,
    14291234    const char      *uri
    14301235);
     
    15831388
    15841389typedef struct {
    1585     char            *exp_tag;
    1586     char            *exp_id;
    1587     char            *camera;
    1588     char            *telescope;
    1589     psS32           imfiles;
     1390    psS64           exp_id;
     1391    char            *tmp_exp_name;
     1392    char            *tmp_camera;
     1393    char            *tmp_telescope;
     1394    char            *state;
    15901395    char            *workdir;
     1396    char            *workdir_state;
    15911397} newExpRow;
    15921398
     
    15971403
    15981404newExpRow *newExpRowAlloc(
    1599     const char      *exp_tag,
    1600     const char      *exp_id,
    1601     const char      *camera,
    1602     const char      *telescope,
    1603     psS32           imfiles,
    1604     const char      *workdir
     1405    psS64           exp_id,
     1406    const char      *tmp_exp_name,
     1407    const char      *tmp_camera,
     1408    const char      *tmp_telescope,
     1409    const char      *state,
     1410    const char      *workdir,
     1411    const char      *workdir_state
    16051412);
    16061413
     
    16321439bool newExpInsert(
    16331440    psDB            *dbh,               ///< Database handle
    1634     const char      *exp_tag,
    1635     const char      *exp_id,
    1636     const char      *camera,
    1637     const char      *telescope,
    1638     psS32           imfiles,
    1639     const char      *workdir
     1441    psS64           exp_id,
     1442    const char      *tmp_exp_name,
     1443    const char      *tmp_camera,
     1444    const char      *tmp_telescope,
     1445    const char      *state,
     1446    const char      *workdir,
     1447    const char      *workdir_state
    16401448);
    16411449
     
    17931601
    17941602typedef struct {
    1795     char            *exp_tag;
    1796     char            *class;
    1797     char            *class_id;
     1603    psS64           exp_id;
     1604    char            *tmp_class_id;
    17981605    char            *uri;
    17991606} newImfileRow;
     
    18051612
    18061613newImfileRow *newImfileRowAlloc(
    1807     const char      *exp_tag,
    1808     const char      *class,
    1809     const char      *class_id,
     1614    psS64           exp_id,
     1615    const char      *tmp_class_id,
    18101616    const char      *uri
    18111617);
     
    18381644bool newImfileInsert(
    18391645    psDB            *dbh,               ///< Database handle
    1840     const char      *exp_tag,
    1841     const char      *class,
    1842     const char      *class_id,
     1646    psS64           exp_id,
     1647    const char      *tmp_class_id,
    18431648    const char      *uri
    18441649);
     
    19971802
    19981803typedef struct {
    1999     char            *exp_tag;
    2000     char            *exp_id;
     1804    psS64           exp_id;
     1805    char            *exp_name;
    20011806    char            *camera;
    20021807    char            *telescope;
    20031808    psTime*         dateobs;
     1809    char            *exp_tag;
    20041810    char            *exp_type;
    2005     psS32           imfiles;
    20061811    char            *filelevel;
    20071812    char            *workdir;
     
    20351840
    20361841rawExpRow *rawExpRowAlloc(
    2037     const char      *exp_tag,
    2038     const char      *exp_id,
     1842    psS64           exp_id,
     1843    const char      *exp_name,
    20391844    const char      *camera,
    20401845    const char      *telescope,
    20411846    psTime*         dateobs,
     1847    const char      *exp_tag,
    20421848    const char      *exp_type,
    2043     psS32           imfiles,
    20441849    const char      *filelevel,
    20451850    const char      *workdir,
     
    20941899bool rawExpInsert(
    20951900    psDB            *dbh,               ///< Database handle
    2096     const char      *exp_tag,
    2097     const char      *exp_id,
     1901    psS64           exp_id,
     1902    const char      *exp_name,
    20981903    const char      *camera,
    20991904    const char      *telescope,
    21001905    psTime*         dateobs,
     1906    const char      *exp_tag,
    21011907    const char      *exp_type,
    2102     psS32           imfiles,
    21031908    const char      *filelevel,
    21041909    const char      *workdir,
     
    22792084
    22802085typedef struct {
    2281     char            *exp_tag;
     2086    psS64           exp_id;
     2087    char            *exp_name;
     2088    char            *camera;
     2089    char            *telescope;
     2090    psTime*         dateobs;
     2091    char            *tmp_class_id;
    22822092    char            *class_id;
    22832093    char            *uri;
     
    23032113    psF64           user_5;
    23042114    char            *object;
    2305     psTime*         dateobs;
    23062115    psS16           fault;
    23072116} rawImfileRow;
     
    23132122
    23142123rawImfileRow *rawImfileRowAlloc(
    2315     const char      *exp_tag,
     2124    psS64           exp_id,
     2125    const char      *exp_name,
     2126    const char      *camera,
     2127    const char      *telescope,
     2128    psTime*         dateobs,
     2129    const char      *tmp_class_id,
    23162130    const char      *class_id,
    23172131    const char      *uri,
     
    23372151    psF64           user_5,
    23382152    const char      *object,
    2339     psTime*         dateobs,
    23402153    psS16           fault
    23412154);
     
    23682181bool rawImfileInsert(
    23692182    psDB            *dbh,               ///< Database handle
    2370     const char      *exp_tag,
     2183    psS64           exp_id,
     2184    const char      *exp_name,
     2185    const char      *camera,
     2186    const char      *telescope,
     2187    psTime*         dateobs,
     2188    const char      *tmp_class_id,
    23712189    const char      *class_id,
    23722190    const char      *uri,
     
    23922210    psF64           user_5,
    23932211    const char      *object,
    2394     psTime*         dateobs,
    23952212    psS16           fault
    23962213);
     
    25502367typedef struct {
    25512368    psS64           guide_id;
    2552     char            *exp_tag;
     2369    psS64           exp_id;
    25532370    char            *recipe;
    25542371} guidePendingExpRow;
     
    25612378guidePendingExpRow *guidePendingExpRowAlloc(
    25622379    psS64           guide_id,
    2563     const char      *exp_tag,
     2380    psS64           exp_id,
    25642381    const char      *recipe
    25652382);
     
    25932410    psDB            *dbh,               ///< Database handle
    25942411    psS64           guide_id,
    2595     const char      *exp_tag,
     2412    psS64           exp_id,
    25962413    const char      *recipe
    25972414);
     
    27442561    bool            mdcf                ///< format as mdconfig or simple
    27452562);
    2746 /** chipPendingExpRow data structure
    2747  *
    2748  * Structure for representing a single row of chipPendingExp table data.
     2563/** chipRunRow data structure
     2564 *
     2565 * Structure for representing a single row of chipRun table data.
    27492566 */
    27502567
    27512568typedef struct {
    27522569    psS64           chip_id;
    2753     char            *exp_tag;
    2754     psS64           guide_id;
     2570    char            *state;
    27552571    char            *workdir;
     2572    char            *workdir_state;
    27562573    char            *label;
    27572574    char            *reduction;
    27582575    char            *expgroup;
    27592576    char            *dvodb;
    2760 } chipPendingExpRow;
    2761 
    2762 /** Creates a new chipPendingExpRow object
    2763  *
    2764  *  @return A new chipPendingExpRow object or NULL on failure.
    2765  */
    2766 
    2767 chipPendingExpRow *chipPendingExpRowAlloc(
     2577} chipRunRow;
     2578
     2579/** Creates a new chipRunRow object
     2580 *
     2581 *  @return A new chipRunRow object or NULL on failure.
     2582 */
     2583
     2584chipRunRow *chipRunRowAlloc(
    27682585    psS64           chip_id,
    2769     const char      *exp_tag,
    2770     psS64           guide_id,
     2586    const char      *state,
    27712587    const char      *workdir,
     2588    const char      *workdir_state,
    27722589    const char      *label,
    27732590    const char      *reduction,
     
    27762593);
    27772594
    2778 /** Creates a new chipPendingExp table
    2779  *
    2780  * @return true on success
    2781  */
    2782 
    2783 bool chipPendingExpCreateTable(
     2595/** Creates a new chipRun table
     2596 *
     2597 * @return true on success
     2598 */
     2599
     2600bool chipRunCreateTable(
    27842601    psDB            *dbh                ///< Database handle
    27852602);
    27862603
    2787 /** Deletes a chipPendingExp table
    2788  *
    2789  * @return true on success
    2790  */
    2791 
    2792 bool chipPendingExpDropTable(
     2604/** Deletes a chipRun table
     2605 *
     2606 * @return true on success
     2607 */
     2608
     2609bool chipRunDropTable(
    27932610    psDB            *dbh                ///< Database handle
    27942611);
     
    28012618 */
    28022619
    2803 bool chipPendingExpInsert(
     2620bool chipRunInsert(
    28042621    psDB            *dbh,               ///< Database handle
    28052622    psS64           chip_id,
    2806     const char      *exp_tag,
    2807     psS64           guide_id,
     2623    const char      *state,
    28082624    const char      *workdir,
     2625    const char      *workdir_state,
    28092626    const char      *label,
    28102627    const char      *reduction,
     
    28182635 */
    28192636
    2820 long long chipPendingExpDelete(
     2637long long chipRunDelete(
    28212638    psDB            *dbh,               ///< Database handle
    28222639    const psMetadata *where,            ///< Row match criteria
     
    28242641);
    28252642
    2826 /** Insert a single chipPendingExpRow object into a table
     2643/** Insert a single chipRunRow object into a table
    28272644 *
    28282645 * This function constructs and inserts a single row based on it's parameters.
     
    28312648 */
    28322649
    2833 bool chipPendingExpInsertObject(
    2834     psDB            *dbh,               ///< Database handle
    2835     chipPendingExpRow *object             ///< chipPendingExpRow object
    2836 );
    2837 
    2838 /** Insert an array of chipPendingExpRow object into a table
     2650bool chipRunInsertObject(
     2651    psDB            *dbh,               ///< Database handle
     2652    chipRunRow      *object             ///< chipRunRow object
     2653);
     2654
     2655/** Insert an array of chipRunRow object into a table
    28392656 *
    28402657 * This function constructs and inserts multiple rows based on it's parameters.
     
    28432660 */
    28442661
    2845 bool chipPendingExpInsertObjects(
    2846     psDB            *dbh,               ///< Database handle
    2847     psArray         *objects            ///< array of chipPendingExpRow objects
    2848 );
    2849 
    2850 /** Insert data from a binary FITS table chipPendingExpRow into the database
     2662bool chipRunInsertObjects(
     2663    psDB            *dbh,               ///< Database handle
     2664    psArray         *objects            ///< array of chipRunRow objects
     2665);
     2666
     2667/** Insert data from a binary FITS table chipRunRow into the database
    28512668 *
    28522669 * This function expects a psFits object with a FITS table as the first
     
    28582675 */
    28592676
    2860 bool chipPendingExpInsertFits(
     2677bool chipRunInsertFits(
    28612678    psDB            *dbh,               ///< Database handle
    28622679    const psFits    *fits               ///< psFits object
     
    28732690 */
    28742691
    2875 bool chipPendingExpSelectRowsFits(
     2692bool chipRunSelectRowsFits(
    28762693    psDB            *dbh,               ///< Database handle
    28772694    psFits          *fits,              ///< psFits object
     
    28802697);
    28812698
    2882 /** Convert a chipPendingExpRow into an equivalent psMetadata
     2699/** Convert a chipRunRow into an equivalent psMetadata
    28832700 *
    28842701 * @return A psMetadata pointer or NULL on error
    28852702 */
    28862703
    2887 psMetadata *chipPendingExpMetadataFromObject(
    2888     const chipPendingExpRow *object             ///< fooRow to convert into a psMetadata
     2704psMetadata *chipRunMetadataFromObject(
     2705    const chipRunRow *object             ///< fooRow to convert into a psMetadata
    28892706);
    28902707
    28912708/** Convert a psMetadata into an equivalent fooRow
    28922709 *
    2893  * @return A chipPendingExpRow pointer or NULL on error
    2894  */
    2895 
    2896 chipPendingExpRow *chipPendingExpObjectFromMetadata(
     2710 * @return A chipRunRow pointer or NULL on error
     2711 */
     2712
     2713chipRunRow *chipRunObjectFromMetadata(
    28972714    psMetadata      *md                 ///< psMetadata to convert into a fooRow
    28982715);
    2899 /** Selects up to limit rows from the database and returns as chipPendingExpRow objects in a psArray
     2716/** Selects up to limit rows from the database and returns as chipRunRow objects in a psArray
    29002717 *
    29012718 *  See psDBSelectRows() for documentation on the format of where.
     
    29042721 */
    29052722
    2906 psArray *chipPendingExpSelectRowObjects(
     2723psArray *chipRunSelectRowObjects(
    29072724    psDB            *dbh,               ///< Database handle
    29082725    const psMetadata *where,            ///< Row match criteria
    29092726    unsigned long long limit            ///< Maximum number of elements to return
    29102727);
    2911 /** Deletes a row from the database coresponding to an chipPendingExp
     2728/** Deletes a row from the database coresponding to an chipRun
    29122729 *
    29132730 *  Note that a 'where' search psMetadata is constructed from each object and
     
    29172734 */
    29182735
    2919 bool chipPendingExpDeleteObject(
    2920     psDB            *dbh,               ///< Database handle
    2921     const chipPendingExpRow *object    ///< Object to delete
     2736bool chipRunDeleteObject(
     2737    psDB            *dbh,               ///< Database handle
     2738    const chipRunRow *object    ///< Object to delete
    29222739);
    29232740/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    29292746 */
    29302747
    2931 long long chipPendingExpDeleteRowObjects(
     2748long long chipRunDeleteRowObjects(
    29322749    psDB            *dbh,               ///< Database handle
    29332750    const psArray   *objects,           ///< Array of objects to delete
    29342751    unsigned long long limit            ///< Maximum number of elements to delete
    29352752);
    2936 /** Formats and prints an array of chipPendingExpRow objects
     2753/** Formats and prints an array of chipRunRow objects
    29372754 *
    29382755 * When mdcf is set the formated output is in psMetadataConfig
     
    29422759 */
    29432760
    2944 bool chipPendingExpPrintObjects(
     2761bool chipRunPrintObjects(
    29452762    FILE            *stream,            ///< a stream
    2946     psArray         *objects,           ///< An array of chipPendingExpRow objects
     2763    psArray         *objects,           ///< An array of chipRunRow objects
    29472764    bool            mdcf                ///< format as mdconfig or simple
    29482765);
    2949 /** Formats and prints an chipPendingExpRow object
     2766/** Formats and prints an chipRunRow object
    29502767 *
    29512768 * When mdcf is set the formated output is in psMetadataConfig
     
    29552772 */
    29562773
    2957 bool chipPendingExpPrintObject(
     2774bool chipRunPrintObject(
    29582775    FILE            *stream,            ///< a stream
    2959     chipPendingExpRow *object,    ///< an chipPendingExpRow object
     2776    chipRunRow *object,    ///< an chipRunRow object
    29602777    bool            mdcf                ///< format as mdconfig or simple
    29612778);
    2962 /** chipPendingImfileRow data structure
    2963  *
    2964  * Structure for representing a single row of chipPendingImfile table data.
     2779/** chipInputImfileRow data structure
     2780 *
     2781 * Structure for representing a single row of chipInputImfile table data.
    29652782 */
    29662783
    29672784typedef struct {
    29682785    psS64           chip_id;
     2786    psS64           exp_id;
    29692787    char            *class_id;
    2970     char            *uri;
    2971 } chipPendingImfileRow;
    2972 
    2973 /** Creates a new chipPendingImfileRow object
    2974  *
    2975  *  @return A new chipPendingImfileRow object or NULL on failure.
    2976  */
    2977 
    2978 chipPendingImfileRow *chipPendingImfileRowAlloc(
     2788} chipInputImfileRow;
     2789
     2790/** Creates a new chipInputImfileRow object
     2791 *
     2792 *  @return A new chipInputImfileRow object or NULL on failure.
     2793 */
     2794
     2795chipInputImfileRow *chipInputImfileRowAlloc(
    29792796    psS64           chip_id,
    2980     const char      *class_id,
    2981     const char      *uri
    2982 );
    2983 
    2984 /** Creates a new chipPendingImfile table
    2985  *
    2986  * @return true on success
    2987  */
    2988 
    2989 bool chipPendingImfileCreateTable(
     2797    psS64           exp_id,
     2798    const char      *class_id
     2799);
     2800
     2801/** Creates a new chipInputImfile table
     2802 *
     2803 * @return true on success
     2804 */
     2805
     2806bool chipInputImfileCreateTable(
    29902807    psDB            *dbh                ///< Database handle
    29912808);
    29922809
    2993 /** Deletes a chipPendingImfile table
    2994  *
    2995  * @return true on success
    2996  */
    2997 
    2998 bool chipPendingImfileDropTable(
     2810/** Deletes a chipInputImfile table
     2811 *
     2812 * @return true on success
     2813 */
     2814
     2815bool chipInputImfileDropTable(
    29992816    psDB            *dbh                ///< Database handle
    30002817);
     
    30072824 */
    30082825
    3009 bool chipPendingImfileInsert(
     2826bool chipInputImfileInsert(
    30102827    psDB            *dbh,               ///< Database handle
    30112828    psS64           chip_id,
    3012     const char      *class_id,
    3013     const char      *uri
     2829    psS64           exp_id,
     2830    const char      *class_id
    30142831);
    30152832
     
    30192836 */
    30202837
    3021 long long chipPendingImfileDelete(
     2838long long chipInputImfileDelete(
    30222839    psDB            *dbh,               ///< Database handle
    30232840    const psMetadata *where,            ///< Row match criteria
     
    30252842);
    30262843
    3027 /** Insert a single chipPendingImfileRow object into a table
     2844/** Insert a single chipInputImfileRow object into a table
    30282845 *
    30292846 * This function constructs and inserts a single row based on it's parameters.
     
    30322849 */
    30332850
    3034 bool chipPendingImfileInsertObject(
    3035     psDB            *dbh,               ///< Database handle
    3036     chipPendingImfileRow *object             ///< chipPendingImfileRow object
    3037 );
    3038 
    3039 /** Insert an array of chipPendingImfileRow object into a table
     2851bool chipInputImfileInsertObject(
     2852    psDB            *dbh,               ///< Database handle
     2853    chipInputImfileRow *object             ///< chipInputImfileRow object
     2854);
     2855
     2856/** Insert an array of chipInputImfileRow object into a table
    30402857 *
    30412858 * This function constructs and inserts multiple rows based on it's parameters.
     
    30442861 */
    30452862
    3046 bool chipPendingImfileInsertObjects(
    3047     psDB            *dbh,               ///< Database handle
    3048     psArray         *objects            ///< array of chipPendingImfileRow objects
    3049 );
    3050 
    3051 /** Insert data from a binary FITS table chipPendingImfileRow into the database
     2863bool chipInputImfileInsertObjects(
     2864    psDB            *dbh,               ///< Database handle
     2865    psArray         *objects            ///< array of chipInputImfileRow objects
     2866);
     2867
     2868/** Insert data from a binary FITS table chipInputImfileRow into the database
    30522869 *
    30532870 * This function expects a psFits object with a FITS table as the first
     
    30592876 */
    30602877
    3061 bool chipPendingImfileInsertFits(
     2878bool chipInputImfileInsertFits(
    30622879    psDB            *dbh,               ///< Database handle
    30632880    const psFits    *fits               ///< psFits object
     
    30742891 */
    30752892
    3076 bool chipPendingImfileSelectRowsFits(
     2893bool chipInputImfileSelectRowsFits(
    30772894    psDB            *dbh,               ///< Database handle
    30782895    psFits          *fits,              ///< psFits object
     
    30812898);
    30822899
    3083 /** Convert a chipPendingImfileRow into an equivalent psMetadata
     2900/** Convert a chipInputImfileRow into an equivalent psMetadata
    30842901 *
    30852902 * @return A psMetadata pointer or NULL on error
    30862903 */
    30872904
    3088 psMetadata *chipPendingImfileMetadataFromObject(
    3089     const chipPendingImfileRow *object             ///< fooRow to convert into a psMetadata
     2905psMetadata *chipInputImfileMetadataFromObject(
     2906    const chipInputImfileRow *object             ///< fooRow to convert into a psMetadata
    30902907);
    30912908
    30922909/** Convert a psMetadata into an equivalent fooRow
    30932910 *
    3094  * @return A chipPendingImfileRow pointer or NULL on error
    3095  */
    3096 
    3097 chipPendingImfileRow *chipPendingImfileObjectFromMetadata(
     2911 * @return A chipInputImfileRow pointer or NULL on error
     2912 */
     2913
     2914chipInputImfileRow *chipInputImfileObjectFromMetadata(
    30982915    psMetadata      *md                 ///< psMetadata to convert into a fooRow
    30992916);
    3100 /** Selects up to limit rows from the database and returns as chipPendingImfileRow objects in a psArray
     2917/** Selects up to limit rows from the database and returns as chipInputImfileRow objects in a psArray
    31012918 *
    31022919 *  See psDBSelectRows() for documentation on the format of where.
     
    31052922 */
    31062923
    3107 psArray *chipPendingImfileSelectRowObjects(
     2924psArray *chipInputImfileSelectRowObjects(
    31082925    psDB            *dbh,               ///< Database handle
    31092926    const psMetadata *where,            ///< Row match criteria
    31102927    unsigned long long limit            ///< Maximum number of elements to return
    31112928);
    3112 /** Deletes a row from the database coresponding to an chipPendingImfile
     2929/** Deletes a row from the database coresponding to an chipInputImfile
    31132930 *
    31142931 *  Note that a 'where' search psMetadata is constructed from each object and
     
    31182935 */
    31192936
    3120 bool chipPendingImfileDeleteObject(
    3121     psDB            *dbh,               ///< Database handle
    3122     const chipPendingImfileRow *object    ///< Object to delete
     2937bool chipInputImfileDeleteObject(
     2938    psDB            *dbh,               ///< Database handle
     2939    const chipInputImfileRow *object    ///< Object to delete
    31232940);
    31242941/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    31302947 */
    31312948
    3132 long long chipPendingImfileDeleteRowObjects(
     2949long long chipInputImfileDeleteRowObjects(
    31332950    psDB            *dbh,               ///< Database handle
    31342951    const psArray   *objects,           ///< Array of objects to delete
    31352952    unsigned long long limit            ///< Maximum number of elements to delete
    31362953);
    3137 /** Formats and prints an array of chipPendingImfileRow objects
     2954/** Formats and prints an array of chipInputImfileRow objects
    31382955 *
    31392956 * When mdcf is set the formated output is in psMetadataConfig
     
    31432960 */
    31442961
    3145 bool chipPendingImfilePrintObjects(
     2962bool chipInputImfilePrintObjects(
    31462963    FILE            *stream,            ///< a stream
    3147     psArray         *objects,           ///< An array of chipPendingImfileRow objects
     2964    psArray         *objects,           ///< An array of chipInputImfileRow objects
    31482965    bool            mdcf                ///< format as mdconfig or simple
    31492966);
    3150 /** Formats and prints an chipPendingImfileRow object
     2967/** Formats and prints an chipInputImfileRow object
    31512968 *
    31522969 * When mdcf is set the formated output is in psMetadataConfig
     
    31562973 */
    31572974
    3158 bool chipPendingImfilePrintObject(
     2975bool chipInputImfilePrintObject(
    31592976    FILE            *stream,            ///< a stream
    3160     chipPendingImfileRow *object,    ///< an chipPendingImfileRow object
     2977    chipInputImfileRow *object,    ///< an chipInputImfileRow object
    31612978    bool            mdcf                ///< format as mdconfig or simple
    31622979);
    3163 /** chipProcessedExpRow data structure
    3164  *
    3165  * Structure for representing a single row of chipProcessedExp table data.
     2980/** chipProcessedImfileRow data structure
     2981 *
     2982 * Structure for representing a single row of chipProcessedImfile table data.
    31662983 */
    31672984
    31682985typedef struct {
    31692986    psS64           chip_id;
    3170     char            *exp_tag;
    3171     psS64           guide_id;
    3172     char            *workdir;
    3173     char            *label;
    3174     char            *reduction;
    3175     char            *expgroup;
    3176     char            *dvodb;
    3177 } chipProcessedExpRow;
    3178 
    3179 /** Creates a new chipProcessedExpRow object
    3180  *
    3181  *  @return A new chipProcessedExpRow object or NULL on failure.
    3182  */
    3183 
    3184 chipProcessedExpRow *chipProcessedExpRowAlloc(
    3185     psS64           chip_id,
    3186     const char      *exp_tag,
    3187     psS64           guide_id,
    3188     const char      *workdir,
    3189     const char      *label,
    3190     const char      *reduction,
    3191     const char      *expgroup,
    3192     const char      *dvodb
    3193 );
    3194 
    3195 /** Creates a new chipProcessedExp table
    3196  *
    3197  * @return true on success
    3198  */
    3199 
    3200 bool chipProcessedExpCreateTable(
    3201     psDB            *dbh                ///< Database handle
    3202 );
    3203 
    3204 /** Deletes a chipProcessedExp table
    3205  *
    3206  * @return true on success
    3207  */
    3208 
    3209 bool chipProcessedExpDropTable(
    3210     psDB            *dbh                ///< Database handle
    3211 );
    3212 
    3213 /** Insert a single row into a table
    3214  *
    3215  * This function constructs and inserts a single row based on it's parameters.
    3216  *
    3217  * @return true on success
    3218  */
    3219 
    3220 bool chipProcessedExpInsert(
    3221     psDB            *dbh,               ///< Database handle
    3222     psS64           chip_id,
    3223     const char      *exp_tag,
    3224     psS64           guide_id,
    3225     const char      *workdir,
    3226     const char      *label,
    3227     const char      *reduction,
    3228     const char      *expgroup,
    3229     const char      *dvodb
    3230 );
    3231 
    3232 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    3233  *
    3234  * @return A The number of rows removed or a negative value on error
    3235  */
    3236 
    3237 long long chipProcessedExpDelete(
    3238     psDB            *dbh,               ///< Database handle
    3239     const psMetadata *where,            ///< Row match criteria
    3240     unsigned long long limit            ///< Maximum number of elements to delete
    3241 );
    3242 
    3243 /** Insert a single chipProcessedExpRow object into a table
    3244  *
    3245  * This function constructs and inserts a single row based on it's parameters.
    3246  *
    3247  * @return true on success
    3248  */
    3249 
    3250 bool chipProcessedExpInsertObject(
    3251     psDB            *dbh,               ///< Database handle
    3252     chipProcessedExpRow *object             ///< chipProcessedExpRow object
    3253 );
    3254 
    3255 /** Insert an array of chipProcessedExpRow object into a table
    3256  *
    3257  * This function constructs and inserts multiple rows based on it's parameters.
    3258  *
    3259  * @return true on success
    3260  */
    3261 
    3262 bool chipProcessedExpInsertObjects(
    3263     psDB            *dbh,               ///< Database handle
    3264     psArray         *objects            ///< array of chipProcessedExpRow objects
    3265 );
    3266 
    3267 /** Insert data from a binary FITS table chipProcessedExpRow into the database
    3268  *
    3269  * This function expects a psFits object with a FITS table as the first
    3270  * extension.  The table must have at least one row of data in it, that is of
    3271  * the appropriate format (number of columns and their type).  All other
    3272  * extensions are ignored.
    3273  *
    3274  * @return true on success
    3275  */
    3276 
    3277 bool chipProcessedExpInsertFits(
    3278     psDB            *dbh,               ///< Database handle
    3279     const psFits    *fits               ///< psFits object
    3280 );
    3281 
    3282 /** Selects up to limit from the database and returns them in a binary FITS table
    3283  *
    3284  * This function assumes an empty psFits object and will create a FITS table
    3285  * as the first extension.
    3286  *
    3287  *  See psDBSelectRows() for documentation on the format of where.
    3288  *
    3289  * @return true on success
    3290  */
    3291 
    3292 bool chipProcessedExpSelectRowsFits(
    3293     psDB            *dbh,               ///< Database handle
    3294     psFits          *fits,              ///< psFits object
    3295     const psMetadata *where,            ///< Row match criteria
    3296     unsigned long long limit            ///< Maximum number of elements to return
    3297 );
    3298 
    3299 /** Convert a chipProcessedExpRow into an equivalent psMetadata
    3300  *
    3301  * @return A psMetadata pointer or NULL on error
    3302  */
    3303 
    3304 psMetadata *chipProcessedExpMetadataFromObject(
    3305     const chipProcessedExpRow *object             ///< fooRow to convert into a psMetadata
    3306 );
    3307 
    3308 /** Convert a psMetadata into an equivalent fooRow
    3309  *
    3310  * @return A chipProcessedExpRow pointer or NULL on error
    3311  */
    3312 
    3313 chipProcessedExpRow *chipProcessedExpObjectFromMetadata(
    3314     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    3315 );
    3316 /** Selects up to limit rows from the database and returns as chipProcessedExpRow objects in a psArray
    3317  *
    3318  *  See psDBSelectRows() for documentation on the format of where.
    3319  *
    3320  * @return A psArray pointer or NULL on error
    3321  */
    3322 
    3323 psArray *chipProcessedExpSelectRowObjects(
    3324     psDB            *dbh,               ///< Database handle
    3325     const psMetadata *where,            ///< Row match criteria
    3326     unsigned long long limit            ///< Maximum number of elements to return
    3327 );
    3328 /** Deletes a row from the database coresponding to an chipProcessedExp
    3329  *
    3330  *  Note that a 'where' search psMetadata is constructed from each object and
    3331  *  used to find rows to delete.
    3332  *
    3333  * @return A The number of rows removed or a negative value on error
    3334  */
    3335 
    3336 bool chipProcessedExpDeleteObject(
    3337     psDB            *dbh,               ///< Database handle
    3338     const chipProcessedExpRow *object    ///< Object to delete
    3339 );
    3340 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    3341  *
    3342  *  Note that a 'where' search psMetadata is constructed from each object and
    3343  *  used to find rows to delete.
    3344  *
    3345  * @return A The number of rows removed or a negative value on error
    3346  */
    3347 
    3348 long long chipProcessedExpDeleteRowObjects(
    3349     psDB            *dbh,               ///< Database handle
    3350     const psArray   *objects,           ///< Array of objects to delete
    3351     unsigned long long limit            ///< Maximum number of elements to delete
    3352 );
    3353 /** Formats and prints an array of chipProcessedExpRow objects
    3354  *
    3355  * When mdcf is set the formated output is in psMetadataConfig
    3356  * format, otherwise it is in a simple tabular format.
    3357  *
    3358  * @return true on success
    3359  */
    3360 
    3361 bool chipProcessedExpPrintObjects(
    3362     FILE            *stream,            ///< a stream
    3363     psArray         *objects,           ///< An array of chipProcessedExpRow objects
    3364     bool            mdcf                ///< format as mdconfig or simple
    3365 );
    3366 /** Formats and prints an chipProcessedExpRow object
    3367  *
    3368  * When mdcf is set the formated output is in psMetadataConfig
    3369  * format, otherwise it is in a simple tabular format.
    3370  *
    3371  * @return true on success
    3372  */
    3373 
    3374 bool chipProcessedExpPrintObject(
    3375     FILE            *stream,            ///< a stream
    3376     chipProcessedExpRow *object,    ///< an chipProcessedExpRow object
    3377     bool            mdcf                ///< format as mdconfig or simple
    3378 );
    3379 /** chipMaskRow data structure
    3380  *
    3381  * Structure for representing a single row of chipMask table data.
    3382  */
    3383 
    3384 typedef struct {
    3385     char            *label;
    3386 } chipMaskRow;
    3387 
    3388 /** Creates a new chipMaskRow object
    3389  *
    3390  *  @return A new chipMaskRow object or NULL on failure.
    3391  */
    3392 
    3393 chipMaskRow *chipMaskRowAlloc(
    3394     const char      *label
    3395 );
    3396 
    3397 /** Creates a new chipMask table
    3398  *
    3399  * @return true on success
    3400  */
    3401 
    3402 bool chipMaskCreateTable(
    3403     psDB            *dbh                ///< Database handle
    3404 );
    3405 
    3406 /** Deletes a chipMask table
    3407  *
    3408  * @return true on success
    3409  */
    3410 
    3411 bool chipMaskDropTable(
    3412     psDB            *dbh                ///< Database handle
    3413 );
    3414 
    3415 /** Insert a single row into a table
    3416  *
    3417  * This function constructs and inserts a single row based on it's parameters.
    3418  *
    3419  * @return true on success
    3420  */
    3421 
    3422 bool chipMaskInsert(
    3423     psDB            *dbh,               ///< Database handle
    3424     const char      *label
    3425 );
    3426 
    3427 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    3428  *
    3429  * @return A The number of rows removed or a negative value on error
    3430  */
    3431 
    3432 long long chipMaskDelete(
    3433     psDB            *dbh,               ///< Database handle
    3434     const psMetadata *where,            ///< Row match criteria
    3435     unsigned long long limit            ///< Maximum number of elements to delete
    3436 );
    3437 
    3438 /** Insert a single chipMaskRow object into a table
    3439  *
    3440  * This function constructs and inserts a single row based on it's parameters.
    3441  *
    3442  * @return true on success
    3443  */
    3444 
    3445 bool chipMaskInsertObject(
    3446     psDB            *dbh,               ///< Database handle
    3447     chipMaskRow     *object             ///< chipMaskRow object
    3448 );
    3449 
    3450 /** Insert an array of chipMaskRow object into a table
    3451  *
    3452  * This function constructs and inserts multiple rows based on it's parameters.
    3453  *
    3454  * @return true on success
    3455  */
    3456 
    3457 bool chipMaskInsertObjects(
    3458     psDB            *dbh,               ///< Database handle
    3459     psArray         *objects            ///< array of chipMaskRow objects
    3460 );
    3461 
    3462 /** Insert data from a binary FITS table chipMaskRow into the database
    3463  *
    3464  * This function expects a psFits object with a FITS table as the first
    3465  * extension.  The table must have at least one row of data in it, that is of
    3466  * the appropriate format (number of columns and their type).  All other
    3467  * extensions are ignored.
    3468  *
    3469  * @return true on success
    3470  */
    3471 
    3472 bool chipMaskInsertFits(
    3473     psDB            *dbh,               ///< Database handle
    3474     const psFits    *fits               ///< psFits object
    3475 );
    3476 
    3477 /** Selects up to limit from the database and returns them in a binary FITS table
    3478  *
    3479  * This function assumes an empty psFits object and will create a FITS table
    3480  * as the first extension.
    3481  *
    3482  *  See psDBSelectRows() for documentation on the format of where.
    3483  *
    3484  * @return true on success
    3485  */
    3486 
    3487 bool chipMaskSelectRowsFits(
    3488     psDB            *dbh,               ///< Database handle
    3489     psFits          *fits,              ///< psFits object
    3490     const psMetadata *where,            ///< Row match criteria
    3491     unsigned long long limit            ///< Maximum number of elements to return
    3492 );
    3493 
    3494 /** Convert a chipMaskRow into an equivalent psMetadata
    3495  *
    3496  * @return A psMetadata pointer or NULL on error
    3497  */
    3498 
    3499 psMetadata *chipMaskMetadataFromObject(
    3500     const chipMaskRow *object             ///< fooRow to convert into a psMetadata
    3501 );
    3502 
    3503 /** Convert a psMetadata into an equivalent fooRow
    3504  *
    3505  * @return A chipMaskRow pointer or NULL on error
    3506  */
    3507 
    3508 chipMaskRow *chipMaskObjectFromMetadata(
    3509     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    3510 );
    3511 /** Selects up to limit rows from the database and returns as chipMaskRow objects in a psArray
    3512  *
    3513  *  See psDBSelectRows() for documentation on the format of where.
    3514  *
    3515  * @return A psArray pointer or NULL on error
    3516  */
    3517 
    3518 psArray *chipMaskSelectRowObjects(
    3519     psDB            *dbh,               ///< Database handle
    3520     const psMetadata *where,            ///< Row match criteria
    3521     unsigned long long limit            ///< Maximum number of elements to return
    3522 );
    3523 /** Deletes a row from the database coresponding to an chipMask
    3524  *
    3525  *  Note that a 'where' search psMetadata is constructed from each object and
    3526  *  used to find rows to delete.
    3527  *
    3528  * @return A The number of rows removed or a negative value on error
    3529  */
    3530 
    3531 bool chipMaskDeleteObject(
    3532     psDB            *dbh,               ///< Database handle
    3533     const chipMaskRow *object    ///< Object to delete
    3534 );
    3535 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    3536  *
    3537  *  Note that a 'where' search psMetadata is constructed from each object and
    3538  *  used to find rows to delete.
    3539  *
    3540  * @return A The number of rows removed or a negative value on error
    3541  */
    3542 
    3543 long long chipMaskDeleteRowObjects(
    3544     psDB            *dbh,               ///< Database handle
    3545     const psArray   *objects,           ///< Array of objects to delete
    3546     unsigned long long limit            ///< Maximum number of elements to delete
    3547 );
    3548 /** Formats and prints an array of chipMaskRow objects
    3549  *
    3550  * When mdcf is set the formated output is in psMetadataConfig
    3551  * format, otherwise it is in a simple tabular format.
    3552  *
    3553  * @return true on success
    3554  */
    3555 
    3556 bool chipMaskPrintObjects(
    3557     FILE            *stream,            ///< a stream
    3558     psArray         *objects,           ///< An array of chipMaskRow objects
    3559     bool            mdcf                ///< format as mdconfig or simple
    3560 );
    3561 /** Formats and prints an chipMaskRow object
    3562  *
    3563  * When mdcf is set the formated output is in psMetadataConfig
    3564  * format, otherwise it is in a simple tabular format.
    3565  *
    3566  * @return true on success
    3567  */
    3568 
    3569 bool chipMaskPrintObject(
    3570     FILE            *stream,            ///< a stream
    3571     chipMaskRow *object,    ///< an chipMaskRow object
    3572     bool            mdcf                ///< format as mdconfig or simple
    3573 );
    3574 /** chipProcessedImfileRow data structure
    3575  *
    3576  * Structure for representing a single row of chipProcessedImfile table data.
    3577  */
    3578 
    3579 typedef struct {
    3580     psS64           chip_id;
     2987    psS64           exp_id;
    35812988    char            *class_id;
    35822989    char            *uri;
     
    36103017chipProcessedImfileRow *chipProcessedImfileRowAlloc(
    36113018    psS64           chip_id,
     3019    psS64           exp_id,
    36123020    const char      *class_id,
    36133021    const char      *uri,
     
    36623070    psDB            *dbh,               ///< Database handle
    36633071    psS64           chip_id,
     3072    psS64           exp_id,
    36643073    const char      *class_id,
    36653074    const char      *uri,
     
    38333242    bool            mdcf                ///< format as mdconfig or simple
    38343243);
    3835 /** camPendingExpRow data structure
    3836  *
    3837  * Structure for representing a single row of camPendingExp table data.
     3244/** chipMaskRow data structure
     3245 *
     3246 * Structure for representing a single row of chipMask table data.
     3247 */
     3248
     3249typedef struct {
     3250    char            *label;
     3251} chipMaskRow;
     3252
     3253/** Creates a new chipMaskRow object
     3254 *
     3255 *  @return A new chipMaskRow object or NULL on failure.
     3256 */
     3257
     3258chipMaskRow *chipMaskRowAlloc(
     3259    const char      *label
     3260);
     3261
     3262/** Creates a new chipMask table
     3263 *
     3264 * @return true on success
     3265 */
     3266
     3267bool chipMaskCreateTable(
     3268    psDB            *dbh                ///< Database handle
     3269);
     3270
     3271/** Deletes a chipMask table
     3272 *
     3273 * @return true on success
     3274 */
     3275
     3276bool chipMaskDropTable(
     3277    psDB            *dbh                ///< Database handle
     3278);
     3279
     3280/** Insert a single row into a table
     3281 *
     3282 * This function constructs and inserts a single row based on it's parameters.
     3283 *
     3284 * @return true on success
     3285 */
     3286
     3287bool chipMaskInsert(
     3288    psDB            *dbh,               ///< Database handle
     3289    const char      *label
     3290);
     3291
     3292/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     3293 *
     3294 * @return A The number of rows removed or a negative value on error
     3295 */
     3296
     3297long long chipMaskDelete(
     3298    psDB            *dbh,               ///< Database handle
     3299    const psMetadata *where,            ///< Row match criteria
     3300    unsigned long long limit            ///< Maximum number of elements to delete
     3301);
     3302
     3303/** Insert a single chipMaskRow object into a table
     3304 *
     3305 * This function constructs and inserts a single row based on it's parameters.
     3306 *
     3307 * @return true on success
     3308 */
     3309
     3310bool chipMaskInsertObject(
     3311    psDB            *dbh,               ///< Database handle
     3312    chipMaskRow     *object             ///< chipMaskRow object
     3313);
     3314
     3315/** Insert an array of chipMaskRow object into a table
     3316 *
     3317 * This function constructs and inserts multiple rows based on it's parameters.
     3318 *
     3319 * @return true on success
     3320 */
     3321
     3322bool chipMaskInsertObjects(
     3323    psDB            *dbh,               ///< Database handle
     3324    psArray         *objects            ///< array of chipMaskRow objects
     3325);
     3326
     3327/** Insert data from a binary FITS table chipMaskRow into the database
     3328 *
     3329 * This function expects a psFits object with a FITS table as the first
     3330 * extension.  The table must have at least one row of data in it, that is of
     3331 * the appropriate format (number of columns and their type).  All other
     3332 * extensions are ignored.
     3333 *
     3334 * @return true on success
     3335 */
     3336
     3337bool chipMaskInsertFits(
     3338    psDB            *dbh,               ///< Database handle
     3339    const psFits    *fits               ///< psFits object
     3340);
     3341
     3342/** Selects up to limit from the database and returns them in a binary FITS table
     3343 *
     3344 * This function assumes an empty psFits object and will create a FITS table
     3345 * as the first extension.
     3346 *
     3347 *  See psDBSelectRows() for documentation on the format of where.
     3348 *
     3349 * @return true on success
     3350 */
     3351
     3352bool chipMaskSelectRowsFits(
     3353    psDB            *dbh,               ///< Database handle
     3354    psFits          *fits,              ///< psFits object
     3355    const psMetadata *where,            ///< Row match criteria
     3356    unsigned long long limit            ///< Maximum number of elements to return
     3357);
     3358
     3359/** Convert a chipMaskRow into an equivalent psMetadata
     3360 *
     3361 * @return A psMetadata pointer or NULL on error
     3362 */
     3363
     3364psMetadata *chipMaskMetadataFromObject(
     3365    const chipMaskRow *object             ///< fooRow to convert into a psMetadata
     3366);
     3367
     3368/** Convert a psMetadata into an equivalent fooRow
     3369 *
     3370 * @return A chipMaskRow pointer or NULL on error
     3371 */
     3372
     3373chipMaskRow *chipMaskObjectFromMetadata(
     3374    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     3375);
     3376/** Selects up to limit rows from the database and returns as chipMaskRow objects in a psArray
     3377 *
     3378 *  See psDBSelectRows() for documentation on the format of where.
     3379 *
     3380 * @return A psArray pointer or NULL on error
     3381 */
     3382
     3383psArray *chipMaskSelectRowObjects(
     3384    psDB            *dbh,               ///< Database handle
     3385    const psMetadata *where,            ///< Row match criteria
     3386    unsigned long long limit            ///< Maximum number of elements to return
     3387);
     3388/** Deletes a row from the database coresponding to an chipMask
     3389 *
     3390 *  Note that a 'where' search psMetadata is constructed from each object and
     3391 *  used to find rows to delete.
     3392 *
     3393 * @return A The number of rows removed or a negative value on error
     3394 */
     3395
     3396bool chipMaskDeleteObject(
     3397    psDB            *dbh,               ///< Database handle
     3398    const chipMaskRow *object    ///< Object to delete
     3399);
     3400/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     3401 *
     3402 *  Note that a 'where' search psMetadata is constructed from each object and
     3403 *  used to find rows to delete.
     3404 *
     3405 * @return A The number of rows removed or a negative value on error
     3406 */
     3407
     3408long long chipMaskDeleteRowObjects(
     3409    psDB            *dbh,               ///< Database handle
     3410    const psArray   *objects,           ///< Array of objects to delete
     3411    unsigned long long limit            ///< Maximum number of elements to delete
     3412);
     3413/** Formats and prints an array of chipMaskRow objects
     3414 *
     3415 * When mdcf is set the formated output is in psMetadataConfig
     3416 * format, otherwise it is in a simple tabular format.
     3417 *
     3418 * @return true on success
     3419 */
     3420
     3421bool chipMaskPrintObjects(
     3422    FILE            *stream,            ///< a stream
     3423    psArray         *objects,           ///< An array of chipMaskRow objects
     3424    bool            mdcf                ///< format as mdconfig or simple
     3425);
     3426/** Formats and prints an chipMaskRow object
     3427 *
     3428 * When mdcf is set the formated output is in psMetadataConfig
     3429 * format, otherwise it is in a simple tabular format.
     3430 *
     3431 * @return true on success
     3432 */
     3433
     3434bool chipMaskPrintObject(
     3435    FILE            *stream,            ///< a stream
     3436    chipMaskRow *object,    ///< an chipMaskRow object
     3437    bool            mdcf                ///< format as mdconfig or simple
     3438);
     3439/** camRunRow data structure
     3440 *
     3441 * Structure for representing a single row of camRun table data.
    38383442 */
    38393443
     
    38413445    psS64           cam_id;
    38423446    psS64           chip_id;
     3447    char            *state;
    38433448    char            *workdir;
     3449    char            *workdir_state;
    38443450    char            *label;
    38453451    char            *reduction;
    38463452    char            *expgroup;
    38473453    char            *dvodb;
    3848 } camPendingExpRow;
    3849 
    3850 /** Creates a new camPendingExpRow object
    3851  *
    3852  *  @return A new camPendingExpRow object or NULL on failure.
    3853  */
    3854 
    3855 camPendingExpRow *camPendingExpRowAlloc(
     3454} camRunRow;
     3455
     3456/** Creates a new camRunRow object
     3457 *
     3458 *  @return A new camRunRow object or NULL on failure.
     3459 */
     3460
     3461camRunRow *camRunRowAlloc(
    38563462    psS64           cam_id,
    38573463    psS64           chip_id,
     3464    const char      *state,
    38583465    const char      *workdir,
     3466    const char      *workdir_state,
    38593467    const char      *label,
    38603468    const char      *reduction,
     
    38633471);
    38643472
    3865 /** Creates a new camPendingExp table
    3866  *
    3867  * @return true on success
    3868  */
    3869 
    3870 bool camPendingExpCreateTable(
     3473/** Creates a new camRun table
     3474 *
     3475 * @return true on success
     3476 */
     3477
     3478bool camRunCreateTable(
    38713479    psDB            *dbh                ///< Database handle
    38723480);
    38733481
    3874 /** Deletes a camPendingExp table
    3875  *
    3876  * @return true on success
    3877  */
    3878 
    3879 bool camPendingExpDropTable(
     3482/** Deletes a camRun table
     3483 *
     3484 * @return true on success
     3485 */
     3486
     3487bool camRunDropTable(
    38803488    psDB            *dbh                ///< Database handle
    38813489);
     
    38883496 */
    38893497
    3890 bool camPendingExpInsert(
     3498bool camRunInsert(
    38913499    psDB            *dbh,               ///< Database handle
    38923500    psS64           cam_id,
    38933501    psS64           chip_id,
     3502    const char      *state,
    38943503    const char      *workdir,
     3504    const char      *workdir_state,
    38953505    const char      *label,
    38963506    const char      *reduction,
     
    39043514 */
    39053515
    3906 long long camPendingExpDelete(
     3516long long camRunDelete(
    39073517    psDB            *dbh,               ///< Database handle
    39083518    const psMetadata *where,            ///< Row match criteria
     
    39103520);
    39113521
    3912 /** Insert a single camPendingExpRow object into a table
     3522/** Insert a single camRunRow object into a table
    39133523 *
    39143524 * This function constructs and inserts a single row based on it's parameters.
     
    39173527 */
    39183528
    3919 bool camPendingExpInsertObject(
    3920     psDB            *dbh,               ///< Database handle
    3921     camPendingExpRow *object             ///< camPendingExpRow object
    3922 );
    3923 
    3924 /** Insert an array of camPendingExpRow object into a table
     3529bool camRunInsertObject(
     3530    psDB            *dbh,               ///< Database handle
     3531    camRunRow       *object             ///< camRunRow object
     3532);
     3533
     3534/** Insert an array of camRunRow object into a table
    39253535 *
    39263536 * This function constructs and inserts multiple rows based on it's parameters.
     
    39293539 */
    39303540
    3931 bool camPendingExpInsertObjects(
    3932     psDB            *dbh,               ///< Database handle
    3933     psArray         *objects            ///< array of camPendingExpRow objects
    3934 );
    3935 
    3936 /** Insert data from a binary FITS table camPendingExpRow into the database
     3541bool camRunInsertObjects(
     3542    psDB            *dbh,               ///< Database handle
     3543    psArray         *objects            ///< array of camRunRow objects
     3544);
     3545
     3546/** Insert data from a binary FITS table camRunRow into the database
    39373547 *
    39383548 * This function expects a psFits object with a FITS table as the first
     
    39443554 */
    39453555
    3946 bool camPendingExpInsertFits(
     3556bool camRunInsertFits(
    39473557    psDB            *dbh,               ///< Database handle
    39483558    const psFits    *fits               ///< psFits object
     
    39593569 */
    39603570
    3961 bool camPendingExpSelectRowsFits(
     3571bool camRunSelectRowsFits(
    39623572    psDB            *dbh,               ///< Database handle
    39633573    psFits          *fits,              ///< psFits object
     
    39663576);
    39673577
    3968 /** Convert a camPendingExpRow into an equivalent psMetadata
     3578/** Convert a camRunRow into an equivalent psMetadata
    39693579 *
    39703580 * @return A psMetadata pointer or NULL on error
    39713581 */
    39723582
    3973 psMetadata *camPendingExpMetadataFromObject(
    3974     const camPendingExpRow *object             ///< fooRow to convert into a psMetadata
     3583psMetadata *camRunMetadataFromObject(
     3584    const camRunRow *object             ///< fooRow to convert into a psMetadata
    39753585);
    39763586
    39773587/** Convert a psMetadata into an equivalent fooRow
    39783588 *
    3979  * @return A camPendingExpRow pointer or NULL on error
    3980  */
    3981 
    3982 camPendingExpRow *camPendingExpObjectFromMetadata(
     3589 * @return A camRunRow pointer or NULL on error
     3590 */
     3591
     3592camRunRow *camRunObjectFromMetadata(
    39833593    psMetadata      *md                 ///< psMetadata to convert into a fooRow
    39843594);
    3985 /** Selects up to limit rows from the database and returns as camPendingExpRow objects in a psArray
     3595/** Selects up to limit rows from the database and returns as camRunRow objects in a psArray
    39863596 *
    39873597 *  See psDBSelectRows() for documentation on the format of where.
     
    39903600 */
    39913601
    3992 psArray *camPendingExpSelectRowObjects(
     3602psArray *camRunSelectRowObjects(
    39933603    psDB            *dbh,               ///< Database handle
    39943604    const psMetadata *where,            ///< Row match criteria
    39953605    unsigned long long limit            ///< Maximum number of elements to return
    39963606);
    3997 /** Deletes a row from the database coresponding to an camPendingExp
     3607/** Deletes a row from the database coresponding to an camRun
    39983608 *
    39993609 *  Note that a 'where' search psMetadata is constructed from each object and
     
    40033613 */
    40043614
    4005 bool camPendingExpDeleteObject(
    4006     psDB            *dbh,               ///< Database handle
    4007     const camPendingExpRow *object    ///< Object to delete
     3615bool camRunDeleteObject(
     3616    psDB            *dbh,               ///< Database handle
     3617    const camRunRow *object    ///< Object to delete
    40083618);
    40093619/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    40153625 */
    40163626
    4017 long long camPendingExpDeleteRowObjects(
     3627long long camRunDeleteRowObjects(
    40183628    psDB            *dbh,               ///< Database handle
    40193629    const psArray   *objects,           ///< Array of objects to delete
    40203630    unsigned long long limit            ///< Maximum number of elements to delete
    40213631);
    4022 /** Formats and prints an array of camPendingExpRow objects
     3632/** Formats and prints an array of camRunRow objects
    40233633 *
    40243634 * When mdcf is set the formated output is in psMetadataConfig
     
    40283638 */
    40293639
    4030 bool camPendingExpPrintObjects(
     3640bool camRunPrintObjects(
    40313641    FILE            *stream,            ///< a stream
    4032     psArray         *objects,           ///< An array of camPendingExpRow objects
     3642    psArray         *objects,           ///< An array of camRunRow objects
    40333643    bool            mdcf                ///< format as mdconfig or simple
    40343644);
    4035 /** Formats and prints an camPendingExpRow object
     3645/** Formats and prints an camRunRow object
    40363646 *
    40373647 * When mdcf is set the formated output is in psMetadataConfig
     
    40413651 */
    40423652
    4043 bool camPendingExpPrintObject(
     3653bool camRunPrintObject(
    40443654    FILE            *stream,            ///< a stream
    4045     camPendingExpRow *object,    ///< an camPendingExpRow object
     3655    camRunRow *object,    ///< an camRunRow object
    40463656    bool            mdcf                ///< format as mdconfig or simple
    40473657);
     
    40543664    psS64           cam_id;
    40553665    psS64           chip_id;
    4056     char            *workdir;
    4057     char            *label;
    4058     char            *reduction;
    4059     char            *expgroup;
    4060     char            *dvodb;
    40613666    char            *uri;
    40623667    psF32           bg;
     
    40853690    psS64           cam_id,
    40863691    psS64           chip_id,
    4087     const char      *workdir,
    4088     const char      *label,
    4089     const char      *reduction,
    4090     const char      *expgroup,
    4091     const char      *dvodb,
    40923692    const char      *uri,
    40933693    psF32           bg,
     
    41373737    psS64           cam_id,
    41383738    psS64           chip_id,
    4139     const char      *workdir,
    4140     const char      *label,
    4141     const char      *reduction,
    4142     const char      *expgroup,
    4143     const char      *dvodb,
    41443739    const char      *uri,
    41453740    psF32           bg,
     
    68716466    psS64           det_id;
    68726467    psS32           iteration;
    6873     char            *exp_tag;
     6468    psS64           exp_id;
    68746469    bool            include;
    68756470} detInputExpRow;
     
    68836478    psS64           det_id,
    68846479    psS32           iteration,
    6885     const char      *exp_tag,
     6480    psS64           exp_id,
    68866481    bool            include
    68876482);
     
    69166511    psS64           det_id,
    69176512    psS32           iteration,
    6918     const char      *exp_tag,
     6513    psS64           exp_id,
    69196514    bool            include
    69206515);
     
    70746669typedef struct {
    70756670    psS64           det_id;
    7076     char            *exp_tag;
     6671    psS64           exp_id;
    70776672    char            *class_id;
    70786673    char            *uri;
     
    71006695detProcessedImfileRow *detProcessedImfileRowAlloc(
    71016696    psS64           det_id,
    7102     const char      *exp_tag,
     6697    psS64           exp_id,
    71036698    const char      *class_id,
    71046699    const char      *uri,
     
    71476742    psDB            *dbh,               ///< Database handle
    71486743    psS64           det_id,
    7149     const char      *exp_tag,
     6744    psS64           exp_id,
    71506745    const char      *class_id,
    71516746    const char      *uri,
     
    73206915typedef struct {
    73216916    psS64           det_id;
    7322     char            *exp_tag;
     6917    psS64           exp_id;
    73236918    char            *recipe;
    73246919    psF64           bg;
     
    73446939detProcessedExpRow *detProcessedExpRowAlloc(
    73456940    psS64           det_id,
    7346     const char      *exp_tag,
     6941    psS64           exp_id,
    73476942    const char      *recipe,
    73486943    psF64           bg,
     
    73896984    psDB            *dbh,               ///< Database handle
    73906985    psS64           det_id,
    7391     const char      *exp_tag,
     6986    psS64           exp_id,
    73926987    const char      *recipe,
    73936988    psF64           bg,
     
    84678062    psS64           det_id;
    84688063    psS32           iteration;
    8469     char            *exp_tag;
     8064    psS64           exp_id;
    84708065    char            *class_id;
    84718066    char            *uri;
     
    84958090    psS64           det_id,
    84968091    psS32           iteration,
    8497     const char      *exp_tag,
     8092    psS64           exp_id,
    84988093    const char      *class_id,
    84998094    const char      *uri,
     
    85448139    psS64           det_id,
    85458140    psS32           iteration,
    8546     const char      *exp_tag,
     8141    psS64           exp_id,
    85478142    const char      *class_id,
    85488143    const char      *uri,
     
    87198314    psS64           det_id;
    87208315    psS32           iteration;
    8721     char            *exp_tag;
     8316    psS64           exp_id;
    87228317    char            *recipe;
    87238318    psF64           bg;
     
    87468341    psS64           det_id,
    87478342    psS32           iteration,
    8748     const char      *exp_tag,
     8343    psS64           exp_id,
    87498344    const char      *recipe,
    87508345    psF64           bg,
     
    87948389    psS64           det_id,
    87958390    psS32           iteration,
    8796     const char      *exp_tag,
     8391    psS64           exp_id,
    87978392    const char      *recipe,
    87988393    psF64           bg,
Note: See TracChangeset for help on using the changeset viewer.