IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14598


Ignore:
Timestamp:
Aug 21, 2007, 4:25:34 PM (19 years ago)
Author:
jhoblitt
Message:

VERSION 1.1.27

Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/dbconfig/config.md

    r14251 r14598  
    22    pkg_name        STR     ippdb
    33    pkg_namespace   STR     ippdb
    4     pkg_version     STR     1.1.26
     4    pkg_version     STR     1.1.27
    55END
  • trunk/ippdb/Makefile.am

    r14451 r14598  
    4848    $(top_builddir)/docs/man/man3/detResidExpRow.3 \
    4949    $(top_builddir)/docs/man/man3/detRunSummaryRow.3 \
    50     $(top_builddir)/docs/man/man3/detRegisteredImfileRow.3
     50    $(top_builddir)/docs/man/man3/detRegisteredImfileRow.3 \
     51    $(top_builddir)/docs/man/man3/magicRunRow.3 \
     52    $(top_builddir)/docs/man/man3/magicInputSkyfileRow.3 \
     53    $(top_builddir)/docs/man/man3/magicTreeRow.3 \
     54    $(top_builddir)/docs/man/man3/magicNodeResultRow.3 \
     55    $(top_builddir)/docs/man/man3/magicMaskRow.3
    5156
    5257
    53 docs/man/man3/ippdb.3 docs/man/man3/summitExpRow.3 docs/man/man3/summitImfileRow.3 docs/man/man3/pzPendingExpRow.3 docs/man/man3/pzPendingImfileRow.3 docs/man/man3/pzDoneExpRow.3 docs/man/man3/pzDoneImfileRow.3 docs/man/man3/newExpRow.3 docs/man/man3/newImfileRow.3 docs/man/man3/rawExpRow.3 docs/man/man3/rawImfileRow.3 docs/man/man3/guidePendingExpRow.3 docs/man/man3/chipRunRow.3 docs/man/man3/chipProcessedImfileRow.3 docs/man/man3/chipMaskRow.3 docs/man/man3/camRunRow.3 docs/man/man3/camProcessedExpRow.3 docs/man/man3/camMaskRow.3 docs/man/man3/warpRunRow.3 docs/man/man3/warpInputExpRow.3 docs/man/man3/warpSkyCellMapRow.3 docs/man/man3/warpSkyfileRow.3 docs/man/man3/diffRunRow.3 docs/man/man3/diffInputSkyfileRow.3 docs/man/man3/diffSkyfileRow.3 docs/man/man3/stackRunRow.3 docs/man/man3/stackInputSkyfileRow.3 docs/man/man3/stackSumSkyfileRow.3 docs/man/man3/detRunRow.3 docs/man/man3/detInputExpRow.3 docs/man/man3/detProcessedImfileRow.3 docs/man/man3/detProcessedExpRow.3 docs/man/man3/detStackedImfileRow.3 docs/man/man3/detNormalizedStatImfileRow.3 docs/man/man3/detNormalizedImfileRow.3 docs/man/man3/detNormalizedExpRow.3 docs/man/man3/detResidImfileRow.3 docs/man/man3/detResidExpRow.3 docs/man/man3/detRunSummaryRow.3 docs/man/man3/detRegisteredImfileRow.3:
     58docs/man/man3/ippdb.3 docs/man/man3/summitExpRow.3 docs/man/man3/summitImfileRow.3 docs/man/man3/pzPendingExpRow.3 docs/man/man3/pzPendingImfileRow.3 docs/man/man3/pzDoneExpRow.3 docs/man/man3/pzDoneImfileRow.3 docs/man/man3/newExpRow.3 docs/man/man3/newImfileRow.3 docs/man/man3/rawExpRow.3 docs/man/man3/rawImfileRow.3 docs/man/man3/guidePendingExpRow.3 docs/man/man3/chipRunRow.3 docs/man/man3/chipProcessedImfileRow.3 docs/man/man3/chipMaskRow.3 docs/man/man3/camRunRow.3 docs/man/man3/camProcessedExpRow.3 docs/man/man3/camMaskRow.3 docs/man/man3/warpRunRow.3 docs/man/man3/warpInputExpRow.3 docs/man/man3/warpSkyCellMapRow.3 docs/man/man3/warpSkyfileRow.3 docs/man/man3/diffRunRow.3 docs/man/man3/diffInputSkyfileRow.3 docs/man/man3/diffSkyfileRow.3 docs/man/man3/stackRunRow.3 docs/man/man3/stackInputSkyfileRow.3 docs/man/man3/stackSumSkyfileRow.3 docs/man/man3/detRunRow.3 docs/man/man3/detInputExpRow.3 docs/man/man3/detProcessedImfileRow.3 docs/man/man3/detProcessedExpRow.3 docs/man/man3/detStackedImfileRow.3 docs/man/man3/detNormalizedStatImfileRow.3 docs/man/man3/detNormalizedImfileRow.3 docs/man/man3/detNormalizedExpRow.3 docs/man/man3/detResidImfileRow.3 docs/man/man3/detResidExpRow.3 docs/man/man3/detRunSummaryRow.3 docs/man/man3/detRegisteredImfileRow.3 docs/man/man3/magicRunRow.3 docs/man/man3/magicInputSkyfileRow.3 docs/man/man3/magicTreeRow.3 docs/man/man3/magicNodeResultRow.3 docs/man/man3/magicMaskRow.3:
    5459        $(DOXYGEN)
    5560
  • trunk/ippdb/configure.ac

    r14451 r14598  
    11dnl
    2 dnl This file was generated by glueforge 1.03
     2dnl This file was generated by glueforge 1.01
    33dnl
    44dnl Do NOT directly edit this file.
     
    77AC_PREREQ(2.61)
    88
    9 AC_INIT([ippdb], [1.1.26], [pan-starrs.ifa.hawaii.edu])
     9AC_INIT([ippdb], [1.1.27], [pan-starrs.ifa.hawaii.edu])
    1010AC_CONFIG_SRCDIR([ippdb.pc.in])
    1111
  • trunk/ippdb/src/ippdb.c

    r14451 r14598  
    2020/*
    2121 *
    22  * This file was generated by glueforge 1.03
     22 * This file was generated by glueforge 1.01
    2323 *
    2424 * Do NOT directly edit this file.
     
    7070#define DETRUNSUMMARY_TABLE_NAME "detRunSummary"
    7171#define DETREGISTEREDIMFILE_TABLE_NAME "detRegisteredImfile"
     72#define MAGICRUN_TABLE_NAME "magicRun"
     73#define MAGICINPUTSKYFILE_TABLE_NAME "magicInputSkyfile"
     74#define MAGICTREE_TABLE_NAME "magicTree"
     75#define MAGICNODERESULT_TABLE_NAME "magicNodeResult"
     76#define MAGICMASK_TABLE_NAME "magicMask"
    7277#define MAX_STRING_LENGTH 1024
    7378
     
    14201425static void pzPendingImfileRowFree(pzPendingImfileRow *object);
    14211426
    1422 pzPendingImfileRow *pzPendingImfileRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, psS64 exp_id)
     1427pzPendingImfileRow *pzPendingImfileRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id)
    14231428{
    14241429    pzPendingImfileRow *_object;
     
    14321437    _object->class = psStringCopy(class);
    14331438    _object->class_id = psStringCopy(class_id);
    1434     _object->exp_id = exp_id;
    14351439
    14361440    return _object;
     
    14741478        return false;
    14751479    }
    1476     if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, "Unique Key", 64)) {
    1477         psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
    1478         psFree(md);
    1479         return false;
    1480     }
    14811480
    14821481    bool status = psDBCreateTable(dbh, PZPENDINGIMFILE_TABLE_NAME, md);
     
    14921491}
    14931492
    1494 bool pzPendingImfileInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, psS64 exp_id)
     1493bool pzPendingImfileInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id)
    14951494{
    14961495    psMetadata *md = psMetadataAlloc();
     
    15171516    if (!psMetadataAdd(md, PS_LIST_TAIL, "class_id", PS_DATA_STRING, NULL, class_id)) {
    15181517        psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
    1519         psFree(md);
    1520         return false;
    1521     }
    1522     if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, NULL, exp_id)) {
    1523         psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
    15241518        psFree(md);
    15251519        return false;
     
    15481542bool pzPendingImfileInsertObject(psDB *dbh, pzPendingImfileRow *object)
    15491543{
    1550     return pzPendingImfileInsert(dbh, object->exp_name, object->camera, object->telescope, object->class, object->class_id, object->exp_id);
     1544    return pzPendingImfileInsert(dbh, object->exp_name, object->camera, object->telescope, object->class, object->class_id);
    15511545}
    15521546
     
    16461640        return false;
    16471641    }
    1648     if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, NULL, object->exp_id)) {
    1649         psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
    1650         psFree(md);
    1651         return false;
    1652     }
    16531642
    16541643
     
    16851674        return false;
    16861675    }
    1687     psS64 exp_id = psMetadataLookupS64(&status, md, "exp_id");
    1688     if (!status) {
    1689         psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item exp_id");
    1690         return false;
    1691     }
    1692 
    1693     return pzPendingImfileRowAlloc(exp_name, camera, telescope, class, class_id, exp_id);
     1676
     1677    return pzPendingImfileRowAlloc(exp_name, camera, telescope, class, class_id);
    16941678}
    16951679psArray *pzPendingImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    21212105static void pzDoneImfileRowFree(pzDoneImfileRow *object);
    21222106
    2123 pzDoneImfileRow *pzDoneImfileRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, psS64 exp_id, const char *uri)
     2107pzDoneImfileRow *pzDoneImfileRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, const char *uri)
    21242108{
    21252109    pzDoneImfileRow *_object;
     
    21332117    _object->class = psStringCopy(class);
    21342118    _object->class_id = psStringCopy(class_id);
    2135     _object->exp_id = exp_id;
    21362119    _object->uri = psStringCopy(uri);
    21372120
     
    21772160        return false;
    21782161    }
    2179     if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, "Unique Key", 64)) {
    2180         psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
    2181         psFree(md);
    2182         return false;
    2183     }
    21842162    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, "255")) {
    21852163        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
     
    22002178}
    22012179
    2202 bool pzDoneImfileInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, psS64 exp_id, const char *uri)
     2180bool pzDoneImfileInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, const char *uri)
    22032181{
    22042182    psMetadata *md = psMetadataAlloc();
     
    22252203    if (!psMetadataAdd(md, PS_LIST_TAIL, "class_id", PS_DATA_STRING, NULL, class_id)) {
    22262204        psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
    2227         psFree(md);
    2228         return false;
    2229     }
    2230     if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, NULL, exp_id)) {
    2231         psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
    22322205        psFree(md);
    22332206        return false;
     
    22612234bool pzDoneImfileInsertObject(psDB *dbh, pzDoneImfileRow *object)
    22622235{
    2263     return pzDoneImfileInsert(dbh, object->exp_name, object->camera, object->telescope, object->class, object->class_id, object->exp_id, object->uri);
     2236    return pzDoneImfileInsert(dbh, object->exp_name, object->camera, object->telescope, object->class, object->class_id, object->uri);
    22642237}
    22652238
     
    23592332        return false;
    23602333    }
    2361     if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, NULL, object->exp_id)) {
    2362         psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
    2363         psFree(md);
    2364         return false;
    2365     }
    23662334    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, object->uri)) {
    23672335        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
     
    24032371        return false;
    24042372    }
    2405     psS64 exp_id = psMetadataLookupS64(&status, md, "exp_id");
    2406     if (!status) {
    2407         psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item exp_id");
    2408         return false;
    2409     }
    24102373    char* uri = psMetadataLookupPtr(&status, md, "uri");
    24112374    if (!status) {
     
    24142377    }
    24152378
    2416     return pzDoneImfileRowAlloc(exp_name, camera, telescope, class, class_id, exp_id, uri);
     2379    return pzDoneImfileRowAlloc(exp_name, camera, telescope, class, class_id, uri);
    24172380}
    24182381psArray *pzDoneImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    93079270static void warpSkyfileRowFree(warpSkyfileRow *object);
    93089271
    9309 warpSkyfileRow *warpSkyfileRowAlloc(psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psS16 fault)
     9272warpSkyfileRow *warpSkyfileRowAlloc(psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF64 pixel_fill, psS16 fault)
    93109273{
    93119274    warpSkyfileRow  *_object;
     
    93219284    _object->bg = bg;
    93229285    _object->bg_stdev = bg_stdev;
     9286    _object->pixel_fill = pixel_fill;
    93239287    _object->fault = fault;
    93249288
     
    93729336        return false;
    93739337    }
     9338    if (!psMetadataAdd(md, PS_LIST_TAIL, "pixel_fill", PS_DATA_F64, "Key", 0.0)) {
     9339        psError(PS_ERR_UNKNOWN, false, "failed to add item pixel_fill");
     9340        psFree(md);
     9341        return false;
     9342    }
    93749343    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "Key", 0)) {
    93759344        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     
    93909359}
    93919360
    9392 bool warpSkyfileInsert(psDB * dbh, psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psS16 fault)
     9361bool warpSkyfileInsert(psDB * dbh, psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF64 pixel_fill, psS16 fault)
    93939362{
    93949363    psMetadata *md = psMetadataAlloc();
     
    94259394    if (!psMetadataAdd(md, PS_LIST_TAIL, "bg_stdev", PS_DATA_F64, NULL, bg_stdev)) {
    94269395        psError(PS_ERR_UNKNOWN, false, "failed to add item bg_stdev");
     9396        psFree(md);
     9397        return false;
     9398    }
     9399    if (!psMetadataAdd(md, PS_LIST_TAIL, "pixel_fill", PS_DATA_F64, NULL, pixel_fill)) {
     9400        psError(PS_ERR_UNKNOWN, false, "failed to add item pixel_fill");
    94279401        psFree(md);
    94289402        return false;
     
    94569430bool warpSkyfileInsertObject(psDB *dbh, warpSkyfileRow *object)
    94579431{
    9458     return warpSkyfileInsert(dbh, object->warp_id, object->skycell_id, object->tess_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->fault);
     9432    return warpSkyfileInsert(dbh, object->warp_id, object->skycell_id, object->tess_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->pixel_fill, object->fault);
    94599433}
    94609434
     
    95649538        return false;
    95659539    }
     9540    if (!psMetadataAdd(md, PS_LIST_TAIL, "pixel_fill", PS_DATA_F64, NULL, object->pixel_fill)) {
     9541        psError(PS_ERR_UNKNOWN, false, "failed to add item pixel_fill");
     9542        psFree(md);
     9543        return false;
     9544    }
    95669545    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
    95679546        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     
    96139592        return false;
    96149593    }
     9594    psF64 pixel_fill = psMetadataLookupF64(&status, md, "pixel_fill");
     9595    if (!status) {
     9596        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item pixel_fill");
     9597        return false;
     9598    }
    96159599    psS16 fault = psMetadataLookupS16(&status, md, "fault");
    96169600    if (!status) {
     
    96199603    }
    96209604
    9621     return warpSkyfileRowAlloc(warp_id, skycell_id, tess_id, uri, path_base, bg, bg_stdev, fault);
     9605    return warpSkyfileRowAlloc(warp_id, skycell_id, tess_id, uri, path_base, bg, bg_stdev, pixel_fill, fault);
    96229606}
    96239607psArray *warpSkyfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    1890218886    return true;
    1890318887}
     18888static void magicRunRowFree(magicRunRow *object);
     18889
     18890magicRunRow *magicRunRowAlloc(psS64 magic_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *dvodb, psTime* registered)
     18891{
     18892    magicRunRow     *_object;
     18893
     18894    _object = psAlloc(sizeof(magicRunRow));
     18895    psMemSetDeallocator(_object, (psFreeFunc)magicRunRowFree);
     18896
     18897    _object->magic_id = magic_id;
     18898    _object->state = psStringCopy(state);
     18899    _object->workdir = psStringCopy(workdir);
     18900    _object->workdir_state = psStringCopy(workdir_state);
     18901    _object->label = psStringCopy(label);
     18902    _object->dvodb = psStringCopy(dvodb);
     18903    _object->registered = psTimeCopy(registered);
     18904
     18905    return _object;
     18906}
     18907
     18908static void magicRunRowFree(magicRunRow *object)
     18909{
     18910    psFree(object->state);
     18911    psFree(object->workdir);
     18912    psFree(object->workdir_state);
     18913    psFree(object->label);
     18914    psFree(object->dvodb);
     18915    psFree(object->registered);
     18916}
     18917
     18918bool magicRunCreateTable(psDB *dbh)
     18919{
     18920    psMetadata *md = psMetadataAlloc();
     18921    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, "Primary Key AUTO_INCREMENT", 0)) {
     18922        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
     18923        psFree(md);
     18924        return false;
     18925    }
     18926    if (!psMetadataAdd(md, PS_LIST_TAIL, "state", PS_DATA_STRING, "Key", "64")) {
     18927        psError(PS_ERR_UNKNOWN, false, "failed to add item state");
     18928        psFree(md);
     18929        return false;
     18930    }
     18931    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, "255")) {
     18932        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
     18933        psFree(md);
     18934        return false;
     18935    }
     18936    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir_state", PS_DATA_STRING, "Key", "255")) {
     18937        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir_state");
     18938        psFree(md);
     18939        return false;
     18940    }
     18941    if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, "key", "64")) {
     18942        psError(PS_ERR_UNKNOWN, false, "failed to add item label");
     18943        psFree(md);
     18944        return false;
     18945    }
     18946    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, "255")) {
     18947        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
     18948        psFree(md);
     18949        return false;
     18950    }
     18951    if (!psMetadataAdd(md, PS_LIST_TAIL, "registered", PS_DATA_TIME, NULL, NULL)) {
     18952        psError(PS_ERR_UNKNOWN, false, "failed to add item registered");
     18953        psFree(md);
     18954        return false;
     18955    }
     18956
     18957    bool status = psDBCreateTable(dbh, MAGICRUN_TABLE_NAME, md);
     18958
     18959    psFree(md);
     18960
     18961    return status;
     18962}
     18963
     18964bool magicRunDropTable(psDB *dbh)
     18965{
     18966    return psDBDropTable(dbh, MAGICRUN_TABLE_NAME);
     18967}
     18968
     18969bool magicRunInsert(psDB * dbh, psS64 magic_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *dvodb, psTime* registered)
     18970{
     18971    psMetadata *md = psMetadataAlloc();
     18972    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, magic_id)) {
     18973        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
     18974        psFree(md);
     18975        return false;
     18976    }
     18977    if (!psMetadataAdd(md, PS_LIST_TAIL, "state", PS_DATA_STRING, NULL, state)) {
     18978        psError(PS_ERR_UNKNOWN, false, "failed to add item state");
     18979        psFree(md);
     18980        return false;
     18981    }
     18982    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, workdir)) {
     18983        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
     18984        psFree(md);
     18985        return false;
     18986    }
     18987    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir_state", PS_DATA_STRING, NULL, workdir_state)) {
     18988        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir_state");
     18989        psFree(md);
     18990        return false;
     18991    }
     18992    if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, NULL, label)) {
     18993        psError(PS_ERR_UNKNOWN, false, "failed to add item label");
     18994        psFree(md);
     18995        return false;
     18996    }
     18997    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, dvodb)) {
     18998        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
     18999        psFree(md);
     19000        return false;
     19001    }
     19002    if (!psMetadataAdd(md, PS_LIST_TAIL, "registered", PS_DATA_TIME, NULL, registered)) {
     19003        psError(PS_ERR_UNKNOWN, false, "failed to add item registered");
     19004        psFree(md);
     19005        return false;
     19006    }
     19007
     19008    bool status = psDBInsertOneRow(dbh, MAGICRUN_TABLE_NAME, md);
     19009    psFree(md);
     19010
     19011    return status;
     19012}
     19013
     19014long long magicRunDelete(psDB *dbh, const psMetadata *where, unsigned long long limit)
     19015{
     19016    long long       deleted = 0;
     19017
     19018    long long count = psDBDeleteRows(dbh, MAGICRUN_TABLE_NAME, where, limit);
     19019    if (count < 0) {
     19020        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicRun");
     19021        return count;
     19022
     19023        deleted += count;
     19024    }
     19025
     19026    return deleted;
     19027}
     19028bool magicRunInsertObject(psDB *dbh, magicRunRow *object)
     19029{
     19030    return magicRunInsert(dbh, object->magic_id, object->state, object->workdir, object->workdir_state, object->label, object->dvodb, object->registered);
     19031}
     19032
     19033bool magicRunInsertObjects(psDB *dbh, psArray *objects)
     19034{
     19035    for (long i = 0; i < psArrayLength(objects); i++) {
     19036        if (!magicRunInsertObject(dbh, objects->data[i])) {
     19037            return false;
     19038        }
     19039    }
     19040
     19041    return true;
     19042}
     19043
     19044bool magicRunInsertFits(psDB *dbh, const psFits *fits)
     19045{
     19046    psArray         *rowSet;
     19047
     19048    // move to (the first?) extension named  MAGICRUN_TABLE_NAME
     19049    if (!psFitsMoveExtName(fits, MAGICRUN_TABLE_NAME)) {
     19050        psError(PS_ERR_UNKNOWN, true, "failed to find FITS extension %s", MAGICRUN_TABLE_NAME);
     19051        return false;
     19052    }
     19053
     19054    // check HDU type
     19055    if (psFitsGetExtType(fits) != PS_FITS_TYPE_BINARY_TABLE)  {
     19056        psError(PS_ERR_UNKNOWN, true, "FITS HDU type is not PS_FITS_TYPE_BINARY_TABLE");
     19057        return false;
     19058    }
     19059
     19060    // read fits table
     19061    rowSet = psFitsReadTable(fits);
     19062    if (!rowSet) {
     19063        psError(PS_ERR_UNKNOWN, true, "FITS read error or FITS table is empty");
     19064        psFree(rowSet);
     19065        return false;
     19066    }
     19067
     19068    if (!psDBInsertRows(dbh, MAGICRUN_TABLE_NAME, rowSet)) {
     19069        psError(PS_ERR_UNKNOWN, false, "databse insert failed");
     19070        psFree(rowSet);
     19071        return false;
     19072    }
     19073
     19074    psFree(rowSet);
     19075
     19076    return true;
     19077}
     19078
     19079bool magicRunSelectRowsFits(psDB *dbh, psFits *fits, const psMetadata *where, unsigned long long limit)
     19080{
     19081    psArray         *rowSet;
     19082
     19083    rowSet = psDBSelectRows(dbh, MAGICRUN_TABLE_NAME, where, limit);
     19084    if (!rowSet) {
     19085        return false;
     19086    }
     19087
     19088    // output to fits
     19089    if (!psFitsWriteTable(fits, NULL, rowSet, MAGICRUN_TABLE_NAME)) {
     19090        psError(PS_ERR_UNKNOWN, false, "FITS table write failed");
     19091        psFree(rowSet);
     19092        return false;
     19093    }
     19094
     19095    psFree(rowSet);
     19096
     19097    return true;
     19098}
     19099
     19100psMetadata *magicRunMetadataFromObject(const magicRunRow *object)
     19101{
     19102    psMetadata *md = psMetadataAlloc();
     19103    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, object->magic_id)) {
     19104        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
     19105        psFree(md);
     19106        return false;
     19107    }
     19108    if (!psMetadataAdd(md, PS_LIST_TAIL, "state", PS_DATA_STRING, NULL, object->state)) {
     19109        psError(PS_ERR_UNKNOWN, false, "failed to add item state");
     19110        psFree(md);
     19111        return false;
     19112    }
     19113    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, object->workdir)) {
     19114        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
     19115        psFree(md);
     19116        return false;
     19117    }
     19118    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir_state", PS_DATA_STRING, NULL, object->workdir_state)) {
     19119        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir_state");
     19120        psFree(md);
     19121        return false;
     19122    }
     19123    if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, NULL, object->label)) {
     19124        psError(PS_ERR_UNKNOWN, false, "failed to add item label");
     19125        psFree(md);
     19126        return false;
     19127    }
     19128    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, object->dvodb)) {
     19129        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
     19130        psFree(md);
     19131        return false;
     19132    }
     19133    if (!psMetadataAdd(md, PS_LIST_TAIL, "registered", PS_DATA_TIME, NULL, object->registered)) {
     19134        psError(PS_ERR_UNKNOWN, false, "failed to add item registered");
     19135        psFree(md);
     19136        return false;
     19137    }
     19138
     19139
     19140    return md;
     19141}
     19142
     19143magicRunRow *magicRunObjectFromMetadata(psMetadata *md)
     19144{
     19145
     19146bool status = false;
     19147    psS64 magic_id = psMetadataLookupS64(&status, md, "magic_id");
     19148    if (!status) {
     19149        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item magic_id");
     19150        return false;
     19151    }
     19152    char* state = psMetadataLookupPtr(&status, md, "state");
     19153    if (!status) {
     19154        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item state");
     19155        return false;
     19156    }
     19157    char* workdir = psMetadataLookupPtr(&status, md, "workdir");
     19158    if (!status) {
     19159        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item workdir");
     19160        return false;
     19161    }
     19162    char* workdir_state = psMetadataLookupPtr(&status, md, "workdir_state");
     19163    if (!status) {
     19164        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item workdir_state");
     19165        return false;
     19166    }
     19167    char* label = psMetadataLookupPtr(&status, md, "label");
     19168    if (!status) {
     19169        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item label");
     19170        return false;
     19171    }
     19172    char* dvodb = psMetadataLookupPtr(&status, md, "dvodb");
     19173    if (!status) {
     19174        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item dvodb");
     19175        return false;
     19176    }
     19177    psTime* registered = psMetadataLookupPtr(&status, md, "registered");
     19178    if (!status) {
     19179        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item registered");
     19180        return false;
     19181    }
     19182
     19183    return magicRunRowAlloc(magic_id, state, workdir, workdir_state, label, dvodb, registered);
     19184}
     19185psArray *magicRunSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     19186{
     19187    psArray         *rowSet;
     19188    psArray         *returnSet;
     19189    psU64           i;
     19190
     19191    rowSet = psDBSelectRows(dbh, MAGICRUN_TABLE_NAME, where, limit);
     19192    if (!rowSet) {
     19193        return NULL;
     19194    }
     19195
     19196    // convert psMetadata rows to row objects
     19197
     19198    returnSet = psArrayAllocEmpty(rowSet->n);
     19199
     19200    for (i = 0; i < rowSet->n; i++) {
     19201        magicRunRow *object = magicRunObjectFromMetadata(rowSet->data[i]);
     19202        psArrayAdd(returnSet, 0, object);
     19203        psFree(object);
     19204    }
     19205
     19206    psFree(rowSet);
     19207
     19208    return returnSet;
     19209}
     19210bool magicRunDeleteObject(psDB *dbh, const magicRunRow *object)
     19211{
     19212    psMetadata *where = magicRunMetadataFromObject(object);
     19213    long long count = psDBDeleteRows(dbh, MAGICRUN_TABLE_NAME, where, 0);
     19214    psFree(where);
     19215    if (count < 0) {
     19216        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicRun");
     19217        return false;
     19218    }
     19219    if (count > 1) {
     19220        // XXX should this be a psAbort() instead?  It is possible that
     19221        // having an object match multiple rows was by design.
     19222        psError(PS_ERR_UNKNOWN, true, "magicRunRow object matched more then one row.  Check your database schema");
     19223        return false;
     19224    }
     19225
     19226    return true;
     19227}
     19228long long magicRunDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
     19229{
     19230    long long       deleted = 0;
     19231
     19232    for (long long i = 0; i < objects->n; i++) {
     19233        magicRunRow *object = objects->data[i];
     19234        psMetadata *where = magicRunMetadataFromObject(object);
     19235        long long count = psDBDeleteRows(dbh, MAGICRUN_TABLE_NAME, where, limit);
     19236        psFree(where);
     19237        if (count < 0) {
     19238            psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicRun");
     19239            return count;
     19240        }
     19241
     19242        deleted += count;
     19243    }
     19244
     19245    return deleted;
     19246}
     19247bool magicRunPrintObjects(FILE *stream, psArray *objects, bool mdcf)
     19248{
     19249    PS_ASSERT_PTR_NON_NULL(objects, false);
     19250
     19251    psMetadata *output = psMetadataAlloc();
     19252    for (long i = 0; i < psArrayLength(objects); i++) {
     19253        psMetadata *md = magicRunMetadataFromObject(objects->data[i]);
     19254        if (!psMetadataAddMetadata(
     19255            output,
     19256            PS_LIST_TAIL,
     19257            MAGICRUN_TABLE_NAME,
     19258            PS_META_DUPLICATE_OK,
     19259            NULL,
     19260            md
     19261        )) {
     19262            psError(PS_ERR_UNKNOWN, false, "failed to add metadata");
     19263            psFree(md);
     19264            psFree(output);
     19265            return false;
     19266        }
     19267        psFree(md);
     19268    }
     19269
     19270    if (!ippdbPrintMetadataRaw(stream, output, mdcf)) {
     19271        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
     19272        psFree(output);
     19273    }
     19274    psFree(output);
     19275
     19276    return true;
     19277}
     19278bool magicRunPrintObject(FILE *stream, magicRunRow *object, bool mdcf)
     19279{
     19280    PS_ASSERT_PTR_NON_NULL(object, false);
     19281
     19282    psMetadata *md = magicRunMetadataFromObject(object);
     19283
     19284    if (!ippdbPrintMetadataRaw(stream, md, mdcf)) {
     19285        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
     19286        psFree(md);
     19287    }
     19288
     19289    psFree(md);
     19290
     19291    return true;
     19292}
     19293static void magicInputSkyfileRowFree(magicInputSkyfileRow *object);
     19294
     19295magicInputSkyfileRow *magicInputSkyfileRowAlloc(psS64 magic_id, psS64 diff_id, psS32 node)
     19296{
     19297    magicInputSkyfileRow *_object;
     19298
     19299    _object = psAlloc(sizeof(magicInputSkyfileRow));
     19300    psMemSetDeallocator(_object, (psFreeFunc)magicInputSkyfileRowFree);
     19301
     19302    _object->magic_id = magic_id;
     19303    _object->diff_id = diff_id;
     19304    _object->node = node;
     19305
     19306    return _object;
     19307}
     19308
     19309static void magicInputSkyfileRowFree(magicInputSkyfileRow *object)
     19310{
     19311}
     19312
     19313bool magicInputSkyfileCreateTable(psDB *dbh)
     19314{
     19315    psMetadata *md = psMetadataAlloc();
     19316    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, "Primary Key fkey(magic_id) ref magicRun(magic_id)", 0)) {
     19317        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
     19318        psFree(md);
     19319        return false;
     19320    }
     19321    if (!psMetadataAdd(md, PS_LIST_TAIL, "diff_id", PS_DATA_S64, "Key fkey(diff_id) ref diffRun(diff_id)", 0)) {
     19322        psError(PS_ERR_UNKNOWN, false, "failed to add item diff_id");
     19323        psFree(md);
     19324        return false;
     19325    }
     19326    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_S32, "AUTO_INCREMENT INDEX(magic_id, node)", 0)) {
     19327        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
     19328        psFree(md);
     19329        return false;
     19330    }
     19331
     19332    bool status = psDBCreateTable(dbh, MAGICINPUTSKYFILE_TABLE_NAME, md);
     19333
     19334    psFree(md);
     19335
     19336    return status;
     19337}
     19338
     19339bool magicInputSkyfileDropTable(psDB *dbh)
     19340{
     19341    return psDBDropTable(dbh, MAGICINPUTSKYFILE_TABLE_NAME);
     19342}
     19343
     19344bool magicInputSkyfileInsert(psDB * dbh, psS64 magic_id, psS64 diff_id, psS32 node)
     19345{
     19346    psMetadata *md = psMetadataAlloc();
     19347    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, magic_id)) {
     19348        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
     19349        psFree(md);
     19350        return false;
     19351    }
     19352    if (!psMetadataAdd(md, PS_LIST_TAIL, "diff_id", PS_DATA_S64, NULL, diff_id)) {
     19353        psError(PS_ERR_UNKNOWN, false, "failed to add item diff_id");
     19354        psFree(md);
     19355        return false;
     19356    }
     19357    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_S32, NULL, node)) {
     19358        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
     19359        psFree(md);
     19360        return false;
     19361    }
     19362
     19363    bool status = psDBInsertOneRow(dbh, MAGICINPUTSKYFILE_TABLE_NAME, md);
     19364    psFree(md);
     19365
     19366    return status;
     19367}
     19368
     19369long long magicInputSkyfileDelete(psDB *dbh, const psMetadata *where, unsigned long long limit)
     19370{
     19371    long long       deleted = 0;
     19372
     19373    long long count = psDBDeleteRows(dbh, MAGICINPUTSKYFILE_TABLE_NAME, where, limit);
     19374    if (count < 0) {
     19375        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicInputSkyfile");
     19376        return count;
     19377
     19378        deleted += count;
     19379    }
     19380
     19381    return deleted;
     19382}
     19383bool magicInputSkyfileInsertObject(psDB *dbh, magicInputSkyfileRow *object)
     19384{
     19385    return magicInputSkyfileInsert(dbh, object->magic_id, object->diff_id, object->node);
     19386}
     19387
     19388bool magicInputSkyfileInsertObjects(psDB *dbh, psArray *objects)
     19389{
     19390    for (long i = 0; i < psArrayLength(objects); i++) {
     19391        if (!magicInputSkyfileInsertObject(dbh, objects->data[i])) {
     19392            return false;
     19393        }
     19394    }
     19395
     19396    return true;
     19397}
     19398
     19399bool magicInputSkyfileInsertFits(psDB *dbh, const psFits *fits)
     19400{
     19401    psArray         *rowSet;
     19402
     19403    // move to (the first?) extension named  MAGICINPUTSKYFILE_TABLE_NAME
     19404    if (!psFitsMoveExtName(fits, MAGICINPUTSKYFILE_TABLE_NAME)) {
     19405        psError(PS_ERR_UNKNOWN, true, "failed to find FITS extension %s", MAGICINPUTSKYFILE_TABLE_NAME);
     19406        return false;
     19407    }
     19408
     19409    // check HDU type
     19410    if (psFitsGetExtType(fits) != PS_FITS_TYPE_BINARY_TABLE)  {
     19411        psError(PS_ERR_UNKNOWN, true, "FITS HDU type is not PS_FITS_TYPE_BINARY_TABLE");
     19412        return false;
     19413    }
     19414
     19415    // read fits table
     19416    rowSet = psFitsReadTable(fits);
     19417    if (!rowSet) {
     19418        psError(PS_ERR_UNKNOWN, true, "FITS read error or FITS table is empty");
     19419        psFree(rowSet);
     19420        return false;
     19421    }
     19422
     19423    if (!psDBInsertRows(dbh, MAGICINPUTSKYFILE_TABLE_NAME, rowSet)) {
     19424        psError(PS_ERR_UNKNOWN, false, "databse insert failed");
     19425        psFree(rowSet);
     19426        return false;
     19427    }
     19428
     19429    psFree(rowSet);
     19430
     19431    return true;
     19432}
     19433
     19434bool magicInputSkyfileSelectRowsFits(psDB *dbh, psFits *fits, const psMetadata *where, unsigned long long limit)
     19435{
     19436    psArray         *rowSet;
     19437
     19438    rowSet = psDBSelectRows(dbh, MAGICINPUTSKYFILE_TABLE_NAME, where, limit);
     19439    if (!rowSet) {
     19440        return false;
     19441    }
     19442
     19443    // output to fits
     19444    if (!psFitsWriteTable(fits, NULL, rowSet, MAGICINPUTSKYFILE_TABLE_NAME)) {
     19445        psError(PS_ERR_UNKNOWN, false, "FITS table write failed");
     19446        psFree(rowSet);
     19447        return false;
     19448    }
     19449
     19450    psFree(rowSet);
     19451
     19452    return true;
     19453}
     19454
     19455psMetadata *magicInputSkyfileMetadataFromObject(const magicInputSkyfileRow *object)
     19456{
     19457    psMetadata *md = psMetadataAlloc();
     19458    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, object->magic_id)) {
     19459        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
     19460        psFree(md);
     19461        return false;
     19462    }
     19463    if (!psMetadataAdd(md, PS_LIST_TAIL, "diff_id", PS_DATA_S64, NULL, object->diff_id)) {
     19464        psError(PS_ERR_UNKNOWN, false, "failed to add item diff_id");
     19465        psFree(md);
     19466        return false;
     19467    }
     19468    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_S32, NULL, object->node)) {
     19469        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
     19470        psFree(md);
     19471        return false;
     19472    }
     19473
     19474
     19475    return md;
     19476}
     19477
     19478magicInputSkyfileRow *magicInputSkyfileObjectFromMetadata(psMetadata *md)
     19479{
     19480
     19481bool status = false;
     19482    psS64 magic_id = psMetadataLookupS64(&status, md, "magic_id");
     19483    if (!status) {
     19484        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item magic_id");
     19485        return false;
     19486    }
     19487    psS64 diff_id = psMetadataLookupS64(&status, md, "diff_id");
     19488    if (!status) {
     19489        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item diff_id");
     19490        return false;
     19491    }
     19492    psS32 node = psMetadataLookupS32(&status, md, "node");
     19493    if (!status) {
     19494        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item node");
     19495        return false;
     19496    }
     19497
     19498    return magicInputSkyfileRowAlloc(magic_id, diff_id, node);
     19499}
     19500psArray *magicInputSkyfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     19501{
     19502    psArray         *rowSet;
     19503    psArray         *returnSet;
     19504    psU64           i;
     19505
     19506    rowSet = psDBSelectRows(dbh, MAGICINPUTSKYFILE_TABLE_NAME, where, limit);
     19507    if (!rowSet) {
     19508        return NULL;
     19509    }
     19510
     19511    // convert psMetadata rows to row objects
     19512
     19513    returnSet = psArrayAllocEmpty(rowSet->n);
     19514
     19515    for (i = 0; i < rowSet->n; i++) {
     19516        magicInputSkyfileRow *object = magicInputSkyfileObjectFromMetadata(rowSet->data[i]);
     19517        psArrayAdd(returnSet, 0, object);
     19518        psFree(object);
     19519    }
     19520
     19521    psFree(rowSet);
     19522
     19523    return returnSet;
     19524}
     19525bool magicInputSkyfileDeleteObject(psDB *dbh, const magicInputSkyfileRow *object)
     19526{
     19527    psMetadata *where = magicInputSkyfileMetadataFromObject(object);
     19528    long long count = psDBDeleteRows(dbh, MAGICINPUTSKYFILE_TABLE_NAME, where, 0);
     19529    psFree(where);
     19530    if (count < 0) {
     19531        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicInputSkyfile");
     19532        return false;
     19533    }
     19534    if (count > 1) {
     19535        // XXX should this be a psAbort() instead?  It is possible that
     19536        // having an object match multiple rows was by design.
     19537        psError(PS_ERR_UNKNOWN, true, "magicInputSkyfileRow object matched more then one row.  Check your database schema");
     19538        return false;
     19539    }
     19540
     19541    return true;
     19542}
     19543long long magicInputSkyfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
     19544{
     19545    long long       deleted = 0;
     19546
     19547    for (long long i = 0; i < objects->n; i++) {
     19548        magicInputSkyfileRow *object = objects->data[i];
     19549        psMetadata *where = magicInputSkyfileMetadataFromObject(object);
     19550        long long count = psDBDeleteRows(dbh, MAGICINPUTSKYFILE_TABLE_NAME, where, limit);
     19551        psFree(where);
     19552        if (count < 0) {
     19553            psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicInputSkyfile");
     19554            return count;
     19555        }
     19556
     19557        deleted += count;
     19558    }
     19559
     19560    return deleted;
     19561}
     19562bool magicInputSkyfilePrintObjects(FILE *stream, psArray *objects, bool mdcf)
     19563{
     19564    PS_ASSERT_PTR_NON_NULL(objects, false);
     19565
     19566    psMetadata *output = psMetadataAlloc();
     19567    for (long i = 0; i < psArrayLength(objects); i++) {
     19568        psMetadata *md = magicInputSkyfileMetadataFromObject(objects->data[i]);
     19569        if (!psMetadataAddMetadata(
     19570            output,
     19571            PS_LIST_TAIL,
     19572            MAGICINPUTSKYFILE_TABLE_NAME,
     19573            PS_META_DUPLICATE_OK,
     19574            NULL,
     19575            md
     19576        )) {
     19577            psError(PS_ERR_UNKNOWN, false, "failed to add metadata");
     19578            psFree(md);
     19579            psFree(output);
     19580            return false;
     19581        }
     19582        psFree(md);
     19583    }
     19584
     19585    if (!ippdbPrintMetadataRaw(stream, output, mdcf)) {
     19586        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
     19587        psFree(output);
     19588    }
     19589    psFree(output);
     19590
     19591    return true;
     19592}
     19593bool magicInputSkyfilePrintObject(FILE *stream, magicInputSkyfileRow *object, bool mdcf)
     19594{
     19595    PS_ASSERT_PTR_NON_NULL(object, false);
     19596
     19597    psMetadata *md = magicInputSkyfileMetadataFromObject(object);
     19598
     19599    if (!ippdbPrintMetadataRaw(stream, md, mdcf)) {
     19600        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
     19601        psFree(md);
     19602    }
     19603
     19604    psFree(md);
     19605
     19606    return true;
     19607}
     19608static void magicTreeRowFree(magicTreeRow *object);
     19609
     19610magicTreeRow *magicTreeRowAlloc(psS64 magic_id, const char *node, const char *dep)
     19611{
     19612    magicTreeRow    *_object;
     19613
     19614    _object = psAlloc(sizeof(magicTreeRow));
     19615    psMemSetDeallocator(_object, (psFreeFunc)magicTreeRowFree);
     19616
     19617    _object->magic_id = magic_id;
     19618    _object->node = psStringCopy(node);
     19619    _object->dep = psStringCopy(dep);
     19620
     19621    return _object;
     19622}
     19623
     19624static void magicTreeRowFree(magicTreeRow *object)
     19625{
     19626    psFree(object->node);
     19627    psFree(object->dep);
     19628}
     19629
     19630bool magicTreeCreateTable(psDB *dbh)
     19631{
     19632    psMetadata *md = psMetadataAlloc();
     19633    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, "Primary Key fkey(magic_id) ref magicRun(magic_id)", 0)) {
     19634        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
     19635        psFree(md);
     19636        return false;
     19637    }
     19638    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_STRING, "Primary Key fkey(magic_id, node) ref magicInputSkyfile(magic_id, node)", "64")) {
     19639        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
     19640        psFree(md);
     19641        return false;
     19642    }
     19643    if (!psMetadataAdd(md, PS_LIST_TAIL, "dep", PS_DATA_STRING, "fkey(magic_id, dep) ref magicInputSkyfile(magic_id, node)", "64")) {
     19644        psError(PS_ERR_UNKNOWN, false, "failed to add item dep");
     19645        psFree(md);
     19646        return false;
     19647    }
     19648
     19649    bool status = psDBCreateTable(dbh, MAGICTREE_TABLE_NAME, md);
     19650
     19651    psFree(md);
     19652
     19653    return status;
     19654}
     19655
     19656bool magicTreeDropTable(psDB *dbh)
     19657{
     19658    return psDBDropTable(dbh, MAGICTREE_TABLE_NAME);
     19659}
     19660
     19661bool magicTreeInsert(psDB * dbh, psS64 magic_id, const char *node, const char *dep)
     19662{
     19663    psMetadata *md = psMetadataAlloc();
     19664    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, magic_id)) {
     19665        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
     19666        psFree(md);
     19667        return false;
     19668    }
     19669    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_STRING, NULL, node)) {
     19670        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
     19671        psFree(md);
     19672        return false;
     19673    }
     19674    if (!psMetadataAdd(md, PS_LIST_TAIL, "dep", PS_DATA_STRING, NULL, dep)) {
     19675        psError(PS_ERR_UNKNOWN, false, "failed to add item dep");
     19676        psFree(md);
     19677        return false;
     19678    }
     19679
     19680    bool status = psDBInsertOneRow(dbh, MAGICTREE_TABLE_NAME, md);
     19681    psFree(md);
     19682
     19683    return status;
     19684}
     19685
     19686long long magicTreeDelete(psDB *dbh, const psMetadata *where, unsigned long long limit)
     19687{
     19688    long long       deleted = 0;
     19689
     19690    long long count = psDBDeleteRows(dbh, MAGICTREE_TABLE_NAME, where, limit);
     19691    if (count < 0) {
     19692        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicTree");
     19693        return count;
     19694
     19695        deleted += count;
     19696    }
     19697
     19698    return deleted;
     19699}
     19700bool magicTreeInsertObject(psDB *dbh, magicTreeRow *object)
     19701{
     19702    return magicTreeInsert(dbh, object->magic_id, object->node, object->dep);
     19703}
     19704
     19705bool magicTreeInsertObjects(psDB *dbh, psArray *objects)
     19706{
     19707    for (long i = 0; i < psArrayLength(objects); i++) {
     19708        if (!magicTreeInsertObject(dbh, objects->data[i])) {
     19709            return false;
     19710        }
     19711    }
     19712
     19713    return true;
     19714}
     19715
     19716bool magicTreeInsertFits(psDB *dbh, const psFits *fits)
     19717{
     19718    psArray         *rowSet;
     19719
     19720    // move to (the first?) extension named  MAGICTREE_TABLE_NAME
     19721    if (!psFitsMoveExtName(fits, MAGICTREE_TABLE_NAME)) {
     19722        psError(PS_ERR_UNKNOWN, true, "failed to find FITS extension %s", MAGICTREE_TABLE_NAME);
     19723        return false;
     19724    }
     19725
     19726    // check HDU type
     19727    if (psFitsGetExtType(fits) != PS_FITS_TYPE_BINARY_TABLE)  {
     19728        psError(PS_ERR_UNKNOWN, true, "FITS HDU type is not PS_FITS_TYPE_BINARY_TABLE");
     19729        return false;
     19730    }
     19731
     19732    // read fits table
     19733    rowSet = psFitsReadTable(fits);
     19734    if (!rowSet) {
     19735        psError(PS_ERR_UNKNOWN, true, "FITS read error or FITS table is empty");
     19736        psFree(rowSet);
     19737        return false;
     19738    }
     19739
     19740    if (!psDBInsertRows(dbh, MAGICTREE_TABLE_NAME, rowSet)) {
     19741        psError(PS_ERR_UNKNOWN, false, "databse insert failed");
     19742        psFree(rowSet);
     19743        return false;
     19744    }
     19745
     19746    psFree(rowSet);
     19747
     19748    return true;
     19749}
     19750
     19751bool magicTreeSelectRowsFits(psDB *dbh, psFits *fits, const psMetadata *where, unsigned long long limit)
     19752{
     19753    psArray         *rowSet;
     19754
     19755    rowSet = psDBSelectRows(dbh, MAGICTREE_TABLE_NAME, where, limit);
     19756    if (!rowSet) {
     19757        return false;
     19758    }
     19759
     19760    // output to fits
     19761    if (!psFitsWriteTable(fits, NULL, rowSet, MAGICTREE_TABLE_NAME)) {
     19762        psError(PS_ERR_UNKNOWN, false, "FITS table write failed");
     19763        psFree(rowSet);
     19764        return false;
     19765    }
     19766
     19767    psFree(rowSet);
     19768
     19769    return true;
     19770}
     19771
     19772psMetadata *magicTreeMetadataFromObject(const magicTreeRow *object)
     19773{
     19774    psMetadata *md = psMetadataAlloc();
     19775    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, object->magic_id)) {
     19776        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
     19777        psFree(md);
     19778        return false;
     19779    }
     19780    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_STRING, NULL, object->node)) {
     19781        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
     19782        psFree(md);
     19783        return false;
     19784    }
     19785    if (!psMetadataAdd(md, PS_LIST_TAIL, "dep", PS_DATA_STRING, NULL, object->dep)) {
     19786        psError(PS_ERR_UNKNOWN, false, "failed to add item dep");
     19787        psFree(md);
     19788        return false;
     19789    }
     19790
     19791
     19792    return md;
     19793}
     19794
     19795magicTreeRow *magicTreeObjectFromMetadata(psMetadata *md)
     19796{
     19797
     19798bool status = false;
     19799    psS64 magic_id = psMetadataLookupS64(&status, md, "magic_id");
     19800    if (!status) {
     19801        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item magic_id");
     19802        return false;
     19803    }
     19804    char* node = psMetadataLookupPtr(&status, md, "node");
     19805    if (!status) {
     19806        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item node");
     19807        return false;
     19808    }
     19809    char* dep = psMetadataLookupPtr(&status, md, "dep");
     19810    if (!status) {
     19811        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item dep");
     19812        return false;
     19813    }
     19814
     19815    return magicTreeRowAlloc(magic_id, node, dep);
     19816}
     19817psArray *magicTreeSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     19818{
     19819    psArray         *rowSet;
     19820    psArray         *returnSet;
     19821    psU64           i;
     19822
     19823    rowSet = psDBSelectRows(dbh, MAGICTREE_TABLE_NAME, where, limit);
     19824    if (!rowSet) {
     19825        return NULL;
     19826    }
     19827
     19828    // convert psMetadata rows to row objects
     19829
     19830    returnSet = psArrayAllocEmpty(rowSet->n);
     19831
     19832    for (i = 0; i < rowSet->n; i++) {
     19833        magicTreeRow *object = magicTreeObjectFromMetadata(rowSet->data[i]);
     19834        psArrayAdd(returnSet, 0, object);
     19835        psFree(object);
     19836    }
     19837
     19838    psFree(rowSet);
     19839
     19840    return returnSet;
     19841}
     19842bool magicTreeDeleteObject(psDB *dbh, const magicTreeRow *object)
     19843{
     19844    psMetadata *where = magicTreeMetadataFromObject(object);
     19845    long long count = psDBDeleteRows(dbh, MAGICTREE_TABLE_NAME, where, 0);
     19846    psFree(where);
     19847    if (count < 0) {
     19848        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicTree");
     19849        return false;
     19850    }
     19851    if (count > 1) {
     19852        // XXX should this be a psAbort() instead?  It is possible that
     19853        // having an object match multiple rows was by design.
     19854        psError(PS_ERR_UNKNOWN, true, "magicTreeRow object matched more then one row.  Check your database schema");
     19855        return false;
     19856    }
     19857
     19858    return true;
     19859}
     19860long long magicTreeDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
     19861{
     19862    long long       deleted = 0;
     19863
     19864    for (long long i = 0; i < objects->n; i++) {
     19865        magicTreeRow *object = objects->data[i];
     19866        psMetadata *where = magicTreeMetadataFromObject(object);
     19867        long long count = psDBDeleteRows(dbh, MAGICTREE_TABLE_NAME, where, limit);
     19868        psFree(where);
     19869        if (count < 0) {
     19870            psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicTree");
     19871            return count;
     19872        }
     19873
     19874        deleted += count;
     19875    }
     19876
     19877    return deleted;
     19878}
     19879bool magicTreePrintObjects(FILE *stream, psArray *objects, bool mdcf)
     19880{
     19881    PS_ASSERT_PTR_NON_NULL(objects, false);
     19882
     19883    psMetadata *output = psMetadataAlloc();
     19884    for (long i = 0; i < psArrayLength(objects); i++) {
     19885        psMetadata *md = magicTreeMetadataFromObject(objects->data[i]);
     19886        if (!psMetadataAddMetadata(
     19887            output,
     19888            PS_LIST_TAIL,
     19889            MAGICTREE_TABLE_NAME,
     19890            PS_META_DUPLICATE_OK,
     19891            NULL,
     19892            md
     19893        )) {
     19894            psError(PS_ERR_UNKNOWN, false, "failed to add metadata");
     19895            psFree(md);
     19896            psFree(output);
     19897            return false;
     19898        }
     19899        psFree(md);
     19900    }
     19901
     19902    if (!ippdbPrintMetadataRaw(stream, output, mdcf)) {
     19903        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
     19904        psFree(output);
     19905    }
     19906    psFree(output);
     19907
     19908    return true;
     19909}
     19910bool magicTreePrintObject(FILE *stream, magicTreeRow *object, bool mdcf)
     19911{
     19912    PS_ASSERT_PTR_NON_NULL(object, false);
     19913
     19914    psMetadata *md = magicTreeMetadataFromObject(object);
     19915
     19916    if (!ippdbPrintMetadataRaw(stream, md, mdcf)) {
     19917        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
     19918        psFree(md);
     19919    }
     19920
     19921    psFree(md);
     19922
     19923    return true;
     19924}
     19925static void magicNodeResultRowFree(magicNodeResultRow *object);
     19926
     19927magicNodeResultRow *magicNodeResultRowAlloc(psS64 magic_id, const char *node, const char *uri)
     19928{
     19929    magicNodeResultRow *_object;
     19930
     19931    _object = psAlloc(sizeof(magicNodeResultRow));
     19932    psMemSetDeallocator(_object, (psFreeFunc)magicNodeResultRowFree);
     19933
     19934    _object->magic_id = magic_id;
     19935    _object->node = psStringCopy(node);
     19936    _object->uri = psStringCopy(uri);
     19937
     19938    return _object;
     19939}
     19940
     19941static void magicNodeResultRowFree(magicNodeResultRow *object)
     19942{
     19943    psFree(object->node);
     19944    psFree(object->uri);
     19945}
     19946
     19947bool magicNodeResultCreateTable(psDB *dbh)
     19948{
     19949    psMetadata *md = psMetadataAlloc();
     19950    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, "Primary Key fkey(magic_id) ref magicRun(magic_id)", 0)) {
     19951        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
     19952        psFree(md);
     19953        return false;
     19954    }
     19955    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_STRING, "Primary Key fkey(magic_id, node) ref magicInputSkyfile(magic_id, node)", "64")) {
     19956        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
     19957        psFree(md);
     19958        return false;
     19959    }
     19960    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, "255")) {
     19961        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
     19962        psFree(md);
     19963        return false;
     19964    }
     19965
     19966    bool status = psDBCreateTable(dbh, MAGICNODERESULT_TABLE_NAME, md);
     19967
     19968    psFree(md);
     19969
     19970    return status;
     19971}
     19972
     19973bool magicNodeResultDropTable(psDB *dbh)
     19974{
     19975    return psDBDropTable(dbh, MAGICNODERESULT_TABLE_NAME);
     19976}
     19977
     19978bool magicNodeResultInsert(psDB * dbh, psS64 magic_id, const char *node, const char *uri)
     19979{
     19980    psMetadata *md = psMetadataAlloc();
     19981    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, magic_id)) {
     19982        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
     19983        psFree(md);
     19984        return false;
     19985    }
     19986    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_STRING, NULL, node)) {
     19987        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
     19988        psFree(md);
     19989        return false;
     19990    }
     19991    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, uri)) {
     19992        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
     19993        psFree(md);
     19994        return false;
     19995    }
     19996
     19997    bool status = psDBInsertOneRow(dbh, MAGICNODERESULT_TABLE_NAME, md);
     19998    psFree(md);
     19999
     20000    return status;
     20001}
     20002
     20003long long magicNodeResultDelete(psDB *dbh, const psMetadata *where, unsigned long long limit)
     20004{
     20005    long long       deleted = 0;
     20006
     20007    long long count = psDBDeleteRows(dbh, MAGICNODERESULT_TABLE_NAME, where, limit);
     20008    if (count < 0) {
     20009        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicNodeResult");
     20010        return count;
     20011
     20012        deleted += count;
     20013    }
     20014
     20015    return deleted;
     20016}
     20017bool magicNodeResultInsertObject(psDB *dbh, magicNodeResultRow *object)
     20018{
     20019    return magicNodeResultInsert(dbh, object->magic_id, object->node, object->uri);
     20020}
     20021
     20022bool magicNodeResultInsertObjects(psDB *dbh, psArray *objects)
     20023{
     20024    for (long i = 0; i < psArrayLength(objects); i++) {
     20025        if (!magicNodeResultInsertObject(dbh, objects->data[i])) {
     20026            return false;
     20027        }
     20028    }
     20029
     20030    return true;
     20031}
     20032
     20033bool magicNodeResultInsertFits(psDB *dbh, const psFits *fits)
     20034{
     20035    psArray         *rowSet;
     20036
     20037    // move to (the first?) extension named  MAGICNODERESULT_TABLE_NAME
     20038    if (!psFitsMoveExtName(fits, MAGICNODERESULT_TABLE_NAME)) {
     20039        psError(PS_ERR_UNKNOWN, true, "failed to find FITS extension %s", MAGICNODERESULT_TABLE_NAME);
     20040        return false;
     20041    }
     20042
     20043    // check HDU type
     20044    if (psFitsGetExtType(fits) != PS_FITS_TYPE_BINARY_TABLE)  {
     20045        psError(PS_ERR_UNKNOWN, true, "FITS HDU type is not PS_FITS_TYPE_BINARY_TABLE");
     20046        return false;
     20047    }
     20048
     20049    // read fits table
     20050    rowSet = psFitsReadTable(fits);
     20051    if (!rowSet) {
     20052        psError(PS_ERR_UNKNOWN, true, "FITS read error or FITS table is empty");
     20053        psFree(rowSet);
     20054        return false;
     20055    }
     20056
     20057    if (!psDBInsertRows(dbh, MAGICNODERESULT_TABLE_NAME, rowSet)) {
     20058        psError(PS_ERR_UNKNOWN, false, "databse insert failed");
     20059        psFree(rowSet);
     20060        return false;
     20061    }
     20062
     20063    psFree(rowSet);
     20064
     20065    return true;
     20066}
     20067
     20068bool magicNodeResultSelectRowsFits(psDB *dbh, psFits *fits, const psMetadata *where, unsigned long long limit)
     20069{
     20070    psArray         *rowSet;
     20071
     20072    rowSet = psDBSelectRows(dbh, MAGICNODERESULT_TABLE_NAME, where, limit);
     20073    if (!rowSet) {
     20074        return false;
     20075    }
     20076
     20077    // output to fits
     20078    if (!psFitsWriteTable(fits, NULL, rowSet, MAGICNODERESULT_TABLE_NAME)) {
     20079        psError(PS_ERR_UNKNOWN, false, "FITS table write failed");
     20080        psFree(rowSet);
     20081        return false;
     20082    }
     20083
     20084    psFree(rowSet);
     20085
     20086    return true;
     20087}
     20088
     20089psMetadata *magicNodeResultMetadataFromObject(const magicNodeResultRow *object)
     20090{
     20091    psMetadata *md = psMetadataAlloc();
     20092    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, object->magic_id)) {
     20093        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
     20094        psFree(md);
     20095        return false;
     20096    }
     20097    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_STRING, NULL, object->node)) {
     20098        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
     20099        psFree(md);
     20100        return false;
     20101    }
     20102    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, object->uri)) {
     20103        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
     20104        psFree(md);
     20105        return false;
     20106    }
     20107
     20108
     20109    return md;
     20110}
     20111
     20112magicNodeResultRow *magicNodeResultObjectFromMetadata(psMetadata *md)
     20113{
     20114
     20115bool status = false;
     20116    psS64 magic_id = psMetadataLookupS64(&status, md, "magic_id");
     20117    if (!status) {
     20118        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item magic_id");
     20119        return false;
     20120    }
     20121    char* node = psMetadataLookupPtr(&status, md, "node");
     20122    if (!status) {
     20123        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item node");
     20124        return false;
     20125    }
     20126    char* uri = psMetadataLookupPtr(&status, md, "uri");
     20127    if (!status) {
     20128        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item uri");
     20129        return false;
     20130    }
     20131
     20132    return magicNodeResultRowAlloc(magic_id, node, uri);
     20133}
     20134psArray *magicNodeResultSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     20135{
     20136    psArray         *rowSet;
     20137    psArray         *returnSet;
     20138    psU64           i;
     20139
     20140    rowSet = psDBSelectRows(dbh, MAGICNODERESULT_TABLE_NAME, where, limit);
     20141    if (!rowSet) {
     20142        return NULL;
     20143    }
     20144
     20145    // convert psMetadata rows to row objects
     20146
     20147    returnSet = psArrayAllocEmpty(rowSet->n);
     20148
     20149    for (i = 0; i < rowSet->n; i++) {
     20150        magicNodeResultRow *object = magicNodeResultObjectFromMetadata(rowSet->data[i]);
     20151        psArrayAdd(returnSet, 0, object);
     20152        psFree(object);
     20153    }
     20154
     20155    psFree(rowSet);
     20156
     20157    return returnSet;
     20158}
     20159bool magicNodeResultDeleteObject(psDB *dbh, const magicNodeResultRow *object)
     20160{
     20161    psMetadata *where = magicNodeResultMetadataFromObject(object);
     20162    long long count = psDBDeleteRows(dbh, MAGICNODERESULT_TABLE_NAME, where, 0);
     20163    psFree(where);
     20164    if (count < 0) {
     20165        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicNodeResult");
     20166        return false;
     20167    }
     20168    if (count > 1) {
     20169        // XXX should this be a psAbort() instead?  It is possible that
     20170        // having an object match multiple rows was by design.
     20171        psError(PS_ERR_UNKNOWN, true, "magicNodeResultRow object matched more then one row.  Check your database schema");
     20172        return false;
     20173    }
     20174
     20175    return true;
     20176}
     20177long long magicNodeResultDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
     20178{
     20179    long long       deleted = 0;
     20180
     20181    for (long long i = 0; i < objects->n; i++) {
     20182        magicNodeResultRow *object = objects->data[i];
     20183        psMetadata *where = magicNodeResultMetadataFromObject(object);
     20184        long long count = psDBDeleteRows(dbh, MAGICNODERESULT_TABLE_NAME, where, limit);
     20185        psFree(where);
     20186        if (count < 0) {
     20187            psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicNodeResult");
     20188            return count;
     20189        }
     20190
     20191        deleted += count;
     20192    }
     20193
     20194    return deleted;
     20195}
     20196bool magicNodeResultPrintObjects(FILE *stream, psArray *objects, bool mdcf)
     20197{
     20198    PS_ASSERT_PTR_NON_NULL(objects, false);
     20199
     20200    psMetadata *output = psMetadataAlloc();
     20201    for (long i = 0; i < psArrayLength(objects); i++) {
     20202        psMetadata *md = magicNodeResultMetadataFromObject(objects->data[i]);
     20203        if (!psMetadataAddMetadata(
     20204            output,
     20205            PS_LIST_TAIL,
     20206            MAGICNODERESULT_TABLE_NAME,
     20207            PS_META_DUPLICATE_OK,
     20208            NULL,
     20209            md
     20210        )) {
     20211            psError(PS_ERR_UNKNOWN, false, "failed to add metadata");
     20212            psFree(md);
     20213            psFree(output);
     20214            return false;
     20215        }
     20216        psFree(md);
     20217    }
     20218
     20219    if (!ippdbPrintMetadataRaw(stream, output, mdcf)) {
     20220        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
     20221        psFree(output);
     20222    }
     20223    psFree(output);
     20224
     20225    return true;
     20226}
     20227bool magicNodeResultPrintObject(FILE *stream, magicNodeResultRow *object, bool mdcf)
     20228{
     20229    PS_ASSERT_PTR_NON_NULL(object, false);
     20230
     20231    psMetadata *md = magicNodeResultMetadataFromObject(object);
     20232
     20233    if (!ippdbPrintMetadataRaw(stream, md, mdcf)) {
     20234        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
     20235        psFree(md);
     20236    }
     20237
     20238    psFree(md);
     20239
     20240    return true;
     20241}
     20242static void magicMaskRowFree(magicMaskRow *object);
     20243
     20244magicMaskRow *magicMaskRowAlloc(psS64 magic_id, const char *uri)
     20245{
     20246    magicMaskRow    *_object;
     20247
     20248    _object = psAlloc(sizeof(magicMaskRow));
     20249    psMemSetDeallocator(_object, (psFreeFunc)magicMaskRowFree);
     20250
     20251    _object->magic_id = magic_id;
     20252    _object->uri = psStringCopy(uri);
     20253
     20254    return _object;
     20255}
     20256
     20257static void magicMaskRowFree(magicMaskRow *object)
     20258{
     20259    psFree(object->uri);
     20260}
     20261
     20262bool magicMaskCreateTable(psDB *dbh)
     20263{
     20264    psMetadata *md = psMetadataAlloc();
     20265    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, "Primary Key fkey(magic_id) ref magicRun(magic_id)", 0)) {
     20266        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
     20267        psFree(md);
     20268        return false;
     20269    }
     20270    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, "255")) {
     20271        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
     20272        psFree(md);
     20273        return false;
     20274    }
     20275
     20276    bool status = psDBCreateTable(dbh, MAGICMASK_TABLE_NAME, md);
     20277
     20278    psFree(md);
     20279
     20280    return status;
     20281}
     20282
     20283bool magicMaskDropTable(psDB *dbh)
     20284{
     20285    return psDBDropTable(dbh, MAGICMASK_TABLE_NAME);
     20286}
     20287
     20288bool magicMaskInsert(psDB * dbh, psS64 magic_id, const char *uri)
     20289{
     20290    psMetadata *md = psMetadataAlloc();
     20291    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, magic_id)) {
     20292        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
     20293        psFree(md);
     20294        return false;
     20295    }
     20296    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, uri)) {
     20297        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
     20298        psFree(md);
     20299        return false;
     20300    }
     20301
     20302    bool status = psDBInsertOneRow(dbh, MAGICMASK_TABLE_NAME, md);
     20303    psFree(md);
     20304
     20305    return status;
     20306}
     20307
     20308long long magicMaskDelete(psDB *dbh, const psMetadata *where, unsigned long long limit)
     20309{
     20310    long long       deleted = 0;
     20311
     20312    long long count = psDBDeleteRows(dbh, MAGICMASK_TABLE_NAME, where, limit);
     20313    if (count < 0) {
     20314        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicMask");
     20315        return count;
     20316
     20317        deleted += count;
     20318    }
     20319
     20320    return deleted;
     20321}
     20322bool magicMaskInsertObject(psDB *dbh, magicMaskRow *object)
     20323{
     20324    return magicMaskInsert(dbh, object->magic_id, object->uri);
     20325}
     20326
     20327bool magicMaskInsertObjects(psDB *dbh, psArray *objects)
     20328{
     20329    for (long i = 0; i < psArrayLength(objects); i++) {
     20330        if (!magicMaskInsertObject(dbh, objects->data[i])) {
     20331            return false;
     20332        }
     20333    }
     20334
     20335    return true;
     20336}
     20337
     20338bool magicMaskInsertFits(psDB *dbh, const psFits *fits)
     20339{
     20340    psArray         *rowSet;
     20341
     20342    // move to (the first?) extension named  MAGICMASK_TABLE_NAME
     20343    if (!psFitsMoveExtName(fits, MAGICMASK_TABLE_NAME)) {
     20344        psError(PS_ERR_UNKNOWN, true, "failed to find FITS extension %s", MAGICMASK_TABLE_NAME);
     20345        return false;
     20346    }
     20347
     20348    // check HDU type
     20349    if (psFitsGetExtType(fits) != PS_FITS_TYPE_BINARY_TABLE)  {
     20350        psError(PS_ERR_UNKNOWN, true, "FITS HDU type is not PS_FITS_TYPE_BINARY_TABLE");
     20351        return false;
     20352    }
     20353
     20354    // read fits table
     20355    rowSet = psFitsReadTable(fits);
     20356    if (!rowSet) {
     20357        psError(PS_ERR_UNKNOWN, true, "FITS read error or FITS table is empty");
     20358        psFree(rowSet);
     20359        return false;
     20360    }
     20361
     20362    if (!psDBInsertRows(dbh, MAGICMASK_TABLE_NAME, rowSet)) {
     20363        psError(PS_ERR_UNKNOWN, false, "databse insert failed");
     20364        psFree(rowSet);
     20365        return false;
     20366    }
     20367
     20368    psFree(rowSet);
     20369
     20370    return true;
     20371}
     20372
     20373bool magicMaskSelectRowsFits(psDB *dbh, psFits *fits, const psMetadata *where, unsigned long long limit)
     20374{
     20375    psArray         *rowSet;
     20376
     20377    rowSet = psDBSelectRows(dbh, MAGICMASK_TABLE_NAME, where, limit);
     20378    if (!rowSet) {
     20379        return false;
     20380    }
     20381
     20382    // output to fits
     20383    if (!psFitsWriteTable(fits, NULL, rowSet, MAGICMASK_TABLE_NAME)) {
     20384        psError(PS_ERR_UNKNOWN, false, "FITS table write failed");
     20385        psFree(rowSet);
     20386        return false;
     20387    }
     20388
     20389    psFree(rowSet);
     20390
     20391    return true;
     20392}
     20393
     20394psMetadata *magicMaskMetadataFromObject(const magicMaskRow *object)
     20395{
     20396    psMetadata *md = psMetadataAlloc();
     20397    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, object->magic_id)) {
     20398        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
     20399        psFree(md);
     20400        return false;
     20401    }
     20402    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, object->uri)) {
     20403        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
     20404        psFree(md);
     20405        return false;
     20406    }
     20407
     20408
     20409    return md;
     20410}
     20411
     20412magicMaskRow *magicMaskObjectFromMetadata(psMetadata *md)
     20413{
     20414
     20415bool status = false;
     20416    psS64 magic_id = psMetadataLookupS64(&status, md, "magic_id");
     20417    if (!status) {
     20418        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item magic_id");
     20419        return false;
     20420    }
     20421    char* uri = psMetadataLookupPtr(&status, md, "uri");
     20422    if (!status) {
     20423        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item uri");
     20424        return false;
     20425    }
     20426
     20427    return magicMaskRowAlloc(magic_id, uri);
     20428}
     20429psArray *magicMaskSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     20430{
     20431    psArray         *rowSet;
     20432    psArray         *returnSet;
     20433    psU64           i;
     20434
     20435    rowSet = psDBSelectRows(dbh, MAGICMASK_TABLE_NAME, where, limit);
     20436    if (!rowSet) {
     20437        return NULL;
     20438    }
     20439
     20440    // convert psMetadata rows to row objects
     20441
     20442    returnSet = psArrayAllocEmpty(rowSet->n);
     20443
     20444    for (i = 0; i < rowSet->n; i++) {
     20445        magicMaskRow *object = magicMaskObjectFromMetadata(rowSet->data[i]);
     20446        psArrayAdd(returnSet, 0, object);
     20447        psFree(object);
     20448    }
     20449
     20450    psFree(rowSet);
     20451
     20452    return returnSet;
     20453}
     20454bool magicMaskDeleteObject(psDB *dbh, const magicMaskRow *object)
     20455{
     20456    psMetadata *where = magicMaskMetadataFromObject(object);
     20457    long long count = psDBDeleteRows(dbh, MAGICMASK_TABLE_NAME, where, 0);
     20458    psFree(where);
     20459    if (count < 0) {
     20460        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicMask");
     20461        return false;
     20462    }
     20463    if (count > 1) {
     20464        // XXX should this be a psAbort() instead?  It is possible that
     20465        // having an object match multiple rows was by design.
     20466        psError(PS_ERR_UNKNOWN, true, "magicMaskRow object matched more then one row.  Check your database schema");
     20467        return false;
     20468    }
     20469
     20470    return true;
     20471}
     20472long long magicMaskDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
     20473{
     20474    long long       deleted = 0;
     20475
     20476    for (long long i = 0; i < objects->n; i++) {
     20477        magicMaskRow *object = objects->data[i];
     20478        psMetadata *where = magicMaskMetadataFromObject(object);
     20479        long long count = psDBDeleteRows(dbh, MAGICMASK_TABLE_NAME, where, limit);
     20480        psFree(where);
     20481        if (count < 0) {
     20482            psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicMask");
     20483            return count;
     20484        }
     20485
     20486        deleted += count;
     20487    }
     20488
     20489    return deleted;
     20490}
     20491bool magicMaskPrintObjects(FILE *stream, psArray *objects, bool mdcf)
     20492{
     20493    PS_ASSERT_PTR_NON_NULL(objects, false);
     20494
     20495    psMetadata *output = psMetadataAlloc();
     20496    for (long i = 0; i < psArrayLength(objects); i++) {
     20497        psMetadata *md = magicMaskMetadataFromObject(objects->data[i]);
     20498        if (!psMetadataAddMetadata(
     20499            output,
     20500            PS_LIST_TAIL,
     20501            MAGICMASK_TABLE_NAME,
     20502            PS_META_DUPLICATE_OK,
     20503            NULL,
     20504            md
     20505        )) {
     20506            psError(PS_ERR_UNKNOWN, false, "failed to add metadata");
     20507            psFree(md);
     20508            psFree(output);
     20509            return false;
     20510        }
     20511        psFree(md);
     20512    }
     20513
     20514    if (!ippdbPrintMetadataRaw(stream, output, mdcf)) {
     20515        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
     20516        psFree(output);
     20517    }
     20518    psFree(output);
     20519
     20520    return true;
     20521}
     20522bool magicMaskPrintObject(FILE *stream, magicMaskRow *object, bool mdcf)
     20523{
     20524    PS_ASSERT_PTR_NON_NULL(object, false);
     20525
     20526    psMetadata *md = magicMaskMetadataFromObject(object);
     20527
     20528    if (!ippdbPrintMetadataRaw(stream, md, mdcf)) {
     20529        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
     20530        psFree(md);
     20531    }
     20532
     20533    psFree(md);
     20534
     20535    return true;
     20536}
  • trunk/ippdb/src/ippdb.h

    r14451 r14598  
    2020/*
    2121 *
    22  * This file was generated by glueforge 1.03
     22 * This file was generated by glueforge 1.01
    2323 *
    2424 * Do NOT directly edit this file.
     
    769769    char            *class;
    770770    char            *class_id;
    771     psS64           exp_id;
    772771} pzPendingImfileRow;
    773772
     
    782781    const char      *telescope,
    783782    const char      *class,
    784     const char      *class_id,
    785     psS64           exp_id
     783    const char      *class_id
    786784);
    787785
     
    817815    const char      *telescope,
    818816    const char      *class,
    819     const char      *class_id,
    820     psS64           exp_id
     817    const char      *class_id
    821818);
    822819
     
    11801177    char            *class;
    11811178    char            *class_id;
    1182     psS64           exp_id;
    11831179    char            *uri;
    11841180} pzDoneImfileRow;
     
    11951191    const char      *class,
    11961192    const char      *class_id,
    1197     psS64           exp_id,
    11981193    const char      *uri
    11991194);
     
    12311226    const char      *class,
    12321227    const char      *class_id,
    1233     psS64           exp_id,
    12341228    const char      *uri
    12351229);
     
    45394533    psF64           bg;
    45404534    psF64           bg_stdev;
     4535    psF64           pixel_fill;
    45414536    psS16           fault;
    45424537} warpSkyfileRow;
     
    45554550    psF64           bg,
    45564551    psF64           bg_stdev,
     4552    psF64           pixel_fill,
    45574553    psS16           fault
    45584554);
     
    45924588    psF64           bg,
    45934589    psF64           bg_stdev,
     4590    psF64           pixel_fill,
    45944591    psS16           fault
    45954592);
     
    88528849    bool            mdcf                ///< format as mdconfig or simple
    88538850);
     8851/** magicRunRow data structure
     8852 *
     8853 * Structure for representing a single row of magicRun table data.
     8854 */
     8855
     8856typedef struct {
     8857    psS64           magic_id;
     8858    char            *state;
     8859    char            *workdir;
     8860    char            *workdir_state;
     8861    char            *label;
     8862    char            *dvodb;
     8863    psTime*         registered;
     8864} magicRunRow;
     8865
     8866/** Creates a new magicRunRow object
     8867 *
     8868 *  @return A new magicRunRow object or NULL on failure.
     8869 */
     8870
     8871magicRunRow *magicRunRowAlloc(
     8872    psS64           magic_id,
     8873    const char      *state,
     8874    const char      *workdir,
     8875    const char      *workdir_state,
     8876    const char      *label,
     8877    const char      *dvodb,
     8878    psTime*         registered
     8879);
     8880
     8881/** Creates a new magicRun table
     8882 *
     8883 * @return true on success
     8884 */
     8885
     8886bool magicRunCreateTable(
     8887    psDB            *dbh                ///< Database handle
     8888);
     8889
     8890/** Deletes a magicRun table
     8891 *
     8892 * @return true on success
     8893 */
     8894
     8895bool magicRunDropTable(
     8896    psDB            *dbh                ///< Database handle
     8897);
     8898
     8899/** Insert a single row into a table
     8900 *
     8901 * This function constructs and inserts a single row based on it's parameters.
     8902 *
     8903 * @return true on success
     8904 */
     8905
     8906bool magicRunInsert(
     8907    psDB            *dbh,               ///< Database handle
     8908    psS64           magic_id,
     8909    const char      *state,
     8910    const char      *workdir,
     8911    const char      *workdir_state,
     8912    const char      *label,
     8913    const char      *dvodb,
     8914    psTime*         registered
     8915);
     8916
     8917/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     8918 *
     8919 * @return A The number of rows removed or a negative value on error
     8920 */
     8921
     8922long long magicRunDelete(
     8923    psDB            *dbh,               ///< Database handle
     8924    const psMetadata *where,            ///< Row match criteria
     8925    unsigned long long limit            ///< Maximum number of elements to delete
     8926);
     8927
     8928/** Insert a single magicRunRow object into a table
     8929 *
     8930 * This function constructs and inserts a single row based on it's parameters.
     8931 *
     8932 * @return true on success
     8933 */
     8934
     8935bool magicRunInsertObject(
     8936    psDB            *dbh,               ///< Database handle
     8937    magicRunRow     *object             ///< magicRunRow object
     8938);
     8939
     8940/** Insert an array of magicRunRow object into a table
     8941 *
     8942 * This function constructs and inserts multiple rows based on it's parameters.
     8943 *
     8944 * @return true on success
     8945 */
     8946
     8947bool magicRunInsertObjects(
     8948    psDB            *dbh,               ///< Database handle
     8949    psArray         *objects            ///< array of magicRunRow objects
     8950);
     8951
     8952/** Insert data from a binary FITS table magicRunRow into the database
     8953 *
     8954 * This function expects a psFits object with a FITS table as the first
     8955 * extension.  The table must have at least one row of data in it, that is of
     8956 * the appropriate format (number of columns and their type).  All other
     8957 * extensions are ignored.
     8958 *
     8959 * @return true on success
     8960 */
     8961
     8962bool magicRunInsertFits(
     8963    psDB            *dbh,               ///< Database handle
     8964    const psFits    *fits               ///< psFits object
     8965);
     8966
     8967/** Selects up to limit from the database and returns them in a binary FITS table
     8968 *
     8969 * This function assumes an empty psFits object and will create a FITS table
     8970 * as the first extension.
     8971 *
     8972 *  See psDBSelectRows() for documentation on the format of where.
     8973 *
     8974 * @return true on success
     8975 */
     8976
     8977bool magicRunSelectRowsFits(
     8978    psDB            *dbh,               ///< Database handle
     8979    psFits          *fits,              ///< psFits object
     8980    const psMetadata *where,            ///< Row match criteria
     8981    unsigned long long limit            ///< Maximum number of elements to return
     8982);
     8983
     8984/** Convert a magicRunRow into an equivalent psMetadata
     8985 *
     8986 * @return A psMetadata pointer or NULL on error
     8987 */
     8988
     8989psMetadata *magicRunMetadataFromObject(
     8990    const magicRunRow *object             ///< fooRow to convert into a psMetadata
     8991);
     8992
     8993/** Convert a psMetadata into an equivalent fooRow
     8994 *
     8995 * @return A magicRunRow pointer or NULL on error
     8996 */
     8997
     8998magicRunRow *magicRunObjectFromMetadata(
     8999    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     9000);
     9001/** Selects up to limit rows from the database and returns as magicRunRow objects in a psArray
     9002 *
     9003 *  See psDBSelectRows() for documentation on the format of where.
     9004 *
     9005 * @return A psArray pointer or NULL on error
     9006 */
     9007
     9008psArray *magicRunSelectRowObjects(
     9009    psDB            *dbh,               ///< Database handle
     9010    const psMetadata *where,            ///< Row match criteria
     9011    unsigned long long limit            ///< Maximum number of elements to return
     9012);
     9013/** Deletes a row from the database coresponding to an magicRun
     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
     9021bool magicRunDeleteObject(
     9022    psDB            *dbh,               ///< Database handle
     9023    const magicRunRow *object    ///< Object to delete
     9024);
     9025/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     9026 *
     9027 *  Note that a 'where' search psMetadata is constructed from each object and
     9028 *  used to find rows to delete.
     9029 *
     9030 * @return A The number of rows removed or a negative value on error
     9031 */
     9032
     9033long long magicRunDeleteRowObjects(
     9034    psDB            *dbh,               ///< Database handle
     9035    const psArray   *objects,           ///< Array of objects to delete
     9036    unsigned long long limit            ///< Maximum number of elements to delete
     9037);
     9038/** Formats and prints an array of magicRunRow objects
     9039 *
     9040 * When mdcf is set the formated output is in psMetadataConfig
     9041 * format, otherwise it is in a simple tabular format.
     9042 *
     9043 * @return true on success
     9044 */
     9045
     9046bool magicRunPrintObjects(
     9047    FILE            *stream,            ///< a stream
     9048    psArray         *objects,           ///< An array of magicRunRow objects
     9049    bool            mdcf                ///< format as mdconfig or simple
     9050);
     9051/** Formats and prints an magicRunRow object
     9052 *
     9053 * When mdcf is set the formated output is in psMetadataConfig
     9054 * format, otherwise it is in a simple tabular format.
     9055 *
     9056 * @return true on success
     9057 */
     9058
     9059bool magicRunPrintObject(
     9060    FILE            *stream,            ///< a stream
     9061    magicRunRow *object,    ///< an magicRunRow object
     9062    bool            mdcf                ///< format as mdconfig or simple
     9063);
     9064/** magicInputSkyfileRow data structure
     9065 *
     9066 * Structure for representing a single row of magicInputSkyfile table data.
     9067 */
     9068
     9069typedef struct {
     9070    psS64           magic_id;
     9071    psS64           diff_id;
     9072    psS32           node;
     9073} magicInputSkyfileRow;
     9074
     9075/** Creates a new magicInputSkyfileRow object
     9076 *
     9077 *  @return A new magicInputSkyfileRow object or NULL on failure.
     9078 */
     9079
     9080magicInputSkyfileRow *magicInputSkyfileRowAlloc(
     9081    psS64           magic_id,
     9082    psS64           diff_id,
     9083    psS32           node
     9084);
     9085
     9086/** Creates a new magicInputSkyfile table
     9087 *
     9088 * @return true on success
     9089 */
     9090
     9091bool magicInputSkyfileCreateTable(
     9092    psDB            *dbh                ///< Database handle
     9093);
     9094
     9095/** Deletes a magicInputSkyfile table
     9096 *
     9097 * @return true on success
     9098 */
     9099
     9100bool magicInputSkyfileDropTable(
     9101    psDB            *dbh                ///< Database handle
     9102);
     9103
     9104/** Insert a single row into a table
     9105 *
     9106 * This function constructs and inserts a single row based on it's parameters.
     9107 *
     9108 * @return true on success
     9109 */
     9110
     9111bool magicInputSkyfileInsert(
     9112    psDB            *dbh,               ///< Database handle
     9113    psS64           magic_id,
     9114    psS64           diff_id,
     9115    psS32           node
     9116);
     9117
     9118/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     9119 *
     9120 * @return A The number of rows removed or a negative value on error
     9121 */
     9122
     9123long long magicInputSkyfileDelete(
     9124    psDB            *dbh,               ///< Database handle
     9125    const psMetadata *where,            ///< Row match criteria
     9126    unsigned long long limit            ///< Maximum number of elements to delete
     9127);
     9128
     9129/** Insert a single magicInputSkyfileRow object into a table
     9130 *
     9131 * This function constructs and inserts a single row based on it's parameters.
     9132 *
     9133 * @return true on success
     9134 */
     9135
     9136bool magicInputSkyfileInsertObject(
     9137    psDB            *dbh,               ///< Database handle
     9138    magicInputSkyfileRow *object             ///< magicInputSkyfileRow object
     9139);
     9140
     9141/** Insert an array of magicInputSkyfileRow object into a table
     9142 *
     9143 * This function constructs and inserts multiple rows based on it's parameters.
     9144 *
     9145 * @return true on success
     9146 */
     9147
     9148bool magicInputSkyfileInsertObjects(
     9149    psDB            *dbh,               ///< Database handle
     9150    psArray         *objects            ///< array of magicInputSkyfileRow objects
     9151);
     9152
     9153/** Insert data from a binary FITS table magicInputSkyfileRow into the database
     9154 *
     9155 * This function expects a psFits object with a FITS table as the first
     9156 * extension.  The table must have at least one row of data in it, that is of
     9157 * the appropriate format (number of columns and their type).  All other
     9158 * extensions are ignored.
     9159 *
     9160 * @return true on success
     9161 */
     9162
     9163bool magicInputSkyfileInsertFits(
     9164    psDB            *dbh,               ///< Database handle
     9165    const psFits    *fits               ///< psFits object
     9166);
     9167
     9168/** Selects up to limit from the database and returns them in a binary FITS table
     9169 *
     9170 * This function assumes an empty psFits object and will create a FITS table
     9171 * as the first extension.
     9172 *
     9173 *  See psDBSelectRows() for documentation on the format of where.
     9174 *
     9175 * @return true on success
     9176 */
     9177
     9178bool magicInputSkyfileSelectRowsFits(
     9179    psDB            *dbh,               ///< Database handle
     9180    psFits          *fits,              ///< psFits object
     9181    const psMetadata *where,            ///< Row match criteria
     9182    unsigned long long limit            ///< Maximum number of elements to return
     9183);
     9184
     9185/** Convert a magicInputSkyfileRow into an equivalent psMetadata
     9186 *
     9187 * @return A psMetadata pointer or NULL on error
     9188 */
     9189
     9190psMetadata *magicInputSkyfileMetadataFromObject(
     9191    const magicInputSkyfileRow *object             ///< fooRow to convert into a psMetadata
     9192);
     9193
     9194/** Convert a psMetadata into an equivalent fooRow
     9195 *
     9196 * @return A magicInputSkyfileRow pointer or NULL on error
     9197 */
     9198
     9199magicInputSkyfileRow *magicInputSkyfileObjectFromMetadata(
     9200    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     9201);
     9202/** Selects up to limit rows from the database and returns as magicInputSkyfileRow objects in a psArray
     9203 *
     9204 *  See psDBSelectRows() for documentation on the format of where.
     9205 *
     9206 * @return A psArray pointer or NULL on error
     9207 */
     9208
     9209psArray *magicInputSkyfileSelectRowObjects(
     9210    psDB            *dbh,               ///< Database handle
     9211    const psMetadata *where,            ///< Row match criteria
     9212    unsigned long long limit            ///< Maximum number of elements to return
     9213);
     9214/** Deletes a row from the database coresponding to an magicInputSkyfile
     9215 *
     9216 *  Note that a 'where' search psMetadata is constructed from each object and
     9217 *  used to find rows to delete.
     9218 *
     9219 * @return A The number of rows removed or a negative value on error
     9220 */
     9221
     9222bool magicInputSkyfileDeleteObject(
     9223    psDB            *dbh,               ///< Database handle
     9224    const magicInputSkyfileRow *object    ///< Object to delete
     9225);
     9226/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     9227 *
     9228 *  Note that a 'where' search psMetadata is constructed from each object and
     9229 *  used to find rows to delete.
     9230 *
     9231 * @return A The number of rows removed or a negative value on error
     9232 */
     9233
     9234long long magicInputSkyfileDeleteRowObjects(
     9235    psDB            *dbh,               ///< Database handle
     9236    const psArray   *objects,           ///< Array of objects to delete
     9237    unsigned long long limit            ///< Maximum number of elements to delete
     9238);
     9239/** Formats and prints an array of magicInputSkyfileRow objects
     9240 *
     9241 * When mdcf is set the formated output is in psMetadataConfig
     9242 * format, otherwise it is in a simple tabular format.
     9243 *
     9244 * @return true on success
     9245 */
     9246
     9247bool magicInputSkyfilePrintObjects(
     9248    FILE            *stream,            ///< a stream
     9249    psArray         *objects,           ///< An array of magicInputSkyfileRow objects
     9250    bool            mdcf                ///< format as mdconfig or simple
     9251);
     9252/** Formats and prints an magicInputSkyfileRow object
     9253 *
     9254 * When mdcf is set the formated output is in psMetadataConfig
     9255 * format, otherwise it is in a simple tabular format.
     9256 *
     9257 * @return true on success
     9258 */
     9259
     9260bool magicInputSkyfilePrintObject(
     9261    FILE            *stream,            ///< a stream
     9262    magicInputSkyfileRow *object,    ///< an magicInputSkyfileRow object
     9263    bool            mdcf                ///< format as mdconfig or simple
     9264);
     9265/** magicTreeRow data structure
     9266 *
     9267 * Structure for representing a single row of magicTree table data.
     9268 */
     9269
     9270typedef struct {
     9271    psS64           magic_id;
     9272    char            *node;
     9273    char            *dep;
     9274} magicTreeRow;
     9275
     9276/** Creates a new magicTreeRow object
     9277 *
     9278 *  @return A new magicTreeRow object or NULL on failure.
     9279 */
     9280
     9281magicTreeRow *magicTreeRowAlloc(
     9282    psS64           magic_id,
     9283    const char      *node,
     9284    const char      *dep
     9285);
     9286
     9287/** Creates a new magicTree table
     9288 *
     9289 * @return true on success
     9290 */
     9291
     9292bool magicTreeCreateTable(
     9293    psDB            *dbh                ///< Database handle
     9294);
     9295
     9296/** Deletes a magicTree table
     9297 *
     9298 * @return true on success
     9299 */
     9300
     9301bool magicTreeDropTable(
     9302    psDB            *dbh                ///< Database handle
     9303);
     9304
     9305/** Insert a single row into a table
     9306 *
     9307 * This function constructs and inserts a single row based on it's parameters.
     9308 *
     9309 * @return true on success
     9310 */
     9311
     9312bool magicTreeInsert(
     9313    psDB            *dbh,               ///< Database handle
     9314    psS64           magic_id,
     9315    const char      *node,
     9316    const char      *dep
     9317);
     9318
     9319/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     9320 *
     9321 * @return A The number of rows removed or a negative value on error
     9322 */
     9323
     9324long long magicTreeDelete(
     9325    psDB            *dbh,               ///< Database handle
     9326    const psMetadata *where,            ///< Row match criteria
     9327    unsigned long long limit            ///< Maximum number of elements to delete
     9328);
     9329
     9330/** Insert a single magicTreeRow object into a table
     9331 *
     9332 * This function constructs and inserts a single row based on it's parameters.
     9333 *
     9334 * @return true on success
     9335 */
     9336
     9337bool magicTreeInsertObject(
     9338    psDB            *dbh,               ///< Database handle
     9339    magicTreeRow    *object             ///< magicTreeRow object
     9340);
     9341
     9342/** Insert an array of magicTreeRow object into a table
     9343 *
     9344 * This function constructs and inserts multiple rows based on it's parameters.
     9345 *
     9346 * @return true on success
     9347 */
     9348
     9349bool magicTreeInsertObjects(
     9350    psDB            *dbh,               ///< Database handle
     9351    psArray         *objects            ///< array of magicTreeRow objects
     9352);
     9353
     9354/** Insert data from a binary FITS table magicTreeRow into the database
     9355 *
     9356 * This function expects a psFits object with a FITS table as the first
     9357 * extension.  The table must have at least one row of data in it, that is of
     9358 * the appropriate format (number of columns and their type).  All other
     9359 * extensions are ignored.
     9360 *
     9361 * @return true on success
     9362 */
     9363
     9364bool magicTreeInsertFits(
     9365    psDB            *dbh,               ///< Database handle
     9366    const psFits    *fits               ///< psFits object
     9367);
     9368
     9369/** Selects up to limit from the database and returns them in a binary FITS table
     9370 *
     9371 * This function assumes an empty psFits object and will create a FITS table
     9372 * as the first extension.
     9373 *
     9374 *  See psDBSelectRows() for documentation on the format of where.
     9375 *
     9376 * @return true on success
     9377 */
     9378
     9379bool magicTreeSelectRowsFits(
     9380    psDB            *dbh,               ///< Database handle
     9381    psFits          *fits,              ///< psFits object
     9382    const psMetadata *where,            ///< Row match criteria
     9383    unsigned long long limit            ///< Maximum number of elements to return
     9384);
     9385
     9386/** Convert a magicTreeRow into an equivalent psMetadata
     9387 *
     9388 * @return A psMetadata pointer or NULL on error
     9389 */
     9390
     9391psMetadata *magicTreeMetadataFromObject(
     9392    const magicTreeRow *object             ///< fooRow to convert into a psMetadata
     9393);
     9394
     9395/** Convert a psMetadata into an equivalent fooRow
     9396 *
     9397 * @return A magicTreeRow pointer or NULL on error
     9398 */
     9399
     9400magicTreeRow *magicTreeObjectFromMetadata(
     9401    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     9402);
     9403/** Selects up to limit rows from the database and returns as magicTreeRow objects in a psArray
     9404 *
     9405 *  See psDBSelectRows() for documentation on the format of where.
     9406 *
     9407 * @return A psArray pointer or NULL on error
     9408 */
     9409
     9410psArray *magicTreeSelectRowObjects(
     9411    psDB            *dbh,               ///< Database handle
     9412    const psMetadata *where,            ///< Row match criteria
     9413    unsigned long long limit            ///< Maximum number of elements to return
     9414);
     9415/** Deletes a row from the database coresponding to an magicTree
     9416 *
     9417 *  Note that a 'where' search psMetadata is constructed from each object and
     9418 *  used to find rows to delete.
     9419 *
     9420 * @return A The number of rows removed or a negative value on error
     9421 */
     9422
     9423bool magicTreeDeleteObject(
     9424    psDB            *dbh,               ///< Database handle
     9425    const magicTreeRow *object    ///< Object to delete
     9426);
     9427/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     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
     9435long long magicTreeDeleteRowObjects(
     9436    psDB            *dbh,               ///< Database handle
     9437    const psArray   *objects,           ///< Array of objects to delete
     9438    unsigned long long limit            ///< Maximum number of elements to delete
     9439);
     9440/** Formats and prints an array of magicTreeRow objects
     9441 *
     9442 * When mdcf is set the formated output is in psMetadataConfig
     9443 * format, otherwise it is in a simple tabular format.
     9444 *
     9445 * @return true on success
     9446 */
     9447
     9448bool magicTreePrintObjects(
     9449    FILE            *stream,            ///< a stream
     9450    psArray         *objects,           ///< An array of magicTreeRow objects
     9451    bool            mdcf                ///< format as mdconfig or simple
     9452);
     9453/** Formats and prints an magicTreeRow object
     9454 *
     9455 * When mdcf is set the formated output is in psMetadataConfig
     9456 * format, otherwise it is in a simple tabular format.
     9457 *
     9458 * @return true on success
     9459 */
     9460
     9461bool magicTreePrintObject(
     9462    FILE            *stream,            ///< a stream
     9463    magicTreeRow *object,    ///< an magicTreeRow object
     9464    bool            mdcf                ///< format as mdconfig or simple
     9465);
     9466/** magicNodeResultRow data structure
     9467 *
     9468 * Structure for representing a single row of magicNodeResult table data.
     9469 */
     9470
     9471typedef struct {
     9472    psS64           magic_id;
     9473    char            *node;
     9474    char            *uri;
     9475} magicNodeResultRow;
     9476
     9477/** Creates a new magicNodeResultRow object
     9478 *
     9479 *  @return A new magicNodeResultRow object or NULL on failure.
     9480 */
     9481
     9482magicNodeResultRow *magicNodeResultRowAlloc(
     9483    psS64           magic_id,
     9484    const char      *node,
     9485    const char      *uri
     9486);
     9487
     9488/** Creates a new magicNodeResult table
     9489 *
     9490 * @return true on success
     9491 */
     9492
     9493bool magicNodeResultCreateTable(
     9494    psDB            *dbh                ///< Database handle
     9495);
     9496
     9497/** Deletes a magicNodeResult table
     9498 *
     9499 * @return true on success
     9500 */
     9501
     9502bool magicNodeResultDropTable(
     9503    psDB            *dbh                ///< Database handle
     9504);
     9505
     9506/** Insert a single row into a table
     9507 *
     9508 * This function constructs and inserts a single row based on it's parameters.
     9509 *
     9510 * @return true on success
     9511 */
     9512
     9513bool magicNodeResultInsert(
     9514    psDB            *dbh,               ///< Database handle
     9515    psS64           magic_id,
     9516    const char      *node,
     9517    const char      *uri
     9518);
     9519
     9520/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     9521 *
     9522 * @return A The number of rows removed or a negative value on error
     9523 */
     9524
     9525long long magicNodeResultDelete(
     9526    psDB            *dbh,               ///< Database handle
     9527    const psMetadata *where,            ///< Row match criteria
     9528    unsigned long long limit            ///< Maximum number of elements to delete
     9529);
     9530
     9531/** Insert a single magicNodeResultRow object into a table
     9532 *
     9533 * This function constructs and inserts a single row based on it's parameters.
     9534 *
     9535 * @return true on success
     9536 */
     9537
     9538bool magicNodeResultInsertObject(
     9539    psDB            *dbh,               ///< Database handle
     9540    magicNodeResultRow *object             ///< magicNodeResultRow object
     9541);
     9542
     9543/** Insert an array of magicNodeResultRow object into a table
     9544 *
     9545 * This function constructs and inserts multiple rows based on it's parameters.
     9546 *
     9547 * @return true on success
     9548 */
     9549
     9550bool magicNodeResultInsertObjects(
     9551    psDB            *dbh,               ///< Database handle
     9552    psArray         *objects            ///< array of magicNodeResultRow objects
     9553);
     9554
     9555/** Insert data from a binary FITS table magicNodeResultRow into the database
     9556 *
     9557 * This function expects a psFits object with a FITS table as the first
     9558 * extension.  The table must have at least one row of data in it, that is of
     9559 * the appropriate format (number of columns and their type).  All other
     9560 * extensions are ignored.
     9561 *
     9562 * @return true on success
     9563 */
     9564
     9565bool magicNodeResultInsertFits(
     9566    psDB            *dbh,               ///< Database handle
     9567    const psFits    *fits               ///< psFits object
     9568);
     9569
     9570/** Selects up to limit from the database and returns them in a binary FITS table
     9571 *
     9572 * This function assumes an empty psFits object and will create a FITS table
     9573 * as the first extension.
     9574 *
     9575 *  See psDBSelectRows() for documentation on the format of where.
     9576 *
     9577 * @return true on success
     9578 */
     9579
     9580bool magicNodeResultSelectRowsFits(
     9581    psDB            *dbh,               ///< Database handle
     9582    psFits          *fits,              ///< psFits object
     9583    const psMetadata *where,            ///< Row match criteria
     9584    unsigned long long limit            ///< Maximum number of elements to return
     9585);
     9586
     9587/** Convert a magicNodeResultRow into an equivalent psMetadata
     9588 *
     9589 * @return A psMetadata pointer or NULL on error
     9590 */
     9591
     9592psMetadata *magicNodeResultMetadataFromObject(
     9593    const magicNodeResultRow *object             ///< fooRow to convert into a psMetadata
     9594);
     9595
     9596/** Convert a psMetadata into an equivalent fooRow
     9597 *
     9598 * @return A magicNodeResultRow pointer or NULL on error
     9599 */
     9600
     9601magicNodeResultRow *magicNodeResultObjectFromMetadata(
     9602    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     9603);
     9604/** Selects up to limit rows from the database and returns as magicNodeResultRow objects in a psArray
     9605 *
     9606 *  See psDBSelectRows() for documentation on the format of where.
     9607 *
     9608 * @return A psArray pointer or NULL on error
     9609 */
     9610
     9611psArray *magicNodeResultSelectRowObjects(
     9612    psDB            *dbh,               ///< Database handle
     9613    const psMetadata *where,            ///< Row match criteria
     9614    unsigned long long limit            ///< Maximum number of elements to return
     9615);
     9616/** Deletes a row from the database coresponding to an magicNodeResult
     9617 *
     9618 *  Note that a 'where' search psMetadata is constructed from each object and
     9619 *  used to find rows to delete.
     9620 *
     9621 * @return A The number of rows removed or a negative value on error
     9622 */
     9623
     9624bool magicNodeResultDeleteObject(
     9625    psDB            *dbh,               ///< Database handle
     9626    const magicNodeResultRow *object    ///< Object to delete
     9627);
     9628/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     9629 *
     9630 *  Note that a 'where' search psMetadata is constructed from each object and
     9631 *  used to find rows to delete.
     9632 *
     9633 * @return A The number of rows removed or a negative value on error
     9634 */
     9635
     9636long long magicNodeResultDeleteRowObjects(
     9637    psDB            *dbh,               ///< Database handle
     9638    const psArray   *objects,           ///< Array of objects to delete
     9639    unsigned long long limit            ///< Maximum number of elements to delete
     9640);
     9641/** Formats and prints an array of magicNodeResultRow objects
     9642 *
     9643 * When mdcf is set the formated output is in psMetadataConfig
     9644 * format, otherwise it is in a simple tabular format.
     9645 *
     9646 * @return true on success
     9647 */
     9648
     9649bool magicNodeResultPrintObjects(
     9650    FILE            *stream,            ///< a stream
     9651    psArray         *objects,           ///< An array of magicNodeResultRow objects
     9652    bool            mdcf                ///< format as mdconfig or simple
     9653);
     9654/** Formats and prints an magicNodeResultRow object
     9655 *
     9656 * When mdcf is set the formated output is in psMetadataConfig
     9657 * format, otherwise it is in a simple tabular format.
     9658 *
     9659 * @return true on success
     9660 */
     9661
     9662bool magicNodeResultPrintObject(
     9663    FILE            *stream,            ///< a stream
     9664    magicNodeResultRow *object,    ///< an magicNodeResultRow object
     9665    bool            mdcf                ///< format as mdconfig or simple
     9666);
     9667/** magicMaskRow data structure
     9668 *
     9669 * Structure for representing a single row of magicMask table data.
     9670 */
     9671
     9672typedef struct {
     9673    psS64           magic_id;
     9674    char            *uri;
     9675} magicMaskRow;
     9676
     9677/** Creates a new magicMaskRow object
     9678 *
     9679 *  @return A new magicMaskRow object or NULL on failure.
     9680 */
     9681
     9682magicMaskRow *magicMaskRowAlloc(
     9683    psS64           magic_id,
     9684    const char      *uri
     9685);
     9686
     9687/** Creates a new magicMask table
     9688 *
     9689 * @return true on success
     9690 */
     9691
     9692bool magicMaskCreateTable(
     9693    psDB            *dbh                ///< Database handle
     9694);
     9695
     9696/** Deletes a magicMask table
     9697 *
     9698 * @return true on success
     9699 */
     9700
     9701bool magicMaskDropTable(
     9702    psDB            *dbh                ///< Database handle
     9703);
     9704
     9705/** Insert a single row into a table
     9706 *
     9707 * This function constructs and inserts a single row based on it's parameters.
     9708 *
     9709 * @return true on success
     9710 */
     9711
     9712bool magicMaskInsert(
     9713    psDB            *dbh,               ///< Database handle
     9714    psS64           magic_id,
     9715    const char      *uri
     9716);
     9717
     9718/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     9719 *
     9720 * @return A The number of rows removed or a negative value on error
     9721 */
     9722
     9723long long magicMaskDelete(
     9724    psDB            *dbh,               ///< Database handle
     9725    const psMetadata *where,            ///< Row match criteria
     9726    unsigned long long limit            ///< Maximum number of elements to delete
     9727);
     9728
     9729/** Insert a single magicMaskRow object into a table
     9730 *
     9731 * This function constructs and inserts a single row based on it's parameters.
     9732 *
     9733 * @return true on success
     9734 */
     9735
     9736bool magicMaskInsertObject(
     9737    psDB            *dbh,               ///< Database handle
     9738    magicMaskRow    *object             ///< magicMaskRow object
     9739);
     9740
     9741/** Insert an array of magicMaskRow object into a table
     9742 *
     9743 * This function constructs and inserts multiple rows based on it's parameters.
     9744 *
     9745 * @return true on success
     9746 */
     9747
     9748bool magicMaskInsertObjects(
     9749    psDB            *dbh,               ///< Database handle
     9750    psArray         *objects            ///< array of magicMaskRow objects
     9751);
     9752
     9753/** Insert data from a binary FITS table magicMaskRow into the database
     9754 *
     9755 * This function expects a psFits object with a FITS table as the first
     9756 * extension.  The table must have at least one row of data in it, that is of
     9757 * the appropriate format (number of columns and their type).  All other
     9758 * extensions are ignored.
     9759 *
     9760 * @return true on success
     9761 */
     9762
     9763bool magicMaskInsertFits(
     9764    psDB            *dbh,               ///< Database handle
     9765    const psFits    *fits               ///< psFits object
     9766);
     9767
     9768/** Selects up to limit from the database and returns them in a binary FITS table
     9769 *
     9770 * This function assumes an empty psFits object and will create a FITS table
     9771 * as the first extension.
     9772 *
     9773 *  See psDBSelectRows() for documentation on the format of where.
     9774 *
     9775 * @return true on success
     9776 */
     9777
     9778bool magicMaskSelectRowsFits(
     9779    psDB            *dbh,               ///< Database handle
     9780    psFits          *fits,              ///< psFits object
     9781    const psMetadata *where,            ///< Row match criteria
     9782    unsigned long long limit            ///< Maximum number of elements to return
     9783);
     9784
     9785/** Convert a magicMaskRow into an equivalent psMetadata
     9786 *
     9787 * @return A psMetadata pointer or NULL on error
     9788 */
     9789
     9790psMetadata *magicMaskMetadataFromObject(
     9791    const magicMaskRow *object             ///< fooRow to convert into a psMetadata
     9792);
     9793
     9794/** Convert a psMetadata into an equivalent fooRow
     9795 *
     9796 * @return A magicMaskRow pointer or NULL on error
     9797 */
     9798
     9799magicMaskRow *magicMaskObjectFromMetadata(
     9800    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     9801);
     9802/** Selects up to limit rows from the database and returns as magicMaskRow objects in a psArray
     9803 *
     9804 *  See psDBSelectRows() for documentation on the format of where.
     9805 *
     9806 * @return A psArray pointer or NULL on error
     9807 */
     9808
     9809psArray *magicMaskSelectRowObjects(
     9810    psDB            *dbh,               ///< Database handle
     9811    const psMetadata *where,            ///< Row match criteria
     9812    unsigned long long limit            ///< Maximum number of elements to return
     9813);
     9814/** Deletes a row from the database coresponding to an magicMask
     9815 *
     9816 *  Note that a 'where' search psMetadata is constructed from each object and
     9817 *  used to find rows to delete.
     9818 *
     9819 * @return A The number of rows removed or a negative value on error
     9820 */
     9821
     9822bool magicMaskDeleteObject(
     9823    psDB            *dbh,               ///< Database handle
     9824    const magicMaskRow *object    ///< Object to delete
     9825);
     9826/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     9827 *
     9828 *  Note that a 'where' search psMetadata is constructed from each object and
     9829 *  used to find rows to delete.
     9830 *
     9831 * @return A The number of rows removed or a negative value on error
     9832 */
     9833
     9834long long magicMaskDeleteRowObjects(
     9835    psDB            *dbh,               ///< Database handle
     9836    const psArray   *objects,           ///< Array of objects to delete
     9837    unsigned long long limit            ///< Maximum number of elements to delete
     9838);
     9839/** Formats and prints an array of magicMaskRow objects
     9840 *
     9841 * When mdcf is set the formated output is in psMetadataConfig
     9842 * format, otherwise it is in a simple tabular format.
     9843 *
     9844 * @return true on success
     9845 */
     9846
     9847bool magicMaskPrintObjects(
     9848    FILE            *stream,            ///< a stream
     9849    psArray         *objects,           ///< An array of magicMaskRow objects
     9850    bool            mdcf                ///< format as mdconfig or simple
     9851);
     9852/** Formats and prints an magicMaskRow object
     9853 *
     9854 * When mdcf is set the formated output is in psMetadataConfig
     9855 * format, otherwise it is in a simple tabular format.
     9856 *
     9857 * @return true on success
     9858 */
     9859
     9860bool magicMaskPrintObject(
     9861    FILE            *stream,            ///< a stream
     9862    magicMaskRow *object,    ///< an magicMaskRow object
     9863    bool            mdcf                ///< format as mdconfig or simple
     9864);
    88549865
    88559866/// @}
     
    88599870#endif
    88609871
    8861 #endif // DETREGISTEREDIMFILE_DB_H
     9872#endif // MAGICMASK_DB_H
  • trunk/ippdb/tests/alloc.c

    r14451 r14598  
    125125        pzPendingImfileRow *object;
    126126
    127         object = pzPendingImfileRowAlloc("a string", "a string", "a string", "a string", "a string", -64    );
     127        object = pzPendingImfileRowAlloc("a string", "a string", "a string", "a string", "a string"    );
    128128
    129129        if (!object) {
     
    151151            exit(EXIT_FAILURE);
    152152        }
     153
     154        psFree(object);
     155    }
     156
     157    {
     158        pzDoneExpRow    *object;
     159
     160        object = pzDoneExpRowAlloc("a string", "a string", "a string"    );
     161
     162        if (!object) {
     163            exit(EXIT_FAILURE);
     164        }
     165
     166        if (strncmp(object->exp_name, "a string", MAX_STRING_LENGTH)) {
     167            psFree(object);
     168            exit(EXIT_FAILURE);
     169        }
     170        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
     171            psFree(object);
     172            exit(EXIT_FAILURE);
     173        }
     174        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
     175            psFree(object);
     176            exit(EXIT_FAILURE);
     177        }
     178
     179        psFree(object);
     180    }
     181
     182    {
     183        pzDoneImfileRow *object;
     184
     185        object = pzDoneImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string"    );
     186
     187        if (!object) {
     188            exit(EXIT_FAILURE);
     189        }
     190
     191        if (strncmp(object->exp_name, "a string", MAX_STRING_LENGTH)) {
     192            psFree(object);
     193            exit(EXIT_FAILURE);
     194        }
     195        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
     196            psFree(object);
     197            exit(EXIT_FAILURE);
     198        }
     199        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
     200            psFree(object);
     201            exit(EXIT_FAILURE);
     202        }
     203        if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) {
     204            psFree(object);
     205            exit(EXIT_FAILURE);
     206        }
     207        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
     208            psFree(object);
     209            exit(EXIT_FAILURE);
     210        }
     211        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     212            psFree(object);
     213            exit(EXIT_FAILURE);
     214        }
     215
     216        psFree(object);
     217    }
     218
     219    {
     220        newExpRow       *object;
     221
     222        object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
     223
     224        if (!object) {
     225            exit(EXIT_FAILURE);
     226        }
     227
    153228        if (!object->exp_id == -64) {
    154229            psFree(object);
    155230            exit(EXIT_FAILURE);
    156231        }
    157 
    158         psFree(object);
    159     }
    160 
    161     {
    162         pzDoneExpRow    *object;
    163 
    164         object = pzDoneExpRowAlloc("a string", "a string", "a string"    );
    165 
    166         if (!object) {
    167             exit(EXIT_FAILURE);
    168         }
    169 
     232        if (strncmp(object->tmp_exp_name, "a string", MAX_STRING_LENGTH)) {
     233            psFree(object);
     234            exit(EXIT_FAILURE);
     235        }
     236        if (strncmp(object->tmp_camera, "a string", MAX_STRING_LENGTH)) {
     237            psFree(object);
     238            exit(EXIT_FAILURE);
     239        }
     240        if (strncmp(object->tmp_telescope, "a string", MAX_STRING_LENGTH)) {
     241            psFree(object);
     242            exit(EXIT_FAILURE);
     243        }
     244        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
     245            psFree(object);
     246            exit(EXIT_FAILURE);
     247        }
     248        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
     249            psFree(object);
     250            exit(EXIT_FAILURE);
     251        }
     252        if (strncmp(object->workdir_state, "a string", MAX_STRING_LENGTH)) {
     253            psFree(object);
     254            exit(EXIT_FAILURE);
     255        }
     256        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
     257            psFree(object);
     258            exit(EXIT_FAILURE);
     259        }
     260
     261        psFree(object);
     262    }
     263
     264    {
     265        newImfileRow    *object;
     266
     267        object = newImfileRowAlloc(-64, "a string", "a string"    );
     268
     269        if (!object) {
     270            exit(EXIT_FAILURE);
     271        }
     272
     273        if (!object->exp_id == -64) {
     274            psFree(object);
     275            exit(EXIT_FAILURE);
     276        }
     277        if (strncmp(object->tmp_class_id, "a string", MAX_STRING_LENGTH)) {
     278            psFree(object);
     279            exit(EXIT_FAILURE);
     280        }
     281        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     282            psFree(object);
     283            exit(EXIT_FAILURE);
     284        }
     285
     286        psFree(object);
     287    }
     288
     289    {
     290        rawExpRow       *object;
     291
     292        object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, -16    );
     293
     294        if (!object) {
     295            exit(EXIT_FAILURE);
     296        }
     297
     298        if (!object->exp_id == -64) {
     299            psFree(object);
     300            exit(EXIT_FAILURE);
     301        }
    170302        if (strncmp(object->exp_name, "a string", MAX_STRING_LENGTH)) {
    171303            psFree(object);
     
    180312            exit(EXIT_FAILURE);
    181313        }
    182 
    183         psFree(object);
    184     }
    185 
    186     {
    187         pzDoneImfileRow *object;
    188 
    189         object = pzDoneImfileRowAlloc("a string", "a string", "a string", "a string", "a string", -64, "a string"    );
    190 
    191         if (!object) {
    192             exit(EXIT_FAILURE);
    193         }
    194 
     314            psFree(object);
     315            exit(EXIT_FAILURE);
     316        }
     317        if (strncmp(object->exp_tag, "a string", MAX_STRING_LENGTH)) {
     318            psFree(object);
     319            exit(EXIT_FAILURE);
     320        }
     321        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
     322            psFree(object);
     323            exit(EXIT_FAILURE);
     324        }
     325        if (strncmp(object->filelevel, "a string", MAX_STRING_LENGTH)) {
     326            psFree(object);
     327            exit(EXIT_FAILURE);
     328        }
     329        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
     330            psFree(object);
     331            exit(EXIT_FAILURE);
     332        }
     333        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
     334            psFree(object);
     335            exit(EXIT_FAILURE);
     336        }
     337        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
     338            psFree(object);
     339            exit(EXIT_FAILURE);
     340        }
     341        if (!object->airmass == 32.32) {
     342            psFree(object);
     343            exit(EXIT_FAILURE);
     344        }
     345        if (!object->ra == 64.64) {
     346            psFree(object);
     347            exit(EXIT_FAILURE);
     348        }
     349        if (!object->decl == 64.64) {
     350            psFree(object);
     351            exit(EXIT_FAILURE);
     352        }
     353        if (!object->exp_time == 32.32) {
     354            psFree(object);
     355            exit(EXIT_FAILURE);
     356        }
     357        if (!object->sat_pixel_frac == 32.32) {
     358            psFree(object);
     359            exit(EXIT_FAILURE);
     360        }
     361        if (!object->bg == 64.64) {
     362            psFree(object);
     363            exit(EXIT_FAILURE);
     364        }
     365        if (!object->bg_stdev == 64.64) {
     366            psFree(object);
     367            exit(EXIT_FAILURE);
     368        }
     369        if (!object->bg_mean_stdev == 64.64) {
     370            psFree(object);
     371            exit(EXIT_FAILURE);
     372        }
     373        if (!object->alt == 64.64) {
     374            psFree(object);
     375            exit(EXIT_FAILURE);
     376        }
     377        if (!object->az == 64.64) {
     378            psFree(object);
     379            exit(EXIT_FAILURE);
     380        }
     381        if (!object->ccd_temp == 32.32) {
     382            psFree(object);
     383            exit(EXIT_FAILURE);
     384        }
     385        if (!object->posang == 64.64) {
     386            psFree(object);
     387            exit(EXIT_FAILURE);
     388        }
     389        if (!object->user_1 == 64.64) {
     390            psFree(object);
     391            exit(EXIT_FAILURE);
     392        }
     393        if (!object->user_2 == 64.64) {
     394            psFree(object);
     395            exit(EXIT_FAILURE);
     396        }
     397        if (!object->user_3 == 64.64) {
     398            psFree(object);
     399            exit(EXIT_FAILURE);
     400        }
     401        if (!object->user_4 == 64.64) {
     402            psFree(object);
     403            exit(EXIT_FAILURE);
     404        }
     405        if (!object->user_5 == 64.64) {
     406            psFree(object);
     407            exit(EXIT_FAILURE);
     408        }
     409        if (strncmp(object->object, "a string", MAX_STRING_LENGTH)) {
     410            psFree(object);
     411            exit(EXIT_FAILURE);
     412        }
     413        if (!object->solang == 32.32) {
     414            psFree(object);
     415            exit(EXIT_FAILURE);
     416        }
     417        if (!object->fault == -16) {
     418            psFree(object);
     419            exit(EXIT_FAILURE);
     420        }
     421
     422        psFree(object);
     423    }
     424
     425    {
     426        rawImfileRow    *object;
     427
     428        object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16    );
     429
     430        if (!object) {
     431            exit(EXIT_FAILURE);
     432        }
     433
     434        if (!object->exp_id == -64) {
     435            psFree(object);
     436            exit(EXIT_FAILURE);
     437        }
    195438        if (strncmp(object->exp_name, "a string", MAX_STRING_LENGTH)) {
    196439            psFree(object);
     
    205448            exit(EXIT_FAILURE);
    206449        }
    207         if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) {
     450            psFree(object);
     451            exit(EXIT_FAILURE);
     452        }
     453        if (strncmp(object->tmp_class_id, "a string", MAX_STRING_LENGTH)) {
    208454            psFree(object);
    209455            exit(EXIT_FAILURE);
     
    213459            exit(EXIT_FAILURE);
    214460        }
     461        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     462            psFree(object);
     463            exit(EXIT_FAILURE);
     464        }
     465        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
     466            psFree(object);
     467            exit(EXIT_FAILURE);
     468        }
     469        if (strncmp(object->filelevel, "a string", MAX_STRING_LENGTH)) {
     470            psFree(object);
     471            exit(EXIT_FAILURE);
     472        }
     473        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
     474            psFree(object);
     475            exit(EXIT_FAILURE);
     476        }
     477        if (!object->airmass == 32.32) {
     478            psFree(object);
     479            exit(EXIT_FAILURE);
     480        }
     481        if (!object->ra == 64.64) {
     482            psFree(object);
     483            exit(EXIT_FAILURE);
     484        }
     485        if (!object->decl == 64.64) {
     486            psFree(object);
     487            exit(EXIT_FAILURE);
     488        }
     489        if (!object->exp_time == 32.32) {
     490            psFree(object);
     491            exit(EXIT_FAILURE);
     492        }
     493        if (!object->sat_pixel_frac == 32.32) {
     494            psFree(object);
     495            exit(EXIT_FAILURE);
     496        }
     497        if (!object->bg == 64.64) {
     498            psFree(object);
     499            exit(EXIT_FAILURE);
     500        }
     501        if (!object->bg_stdev == 64.64) {
     502            psFree(object);
     503            exit(EXIT_FAILURE);
     504        }
     505        if (!object->bg_mean_stdev == 64.64) {
     506            psFree(object);
     507            exit(EXIT_FAILURE);
     508        }
     509        if (!object->alt == 64.64) {
     510            psFree(object);
     511            exit(EXIT_FAILURE);
     512        }
     513        if (!object->az == 64.64) {
     514            psFree(object);
     515            exit(EXIT_FAILURE);
     516        }
     517        if (!object->ccd_temp == 32.32) {
     518            psFree(object);
     519            exit(EXIT_FAILURE);
     520        }
     521        if (!object->posang == 64.64) {
     522            psFree(object);
     523            exit(EXIT_FAILURE);
     524        }
     525        if (!object->user_1 == 64.64) {
     526            psFree(object);
     527            exit(EXIT_FAILURE);
     528        }
     529        if (!object->user_2 == 64.64) {
     530            psFree(object);
     531            exit(EXIT_FAILURE);
     532        }
     533        if (!object->user_3 == 64.64) {
     534            psFree(object);
     535            exit(EXIT_FAILURE);
     536        }
     537        if (!object->user_4 == 64.64) {
     538            psFree(object);
     539            exit(EXIT_FAILURE);
     540        }
     541        if (!object->user_5 == 64.64) {
     542            psFree(object);
     543            exit(EXIT_FAILURE);
     544        }
     545        if (strncmp(object->object, "a string", MAX_STRING_LENGTH)) {
     546            psFree(object);
     547            exit(EXIT_FAILURE);
     548        }
     549        if (!object->fault == -16) {
     550            psFree(object);
     551            exit(EXIT_FAILURE);
     552        }
     553
     554        psFree(object);
     555    }
     556
     557    {
     558        guidePendingExpRow *object;
     559
     560        object = guidePendingExpRowAlloc(-64, -64, "a string"    );
     561
     562        if (!object) {
     563            exit(EXIT_FAILURE);
     564        }
     565
     566        if (!object->guide_id == -64) {
     567            psFree(object);
     568            exit(EXIT_FAILURE);
     569        }
    215570        if (!object->exp_id == -64) {
    216571            psFree(object);
    217572            exit(EXIT_FAILURE);
    218573        }
     574        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     575            psFree(object);
     576            exit(EXIT_FAILURE);
     577        }
     578
     579        psFree(object);
     580    }
     581
     582    {
     583        chipRunRow      *object;
     584
     585        object = chipRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
     586
     587        if (!object) {
     588            exit(EXIT_FAILURE);
     589        }
     590
     591        if (!object->chip_id == -64) {
     592            psFree(object);
     593            exit(EXIT_FAILURE);
     594        }
     595        if (!object->exp_id == -64) {
     596            psFree(object);
     597            exit(EXIT_FAILURE);
     598        }
     599        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
     600            psFree(object);
     601            exit(EXIT_FAILURE);
     602        }
     603        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
     604            psFree(object);
     605            exit(EXIT_FAILURE);
     606        }
     607        if (strncmp(object->workdir_state, "a string", MAX_STRING_LENGTH)) {
     608            psFree(object);
     609            exit(EXIT_FAILURE);
     610        }
     611        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
     612            psFree(object);
     613            exit(EXIT_FAILURE);
     614        }
     615        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
     616            psFree(object);
     617            exit(EXIT_FAILURE);
     618        }
     619        if (strncmp(object->expgroup, "a string", MAX_STRING_LENGTH)) {
     620            psFree(object);
     621            exit(EXIT_FAILURE);
     622        }
     623        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
     624            psFree(object);
     625            exit(EXIT_FAILURE);
     626        }
     627
     628        psFree(object);
     629    }
     630
     631    {
     632        chipProcessedImfileRow *object;
     633
     634        object = chipProcessedImfileRowAlloc(-64, -64, "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, -32, -32, -32, -32, "a string", -16    );
     635
     636        if (!object) {
     637            exit(EXIT_FAILURE);
     638        }
     639
     640        if (!object->chip_id == -64) {
     641            psFree(object);
     642            exit(EXIT_FAILURE);
     643        }
     644        if (!object->exp_id == -64) {
     645            psFree(object);
     646            exit(EXIT_FAILURE);
     647        }
     648        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
     649            psFree(object);
     650            exit(EXIT_FAILURE);
     651        }
    219652        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
    220653            psFree(object);
    221654            exit(EXIT_FAILURE);
    222655        }
    223 
    224         psFree(object);
    225     }
    226 
    227     {
    228         newExpRow       *object;
    229 
    230         object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
    231 
    232         if (!object) {
    233             exit(EXIT_FAILURE);
    234         }
    235 
     656        if (!object->bg == 32.32) {
     657            psFree(object);
     658            exit(EXIT_FAILURE);
     659        }
     660        if (!object->bg_stdev == 32.32) {
     661            psFree(object);
     662            exit(EXIT_FAILURE);
     663        }
     664        if (!object->bg_mean_stdev == 32.32) {
     665            psFree(object);
     666            exit(EXIT_FAILURE);
     667        }
     668        if (!object->bias == 32.32) {
     669            psFree(object);
     670            exit(EXIT_FAILURE);
     671        }
     672        if (!object->bias_stdev == 32.32) {
     673            psFree(object);
     674            exit(EXIT_FAILURE);
     675        }
     676        if (!object->fringe_0 == 32.32) {
     677            psFree(object);
     678            exit(EXIT_FAILURE);
     679        }
     680        if (!object->fringe_1 == 32.32) {
     681            psFree(object);
     682            exit(EXIT_FAILURE);
     683        }
     684        if (!object->fringe_2 == 32.32) {
     685            psFree(object);
     686            exit(EXIT_FAILURE);
     687        }
     688        if (!object->sigma_ra == 32.32) {
     689            psFree(object);
     690            exit(EXIT_FAILURE);
     691        }
     692        if (!object->sigma_dec == 32.32) {
     693            psFree(object);
     694            exit(EXIT_FAILURE);
     695        }
     696        if (!object->ap_resid == 32.32) {
     697            psFree(object);
     698            exit(EXIT_FAILURE);
     699        }
     700        if (!object->ap_resid_stdev == 32.32) {
     701            psFree(object);
     702            exit(EXIT_FAILURE);
     703        }
     704        if (!object->fwhm == 32.32) {
     705            psFree(object);
     706            exit(EXIT_FAILURE);
     707        }
     708        if (!object->fwhm_range == 32.32) {
     709            psFree(object);
     710            exit(EXIT_FAILURE);
     711        }
     712        if (!object->n_stars == -32) {
     713            psFree(object);
     714            exit(EXIT_FAILURE);
     715        }
     716        if (!object->n_extended == -32) {
     717            psFree(object);
     718            exit(EXIT_FAILURE);
     719        }
     720        if (!object->n_cr == -32) {
     721            psFree(object);
     722            exit(EXIT_FAILURE);
     723        }
     724        if (!object->n_astrom == -32) {
     725            psFree(object);
     726            exit(EXIT_FAILURE);
     727        }
     728        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
     729            psFree(object);
     730            exit(EXIT_FAILURE);
     731        }
     732        if (!object->fault == -16) {
     733            psFree(object);
     734            exit(EXIT_FAILURE);
     735        }
     736
     737        psFree(object);
     738    }
     739
     740    {
     741        chipMaskRow     *object;
     742
     743        object = chipMaskRowAlloc("a string"    );
     744
     745        if (!object) {
     746            exit(EXIT_FAILURE);
     747        }
     748
     749        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
     750            psFree(object);
     751            exit(EXIT_FAILURE);
     752        }
     753
     754        psFree(object);
     755    }
     756
     757    {
     758        camRunRow       *object;
     759
     760        object = camRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
     761
     762        if (!object) {
     763            exit(EXIT_FAILURE);
     764        }
     765
     766        if (!object->cam_id == -64) {
     767            psFree(object);
     768            exit(EXIT_FAILURE);
     769        }
     770        if (!object->chip_id == -64) {
     771            psFree(object);
     772            exit(EXIT_FAILURE);
     773        }
     774        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
     775            psFree(object);
     776            exit(EXIT_FAILURE);
     777        }
     778        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
     779            psFree(object);
     780            exit(EXIT_FAILURE);
     781        }
     782        if (strncmp(object->workdir_state, "a string", MAX_STRING_LENGTH)) {
     783            psFree(object);
     784            exit(EXIT_FAILURE);
     785        }
     786        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
     787            psFree(object);
     788            exit(EXIT_FAILURE);
     789        }
     790        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
     791            psFree(object);
     792            exit(EXIT_FAILURE);
     793        }
     794        if (strncmp(object->expgroup, "a string", MAX_STRING_LENGTH)) {
     795            psFree(object);
     796            exit(EXIT_FAILURE);
     797        }
     798        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
     799            psFree(object);
     800            exit(EXIT_FAILURE);
     801        }
     802
     803        psFree(object);
     804    }
     805
     806    {
     807        camProcessedExpRow *object;
     808
     809        object = camProcessedExpRowAlloc(-64, -64, "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, -32, -32, -32, -32, "a string", -16    );
     810
     811        if (!object) {
     812            exit(EXIT_FAILURE);
     813        }
     814
     815        if (!object->cam_id == -64) {
     816            psFree(object);
     817            exit(EXIT_FAILURE);
     818        }
     819        if (!object->chip_id == -64) {
     820            psFree(object);
     821            exit(EXIT_FAILURE);
     822        }
     823        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     824            psFree(object);
     825            exit(EXIT_FAILURE);
     826        }
     827        if (!object->bg == 32.32) {
     828            psFree(object);
     829            exit(EXIT_FAILURE);
     830        }
     831        if (!object->bg_stdev == 32.32) {
     832            psFree(object);
     833            exit(EXIT_FAILURE);
     834        }
     835        if (!object->bg_mean_stdev == 32.32) {
     836            psFree(object);
     837            exit(EXIT_FAILURE);
     838        }
     839        if (!object->sigma_ra == 32.32) {
     840            psFree(object);
     841            exit(EXIT_FAILURE);
     842        }
     843        if (!object->sigma_dec == 32.32) {
     844            psFree(object);
     845            exit(EXIT_FAILURE);
     846        }
     847        if (!object->zp_mean == 32.32) {
     848            psFree(object);
     849            exit(EXIT_FAILURE);
     850        }
     851        if (!object->zp_stdev == 32.32) {
     852            psFree(object);
     853            exit(EXIT_FAILURE);
     854        }
     855        if (!object->fwhm == 32.32) {
     856            psFree(object);
     857            exit(EXIT_FAILURE);
     858        }
     859        if (!object->fwhm_range == 32.32) {
     860            psFree(object);
     861            exit(EXIT_FAILURE);
     862        }
     863        if (!object->n_stars == -32) {
     864            psFree(object);
     865            exit(EXIT_FAILURE);
     866        }
     867        if (!object->n_extended == -32) {
     868            psFree(object);
     869            exit(EXIT_FAILURE);
     870        }
     871        if (!object->n_cr == -32) {
     872            psFree(object);
     873            exit(EXIT_FAILURE);
     874        }
     875        if (!object->n_astrom == -32) {
     876            psFree(object);
     877            exit(EXIT_FAILURE);
     878        }
     879        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
     880            psFree(object);
     881            exit(EXIT_FAILURE);
     882        }
     883        if (!object->fault == -16) {
     884            psFree(object);
     885            exit(EXIT_FAILURE);
     886        }
     887
     888        psFree(object);
     889    }
     890
     891    {
     892        camMaskRow      *object;
     893
     894        object = camMaskRowAlloc("a string"    );
     895
     896        if (!object) {
     897            exit(EXIT_FAILURE);
     898        }
     899
     900        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
     901            psFree(object);
     902            exit(EXIT_FAILURE);
     903        }
     904
     905        psFree(object);
     906    }
     907
     908    {
     909        warpRunRow      *object;
     910
     911        object = warpRunRowAlloc(-64, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z"    );
     912
     913        if (!object) {
     914            exit(EXIT_FAILURE);
     915        }
     916
     917        if (!object->warp_id == -64) {
     918            psFree(object);
     919            exit(EXIT_FAILURE);
     920        }
     921        if (strncmp(object->mode, "a string", MAX_STRING_LENGTH)) {
     922            psFree(object);
     923            exit(EXIT_FAILURE);
     924        }
     925        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
     926            psFree(object);
     927            exit(EXIT_FAILURE);
     928        }
     929        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
     930            psFree(object);
     931            exit(EXIT_FAILURE);
     932        }
     933        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
     934            psFree(object);
     935            exit(EXIT_FAILURE);
     936        }
     937            psFree(object);
     938            exit(EXIT_FAILURE);
     939        }
     940
     941        psFree(object);
     942    }
     943
     944    {
     945        warpInputExpRow *object;
     946
     947        object = warpInputExpRowAlloc(-64, -64, true    );
     948
     949        if (!object) {
     950            exit(EXIT_FAILURE);
     951        }
     952
     953        if (!object->warp_id == -64) {
     954            psFree(object);
     955            exit(EXIT_FAILURE);
     956        }
     957        if (!object->cam_id == -64) {
     958            psFree(object);
     959            exit(EXIT_FAILURE);
     960        }
     961        if (!object->magiced == true) {
     962            psFree(object);
     963            exit(EXIT_FAILURE);
     964        }
     965
     966        psFree(object);
     967    }
     968
     969    {
     970        warpSkyCellMapRow *object;
     971
     972        object = warpSkyCellMapRowAlloc(-64, "a string", "a string", -64, "a string", -16    );
     973
     974        if (!object) {
     975            exit(EXIT_FAILURE);
     976        }
     977
     978        if (!object->warp_id == -64) {
     979            psFree(object);
     980            exit(EXIT_FAILURE);
     981        }
     982        if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
     983            psFree(object);
     984            exit(EXIT_FAILURE);
     985        }
     986        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
     987            psFree(object);
     988            exit(EXIT_FAILURE);
     989        }
     990        if (!object->cam_id == -64) {
     991            psFree(object);
     992            exit(EXIT_FAILURE);
     993        }
     994        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
     995            psFree(object);
     996            exit(EXIT_FAILURE);
     997        }
     998        if (!object->fault == -16) {
     999            psFree(object);
     1000            exit(EXIT_FAILURE);
     1001        }
     1002
     1003        psFree(object);
     1004    }
     1005
     1006    {
     1007        warpSkyfileRow  *object;
     1008
     1009        object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, -16    );
     1010
     1011        if (!object) {
     1012            exit(EXIT_FAILURE);
     1013        }
     1014
     1015        if (!object->warp_id == -64) {
     1016            psFree(object);
     1017            exit(EXIT_FAILURE);
     1018        }
     1019        if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
     1020            psFree(object);
     1021            exit(EXIT_FAILURE);
     1022        }
     1023        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
     1024            psFree(object);
     1025            exit(EXIT_FAILURE);
     1026        }
     1027        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     1028            psFree(object);
     1029            exit(EXIT_FAILURE);
     1030        }
     1031        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
     1032            psFree(object);
     1033            exit(EXIT_FAILURE);
     1034        }
     1035        if (!object->bg == 64.64) {
     1036            psFree(object);
     1037            exit(EXIT_FAILURE);
     1038        }
     1039        if (!object->bg_stdev == 64.64) {
     1040            psFree(object);
     1041            exit(EXIT_FAILURE);
     1042        }
     1043        if (!object->pixel_fill == 64.64) {
     1044            psFree(object);
     1045            exit(EXIT_FAILURE);
     1046        }
     1047        if (!object->fault == -16) {
     1048            psFree(object);
     1049            exit(EXIT_FAILURE);
     1050        }
     1051
     1052        psFree(object);
     1053    }
     1054
     1055    {
     1056        diffRunRow      *object;
     1057
     1058        object = diffRunRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string"    );
     1059
     1060        if (!object) {
     1061            exit(EXIT_FAILURE);
     1062        }
     1063
     1064        if (!object->diff_id == -64) {
     1065            psFree(object);
     1066            exit(EXIT_FAILURE);
     1067        }
     1068        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
     1069            psFree(object);
     1070            exit(EXIT_FAILURE);
     1071        }
     1072        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
     1073            psFree(object);
     1074            exit(EXIT_FAILURE);
     1075        }
     1076        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
     1077            psFree(object);
     1078            exit(EXIT_FAILURE);
     1079        }
     1080            psFree(object);
     1081            exit(EXIT_FAILURE);
     1082        }
     1083        if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
     1084            psFree(object);
     1085            exit(EXIT_FAILURE);
     1086        }
     1087        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
     1088            psFree(object);
     1089            exit(EXIT_FAILURE);
     1090        }
     1091
     1092        psFree(object);
     1093    }
     1094
     1095    {
     1096        diffInputSkyfileRow *object;
     1097
     1098        object = diffInputSkyfileRowAlloc(-64, true, -64, -64, "a string", "a string", "a string"    );
     1099
     1100        if (!object) {
     1101            exit(EXIT_FAILURE);
     1102        }
     1103
     1104        if (!object->diff_id == -64) {
     1105            psFree(object);
     1106            exit(EXIT_FAILURE);
     1107        }
     1108        if (!object->template == true) {
     1109            psFree(object);
     1110            exit(EXIT_FAILURE);
     1111        }
     1112        if (!object->stack_id == -64) {
     1113            psFree(object);
     1114            exit(EXIT_FAILURE);
     1115        }
     1116        if (!object->warp_id == -64) {
     1117            psFree(object);
     1118            exit(EXIT_FAILURE);
     1119        }
     1120        if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
     1121            psFree(object);
     1122            exit(EXIT_FAILURE);
     1123        }
     1124        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
     1125            psFree(object);
     1126            exit(EXIT_FAILURE);
     1127        }
     1128        if (strncmp(object->kind, "a string", MAX_STRING_LENGTH)) {
     1129            psFree(object);
     1130            exit(EXIT_FAILURE);
     1131        }
     1132
     1133        psFree(object);
     1134    }
     1135
     1136    {
     1137        diffSkyfileRow  *object;
     1138
     1139        object = diffSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, -16    );
     1140
     1141        if (!object) {
     1142            exit(EXIT_FAILURE);
     1143        }
     1144
     1145        if (!object->diff_id == -64) {
     1146            psFree(object);
     1147            exit(EXIT_FAILURE);
     1148        }
     1149        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     1150            psFree(object);
     1151            exit(EXIT_FAILURE);
     1152        }
     1153        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
     1154            psFree(object);
     1155            exit(EXIT_FAILURE);
     1156        }
     1157        if (!object->bg == 64.64) {
     1158            psFree(object);
     1159            exit(EXIT_FAILURE);
     1160        }
     1161        if (!object->bg_stdev == 64.64) {
     1162            psFree(object);
     1163            exit(EXIT_FAILURE);
     1164        }
     1165        if (!object->fault == -16) {
     1166            psFree(object);
     1167            exit(EXIT_FAILURE);
     1168        }
     1169
     1170        psFree(object);
     1171    }
     1172
     1173    {
     1174        stackRunRow     *object;
     1175
     1176        object = stackRunRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string"    );
     1177
     1178        if (!object) {
     1179            exit(EXIT_FAILURE);
     1180        }
     1181
     1182        if (!object->stack_id == -64) {
     1183            psFree(object);
     1184            exit(EXIT_FAILURE);
     1185        }
     1186        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
     1187            psFree(object);
     1188            exit(EXIT_FAILURE);
     1189        }
     1190        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
     1191            psFree(object);
     1192            exit(EXIT_FAILURE);
     1193        }
     1194        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
     1195            psFree(object);
     1196            exit(EXIT_FAILURE);
     1197        }
     1198            psFree(object);
     1199            exit(EXIT_FAILURE);
     1200        }
     1201        if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
     1202            psFree(object);
     1203            exit(EXIT_FAILURE);
     1204        }
     1205        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
     1206            psFree(object);
     1207            exit(EXIT_FAILURE);
     1208        }
     1209
     1210        psFree(object);
     1211    }
     1212
     1213    {
     1214        stackInputSkyfileRow *object;
     1215
     1216        object = stackInputSkyfileRowAlloc(-64, -64    );
     1217
     1218        if (!object) {
     1219            exit(EXIT_FAILURE);
     1220        }
     1221
     1222        if (!object->stack_id == -64) {
     1223            psFree(object);
     1224            exit(EXIT_FAILURE);
     1225        }
     1226        if (!object->warp_id == -64) {
     1227            psFree(object);
     1228            exit(EXIT_FAILURE);
     1229        }
     1230
     1231        psFree(object);
     1232    }
     1233
     1234    {
     1235        stackSumSkyfileRow *object;
     1236
     1237        object = stackSumSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, -16    );
     1238
     1239        if (!object) {
     1240            exit(EXIT_FAILURE);
     1241        }
     1242
     1243        if (!object->stack_id == -64) {
     1244            psFree(object);
     1245            exit(EXIT_FAILURE);
     1246        }
     1247        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     1248            psFree(object);
     1249            exit(EXIT_FAILURE);
     1250        }
     1251        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
     1252            psFree(object);
     1253            exit(EXIT_FAILURE);
     1254        }
     1255        if (!object->bg == 64.64) {
     1256            psFree(object);
     1257            exit(EXIT_FAILURE);
     1258        }
     1259        if (!object->bg_stdev == 64.64) {
     1260            psFree(object);
     1261            exit(EXIT_FAILURE);
     1262        }
     1263        if (!object->fault == -16) {
     1264            psFree(object);
     1265            exit(EXIT_FAILURE);
     1266        }
     1267
     1268        psFree(object);
     1269    }
     1270
     1271    {
     1272        detRunRow       *object;
     1273
     1274        object = detRunRowAlloc(-64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32    );
     1275
     1276        if (!object) {
     1277            exit(EXIT_FAILURE);
     1278        }
     1279
     1280        if (!object->det_id == -64) {
     1281            psFree(object);
     1282            exit(EXIT_FAILURE);
     1283        }
     1284        if (!object->iteration == -32) {
     1285            psFree(object);
     1286            exit(EXIT_FAILURE);
     1287        }
     1288        if (strncmp(object->det_type, "a string", MAX_STRING_LENGTH)) {
     1289            psFree(object);
     1290            exit(EXIT_FAILURE);
     1291        }
     1292        if (strncmp(object->mode, "a string", MAX_STRING_LENGTH)) {
     1293            psFree(object);
     1294            exit(EXIT_FAILURE);
     1295        }
     1296        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
     1297            psFree(object);
     1298            exit(EXIT_FAILURE);
     1299        }
     1300        if (strncmp(object->filelevel, "a string", MAX_STRING_LENGTH)) {
     1301            psFree(object);
     1302            exit(EXIT_FAILURE);
     1303        }
     1304        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
     1305            psFree(object);
     1306            exit(EXIT_FAILURE);
     1307        }
     1308        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
     1309            psFree(object);
     1310            exit(EXIT_FAILURE);
     1311        }
     1312        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
     1313            psFree(object);
     1314            exit(EXIT_FAILURE);
     1315        }
     1316        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
     1317            psFree(object);
     1318            exit(EXIT_FAILURE);
     1319        }
     1320        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
     1321            psFree(object);
     1322            exit(EXIT_FAILURE);
     1323        }
     1324        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
     1325            psFree(object);
     1326            exit(EXIT_FAILURE);
     1327        }
     1328        if (!object->airmass_min == 32.32) {
     1329            psFree(object);
     1330            exit(EXIT_FAILURE);
     1331        }
     1332        if (!object->airmass_max == 32.32) {
     1333            psFree(object);
     1334            exit(EXIT_FAILURE);
     1335        }
     1336        if (!object->exp_time_min == 32.32) {
     1337            psFree(object);
     1338            exit(EXIT_FAILURE);
     1339        }
     1340        if (!object->exp_time_max == 32.32) {
     1341            psFree(object);
     1342            exit(EXIT_FAILURE);
     1343        }
     1344        if (!object->ccd_temp_min == 32.32) {
     1345            psFree(object);
     1346            exit(EXIT_FAILURE);
     1347        }
     1348        if (!object->ccd_temp_max == 32.32) {
     1349            psFree(object);
     1350            exit(EXIT_FAILURE);
     1351        }
     1352        if (!object->posang_min == 64.64) {
     1353            psFree(object);
     1354            exit(EXIT_FAILURE);
     1355        }
     1356        if (!object->posang_max == 64.64) {
     1357            psFree(object);
     1358            exit(EXIT_FAILURE);
     1359        }
     1360            psFree(object);
     1361            exit(EXIT_FAILURE);
     1362        }
     1363            psFree(object);
     1364            exit(EXIT_FAILURE);
     1365        }
     1366            psFree(object);
     1367            exit(EXIT_FAILURE);
     1368        }
     1369            psFree(object);
     1370            exit(EXIT_FAILURE);
     1371        }
     1372            psFree(object);
     1373            exit(EXIT_FAILURE);
     1374        }
     1375        if (!object->solang_min == 32.32) {
     1376            psFree(object);
     1377            exit(EXIT_FAILURE);
     1378        }
     1379        if (!object->solang_max == 32.32) {
     1380            psFree(object);
     1381            exit(EXIT_FAILURE);
     1382        }
     1383        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
     1384            psFree(object);
     1385            exit(EXIT_FAILURE);
     1386        }
     1387        if (!object->parent == -32) {
     1388            psFree(object);
     1389            exit(EXIT_FAILURE);
     1390        }
     1391
     1392        psFree(object);
     1393    }
     1394
     1395    {
     1396        detInputExpRow  *object;
     1397
     1398        object = detInputExpRowAlloc(-64, -32, -64, true    );
     1399
     1400        if (!object) {
     1401            exit(EXIT_FAILURE);
     1402        }
     1403
     1404        if (!object->det_id == -64) {
     1405            psFree(object);
     1406            exit(EXIT_FAILURE);
     1407        }
     1408        if (!object->iteration == -32) {
     1409            psFree(object);
     1410            exit(EXIT_FAILURE);
     1411        }
    2361412        if (!object->exp_id == -64) {
    2371413            psFree(object);
    2381414            exit(EXIT_FAILURE);
    2391415        }
    240         if (strncmp(object->tmp_exp_name, "a string", MAX_STRING_LENGTH)) {
    241             psFree(object);
    242             exit(EXIT_FAILURE);
    243         }
    244         if (strncmp(object->tmp_camera, "a string", MAX_STRING_LENGTH)) {
    245             psFree(object);
    246             exit(EXIT_FAILURE);
    247         }
    248         if (strncmp(object->tmp_telescope, "a string", MAX_STRING_LENGTH)) {
     1416        if (!object->include == true) {
     1417            psFree(object);
     1418            exit(EXIT_FAILURE);
     1419        }
     1420
     1421        psFree(object);
     1422    }
     1423
     1424    {
     1425        detProcessedImfileRow *object;
     1426
     1427        object = detProcessedImfileRowAlloc(-64, -64, "a string", "a string", "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16    );
     1428
     1429        if (!object) {
     1430            exit(EXIT_FAILURE);
     1431        }
     1432
     1433        if (!object->det_id == -64) {
     1434            psFree(object);
     1435            exit(EXIT_FAILURE);
     1436        }
     1437        if (!object->exp_id == -64) {
     1438            psFree(object);
     1439            exit(EXIT_FAILURE);
     1440        }
     1441        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
     1442            psFree(object);
     1443            exit(EXIT_FAILURE);
     1444        }
     1445        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     1446            psFree(object);
     1447            exit(EXIT_FAILURE);
     1448        }
     1449        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     1450            psFree(object);
     1451            exit(EXIT_FAILURE);
     1452        }
     1453        if (!object->bg == 64.64) {
     1454            psFree(object);
     1455            exit(EXIT_FAILURE);
     1456        }
     1457        if (!object->bg_stdev == 64.64) {
     1458            psFree(object);
     1459            exit(EXIT_FAILURE);
     1460        }
     1461        if (!object->bg_mean_stdev == 64.64) {
     1462            psFree(object);
     1463            exit(EXIT_FAILURE);
     1464        }
     1465        if (!object->fringe_0 == 64.64) {
     1466            psFree(object);
     1467            exit(EXIT_FAILURE);
     1468        }
     1469        if (!object->fringe_1 == 64.64) {
     1470            psFree(object);
     1471            exit(EXIT_FAILURE);
     1472        }
     1473        if (!object->fringe_2 == 64.64) {
     1474            psFree(object);
     1475            exit(EXIT_FAILURE);
     1476        }
     1477        if (!object->user_1 == 64.64) {
     1478            psFree(object);
     1479            exit(EXIT_FAILURE);
     1480        }
     1481        if (!object->user_2 == 64.64) {
     1482            psFree(object);
     1483            exit(EXIT_FAILURE);
     1484        }
     1485        if (!object->user_3 == 64.64) {
     1486            psFree(object);
     1487            exit(EXIT_FAILURE);
     1488        }
     1489        if (!object->user_4 == 64.64) {
     1490            psFree(object);
     1491            exit(EXIT_FAILURE);
     1492        }
     1493        if (!object->user_5 == 64.64) {
     1494            psFree(object);
     1495            exit(EXIT_FAILURE);
     1496        }
     1497        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
     1498            psFree(object);
     1499            exit(EXIT_FAILURE);
     1500        }
     1501        if (!object->fault == -16) {
     1502            psFree(object);
     1503            exit(EXIT_FAILURE);
     1504        }
     1505
     1506        psFree(object);
     1507    }
     1508
     1509    {
     1510        detProcessedExpRow *object;
     1511
     1512        object = detProcessedExpRowAlloc(-64, -64, "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16    );
     1513
     1514        if (!object) {
     1515            exit(EXIT_FAILURE);
     1516        }
     1517
     1518        if (!object->det_id == -64) {
     1519            psFree(object);
     1520            exit(EXIT_FAILURE);
     1521        }
     1522        if (!object->exp_id == -64) {
     1523            psFree(object);
     1524            exit(EXIT_FAILURE);
     1525        }
     1526        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     1527            psFree(object);
     1528            exit(EXIT_FAILURE);
     1529        }
     1530        if (!object->bg == 64.64) {
     1531            psFree(object);
     1532            exit(EXIT_FAILURE);
     1533        }
     1534        if (!object->bg_stdev == 64.64) {
     1535            psFree(object);
     1536            exit(EXIT_FAILURE);
     1537        }
     1538        if (!object->bg_mean_stdev == 64.64) {
     1539            psFree(object);
     1540            exit(EXIT_FAILURE);
     1541        }
     1542        if (!object->fringe_0 == 64.64) {
     1543            psFree(object);
     1544            exit(EXIT_FAILURE);
     1545        }
     1546        if (!object->fringe_1 == 64.64) {
     1547            psFree(object);
     1548            exit(EXIT_FAILURE);
     1549        }
     1550        if (!object->fringe_2 == 64.64) {
     1551            psFree(object);
     1552            exit(EXIT_FAILURE);
     1553        }
     1554        if (!object->user_1 == 64.64) {
     1555            psFree(object);
     1556            exit(EXIT_FAILURE);
     1557        }
     1558        if (!object->user_2 == 64.64) {
     1559            psFree(object);
     1560            exit(EXIT_FAILURE);
     1561        }
     1562        if (!object->user_3 == 64.64) {
     1563            psFree(object);
     1564            exit(EXIT_FAILURE);
     1565        }
     1566        if (!object->user_4 == 64.64) {
     1567            psFree(object);
     1568            exit(EXIT_FAILURE);
     1569        }
     1570        if (!object->user_5 == 64.64) {
     1571            psFree(object);
     1572            exit(EXIT_FAILURE);
     1573        }
     1574        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
     1575            psFree(object);
     1576            exit(EXIT_FAILURE);
     1577        }
     1578        if (!object->fault == -16) {
     1579            psFree(object);
     1580            exit(EXIT_FAILURE);
     1581        }
     1582
     1583        psFree(object);
     1584    }
     1585
     1586    {
     1587        detStackedImfileRow *object;
     1588
     1589        object = detStackedImfileRowAlloc(-64, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, -16    );
     1590
     1591        if (!object) {
     1592            exit(EXIT_FAILURE);
     1593        }
     1594
     1595        if (!object->det_id == -64) {
     1596            psFree(object);
     1597            exit(EXIT_FAILURE);
     1598        }
     1599        if (!object->iteration == -32) {
     1600            psFree(object);
     1601            exit(EXIT_FAILURE);
     1602        }
     1603        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
     1604            psFree(object);
     1605            exit(EXIT_FAILURE);
     1606        }
     1607        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     1608            psFree(object);
     1609            exit(EXIT_FAILURE);
     1610        }
     1611        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     1612            psFree(object);
     1613            exit(EXIT_FAILURE);
     1614        }
     1615        if (!object->bg == 64.64) {
     1616            psFree(object);
     1617            exit(EXIT_FAILURE);
     1618        }
     1619        if (!object->bg_stdev == 64.64) {
     1620            psFree(object);
     1621            exit(EXIT_FAILURE);
     1622        }
     1623        if (!object->bg_mean_stdev == 64.64) {
     1624            psFree(object);
     1625            exit(EXIT_FAILURE);
     1626        }
     1627        if (!object->user_1 == 64.64) {
     1628            psFree(object);
     1629            exit(EXIT_FAILURE);
     1630        }
     1631        if (!object->user_2 == 64.64) {
     1632            psFree(object);
     1633            exit(EXIT_FAILURE);
     1634        }
     1635        if (!object->user_3 == 64.64) {
     1636            psFree(object);
     1637            exit(EXIT_FAILURE);
     1638        }
     1639        if (!object->user_4 == 64.64) {
     1640            psFree(object);
     1641            exit(EXIT_FAILURE);
     1642        }
     1643        if (!object->user_5 == 64.64) {
     1644            psFree(object);
     1645            exit(EXIT_FAILURE);
     1646        }
     1647        if (!object->fault == -16) {
     1648            psFree(object);
     1649            exit(EXIT_FAILURE);
     1650        }
     1651
     1652        psFree(object);
     1653    }
     1654
     1655    {
     1656        detNormalizedStatImfileRow *object;
     1657
     1658        object = detNormalizedStatImfileRowAlloc(-64, -32, "a string", 32.32, -16    );
     1659
     1660        if (!object) {
     1661            exit(EXIT_FAILURE);
     1662        }
     1663
     1664        if (!object->det_id == -64) {
     1665            psFree(object);
     1666            exit(EXIT_FAILURE);
     1667        }
     1668        if (!object->iteration == -32) {
     1669            psFree(object);
     1670            exit(EXIT_FAILURE);
     1671        }
     1672        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
     1673            psFree(object);
     1674            exit(EXIT_FAILURE);
     1675        }
     1676        if (!object->norm == 32.32) {
     1677            psFree(object);
     1678            exit(EXIT_FAILURE);
     1679        }
     1680        if (!object->fault == -16) {
     1681            psFree(object);
     1682            exit(EXIT_FAILURE);
     1683        }
     1684
     1685        psFree(object);
     1686    }
     1687
     1688    {
     1689        detNormalizedImfileRow *object;
     1690
     1691        object = detNormalizedImfileRowAlloc(-64, -32, "a string", "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16    );
     1692
     1693        if (!object) {
     1694            exit(EXIT_FAILURE);
     1695        }
     1696
     1697        if (!object->det_id == -64) {
     1698            psFree(object);
     1699            exit(EXIT_FAILURE);
     1700        }
     1701        if (!object->iteration == -32) {
     1702            psFree(object);
     1703            exit(EXIT_FAILURE);
     1704        }
     1705        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
     1706            psFree(object);
     1707            exit(EXIT_FAILURE);
     1708        }
     1709        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     1710            psFree(object);
     1711            exit(EXIT_FAILURE);
     1712        }
     1713        if (!object->bg == 64.64) {
     1714            psFree(object);
     1715            exit(EXIT_FAILURE);
     1716        }
     1717        if (!object->bg_stdev == 64.64) {
     1718            psFree(object);
     1719            exit(EXIT_FAILURE);
     1720        }
     1721        if (!object->bg_mean_stdev == 64.64) {
     1722            psFree(object);
     1723            exit(EXIT_FAILURE);
     1724        }
     1725        if (!object->user_1 == 64.64) {
     1726            psFree(object);
     1727            exit(EXIT_FAILURE);
     1728        }
     1729        if (!object->user_2 == 64.64) {
     1730            psFree(object);
     1731            exit(EXIT_FAILURE);
     1732        }
     1733        if (!object->user_3 == 64.64) {
     1734            psFree(object);
     1735            exit(EXIT_FAILURE);
     1736        }
     1737        if (!object->user_4 == 64.64) {
     1738            psFree(object);
     1739            exit(EXIT_FAILURE);
     1740        }
     1741        if (!object->user_5 == 64.64) {
     1742            psFree(object);
     1743            exit(EXIT_FAILURE);
     1744        }
     1745        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
     1746            psFree(object);
     1747            exit(EXIT_FAILURE);
     1748        }
     1749        if (!object->fault == -16) {
     1750            psFree(object);
     1751            exit(EXIT_FAILURE);
     1752        }
     1753
     1754        psFree(object);
     1755    }
     1756
     1757    {
     1758        detNormalizedExpRow *object;
     1759
     1760        object = detNormalizedExpRowAlloc(-64, -32, "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16    );
     1761
     1762        if (!object) {
     1763            exit(EXIT_FAILURE);
     1764        }
     1765
     1766        if (!object->det_id == -64) {
     1767            psFree(object);
     1768            exit(EXIT_FAILURE);
     1769        }
     1770        if (!object->iteration == -32) {
     1771            psFree(object);
     1772            exit(EXIT_FAILURE);
     1773        }
     1774        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     1775            psFree(object);
     1776            exit(EXIT_FAILURE);
     1777        }
     1778        if (!object->bg == 64.64) {
     1779            psFree(object);
     1780            exit(EXIT_FAILURE);
     1781        }
     1782        if (!object->bg_stdev == 64.64) {
     1783            psFree(object);
     1784            exit(EXIT_FAILURE);
     1785        }
     1786        if (!object->bg_mean_stdev == 64.64) {
     1787            psFree(object);
     1788            exit(EXIT_FAILURE);
     1789        }
     1790        if (!object->user_1 == 64.64) {
     1791            psFree(object);
     1792            exit(EXIT_FAILURE);
     1793        }
     1794        if (!object->user_2 == 64.64) {
     1795            psFree(object);
     1796            exit(EXIT_FAILURE);
     1797        }
     1798        if (!object->user_3 == 64.64) {
     1799            psFree(object);
     1800            exit(EXIT_FAILURE);
     1801        }
     1802        if (!object->user_4 == 64.64) {
     1803            psFree(object);
     1804            exit(EXIT_FAILURE);
     1805        }
     1806        if (!object->user_5 == 64.64) {
     1807            psFree(object);
     1808            exit(EXIT_FAILURE);
     1809        }
     1810        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
     1811            psFree(object);
     1812            exit(EXIT_FAILURE);
     1813        }
     1814        if (!object->fault == -16) {
     1815            psFree(object);
     1816            exit(EXIT_FAILURE);
     1817        }
     1818
     1819        psFree(object);
     1820    }
     1821
     1822    {
     1823        detResidImfileRow *object;
     1824
     1825        object = detResidImfileRowAlloc(-64, -32, -64, "a string", "a string", "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16    );
     1826
     1827        if (!object) {
     1828            exit(EXIT_FAILURE);
     1829        }
     1830
     1831        if (!object->det_id == -64) {
     1832            psFree(object);
     1833            exit(EXIT_FAILURE);
     1834        }
     1835        if (!object->iteration == -32) {
     1836            psFree(object);
     1837            exit(EXIT_FAILURE);
     1838        }
     1839        if (!object->exp_id == -64) {
     1840            psFree(object);
     1841            exit(EXIT_FAILURE);
     1842        }
     1843        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
     1844            psFree(object);
     1845            exit(EXIT_FAILURE);
     1846        }
     1847        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     1848            psFree(object);
     1849            exit(EXIT_FAILURE);
     1850        }
     1851        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     1852            psFree(object);
     1853            exit(EXIT_FAILURE);
     1854        }
     1855        if (!object->bg == 64.64) {
     1856            psFree(object);
     1857            exit(EXIT_FAILURE);
     1858        }
     1859        if (!object->bg_stdev == 64.64) {
     1860            psFree(object);
     1861            exit(EXIT_FAILURE);
     1862        }
     1863        if (!object->bg_mean_stdev == 64.64) {
     1864            psFree(object);
     1865            exit(EXIT_FAILURE);
     1866        }
     1867        if (!object->bg_skewness == 64.64) {
     1868            psFree(object);
     1869            exit(EXIT_FAILURE);
     1870        }
     1871        if (!object->bg_kurtosis == 64.64) {
     1872            psFree(object);
     1873            exit(EXIT_FAILURE);
     1874        }
     1875        if (!object->bin_stdev == 64.64) {
     1876            psFree(object);
     1877            exit(EXIT_FAILURE);
     1878        }
     1879        if (!object->fringe_0 == 64.64) {
     1880            psFree(object);
     1881            exit(EXIT_FAILURE);
     1882        }
     1883        if (!object->fringe_1 == 64.64) {
     1884            psFree(object);
     1885            exit(EXIT_FAILURE);
     1886        }
     1887        if (!object->fringe_2 == 64.64) {
     1888            psFree(object);
     1889            exit(EXIT_FAILURE);
     1890        }
     1891        if (!object->fringe_resid_0 == 64.64) {
     1892            psFree(object);
     1893            exit(EXIT_FAILURE);
     1894        }
     1895        if (!object->fringe_resid_1 == 64.64) {
     1896            psFree(object);
     1897            exit(EXIT_FAILURE);
     1898        }
     1899        if (!object->fringe_resid_2 == 64.64) {
     1900            psFree(object);
     1901            exit(EXIT_FAILURE);
     1902        }
     1903        if (!object->user_1 == 64.64) {
     1904            psFree(object);
     1905            exit(EXIT_FAILURE);
     1906        }
     1907        if (!object->user_2 == 64.64) {
     1908            psFree(object);
     1909            exit(EXIT_FAILURE);
     1910        }
     1911        if (!object->user_3 == 64.64) {
     1912            psFree(object);
     1913            exit(EXIT_FAILURE);
     1914        }
     1915        if (!object->user_4 == 64.64) {
     1916            psFree(object);
     1917            exit(EXIT_FAILURE);
     1918        }
     1919        if (!object->user_5 == 64.64) {
     1920            psFree(object);
     1921            exit(EXIT_FAILURE);
     1922        }
     1923        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
     1924            psFree(object);
     1925            exit(EXIT_FAILURE);
     1926        }
     1927        if (!object->fault == -16) {
     1928            psFree(object);
     1929            exit(EXIT_FAILURE);
     1930        }
     1931
     1932        psFree(object);
     1933    }
     1934
     1935    {
     1936        detResidExpRow  *object;
     1937
     1938        object = detResidExpRowAlloc(-64, -32, -64, "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", true, -16    );
     1939
     1940        if (!object) {
     1941            exit(EXIT_FAILURE);
     1942        }
     1943
     1944        if (!object->det_id == -64) {
     1945            psFree(object);
     1946            exit(EXIT_FAILURE);
     1947        }
     1948        if (!object->iteration == -32) {
     1949            psFree(object);
     1950            exit(EXIT_FAILURE);
     1951        }
     1952        if (!object->exp_id == -64) {
     1953            psFree(object);
     1954            exit(EXIT_FAILURE);
     1955        }
     1956        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     1957            psFree(object);
     1958            exit(EXIT_FAILURE);
     1959        }
     1960        if (!object->bg == 64.64) {
     1961            psFree(object);
     1962            exit(EXIT_FAILURE);
     1963        }
     1964        if (!object->bg_stdev == 64.64) {
     1965            psFree(object);
     1966            exit(EXIT_FAILURE);
     1967        }
     1968        if (!object->bg_mean_stdev == 64.64) {
     1969            psFree(object);
     1970            exit(EXIT_FAILURE);
     1971        }
     1972        if (!object->bg_skewness == 64.64) {
     1973            psFree(object);
     1974            exit(EXIT_FAILURE);
     1975        }
     1976        if (!object->bg_kurtosis == 64.64) {
     1977            psFree(object);
     1978            exit(EXIT_FAILURE);
     1979        }
     1980        if (!object->bin_stdev == 64.64) {
     1981            psFree(object);
     1982            exit(EXIT_FAILURE);
     1983        }
     1984        if (!object->fringe_0 == 64.64) {
     1985            psFree(object);
     1986            exit(EXIT_FAILURE);
     1987        }
     1988        if (!object->fringe_1 == 64.64) {
     1989            psFree(object);
     1990            exit(EXIT_FAILURE);
     1991        }
     1992        if (!object->fringe_2 == 64.64) {
     1993            psFree(object);
     1994            exit(EXIT_FAILURE);
     1995        }
     1996        if (!object->fringe_resid_0 == 64.64) {
     1997            psFree(object);
     1998            exit(EXIT_FAILURE);
     1999        }
     2000        if (!object->fringe_resid_1 == 64.64) {
     2001            psFree(object);
     2002            exit(EXIT_FAILURE);
     2003        }
     2004        if (!object->fringe_resid_2 == 64.64) {
     2005            psFree(object);
     2006            exit(EXIT_FAILURE);
     2007        }
     2008        if (!object->user_1 == 64.64) {
     2009            psFree(object);
     2010            exit(EXIT_FAILURE);
     2011        }
     2012        if (!object->user_2 == 64.64) {
     2013            psFree(object);
     2014            exit(EXIT_FAILURE);
     2015        }
     2016        if (!object->user_3 == 64.64) {
     2017            psFree(object);
     2018            exit(EXIT_FAILURE);
     2019        }
     2020        if (!object->user_4 == 64.64) {
     2021            psFree(object);
     2022            exit(EXIT_FAILURE);
     2023        }
     2024        if (!object->user_5 == 64.64) {
     2025            psFree(object);
     2026            exit(EXIT_FAILURE);
     2027        }
     2028        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
     2029            psFree(object);
     2030            exit(EXIT_FAILURE);
     2031        }
     2032        if (!object->accept == true) {
     2033            psFree(object);
     2034            exit(EXIT_FAILURE);
     2035        }
     2036        if (!object->fault == -16) {
     2037            psFree(object);
     2038            exit(EXIT_FAILURE);
     2039        }
     2040
     2041        psFree(object);
     2042    }
     2043
     2044    {
     2045        detRunSummaryRow *object;
     2046
     2047        object = detRunSummaryRowAlloc(-64, -32, 64.64, 64.64, 64.64, true, -16    );
     2048
     2049        if (!object) {
     2050            exit(EXIT_FAILURE);
     2051        }
     2052
     2053        if (!object->det_id == -64) {
     2054            psFree(object);
     2055            exit(EXIT_FAILURE);
     2056        }
     2057        if (!object->iteration == -32) {
     2058            psFree(object);
     2059            exit(EXIT_FAILURE);
     2060        }
     2061        if (!object->bg == 64.64) {
     2062            psFree(object);
     2063            exit(EXIT_FAILURE);
     2064        }
     2065        if (!object->bg_stdev == 64.64) {
     2066            psFree(object);
     2067            exit(EXIT_FAILURE);
     2068        }
     2069        if (!object->bg_mean_stdev == 64.64) {
     2070            psFree(object);
     2071            exit(EXIT_FAILURE);
     2072        }
     2073        if (!object->accept == true) {
     2074            psFree(object);
     2075            exit(EXIT_FAILURE);
     2076        }
     2077        if (!object->fault == -16) {
     2078            psFree(object);
     2079            exit(EXIT_FAILURE);
     2080        }
     2081
     2082        psFree(object);
     2083    }
     2084
     2085    {
     2086        detRegisteredImfileRow *object;
     2087
     2088        object = detRegisteredImfileRowAlloc(-64, -32, "a string", "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16    );
     2089
     2090        if (!object) {
     2091            exit(EXIT_FAILURE);
     2092        }
     2093
     2094        if (!object->det_id == -64) {
     2095            psFree(object);
     2096            exit(EXIT_FAILURE);
     2097        }
     2098        if (!object->iteration == -32) {
     2099            psFree(object);
     2100            exit(EXIT_FAILURE);
     2101        }
     2102        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
     2103            psFree(object);
     2104            exit(EXIT_FAILURE);
     2105        }
     2106        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     2107            psFree(object);
     2108            exit(EXIT_FAILURE);
     2109        }
     2110        if (!object->bg == 64.64) {
     2111            psFree(object);
     2112            exit(EXIT_FAILURE);
     2113        }
     2114        if (!object->bg_stdev == 64.64) {
     2115            psFree(object);
     2116            exit(EXIT_FAILURE);
     2117        }
     2118        if (!object->bg_mean_stdev == 64.64) {
     2119            psFree(object);
     2120            exit(EXIT_FAILURE);
     2121        }
     2122        if (!object->user_1 == 64.64) {
     2123            psFree(object);
     2124            exit(EXIT_FAILURE);
     2125        }
     2126        if (!object->user_2 == 64.64) {
     2127            psFree(object);
     2128            exit(EXIT_FAILURE);
     2129        }
     2130        if (!object->user_3 == 64.64) {
     2131            psFree(object);
     2132            exit(EXIT_FAILURE);
     2133        }
     2134        if (!object->user_4 == 64.64) {
     2135            psFree(object);
     2136            exit(EXIT_FAILURE);
     2137        }
     2138        if (!object->user_5 == 64.64) {
     2139            psFree(object);
     2140            exit(EXIT_FAILURE);
     2141        }
     2142        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
     2143            psFree(object);
     2144            exit(EXIT_FAILURE);
     2145        }
     2146        if (!object->fault == -16) {
     2147            psFree(object);
     2148            exit(EXIT_FAILURE);
     2149        }
     2150
     2151        psFree(object);
     2152    }
     2153
     2154    {
     2155        magicRunRow     *object;
     2156
     2157        object = magicRunRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z"    );
     2158
     2159        if (!object) {
     2160            exit(EXIT_FAILURE);
     2161        }
     2162
     2163        if (!object->magic_id == -64) {
    2492164            psFree(object);
    2502165            exit(EXIT_FAILURE);
     
    2622177            exit(EXIT_FAILURE);
    2632178        }
    264         if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
    265             psFree(object);
    266             exit(EXIT_FAILURE);
    267         }
    268 
    269         psFree(object);
    270     }
    271 
    272     {
    273         newImfileRow    *object;
    274 
    275         object = newImfileRowAlloc(-64, "a string", "a string"    );
    276 
    277         if (!object) {
    278             exit(EXIT_FAILURE);
    279         }
    280 
    281         if (!object->exp_id == -64) {
    282             psFree(object);
    283             exit(EXIT_FAILURE);
    284         }
    285         if (strncmp(object->tmp_class_id, "a string", MAX_STRING_LENGTH)) {
     2179        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
     2180            psFree(object);
     2181            exit(EXIT_FAILURE);
     2182        }
     2183        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
     2184            psFree(object);
     2185            exit(EXIT_FAILURE);
     2186        }
     2187            psFree(object);
     2188            exit(EXIT_FAILURE);
     2189        }
     2190
     2191        psFree(object);
     2192    }
     2193
     2194    {
     2195        magicInputSkyfileRow *object;
     2196
     2197        object = magicInputSkyfileRowAlloc(-64, -64, -32    );
     2198
     2199        if (!object) {
     2200            exit(EXIT_FAILURE);
     2201        }
     2202
     2203        if (!object->magic_id == -64) {
     2204            psFree(object);
     2205            exit(EXIT_FAILURE);
     2206        }
     2207        if (!object->diff_id == -64) {
     2208            psFree(object);
     2209            exit(EXIT_FAILURE);
     2210        }
     2211        if (!object->node == -32) {
     2212            psFree(object);
     2213            exit(EXIT_FAILURE);
     2214        }
     2215
     2216        psFree(object);
     2217    }
     2218
     2219    {
     2220        magicTreeRow    *object;
     2221
     2222        object = magicTreeRowAlloc(-64, "a string", "a string"    );
     2223
     2224        if (!object) {
     2225            exit(EXIT_FAILURE);
     2226        }
     2227
     2228        if (!object->magic_id == -64) {
     2229            psFree(object);
     2230            exit(EXIT_FAILURE);
     2231        }
     2232        if (strncmp(object->node, "a string", MAX_STRING_LENGTH)) {
     2233            psFree(object);
     2234            exit(EXIT_FAILURE);
     2235        }
     2236        if (strncmp(object->dep, "a string", MAX_STRING_LENGTH)) {
     2237            psFree(object);
     2238            exit(EXIT_FAILURE);
     2239        }
     2240
     2241        psFree(object);
     2242    }
     2243
     2244    {
     2245        magicNodeResultRow *object;
     2246
     2247        object = magicNodeResultRowAlloc(-64, "a string", "a string"    );
     2248
     2249        if (!object) {
     2250            exit(EXIT_FAILURE);
     2251        }
     2252
     2253        if (!object->magic_id == -64) {
     2254            psFree(object);
     2255            exit(EXIT_FAILURE);
     2256        }
     2257        if (strncmp(object->node, "a string", MAX_STRING_LENGTH)) {
    2862258            psFree(object);
    2872259            exit(EXIT_FAILURE);
     
    2962268
    2972269    {
    298         rawExpRow       *object;
    299 
    300         object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, -16    );
    301 
    302         if (!object) {
    303             exit(EXIT_FAILURE);
    304         }
    305 
    306         if (!object->exp_id == -64) {
    307             psFree(object);
    308             exit(EXIT_FAILURE);
    309         }
    310         if (strncmp(object->exp_name, "a string", MAX_STRING_LENGTH)) {
    311             psFree(object);
    312             exit(EXIT_FAILURE);
    313         }
    314         if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
    315             psFree(object);
    316             exit(EXIT_FAILURE);
    317         }
    318         if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
    319             psFree(object);
    320             exit(EXIT_FAILURE);
    321         }
    322             psFree(object);
    323             exit(EXIT_FAILURE);
    324         }
    325         if (strncmp(object->exp_tag, "a string", MAX_STRING_LENGTH)) {
    326             psFree(object);
    327             exit(EXIT_FAILURE);
    328         }
    329         if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
    330             psFree(object);
    331             exit(EXIT_FAILURE);
    332         }
    333         if (strncmp(object->filelevel, "a string", MAX_STRING_LENGTH)) {
    334             psFree(object);
    335             exit(EXIT_FAILURE);
    336         }
    337         if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
    338             psFree(object);
    339             exit(EXIT_FAILURE);
    340         }
    341         if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
    342             psFree(object);
    343             exit(EXIT_FAILURE);
    344         }
    345         if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
    346             psFree(object);
    347             exit(EXIT_FAILURE);
    348         }
    349         if (!object->airmass == 32.32) {
    350             psFree(object);
    351             exit(EXIT_FAILURE);
    352         }
    353         if (!object->ra == 64.64) {
    354             psFree(object);
    355             exit(EXIT_FAILURE);
    356         }
    357         if (!object->decl == 64.64) {
    358             psFree(object);
    359             exit(EXIT_FAILURE);
    360         }
    361         if (!object->exp_time == 32.32) {
    362             psFree(object);
    363             exit(EXIT_FAILURE);
    364         }
    365         if (!object->sat_pixel_frac == 32.32) {
    366             psFree(object);
    367             exit(EXIT_FAILURE);
    368         }
    369         if (!object->bg == 64.64) {
    370             psFree(object);
    371             exit(EXIT_FAILURE);
    372         }
    373         if (!object->bg_stdev == 64.64) {
    374             psFree(object);
    375             exit(EXIT_FAILURE);
    376         }
    377         if (!object->bg_mean_stdev == 64.64) {
    378             psFree(object);
    379             exit(EXIT_FAILURE);
    380         }
    381         if (!object->alt == 64.64) {
    382             psFree(object);
    383             exit(EXIT_FAILURE);
    384         }
    385         if (!object->az == 64.64) {
    386             psFree(object);
    387             exit(EXIT_FAILURE);
    388         }
    389         if (!object->ccd_temp == 32.32) {
    390             psFree(object);
    391             exit(EXIT_FAILURE);
    392         }
    393         if (!object->posang == 64.64) {
    394             psFree(object);
    395             exit(EXIT_FAILURE);
    396         }
    397         if (!object->user_1 == 64.64) {
    398             psFree(object);
    399             exit(EXIT_FAILURE);
    400         }
    401         if (!object->user_2 == 64.64) {
    402             psFree(object);
    403             exit(EXIT_FAILURE);
    404         }
    405         if (!object->user_3 == 64.64) {
    406             psFree(object);
    407             exit(EXIT_FAILURE);
    408         }
    409         if (!object->user_4 == 64.64) {
    410             psFree(object);
    411             exit(EXIT_FAILURE);
    412         }
    413         if (!object->user_5 == 64.64) {
    414             psFree(object);
    415             exit(EXIT_FAILURE);
    416         }
    417         if (strncmp(object->object, "a string", MAX_STRING_LENGTH)) {
    418             psFree(object);
    419             exit(EXIT_FAILURE);
    420         }
    421         if (!object->solang == 32.32) {
    422             psFree(object);
    423             exit(EXIT_FAILURE);
    424         }
    425         if (!object->fault == -16) {
    426             psFree(object);
    427             exit(EXIT_FAILURE);
    428         }
    429 
    430         psFree(object);
    431     }
    432 
    433     {
    434         rawImfileRow    *object;
    435 
    436         object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16    );
    437 
    438         if (!object) {
    439             exit(EXIT_FAILURE);
    440         }
    441 
    442         if (!object->exp_id == -64) {
    443             psFree(object);
    444             exit(EXIT_FAILURE);
    445         }
    446         if (strncmp(object->exp_name, "a string", MAX_STRING_LENGTH)) {
    447             psFree(object);
    448             exit(EXIT_FAILURE);
    449         }
    450         if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
    451             psFree(object);
    452             exit(EXIT_FAILURE);
    453         }
    454         if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
    455             psFree(object);
    456             exit(EXIT_FAILURE);
    457         }
    458             psFree(object);
    459             exit(EXIT_FAILURE);
    460         }
    461         if (strncmp(object->tmp_class_id, "a string", MAX_STRING_LENGTH)) {
    462             psFree(object);
    463             exit(EXIT_FAILURE);
    464         }
    465         if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
     2270        magicMaskRow    *object;
     2271
     2272        object = magicMaskRowAlloc(-64, "a string"    );
     2273
     2274        if (!object) {
     2275            exit(EXIT_FAILURE);
     2276        }
     2277
     2278        if (!object->magic_id == -64) {
    4662279            psFree(object);
    4672280            exit(EXIT_FAILURE);
    4682281        }
    4692282        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
    470             psFree(object);
    471             exit(EXIT_FAILURE);
    472         }
    473         if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
    474             psFree(object);
    475             exit(EXIT_FAILURE);
    476         }
    477         if (strncmp(object->filelevel, "a string", MAX_STRING_LENGTH)) {
    478             psFree(object);
    479             exit(EXIT_FAILURE);
    480         }
    481         if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
    482             psFree(object);
    483             exit(EXIT_FAILURE);
    484         }
    485         if (!object->airmass == 32.32) {
    486             psFree(object);
    487             exit(EXIT_FAILURE);
    488         }
    489         if (!object->ra == 64.64) {
    490             psFree(object);
    491             exit(EXIT_FAILURE);
    492         }
    493         if (!object->decl == 64.64) {
    494             psFree(object);
    495             exit(EXIT_FAILURE);
    496         }
    497         if (!object->exp_time == 32.32) {
    498             psFree(object);
    499             exit(EXIT_FAILURE);
    500         }
    501         if (!object->sat_pixel_frac == 32.32) {
    502             psFree(object);
    503             exit(EXIT_FAILURE);
    504         }
    505         if (!object->bg == 64.64) {
    506             psFree(object);
    507             exit(EXIT_FAILURE);
    508         }
    509         if (!object->bg_stdev == 64.64) {
    510             psFree(object);
    511             exit(EXIT_FAILURE);
    512         }
    513         if (!object->bg_mean_stdev == 64.64) {
    514             psFree(object);
    515             exit(EXIT_FAILURE);
    516         }
    517         if (!object->alt == 64.64) {
    518             psFree(object);
    519             exit(EXIT_FAILURE);
    520         }
    521         if (!object->az == 64.64) {
    522             psFree(object);
    523             exit(EXIT_FAILURE);
    524         }
    525         if (!object->ccd_temp == 32.32) {
    526             psFree(object);
    527             exit(EXIT_FAILURE);
    528         }
    529         if (!object->posang == 64.64) {
    530             psFree(object);
    531             exit(EXIT_FAILURE);
    532         }
    533         if (!object->user_1 == 64.64) {
    534             psFree(object);
    535             exit(EXIT_FAILURE);
    536         }
    537         if (!object->user_2 == 64.64) {
    538             psFree(object);
    539             exit(EXIT_FAILURE);
    540         }
    541         if (!object->user_3 == 64.64) {
    542             psFree(object);
    543             exit(EXIT_FAILURE);
    544         }
    545         if (!object->user_4 == 64.64) {
    546             psFree(object);
    547             exit(EXIT_FAILURE);
    548         }
    549         if (!object->user_5 == 64.64) {
    550             psFree(object);
    551             exit(EXIT_FAILURE);
    552         }
    553         if (strncmp(object->object, "a string", MAX_STRING_LENGTH)) {
    554             psFree(object);
    555             exit(EXIT_FAILURE);
    556         }
    557         if (!object->fault == -16) {
    558             psFree(object);
    559             exit(EXIT_FAILURE);
    560         }
    561 
    562         psFree(object);
    563     }
    564 
    565     {
    566         guidePendingExpRow *object;
    567 
    568         object = guidePendingExpRowAlloc(-64, -64, "a string"    );
    569 
    570         if (!object) {
    571             exit(EXIT_FAILURE);
    572         }
    573 
    574         if (!object->guide_id == -64) {
    575             psFree(object);
    576             exit(EXIT_FAILURE);
    577         }
    578         if (!object->exp_id == -64) {
    579             psFree(object);
    580             exit(EXIT_FAILURE);
    581         }
    582         if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
    583             psFree(object);
    584             exit(EXIT_FAILURE);
    585         }
    586 
    587         psFree(object);
    588     }
    589 
    590     {
    591         chipRunRow      *object;
    592 
    593         object = chipRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
    594 
    595         if (!object) {
    596             exit(EXIT_FAILURE);
    597         }
    598 
    599         if (!object->chip_id == -64) {
    600             psFree(object);
    601             exit(EXIT_FAILURE);
    602         }
    603         if (!object->exp_id == -64) {
    604             psFree(object);
    605             exit(EXIT_FAILURE);
    606         }
    607         if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
    608             psFree(object);
    609             exit(EXIT_FAILURE);
    610         }
    611         if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
    612             psFree(object);
    613             exit(EXIT_FAILURE);
    614         }
    615         if (strncmp(object->workdir_state, "a string", MAX_STRING_LENGTH)) {
    616             psFree(object);
    617             exit(EXIT_FAILURE);
    618         }
    619         if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
    620             psFree(object);
    621             exit(EXIT_FAILURE);
    622         }
    623         if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
    624             psFree(object);
    625             exit(EXIT_FAILURE);
    626         }
    627         if (strncmp(object->expgroup, "a string", MAX_STRING_LENGTH)) {
    628             psFree(object);
    629             exit(EXIT_FAILURE);
    630         }
    631         if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
    632             psFree(object);
    633             exit(EXIT_FAILURE);
    634         }
    635 
    636         psFree(object);
    637     }
    638 
    639     {
    640         chipProcessedImfileRow *object;
    641 
    642         object = chipProcessedImfileRowAlloc(-64, -64, "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, -32, -32, -32, -32, "a string", -16    );
    643 
    644         if (!object) {
    645             exit(EXIT_FAILURE);
    646         }
    647 
    648         if (!object->chip_id == -64) {
    649             psFree(object);
    650             exit(EXIT_FAILURE);
    651         }
    652         if (!object->exp_id == -64) {
    653             psFree(object);
    654             exit(EXIT_FAILURE);
    655         }
    656         if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
    657             psFree(object);
    658             exit(EXIT_FAILURE);
    659         }
    660         if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
    661             psFree(object);
    662             exit(EXIT_FAILURE);
    663         }
    664         if (!object->bg == 32.32) {
    665             psFree(object);
    666             exit(EXIT_FAILURE);
    667         }
    668         if (!object->bg_stdev == 32.32) {
    669             psFree(object);
    670             exit(EXIT_FAILURE);
    671         }
    672         if (!object->bg_mean_stdev == 32.32) {
    673             psFree(object);
    674             exit(EXIT_FAILURE);
    675         }
    676         if (!object->bias == 32.32) {
    677             psFree(object);
    678             exit(EXIT_FAILURE);
    679         }
    680         if (!object->bias_stdev == 32.32) {
    681             psFree(object);
    682             exit(EXIT_FAILURE);
    683         }
    684         if (!object->fringe_0 == 32.32) {
    685             psFree(object);
    686             exit(EXIT_FAILURE);
    687         }
    688         if (!object->fringe_1 == 32.32) {
    689             psFree(object);
    690             exit(EXIT_FAILURE);
    691         }
    692         if (!object->fringe_2 == 32.32) {
    693             psFree(object);
    694             exit(EXIT_FAILURE);
    695         }
    696         if (!object->sigma_ra == 32.32) {
    697             psFree(object);
    698             exit(EXIT_FAILURE);
    699         }
    700         if (!object->sigma_dec == 32.32) {
    701             psFree(object);
    702             exit(EXIT_FAILURE);
    703         }
    704         if (!object->ap_resid == 32.32) {
    705             psFree(object);
    706             exit(EXIT_FAILURE);
    707         }
    708         if (!object->ap_resid_stdev == 32.32) {
    709             psFree(object);
    710             exit(EXIT_FAILURE);
    711         }
    712         if (!object->fwhm == 32.32) {
    713             psFree(object);
    714             exit(EXIT_FAILURE);
    715         }
    716         if (!object->fwhm_range == 32.32) {
    717             psFree(object);
    718             exit(EXIT_FAILURE);
    719         }
    720         if (!object->n_stars == -32) {
    721             psFree(object);
    722             exit(EXIT_FAILURE);
    723         }
    724         if (!object->n_extended == -32) {
    725             psFree(object);
    726             exit(EXIT_FAILURE);
    727         }
    728         if (!object->n_cr == -32) {
    729             psFree(object);
    730             exit(EXIT_FAILURE);
    731         }
    732         if (!object->n_astrom == -32) {
    733             psFree(object);
    734             exit(EXIT_FAILURE);
    735         }
    736         if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
    737             psFree(object);
    738             exit(EXIT_FAILURE);
    739         }
    740         if (!object->fault == -16) {
    741             psFree(object);
    742             exit(EXIT_FAILURE);
    743         }
    744 
    745         psFree(object);
    746     }
    747 
    748     {
    749         chipMaskRow     *object;
    750 
    751         object = chipMaskRowAlloc("a string"    );
    752 
    753         if (!object) {
    754             exit(EXIT_FAILURE);
    755         }
    756 
    757         if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
    758             psFree(object);
    759             exit(EXIT_FAILURE);
    760         }
    761 
    762         psFree(object);
    763     }
    764 
    765     {
    766         camRunRow       *object;
    767 
    768         object = camRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
    769 
    770         if (!object) {
    771             exit(EXIT_FAILURE);
    772         }
    773 
    774         if (!object->cam_id == -64) {
    775             psFree(object);
    776             exit(EXIT_FAILURE);
    777         }
    778         if (!object->chip_id == -64) {
    779             psFree(object);
    780             exit(EXIT_FAILURE);
    781         }
    782         if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
    783             psFree(object);
    784             exit(EXIT_FAILURE);
    785         }
    786         if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
    787             psFree(object);
    788             exit(EXIT_FAILURE);
    789         }
    790         if (strncmp(object->workdir_state, "a string", MAX_STRING_LENGTH)) {
    791             psFree(object);
    792             exit(EXIT_FAILURE);
    793         }
    794         if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
    795             psFree(object);
    796             exit(EXIT_FAILURE);
    797         }
    798         if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
    799             psFree(object);
    800             exit(EXIT_FAILURE);
    801         }
    802         if (strncmp(object->expgroup, "a string", MAX_STRING_LENGTH)) {
    803             psFree(object);
    804             exit(EXIT_FAILURE);
    805         }
    806         if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
    807             psFree(object);
    808             exit(EXIT_FAILURE);
    809         }
    810 
    811         psFree(object);
    812     }
    813 
    814     {
    815         camProcessedExpRow *object;
    816 
    817         object = camProcessedExpRowAlloc(-64, -64, "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, -32, -32, -32, -32, "a string", -16    );
    818 
    819         if (!object) {
    820             exit(EXIT_FAILURE);
    821         }
    822 
    823         if (!object->cam_id == -64) {
    824             psFree(object);
    825             exit(EXIT_FAILURE);
    826         }
    827         if (!object->chip_id == -64) {
    828             psFree(object);
    829             exit(EXIT_FAILURE);
    830         }
    831         if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
    832             psFree(object);
    833             exit(EXIT_FAILURE);
    834         }
    835         if (!object->bg == 32.32) {
    836             psFree(object);
    837             exit(EXIT_FAILURE);
    838         }
    839         if (!object->bg_stdev == 32.32) {
    840             psFree(object);
    841             exit(EXIT_FAILURE);
    842         }
    843         if (!object->bg_mean_stdev == 32.32) {
    844             psFree(object);
    845             exit(EXIT_FAILURE);
    846         }
    847         if (!object->sigma_ra == 32.32) {
    848             psFree(object);
    849             exit(EXIT_FAILURE);
    850         }
    851         if (!object->sigma_dec == 32.32) {
    852             psFree(object);
    853             exit(EXIT_FAILURE);
    854         }
    855         if (!object->zp_mean == 32.32) {
    856             psFree(object);
    857             exit(EXIT_FAILURE);
    858         }
    859         if (!object->zp_stdev == 32.32) {
    860             psFree(object);
    861             exit(EXIT_FAILURE);
    862         }
    863         if (!object->fwhm == 32.32) {
    864             psFree(object);
    865             exit(EXIT_FAILURE);
    866         }
    867         if (!object->fwhm_range == 32.32) {
    868             psFree(object);
    869             exit(EXIT_FAILURE);
    870         }
    871         if (!object->n_stars == -32) {
    872             psFree(object);
    873             exit(EXIT_FAILURE);
    874         }
    875         if (!object->n_extended == -32) {
    876             psFree(object);
    877             exit(EXIT_FAILURE);
    878         }
    879         if (!object->n_cr == -32) {
    880             psFree(object);
    881             exit(EXIT_FAILURE);
    882         }
    883         if (!object->n_astrom == -32) {
    884             psFree(object);
    885             exit(EXIT_FAILURE);
    886         }
    887         if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
    888             psFree(object);
    889             exit(EXIT_FAILURE);
    890         }
    891         if (!object->fault == -16) {
    892             psFree(object);
    893             exit(EXIT_FAILURE);
    894         }
    895 
    896         psFree(object);
    897     }
    898 
    899     {
    900         camMaskRow      *object;
    901 
    902         object = camMaskRowAlloc("a string"    );
    903 
    904         if (!object) {
    905             exit(EXIT_FAILURE);
    906         }
    907 
    908         if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
    909             psFree(object);
    910             exit(EXIT_FAILURE);
    911         }
    912 
    913         psFree(object);
    914     }
    915 
    916     {
    917         warpRunRow      *object;
    918 
    919         object = warpRunRowAlloc(-64, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z"    );
    920 
    921         if (!object) {
    922             exit(EXIT_FAILURE);
    923         }
    924 
    925         if (!object->warp_id == -64) {
    926             psFree(object);
    927             exit(EXIT_FAILURE);
    928         }
    929         if (strncmp(object->mode, "a string", MAX_STRING_LENGTH)) {
    930             psFree(object);
    931             exit(EXIT_FAILURE);
    932         }
    933         if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
    934             psFree(object);
    935             exit(EXIT_FAILURE);
    936         }
    937         if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
    938             psFree(object);
    939             exit(EXIT_FAILURE);
    940         }
    941         if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
    942             psFree(object);
    943             exit(EXIT_FAILURE);
    944         }
    945             psFree(object);
    946             exit(EXIT_FAILURE);
    947         }
    948 
    949         psFree(object);
    950     }
    951 
    952     {
    953         warpInputExpRow *object;
    954 
    955         object = warpInputExpRowAlloc(-64, -64, true    );
    956 
    957         if (!object) {
    958             exit(EXIT_FAILURE);
    959         }
    960 
    961         if (!object->warp_id == -64) {
    962             psFree(object);
    963             exit(EXIT_FAILURE);
    964         }
    965         if (!object->cam_id == -64) {
    966             psFree(object);
    967             exit(EXIT_FAILURE);
    968         }
    969         if (!object->magiced == true) {
    970             psFree(object);
    971             exit(EXIT_FAILURE);
    972         }
    973 
    974         psFree(object);
    975     }
    976 
    977     {
    978         warpSkyCellMapRow *object;
    979 
    980         object = warpSkyCellMapRowAlloc(-64, "a string", "a string", -64, "a string", -16    );
    981 
    982         if (!object) {
    983             exit(EXIT_FAILURE);
    984         }
    985 
    986         if (!object->warp_id == -64) {
    987             psFree(object);
    988             exit(EXIT_FAILURE);
    989         }
    990         if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
    991             psFree(object);
    992             exit(EXIT_FAILURE);
    993         }
    994         if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
    995             psFree(object);
    996             exit(EXIT_FAILURE);
    997         }
    998         if (!object->cam_id == -64) {
    999             psFree(object);
    1000             exit(EXIT_FAILURE);
    1001         }
    1002         if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
    1003             psFree(object);
    1004             exit(EXIT_FAILURE);
    1005         }
    1006         if (!object->fault == -16) {
    1007             psFree(object);
    1008             exit(EXIT_FAILURE);
    1009         }
    1010 
    1011         psFree(object);
    1012     }
    1013 
    1014     {
    1015         warpSkyfileRow  *object;
    1016 
    1017         object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, -16    );
    1018 
    1019         if (!object) {
    1020             exit(EXIT_FAILURE);
    1021         }
    1022 
    1023         if (!object->warp_id == -64) {
    1024             psFree(object);
    1025             exit(EXIT_FAILURE);
    1026         }
    1027         if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
    1028             psFree(object);
    1029             exit(EXIT_FAILURE);
    1030         }
    1031         if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
    1032             psFree(object);
    1033             exit(EXIT_FAILURE);
    1034         }
    1035         if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
    1036             psFree(object);
    1037             exit(EXIT_FAILURE);
    1038         }
    1039         if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
    1040             psFree(object);
    1041             exit(EXIT_FAILURE);
    1042         }
    1043         if (!object->bg == 64.64) {
    1044             psFree(object);
    1045             exit(EXIT_FAILURE);
    1046         }
    1047         if (!object->bg_stdev == 64.64) {
    1048             psFree(object);
    1049             exit(EXIT_FAILURE);
    1050         }
    1051         if (!object->fault == -16) {
    1052             psFree(object);
    1053             exit(EXIT_FAILURE);
    1054         }
    1055 
    1056         psFree(object);
    1057     }
    1058 
    1059     {
    1060         diffRunRow      *object;
    1061 
    1062         object = diffRunRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string"    );
    1063 
    1064         if (!object) {
    1065             exit(EXIT_FAILURE);
    1066         }
    1067 
    1068         if (!object->diff_id == -64) {
    1069             psFree(object);
    1070             exit(EXIT_FAILURE);
    1071         }
    1072         if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
    1073             psFree(object);
    1074             exit(EXIT_FAILURE);
    1075         }
    1076         if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
    1077             psFree(object);
    1078             exit(EXIT_FAILURE);
    1079         }
    1080         if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
    1081             psFree(object);
    1082             exit(EXIT_FAILURE);
    1083         }
    1084             psFree(object);
    1085             exit(EXIT_FAILURE);
    1086         }
    1087         if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
    1088             psFree(object);
    1089             exit(EXIT_FAILURE);
    1090         }
    1091         if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
    1092             psFree(object);
    1093             exit(EXIT_FAILURE);
    1094         }
    1095 
    1096         psFree(object);
    1097     }
    1098 
    1099     {
    1100         diffInputSkyfileRow *object;
    1101 
    1102         object = diffInputSkyfileRowAlloc(-64, true, -64, -64, "a string", "a string", "a string"    );
    1103 
    1104         if (!object) {
    1105             exit(EXIT_FAILURE);
    1106         }
    1107 
    1108         if (!object->diff_id == -64) {
    1109             psFree(object);
    1110             exit(EXIT_FAILURE);
    1111         }
    1112         if (!object->template == true) {
    1113             psFree(object);
    1114             exit(EXIT_FAILURE);
    1115         }
    1116         if (!object->stack_id == -64) {
    1117             psFree(object);
    1118             exit(EXIT_FAILURE);
    1119         }
    1120         if (!object->warp_id == -64) {
    1121             psFree(object);
    1122             exit(EXIT_FAILURE);
    1123         }
    1124         if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
    1125             psFree(object);
    1126             exit(EXIT_FAILURE);
    1127         }
    1128         if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
    1129             psFree(object);
    1130             exit(EXIT_FAILURE);
    1131         }
    1132         if (strncmp(object->kind, "a string", MAX_STRING_LENGTH)) {
    1133             psFree(object);
    1134             exit(EXIT_FAILURE);
    1135         }
    1136 
    1137         psFree(object);
    1138     }
    1139 
    1140     {
    1141         diffSkyfileRow  *object;
    1142 
    1143         object = diffSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, -16    );
    1144 
    1145         if (!object) {
    1146             exit(EXIT_FAILURE);
    1147         }
    1148 
    1149         if (!object->diff_id == -64) {
    1150             psFree(object);
    1151             exit(EXIT_FAILURE);
    1152         }
    1153         if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
    1154             psFree(object);
    1155             exit(EXIT_FAILURE);
    1156         }
    1157         if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
    1158             psFree(object);
    1159             exit(EXIT_FAILURE);
    1160         }
    1161         if (!object->bg == 64.64) {
    1162             psFree(object);
    1163             exit(EXIT_FAILURE);
    1164         }
    1165         if (!object->bg_stdev == 64.64) {
    1166             psFree(object);
    1167             exit(EXIT_FAILURE);
    1168         }
    1169         if (!object->fault == -16) {
    1170             psFree(object);
    1171             exit(EXIT_FAILURE);
    1172         }
    1173 
    1174         psFree(object);
    1175     }
    1176 
    1177     {
    1178         stackRunRow     *object;
    1179 
    1180         object = stackRunRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string"    );
    1181 
    1182         if (!object) {
    1183             exit(EXIT_FAILURE);
    1184         }
    1185 
    1186         if (!object->stack_id == -64) {
    1187             psFree(object);
    1188             exit(EXIT_FAILURE);
    1189         }
    1190         if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
    1191             psFree(object);
    1192             exit(EXIT_FAILURE);
    1193         }
    1194         if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
    1195             psFree(object);
    1196             exit(EXIT_FAILURE);
    1197         }
    1198         if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
    1199             psFree(object);
    1200             exit(EXIT_FAILURE);
    1201         }
    1202             psFree(object);
    1203             exit(EXIT_FAILURE);
    1204         }
    1205         if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
    1206             psFree(object);
    1207             exit(EXIT_FAILURE);
    1208         }
    1209         if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
    1210             psFree(object);
    1211             exit(EXIT_FAILURE);
    1212         }
    1213 
    1214         psFree(object);
    1215     }
    1216 
    1217     {
    1218         stackInputSkyfileRow *object;
    1219 
    1220         object = stackInputSkyfileRowAlloc(-64, -64    );
    1221 
    1222         if (!object) {
    1223             exit(EXIT_FAILURE);
    1224         }
    1225 
    1226         if (!object->stack_id == -64) {
    1227             psFree(object);
    1228             exit(EXIT_FAILURE);
    1229         }
    1230         if (!object->warp_id == -64) {
    1231             psFree(object);
    1232             exit(EXIT_FAILURE);
    1233         }
    1234 
    1235         psFree(object);
    1236     }
    1237 
    1238     {
    1239         stackSumSkyfileRow *object;
    1240 
    1241         object = stackSumSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, -16    );
    1242 
    1243         if (!object) {
    1244             exit(EXIT_FAILURE);
    1245         }
    1246 
    1247         if (!object->stack_id == -64) {
    1248             psFree(object);
    1249             exit(EXIT_FAILURE);
    1250         }
    1251         if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
    1252             psFree(object);
    1253             exit(EXIT_FAILURE);
    1254         }
    1255         if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
    1256             psFree(object);
    1257             exit(EXIT_FAILURE);
    1258         }
    1259         if (!object->bg == 64.64) {
    1260             psFree(object);
    1261             exit(EXIT_FAILURE);
    1262         }
    1263         if (!object->bg_stdev == 64.64) {
    1264             psFree(object);
    1265             exit(EXIT_FAILURE);
    1266         }
    1267         if (!object->fault == -16) {
    1268             psFree(object);
    1269             exit(EXIT_FAILURE);
    1270         }
    1271 
    1272         psFree(object);
    1273     }
    1274 
    1275     {
    1276         detRunRow       *object;
    1277 
    1278         object = detRunRowAlloc(-64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32    );
    1279 
    1280         if (!object) {
    1281             exit(EXIT_FAILURE);
    1282         }
    1283 
    1284         if (!object->det_id == -64) {
    1285             psFree(object);
    1286             exit(EXIT_FAILURE);
    1287         }
    1288         if (!object->iteration == -32) {
    1289             psFree(object);
    1290             exit(EXIT_FAILURE);
    1291         }
    1292         if (strncmp(object->det_type, "a string", MAX_STRING_LENGTH)) {
    1293             psFree(object);
    1294             exit(EXIT_FAILURE);
    1295         }
    1296         if (strncmp(object->mode, "a string", MAX_STRING_LENGTH)) {
    1297             psFree(object);
    1298             exit(EXIT_FAILURE);
    1299         }
    1300         if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
    1301             psFree(object);
    1302             exit(EXIT_FAILURE);
    1303         }
    1304         if (strncmp(object->filelevel, "a string", MAX_STRING_LENGTH)) {
    1305             psFree(object);
    1306             exit(EXIT_FAILURE);
    1307         }
    1308         if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
    1309             psFree(object);
    1310             exit(EXIT_FAILURE);
    1311         }
    1312         if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
    1313             psFree(object);
    1314             exit(EXIT_FAILURE);
    1315         }
    1316         if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
    1317             psFree(object);
    1318             exit(EXIT_FAILURE);
    1319         }
    1320         if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
    1321             psFree(object);
    1322             exit(EXIT_FAILURE);
    1323         }
    1324         if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
    1325             psFree(object);
    1326             exit(EXIT_FAILURE);
    1327         }
    1328         if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
    1329             psFree(object);
    1330             exit(EXIT_FAILURE);
    1331         }
    1332         if (!object->airmass_min == 32.32) {
    1333             psFree(object);
    1334             exit(EXIT_FAILURE);
    1335         }
    1336         if (!object->airmass_max == 32.32) {
    1337             psFree(object);
    1338             exit(EXIT_FAILURE);
    1339         }
    1340         if (!object->exp_time_min == 32.32) {
    1341             psFree(object);
    1342             exit(EXIT_FAILURE);
    1343         }
    1344         if (!object->exp_time_max == 32.32) {
    1345             psFree(object);
    1346             exit(EXIT_FAILURE);
    1347         }
    1348         if (!object->ccd_temp_min == 32.32) {
    1349             psFree(object);
    1350             exit(EXIT_FAILURE);
    1351         }
    1352         if (!object->ccd_temp_max == 32.32) {
    1353             psFree(object);
    1354             exit(EXIT_FAILURE);
    1355         }
    1356         if (!object->posang_min == 64.64) {
    1357             psFree(object);
    1358             exit(EXIT_FAILURE);
    1359         }
    1360         if (!object->posang_max == 64.64) {
    1361             psFree(object);
    1362             exit(EXIT_FAILURE);
    1363         }
    1364             psFree(object);
    1365             exit(EXIT_FAILURE);
    1366         }
    1367             psFree(object);
    1368             exit(EXIT_FAILURE);
    1369         }
    1370             psFree(object);
    1371             exit(EXIT_FAILURE);
    1372         }
    1373             psFree(object);
    1374             exit(EXIT_FAILURE);
    1375         }
    1376             psFree(object);
    1377             exit(EXIT_FAILURE);
    1378         }
    1379         if (!object->solang_min == 32.32) {
    1380             psFree(object);
    1381             exit(EXIT_FAILURE);
    1382         }
    1383         if (!object->solang_max == 32.32) {
    1384             psFree(object);
    1385             exit(EXIT_FAILURE);
    1386         }
    1387         if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
    1388             psFree(object);
    1389             exit(EXIT_FAILURE);
    1390         }
    1391         if (!object->parent == -32) {
    1392             psFree(object);
    1393             exit(EXIT_FAILURE);
    1394         }
    1395 
    1396         psFree(object);
    1397     }
    1398 
    1399     {
    1400         detInputExpRow  *object;
    1401 
    1402         object = detInputExpRowAlloc(-64, -32, -64, true    );
    1403 
    1404         if (!object) {
    1405             exit(EXIT_FAILURE);
    1406         }
    1407 
    1408         if (!object->det_id == -64) {
    1409             psFree(object);
    1410             exit(EXIT_FAILURE);
    1411         }
    1412         if (!object->iteration == -32) {
    1413             psFree(object);
    1414             exit(EXIT_FAILURE);
    1415         }
    1416         if (!object->exp_id == -64) {
    1417             psFree(object);
    1418             exit(EXIT_FAILURE);
    1419         }
    1420         if (!object->include == true) {
    1421             psFree(object);
    1422             exit(EXIT_FAILURE);
    1423         }
    1424 
    1425         psFree(object);
    1426     }
    1427 
    1428     {
    1429         detProcessedImfileRow *object;
    1430 
    1431         object = detProcessedImfileRowAlloc(-64, -64, "a string", "a string", "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16    );
    1432 
    1433         if (!object) {
    1434             exit(EXIT_FAILURE);
    1435         }
    1436 
    1437         if (!object->det_id == -64) {
    1438             psFree(object);
    1439             exit(EXIT_FAILURE);
    1440         }
    1441         if (!object->exp_id == -64) {
    1442             psFree(object);
    1443             exit(EXIT_FAILURE);
    1444         }
    1445         if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
    1446             psFree(object);
    1447             exit(EXIT_FAILURE);
    1448         }
    1449         if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
    1450             psFree(object);
    1451             exit(EXIT_FAILURE);
    1452         }
    1453         if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
    1454             psFree(object);
    1455             exit(EXIT_FAILURE);
    1456         }
    1457         if (!object->bg == 64.64) {
    1458             psFree(object);
    1459             exit(EXIT_FAILURE);
    1460         }
    1461         if (!object->bg_stdev == 64.64) {
    1462             psFree(object);
    1463             exit(EXIT_FAILURE);
    1464         }
    1465         if (!object->bg_mean_stdev == 64.64) {
    1466             psFree(object);
    1467             exit(EXIT_FAILURE);
    1468         }
    1469         if (!object->fringe_0 == 64.64) {
    1470             psFree(object);
    1471             exit(EXIT_FAILURE);
    1472         }
    1473         if (!object->fringe_1 == 64.64) {
    1474             psFree(object);
    1475             exit(EXIT_FAILURE);
    1476         }
    1477         if (!object->fringe_2 == 64.64) {
    1478             psFree(object);
    1479             exit(EXIT_FAILURE);
    1480         }
    1481         if (!object->user_1 == 64.64) {
    1482             psFree(object);
    1483             exit(EXIT_FAILURE);
    1484         }
    1485         if (!object->user_2 == 64.64) {
    1486             psFree(object);
    1487             exit(EXIT_FAILURE);
    1488         }
    1489         if (!object->user_3 == 64.64) {
    1490             psFree(object);
    1491             exit(EXIT_FAILURE);
    1492         }
    1493         if (!object->user_4 == 64.64) {
    1494             psFree(object);
    1495             exit(EXIT_FAILURE);
    1496         }
    1497         if (!object->user_5 == 64.64) {
    1498             psFree(object);
    1499             exit(EXIT_FAILURE);
    1500         }
    1501         if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
    1502             psFree(object);
    1503             exit(EXIT_FAILURE);
    1504         }
    1505         if (!object->fault == -16) {
    1506             psFree(object);
    1507             exit(EXIT_FAILURE);
    1508         }
    1509 
    1510         psFree(object);
    1511     }
    1512 
    1513     {
    1514         detProcessedExpRow *object;
    1515 
    1516         object = detProcessedExpRowAlloc(-64, -64, "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16    );
    1517 
    1518         if (!object) {
    1519             exit(EXIT_FAILURE);
    1520         }
    1521 
    1522         if (!object->det_id == -64) {
    1523             psFree(object);
    1524             exit(EXIT_FAILURE);
    1525         }
    1526         if (!object->exp_id == -64) {
    1527             psFree(object);
    1528             exit(EXIT_FAILURE);
    1529         }
    1530         if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
    1531             psFree(object);
    1532             exit(EXIT_FAILURE);
    1533         }
    1534         if (!object->bg == 64.64) {
    1535             psFree(object);
    1536             exit(EXIT_FAILURE);
    1537         }
    1538         if (!object->bg_stdev == 64.64) {
    1539             psFree(object);
    1540             exit(EXIT_FAILURE);
    1541         }
    1542         if (!object->bg_mean_stdev == 64.64) {
    1543             psFree(object);
    1544             exit(EXIT_FAILURE);
    1545         }
    1546         if (!object->fringe_0 == 64.64) {
    1547             psFree(object);
    1548             exit(EXIT_FAILURE);
    1549         }
    1550         if (!object->fringe_1 == 64.64) {
    1551             psFree(object);
    1552             exit(EXIT_FAILURE);
    1553         }
    1554         if (!object->fringe_2 == 64.64) {
    1555             psFree(object);
    1556             exit(EXIT_FAILURE);
    1557         }
    1558         if (!object->user_1 == 64.64) {
    1559             psFree(object);
    1560             exit(EXIT_FAILURE);
    1561         }
    1562         if (!object->user_2 == 64.64) {
    1563             psFree(object);
    1564             exit(EXIT_FAILURE);
    1565         }
    1566         if (!object->user_3 == 64.64) {
    1567             psFree(object);
    1568             exit(EXIT_FAILURE);
    1569         }
    1570         if (!object->user_4 == 64.64) {
    1571             psFree(object);
    1572             exit(EXIT_FAILURE);
    1573         }
    1574         if (!object->user_5 == 64.64) {
    1575             psFree(object);
    1576             exit(EXIT_FAILURE);
    1577         }
    1578         if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
    1579             psFree(object);
    1580             exit(EXIT_FAILURE);
    1581         }
    1582         if (!object->fault == -16) {
    1583             psFree(object);
    1584             exit(EXIT_FAILURE);
    1585         }
    1586 
    1587         psFree(object);
    1588     }
    1589 
    1590     {
    1591         detStackedImfileRow *object;
    1592 
    1593         object = detStackedImfileRowAlloc(-64, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, -16    );
    1594 
    1595         if (!object) {
    1596             exit(EXIT_FAILURE);
    1597         }
    1598 
    1599         if (!object->det_id == -64) {
    1600             psFree(object);
    1601             exit(EXIT_FAILURE);
    1602         }
    1603         if (!object->iteration == -32) {
    1604             psFree(object);
    1605             exit(EXIT_FAILURE);
    1606         }
    1607         if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
    1608             psFree(object);
    1609             exit(EXIT_FAILURE);
    1610         }
    1611         if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
    1612             psFree(object);
    1613             exit(EXIT_FAILURE);
    1614         }
    1615         if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
    1616             psFree(object);
    1617             exit(EXIT_FAILURE);
    1618         }
    1619         if (!object->bg == 64.64) {
    1620             psFree(object);
    1621             exit(EXIT_FAILURE);
    1622         }
    1623         if (!object->bg_stdev == 64.64) {
    1624             psFree(object);
    1625             exit(EXIT_FAILURE);
    1626         }
    1627         if (!object->bg_mean_stdev == 64.64) {
    1628             psFree(object);
    1629             exit(EXIT_FAILURE);
    1630         }
    1631         if (!object->user_1 == 64.64) {
    1632             psFree(object);
    1633             exit(EXIT_FAILURE);
    1634         }
    1635         if (!object->user_2 == 64.64) {
    1636             psFree(object);
    1637             exit(EXIT_FAILURE);
    1638         }
    1639         if (!object->user_3 == 64.64) {
    1640             psFree(object);
    1641             exit(EXIT_FAILURE);
    1642         }
    1643         if (!object->user_4 == 64.64) {
    1644             psFree(object);
    1645             exit(EXIT_FAILURE);
    1646         }
    1647         if (!object->user_5 == 64.64) {
    1648             psFree(object);
    1649             exit(EXIT_FAILURE);
    1650         }
    1651         if (!object->fault == -16) {
    1652             psFree(object);
    1653             exit(EXIT_FAILURE);
    1654         }
    1655 
    1656         psFree(object);
    1657     }
    1658 
    1659     {
    1660         detNormalizedStatImfileRow *object;
    1661 
    1662         object = detNormalizedStatImfileRowAlloc(-64, -32, "a string", 32.32, -16    );
    1663 
    1664         if (!object) {
    1665             exit(EXIT_FAILURE);
    1666         }
    1667 
    1668         if (!object->det_id == -64) {
    1669             psFree(object);
    1670             exit(EXIT_FAILURE);
    1671         }
    1672         if (!object->iteration == -32) {
    1673             psFree(object);
    1674             exit(EXIT_FAILURE);
    1675         }
    1676         if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
    1677             psFree(object);
    1678             exit(EXIT_FAILURE);
    1679         }
    1680         if (!object->norm == 32.32) {
    1681             psFree(object);
    1682             exit(EXIT_FAILURE);
    1683         }
    1684         if (!object->fault == -16) {
    1685             psFree(object);
    1686             exit(EXIT_FAILURE);
    1687         }
    1688 
    1689         psFree(object);
    1690     }
    1691 
    1692     {
    1693         detNormalizedImfileRow *object;
    1694 
    1695         object = detNormalizedImfileRowAlloc(-64, -32, "a string", "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16    );
    1696 
    1697         if (!object) {
    1698             exit(EXIT_FAILURE);
    1699         }
    1700 
    1701         if (!object->det_id == -64) {
    1702             psFree(object);
    1703             exit(EXIT_FAILURE);
    1704         }
    1705         if (!object->iteration == -32) {
    1706             psFree(object);
    1707             exit(EXIT_FAILURE);
    1708         }
    1709         if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
    1710             psFree(object);
    1711             exit(EXIT_FAILURE);
    1712         }
    1713         if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
    1714             psFree(object);
    1715             exit(EXIT_FAILURE);
    1716         }
    1717         if (!object->bg == 64.64) {
    1718             psFree(object);
    1719             exit(EXIT_FAILURE);
    1720         }
    1721         if (!object->bg_stdev == 64.64) {
    1722             psFree(object);
    1723             exit(EXIT_FAILURE);
    1724         }
    1725         if (!object->bg_mean_stdev == 64.64) {
    1726             psFree(object);
    1727             exit(EXIT_FAILURE);
    1728         }
    1729         if (!object->user_1 == 64.64) {
    1730             psFree(object);
    1731             exit(EXIT_FAILURE);
    1732         }
    1733         if (!object->user_2 == 64.64) {
    1734             psFree(object);
    1735             exit(EXIT_FAILURE);
    1736         }
    1737         if (!object->user_3 == 64.64) {
    1738             psFree(object);
    1739             exit(EXIT_FAILURE);
    1740         }
    1741         if (!object->user_4 == 64.64) {
    1742             psFree(object);
    1743             exit(EXIT_FAILURE);
    1744         }
    1745         if (!object->user_5 == 64.64) {
    1746             psFree(object);
    1747             exit(EXIT_FAILURE);
    1748         }
    1749         if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
    1750             psFree(object);
    1751             exit(EXIT_FAILURE);
    1752         }
    1753         if (!object->fault == -16) {
    1754             psFree(object);
    1755             exit(EXIT_FAILURE);
    1756         }
    1757 
    1758         psFree(object);
    1759     }
    1760 
    1761     {
    1762         detNormalizedExpRow *object;
    1763 
    1764         object = detNormalizedExpRowAlloc(-64, -32, "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16    );
    1765 
    1766         if (!object) {
    1767             exit(EXIT_FAILURE);
    1768         }
    1769 
    1770         if (!object->det_id == -64) {
    1771             psFree(object);
    1772             exit(EXIT_FAILURE);
    1773         }
    1774         if (!object->iteration == -32) {
    1775             psFree(object);
    1776             exit(EXIT_FAILURE);
    1777         }
    1778         if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
    1779             psFree(object);
    1780             exit(EXIT_FAILURE);
    1781         }
    1782         if (!object->bg == 64.64) {
    1783             psFree(object);
    1784             exit(EXIT_FAILURE);
    1785         }
    1786         if (!object->bg_stdev == 64.64) {
    1787             psFree(object);
    1788             exit(EXIT_FAILURE);
    1789         }
    1790         if (!object->bg_mean_stdev == 64.64) {
    1791             psFree(object);
    1792             exit(EXIT_FAILURE);
    1793         }
    1794         if (!object->user_1 == 64.64) {
    1795             psFree(object);
    1796             exit(EXIT_FAILURE);
    1797         }
    1798         if (!object->user_2 == 64.64) {
    1799             psFree(object);
    1800             exit(EXIT_FAILURE);
    1801         }
    1802         if (!object->user_3 == 64.64) {
    1803             psFree(object);
    1804             exit(EXIT_FAILURE);
    1805         }
    1806         if (!object->user_4 == 64.64) {
    1807             psFree(object);
    1808             exit(EXIT_FAILURE);
    1809         }
    1810         if (!object->user_5 == 64.64) {
    1811             psFree(object);
    1812             exit(EXIT_FAILURE);
    1813         }
    1814         if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
    1815             psFree(object);
    1816             exit(EXIT_FAILURE);
    1817         }
    1818         if (!object->fault == -16) {
    1819             psFree(object);
    1820             exit(EXIT_FAILURE);
    1821         }
    1822 
    1823         psFree(object);
    1824     }
    1825 
    1826     {
    1827         detResidImfileRow *object;
    1828 
    1829         object = detResidImfileRowAlloc(-64, -32, -64, "a string", "a string", "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16    );
    1830 
    1831         if (!object) {
    1832             exit(EXIT_FAILURE);
    1833         }
    1834 
    1835         if (!object->det_id == -64) {
    1836             psFree(object);
    1837             exit(EXIT_FAILURE);
    1838         }
    1839         if (!object->iteration == -32) {
    1840             psFree(object);
    1841             exit(EXIT_FAILURE);
    1842         }
    1843         if (!object->exp_id == -64) {
    1844             psFree(object);
    1845             exit(EXIT_FAILURE);
    1846         }
    1847         if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
    1848             psFree(object);
    1849             exit(EXIT_FAILURE);
    1850         }
    1851         if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
    1852             psFree(object);
    1853             exit(EXIT_FAILURE);
    1854         }
    1855         if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
    1856             psFree(object);
    1857             exit(EXIT_FAILURE);
    1858         }
    1859         if (!object->bg == 64.64) {
    1860             psFree(object);
    1861             exit(EXIT_FAILURE);
    1862         }
    1863         if (!object->bg_stdev == 64.64) {
    1864             psFree(object);
    1865             exit(EXIT_FAILURE);
    1866         }
    1867         if (!object->bg_mean_stdev == 64.64) {
    1868             psFree(object);
    1869             exit(EXIT_FAILURE);
    1870         }
    1871         if (!object->bg_skewness == 64.64) {
    1872             psFree(object);
    1873             exit(EXIT_FAILURE);
    1874         }
    1875         if (!object->bg_kurtosis == 64.64) {
    1876             psFree(object);
    1877             exit(EXIT_FAILURE);
    1878         }
    1879         if (!object->bin_stdev == 64.64) {
    1880             psFree(object);
    1881             exit(EXIT_FAILURE);
    1882         }
    1883         if (!object->fringe_0 == 64.64) {
    1884             psFree(object);
    1885             exit(EXIT_FAILURE);
    1886         }
    1887         if (!object->fringe_1 == 64.64) {
    1888             psFree(object);
    1889             exit(EXIT_FAILURE);
    1890         }
    1891         if (!object->fringe_2 == 64.64) {
    1892             psFree(object);
    1893             exit(EXIT_FAILURE);
    1894         }
    1895         if (!object->fringe_resid_0 == 64.64) {
    1896             psFree(object);
    1897             exit(EXIT_FAILURE);
    1898         }
    1899         if (!object->fringe_resid_1 == 64.64) {
    1900             psFree(object);
    1901             exit(EXIT_FAILURE);
    1902         }
    1903         if (!object->fringe_resid_2 == 64.64) {
    1904             psFree(object);
    1905             exit(EXIT_FAILURE);
    1906         }
    1907         if (!object->user_1 == 64.64) {
    1908             psFree(object);
    1909             exit(EXIT_FAILURE);
    1910         }
    1911         if (!object->user_2 == 64.64) {
    1912             psFree(object);
    1913             exit(EXIT_FAILURE);
    1914         }
    1915         if (!object->user_3 == 64.64) {
    1916             psFree(object);
    1917             exit(EXIT_FAILURE);
    1918         }
    1919         if (!object->user_4 == 64.64) {
    1920             psFree(object);
    1921             exit(EXIT_FAILURE);
    1922         }
    1923         if (!object->user_5 == 64.64) {
    1924             psFree(object);
    1925             exit(EXIT_FAILURE);
    1926         }
    1927         if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
    1928             psFree(object);
    1929             exit(EXIT_FAILURE);
    1930         }
    1931         if (!object->fault == -16) {
    1932             psFree(object);
    1933             exit(EXIT_FAILURE);
    1934         }
    1935 
    1936         psFree(object);
    1937     }
    1938 
    1939     {
    1940         detResidExpRow  *object;
    1941 
    1942         object = detResidExpRowAlloc(-64, -32, -64, "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", true, -16    );
    1943 
    1944         if (!object) {
    1945             exit(EXIT_FAILURE);
    1946         }
    1947 
    1948         if (!object->det_id == -64) {
    1949             psFree(object);
    1950             exit(EXIT_FAILURE);
    1951         }
    1952         if (!object->iteration == -32) {
    1953             psFree(object);
    1954             exit(EXIT_FAILURE);
    1955         }
    1956         if (!object->exp_id == -64) {
    1957             psFree(object);
    1958             exit(EXIT_FAILURE);
    1959         }
    1960         if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
    1961             psFree(object);
    1962             exit(EXIT_FAILURE);
    1963         }
    1964         if (!object->bg == 64.64) {
    1965             psFree(object);
    1966             exit(EXIT_FAILURE);
    1967         }
    1968         if (!object->bg_stdev == 64.64) {
    1969             psFree(object);
    1970             exit(EXIT_FAILURE);
    1971         }
    1972         if (!object->bg_mean_stdev == 64.64) {
    1973             psFree(object);
    1974             exit(EXIT_FAILURE);
    1975         }
    1976         if (!object->bg_skewness == 64.64) {
    1977             psFree(object);
    1978             exit(EXIT_FAILURE);
    1979         }
    1980         if (!object->bg_kurtosis == 64.64) {
    1981             psFree(object);
    1982             exit(EXIT_FAILURE);
    1983         }
    1984         if (!object->bin_stdev == 64.64) {
    1985             psFree(object);
    1986             exit(EXIT_FAILURE);
    1987         }
    1988         if (!object->fringe_0 == 64.64) {
    1989             psFree(object);
    1990             exit(EXIT_FAILURE);
    1991         }
    1992         if (!object->fringe_1 == 64.64) {
    1993             psFree(object);
    1994             exit(EXIT_FAILURE);
    1995         }
    1996         if (!object->fringe_2 == 64.64) {
    1997             psFree(object);
    1998             exit(EXIT_FAILURE);
    1999         }
    2000         if (!object->fringe_resid_0 == 64.64) {
    2001             psFree(object);
    2002             exit(EXIT_FAILURE);
    2003         }
    2004         if (!object->fringe_resid_1 == 64.64) {
    2005             psFree(object);
    2006             exit(EXIT_FAILURE);
    2007         }
    2008         if (!object->fringe_resid_2 == 64.64) {
    2009             psFree(object);
    2010             exit(EXIT_FAILURE);
    2011         }
    2012         if (!object->user_1 == 64.64) {
    2013             psFree(object);
    2014             exit(EXIT_FAILURE);
    2015         }
    2016         if (!object->user_2 == 64.64) {
    2017             psFree(object);
    2018             exit(EXIT_FAILURE);
    2019         }
    2020         if (!object->user_3 == 64.64) {
    2021             psFree(object);
    2022             exit(EXIT_FAILURE);
    2023         }
    2024         if (!object->user_4 == 64.64) {
    2025             psFree(object);
    2026             exit(EXIT_FAILURE);
    2027         }
    2028         if (!object->user_5 == 64.64) {
    2029             psFree(object);
    2030             exit(EXIT_FAILURE);
    2031         }
    2032         if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
    2033             psFree(object);
    2034             exit(EXIT_FAILURE);
    2035         }
    2036         if (!object->accept == true) {
    2037             psFree(object);
    2038             exit(EXIT_FAILURE);
    2039         }
    2040         if (!object->fault == -16) {
    2041             psFree(object);
    2042             exit(EXIT_FAILURE);
    2043         }
    2044 
    2045         psFree(object);
    2046     }
    2047 
    2048     {
    2049         detRunSummaryRow *object;
    2050 
    2051         object = detRunSummaryRowAlloc(-64, -32, 64.64, 64.64, 64.64, true, -16    );
    2052 
    2053         if (!object) {
    2054             exit(EXIT_FAILURE);
    2055         }
    2056 
    2057         if (!object->det_id == -64) {
    2058             psFree(object);
    2059             exit(EXIT_FAILURE);
    2060         }
    2061         if (!object->iteration == -32) {
    2062             psFree(object);
    2063             exit(EXIT_FAILURE);
    2064         }
    2065         if (!object->bg == 64.64) {
    2066             psFree(object);
    2067             exit(EXIT_FAILURE);
    2068         }
    2069         if (!object->bg_stdev == 64.64) {
    2070             psFree(object);
    2071             exit(EXIT_FAILURE);
    2072         }
    2073         if (!object->bg_mean_stdev == 64.64) {
    2074             psFree(object);
    2075             exit(EXIT_FAILURE);
    2076         }
    2077         if (!object->accept == true) {
    2078             psFree(object);
    2079             exit(EXIT_FAILURE);
    2080         }
    2081         if (!object->fault == -16) {
    2082             psFree(object);
    2083             exit(EXIT_FAILURE);
    2084         }
    2085 
    2086         psFree(object);
    2087     }
    2088 
    2089     {
    2090         detRegisteredImfileRow *object;
    2091 
    2092         object = detRegisteredImfileRowAlloc(-64, -32, "a string", "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16    );
    2093 
    2094         if (!object) {
    2095             exit(EXIT_FAILURE);
    2096         }
    2097 
    2098         if (!object->det_id == -64) {
    2099             psFree(object);
    2100             exit(EXIT_FAILURE);
    2101         }
    2102         if (!object->iteration == -32) {
    2103             psFree(object);
    2104             exit(EXIT_FAILURE);
    2105         }
    2106         if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
    2107             psFree(object);
    2108             exit(EXIT_FAILURE);
    2109         }
    2110         if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
    2111             psFree(object);
    2112             exit(EXIT_FAILURE);
    2113         }
    2114         if (!object->bg == 64.64) {
    2115             psFree(object);
    2116             exit(EXIT_FAILURE);
    2117         }
    2118         if (!object->bg_stdev == 64.64) {
    2119             psFree(object);
    2120             exit(EXIT_FAILURE);
    2121         }
    2122         if (!object->bg_mean_stdev == 64.64) {
    2123             psFree(object);
    2124             exit(EXIT_FAILURE);
    2125         }
    2126         if (!object->user_1 == 64.64) {
    2127             psFree(object);
    2128             exit(EXIT_FAILURE);
    2129         }
    2130         if (!object->user_2 == 64.64) {
    2131             psFree(object);
    2132             exit(EXIT_FAILURE);
    2133         }
    2134         if (!object->user_3 == 64.64) {
    2135             psFree(object);
    2136             exit(EXIT_FAILURE);
    2137         }
    2138         if (!object->user_4 == 64.64) {
    2139             psFree(object);
    2140             exit(EXIT_FAILURE);
    2141         }
    2142         if (!object->user_5 == 64.64) {
    2143             psFree(object);
    2144             exit(EXIT_FAILURE);
    2145         }
    2146         if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
    2147             psFree(object);
    2148             exit(EXIT_FAILURE);
    2149         }
    2150         if (!object->fault == -16) {
    21512283            psFree(object);
    21522284            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/createtable.c

    r14451 r14598  
    590590    }
    591591
     592    {
     593        psDB            *dbh;
     594
     595        dbh = psDBInit("localhost", "test", NULL, "test");
     596        if (!dbh) {
     597            exit(EXIT_FAILURE);
     598        }
     599
     600        if(!magicRunCreateTable(dbh)) {
     601            exit(EXIT_FAILURE);
     602        }
     603
     604        psDBCleanup(dbh);
     605    }
     606
     607    {
     608        psDB            *dbh;
     609
     610        dbh = psDBInit("localhost", "test", NULL, "test");
     611        if (!dbh) {
     612            exit(EXIT_FAILURE);
     613        }
     614
     615        if(!magicInputSkyfileCreateTable(dbh)) {
     616            exit(EXIT_FAILURE);
     617        }
     618
     619        psDBCleanup(dbh);
     620    }
     621
     622    {
     623        psDB            *dbh;
     624
     625        dbh = psDBInit("localhost", "test", NULL, "test");
     626        if (!dbh) {
     627            exit(EXIT_FAILURE);
     628        }
     629
     630        if(!magicTreeCreateTable(dbh)) {
     631            exit(EXIT_FAILURE);
     632        }
     633
     634        psDBCleanup(dbh);
     635    }
     636
     637    {
     638        psDB            *dbh;
     639
     640        dbh = psDBInit("localhost", "test", NULL, "test");
     641        if (!dbh) {
     642            exit(EXIT_FAILURE);
     643        }
     644
     645        if(!magicNodeResultCreateTable(dbh)) {
     646            exit(EXIT_FAILURE);
     647        }
     648
     649        psDBCleanup(dbh);
     650    }
     651
     652    {
     653        psDB            *dbh;
     654
     655        dbh = psDBInit("localhost", "test", NULL, "test");
     656        if (!dbh) {
     657            exit(EXIT_FAILURE);
     658        }
     659
     660        if(!magicMaskCreateTable(dbh)) {
     661            exit(EXIT_FAILURE);
     662        }
     663
     664        psDBCleanup(dbh);
     665    }
     666
    592667    exit(EXIT_SUCCESS);
    593668}
  • trunk/ippdb/tests/dbcleanup.c

    r14451 r14598  
    5050    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detRunSummary");
    5151    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detRegisteredImfile");
     52    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicRun");
     53    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicInputSkyfile");
     54    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicTree");
     55    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicNodeResult");
     56    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicMask");
    5257
    5358    psDBCleanup(dbh);
  • trunk/ippdb/tests/dbsetup.c

    r14451 r14598  
    130130    detRegisteredImfileCreateTable(dbh);
    131131
     132    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicRun");
     133    magicRunCreateTable(dbh);
     134
     135    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicInputSkyfile");
     136    magicInputSkyfileCreateTable(dbh);
     137
     138    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicTree");
     139    magicTreeCreateTable(dbh);
     140
     141    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicNodeResult");
     142    magicNodeResultCreateTable(dbh);
     143
     144    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicMask");
     145    magicMaskCreateTable(dbh);
     146
    132147    psDBCleanup(dbh);
    133148
  • trunk/ippdb/tests/droptable.c

    r14451 r14598  
    590590    }
    591591
     592    {
     593        psDB            *dbh;
     594
     595        dbh = psDBInit("localhost", "test", NULL, "test");
     596        if (!dbh) {
     597            exit(EXIT_FAILURE);
     598        }
     599
     600        if (!magicRunDropTable(dbh)) {
     601            exit(EXIT_FAILURE);
     602        }
     603
     604        psDBCleanup(dbh);
     605    }
     606
     607    {
     608        psDB            *dbh;
     609
     610        dbh = psDBInit("localhost", "test", NULL, "test");
     611        if (!dbh) {
     612            exit(EXIT_FAILURE);
     613        }
     614
     615        if (!magicInputSkyfileDropTable(dbh)) {
     616            exit(EXIT_FAILURE);
     617        }
     618
     619        psDBCleanup(dbh);
     620    }
     621
     622    {
     623        psDB            *dbh;
     624
     625        dbh = psDBInit("localhost", "test", NULL, "test");
     626        if (!dbh) {
     627            exit(EXIT_FAILURE);
     628        }
     629
     630        if (!magicTreeDropTable(dbh)) {
     631            exit(EXIT_FAILURE);
     632        }
     633
     634        psDBCleanup(dbh);
     635    }
     636
     637    {
     638        psDB            *dbh;
     639
     640        dbh = psDBInit("localhost", "test", NULL, "test");
     641        if (!dbh) {
     642            exit(EXIT_FAILURE);
     643        }
     644
     645        if (!magicNodeResultDropTable(dbh)) {
     646            exit(EXIT_FAILURE);
     647        }
     648
     649        psDBCleanup(dbh);
     650    }
     651
     652    {
     653        psDB            *dbh;
     654
     655        dbh = psDBInit("localhost", "test", NULL, "test");
     656        if (!dbh) {
     657            exit(EXIT_FAILURE);
     658        }
     659
     660        if (!magicMaskDropTable(dbh)) {
     661            exit(EXIT_FAILURE);
     662        }
     663
     664        psDBCleanup(dbh);
     665    }
     666
    592667    exit(EXIT_SUCCESS);
    593668}
  • trunk/ippdb/tests/insert.c

    r14451 r14598  
    5858        }
    5959
    60         if (!pzPendingImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", -64)) {
     60        if (!pzPendingImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string")) {
    6161            exit(EXIT_FAILURE);
    6262        }
     
    8888        }
    8989
    90         if (!pzDoneImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", -64, "a string")) {
     90        if (!pzDoneImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", "a string")) {
    9191            exit(EXIT_FAILURE);
    9292        }
     
    313313        }
    314314
    315         if (!warpSkyfileInsert(dbh, -64, "a string", "a string", "a string", "a string", 64.64, 64.64, -16)) {
     315        if (!warpSkyfileInsert(dbh, -64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, -16)) {
    316316            exit(EXIT_FAILURE);
    317317        }
     
    584584
    585585        if (!detRegisteredImfileInsert(dbh, -64, -32, "a string", "a string", 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16)) {
     586            exit(EXIT_FAILURE);
     587        }
     588
     589        psDBCleanup(dbh);
     590    }
     591
     592    {
     593        psDB            *dbh;
     594
     595        dbh = psDBInit("localhost", "test", NULL, "test");
     596        if (!dbh) {
     597            exit(EXIT_FAILURE);
     598        }
     599
     600        if (!magicRunInsert(dbh, -64, "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z")) {
     601            exit(EXIT_FAILURE);
     602        }
     603
     604        psDBCleanup(dbh);
     605    }
     606
     607    {
     608        psDB            *dbh;
     609
     610        dbh = psDBInit("localhost", "test", NULL, "test");
     611        if (!dbh) {
     612            exit(EXIT_FAILURE);
     613        }
     614
     615        if (!magicInputSkyfileInsert(dbh, -64, -64, -32)) {
     616            exit(EXIT_FAILURE);
     617        }
     618
     619        psDBCleanup(dbh);
     620    }
     621
     622    {
     623        psDB            *dbh;
     624
     625        dbh = psDBInit("localhost", "test", NULL, "test");
     626        if (!dbh) {
     627            exit(EXIT_FAILURE);
     628        }
     629
     630        if (!magicTreeInsert(dbh, -64, "a string", "a string")) {
     631            exit(EXIT_FAILURE);
     632        }
     633
     634        psDBCleanup(dbh);
     635    }
     636
     637    {
     638        psDB            *dbh;
     639
     640        dbh = psDBInit("localhost", "test", NULL, "test");
     641        if (!dbh) {
     642            exit(EXIT_FAILURE);
     643        }
     644
     645        if (!magicNodeResultInsert(dbh, -64, "a string", "a string")) {
     646            exit(EXIT_FAILURE);
     647        }
     648
     649        psDBCleanup(dbh);
     650    }
     651
     652    {
     653        psDB            *dbh;
     654
     655        dbh = psDBInit("localhost", "test", NULL, "test");
     656        if (!dbh) {
     657            exit(EXIT_FAILURE);
     658        }
     659
     660        if (!magicMaskInsert(dbh, -64, "a string")) {
    586661            exit(EXIT_FAILURE);
    587662        }
  • trunk/ippdb/tests/insertfits.c

    r14451 r14598  
    10231023    }
    10241024
     1025    {
     1026        psDB            *dbh;
     1027        psFits          *fits;
     1028
     1029        dbh = psDBInit("localhost", "test", NULL, "test");
     1030        if (!dbh) {
     1031            exit(EXIT_FAILURE);
     1032        }
     1033
     1034        // open a temp
     1035        fits = psFitsOpen(TMP_FILENAME, "r");
     1036        if (!fits) {
     1037            exit(EXIT_FAILURE);
     1038        }
     1039
     1040        if (!magicRunInsertFits(dbh, fits)) {
     1041            exit(EXIT_FAILURE);
     1042        }
     1043
     1044        if (!psFitsClose(fits)) {
     1045            exit(EXIT_FAILURE);
     1046        }
     1047
     1048        psDBCleanup(dbh);
     1049    }
     1050
     1051    {
     1052        psDB            *dbh;
     1053        psFits          *fits;
     1054
     1055        dbh = psDBInit("localhost", "test", NULL, "test");
     1056        if (!dbh) {
     1057            exit(EXIT_FAILURE);
     1058        }
     1059
     1060        // open a temp
     1061        fits = psFitsOpen(TMP_FILENAME, "r");
     1062        if (!fits) {
     1063            exit(EXIT_FAILURE);
     1064        }
     1065
     1066        if (!magicInputSkyfileInsertFits(dbh, fits)) {
     1067            exit(EXIT_FAILURE);
     1068        }
     1069
     1070        if (!psFitsClose(fits)) {
     1071            exit(EXIT_FAILURE);
     1072        }
     1073
     1074        psDBCleanup(dbh);
     1075    }
     1076
     1077    {
     1078        psDB            *dbh;
     1079        psFits          *fits;
     1080
     1081        dbh = psDBInit("localhost", "test", NULL, "test");
     1082        if (!dbh) {
     1083            exit(EXIT_FAILURE);
     1084        }
     1085
     1086        // open a temp
     1087        fits = psFitsOpen(TMP_FILENAME, "r");
     1088        if (!fits) {
     1089            exit(EXIT_FAILURE);
     1090        }
     1091
     1092        if (!magicTreeInsertFits(dbh, fits)) {
     1093            exit(EXIT_FAILURE);
     1094        }
     1095
     1096        if (!psFitsClose(fits)) {
     1097            exit(EXIT_FAILURE);
     1098        }
     1099
     1100        psDBCleanup(dbh);
     1101    }
     1102
     1103    {
     1104        psDB            *dbh;
     1105        psFits          *fits;
     1106
     1107        dbh = psDBInit("localhost", "test", NULL, "test");
     1108        if (!dbh) {
     1109            exit(EXIT_FAILURE);
     1110        }
     1111
     1112        // open a temp
     1113        fits = psFitsOpen(TMP_FILENAME, "r");
     1114        if (!fits) {
     1115            exit(EXIT_FAILURE);
     1116        }
     1117
     1118        if (!magicNodeResultInsertFits(dbh, fits)) {
     1119            exit(EXIT_FAILURE);
     1120        }
     1121
     1122        if (!psFitsClose(fits)) {
     1123            exit(EXIT_FAILURE);
     1124        }
     1125
     1126        psDBCleanup(dbh);
     1127    }
     1128
     1129    {
     1130        psDB            *dbh;
     1131        psFits          *fits;
     1132
     1133        dbh = psDBInit("localhost", "test", NULL, "test");
     1134        if (!dbh) {
     1135            exit(EXIT_FAILURE);
     1136        }
     1137
     1138        // open a temp
     1139        fits = psFitsOpen(TMP_FILENAME, "r");
     1140        if (!fits) {
     1141            exit(EXIT_FAILURE);
     1142        }
     1143
     1144        if (!magicMaskInsertFits(dbh, fits)) {
     1145            exit(EXIT_FAILURE);
     1146        }
     1147
     1148        if (!psFitsClose(fits)) {
     1149            exit(EXIT_FAILURE);
     1150        }
     1151
     1152        psDBCleanup(dbh);
     1153    }
     1154
    10251155    exit(EXIT_SUCCESS);
    10261156}
  • trunk/ippdb/tests/insertobject.c

    r14451 r14598  
    8080        }
    8181
    82         object = pzPendingImfileRowAlloc("a string", "a string", "a string", "a string", "a string", -64);
     82        object = pzPendingImfileRowAlloc("a string", "a string", "a string", "a string", "a string");
    8383        if (!object) {
    8484            exit(EXIT_FAILURE);
     
    124124        }
    125125
    126         object = pzDoneImfileRowAlloc("a string", "a string", "a string", "a string", "a string", -64, "a string");
     126        object = pzDoneImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string");
    127127        if (!object) {
    128128            exit(EXIT_FAILURE);
     
    454454        }
    455455
    456         object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, -16);
     456        object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, -16);
    457457        if (!object) {
    458458            exit(EXIT_FAILURE);
     
    856856
    857857        if (!detRegisteredImfileInsertObject(dbh, object)) {
     858            exit(EXIT_FAILURE);
     859        }
     860
     861        psFree(object);
     862        psDBCleanup(dbh);
     863    }
     864
     865    {
     866        psDB            *dbh;
     867        magicRunRow     *object;
     868
     869        dbh = psDBInit("localhost", "test", NULL, "test");
     870        if (!dbh) {
     871            exit(EXIT_FAILURE);
     872        }
     873
     874        object = magicRunRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z");
     875        if (!object) {
     876            exit(EXIT_FAILURE);
     877        }
     878
     879        if (!magicRunInsertObject(dbh, object)) {
     880            exit(EXIT_FAILURE);
     881        }
     882
     883        psFree(object);
     884        psDBCleanup(dbh);
     885    }
     886
     887    {
     888        psDB            *dbh;
     889        magicInputSkyfileRow *object;
     890
     891        dbh = psDBInit("localhost", "test", NULL, "test");
     892        if (!dbh) {
     893            exit(EXIT_FAILURE);
     894        }
     895
     896        object = magicInputSkyfileRowAlloc(-64, -64, -32);
     897        if (!object) {
     898            exit(EXIT_FAILURE);
     899        }
     900
     901        if (!magicInputSkyfileInsertObject(dbh, object)) {
     902            exit(EXIT_FAILURE);
     903        }
     904
     905        psFree(object);
     906        psDBCleanup(dbh);
     907    }
     908
     909    {
     910        psDB            *dbh;
     911        magicTreeRow    *object;
     912
     913        dbh = psDBInit("localhost", "test", NULL, "test");
     914        if (!dbh) {
     915            exit(EXIT_FAILURE);
     916        }
     917
     918        object = magicTreeRowAlloc(-64, "a string", "a string");
     919        if (!object) {
     920            exit(EXIT_FAILURE);
     921        }
     922
     923        if (!magicTreeInsertObject(dbh, object)) {
     924            exit(EXIT_FAILURE);
     925        }
     926
     927        psFree(object);
     928        psDBCleanup(dbh);
     929    }
     930
     931    {
     932        psDB            *dbh;
     933        magicNodeResultRow *object;
     934
     935        dbh = psDBInit("localhost", "test", NULL, "test");
     936        if (!dbh) {
     937            exit(EXIT_FAILURE);
     938        }
     939
     940        object = magicNodeResultRowAlloc(-64, "a string", "a string");
     941        if (!object) {
     942            exit(EXIT_FAILURE);
     943        }
     944
     945        if (!magicNodeResultInsertObject(dbh, object)) {
     946            exit(EXIT_FAILURE);
     947        }
     948
     949        psFree(object);
     950        psDBCleanup(dbh);
     951    }
     952
     953    {
     954        psDB            *dbh;
     955        magicMaskRow    *object;
     956
     957        dbh = psDBInit("localhost", "test", NULL, "test");
     958        if (!dbh) {
     959            exit(EXIT_FAILURE);
     960        }
     961
     962        object = magicMaskRowAlloc(-64, "a string");
     963        if (!object) {
     964            exit(EXIT_FAILURE);
     965        }
     966
     967        if (!magicMaskInsertObject(dbh, object)) {
    858968            exit(EXIT_FAILURE);
    859969        }
  • trunk/ippdb/tests/metadatafromobject.c

    r14451 r14598  
    151151        bool            status;
    152152
    153         object = pzPendingImfileRowAlloc("a string", "a string", "a string", "a string", "a string", -64);
     153        object = pzPendingImfileRowAlloc("a string", "a string", "a string", "a string", "a string");
    154154        if (!object) {
    155155            exit(EXIT_FAILURE);
     
    183183            exit(EXIT_FAILURE);
    184184        }
    185             psFree(md);
    186             exit(EXIT_FAILURE);
    187         }
    188185
    189186        psFree(md);
     
    228225        bool            status;
    229226
    230         object = pzDoneImfileRowAlloc("a string", "a string", "a string", "a string", "a string", -64, "a string");
     227        object = pzDoneImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string");
    231228        if (!object) {
    232229            exit(EXIT_FAILURE);
     
    260257            exit(EXIT_FAILURE);
    261258        }
    262             psFree(md);
    263             exit(EXIT_FAILURE);
    264         }
    265259        if (strncmp(psMetadataLookupPtr(&status, md, "uri"), "a string", MAX_STRING_LENGTH)) {
    266260            psFree(md);
     
    11511145        bool            status;
    11521146
    1153         object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, -16);
     1147        object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, -16);
    11541148        if (!object) {
    11551149            exit(EXIT_FAILURE);
     
    11901184            exit(EXIT_FAILURE);
    11911185        }
     1186        if (!psMetadataLookupF64(&status, md, "pixel_fill") == 64.64) {
     1187            psFree(md);
     1188            exit(EXIT_FAILURE);
     1189        }
    11921190            psFree(md);
    11931191            exit(EXIT_FAILURE);
     
    23952393            exit(EXIT_FAILURE);
    23962394        }
     2395            psFree(md);
     2396            exit(EXIT_FAILURE);
     2397        }
     2398
     2399        psFree(md);
     2400    }
     2401
     2402    {
     2403        psMetadata      *md;
     2404        magicRunRow     *object;
     2405        bool            status;
     2406
     2407        object = magicRunRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z");
     2408        if (!object) {
     2409            exit(EXIT_FAILURE);
     2410        }
     2411
     2412        md = magicRunMetadataFromObject(object);
     2413        if (!md) {
     2414            exit(EXIT_FAILURE);
     2415        }
     2416
     2417        psFree(object);
     2418
     2419            psFree(md);
     2420            exit(EXIT_FAILURE);
     2421        }
     2422        if (strncmp(psMetadataLookupPtr(&status, md, "state"), "a string", MAX_STRING_LENGTH)) {
     2423            psFree(md);
     2424            exit(EXIT_FAILURE);
     2425        }
     2426        if (strncmp(psMetadataLookupPtr(&status, md, "workdir"), "a string", MAX_STRING_LENGTH)) {
     2427            psFree(md);
     2428            exit(EXIT_FAILURE);
     2429        }
     2430        if (strncmp(psMetadataLookupPtr(&status, md, "workdir_state"), "a string", MAX_STRING_LENGTH)) {
     2431            psFree(md);
     2432            exit(EXIT_FAILURE);
     2433        }
     2434        if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) {
     2435            psFree(md);
     2436            exit(EXIT_FAILURE);
     2437        }
     2438        if (strncmp(psMetadataLookupPtr(&status, md, "dvodb"), "a string", MAX_STRING_LENGTH)) {
     2439            psFree(md);
     2440            exit(EXIT_FAILURE);
     2441        }
     2442            psFree(md);
     2443            exit(EXIT_FAILURE);
     2444        }
     2445
     2446        psFree(md);
     2447    }
     2448
     2449    {
     2450        psMetadata      *md;
     2451        magicInputSkyfileRow *object;
     2452        bool            status;
     2453
     2454        object = magicInputSkyfileRowAlloc(-64, -64, -32);
     2455        if (!object) {
     2456            exit(EXIT_FAILURE);
     2457        }
     2458
     2459        md = magicInputSkyfileMetadataFromObject(object);
     2460        if (!md) {
     2461            exit(EXIT_FAILURE);
     2462        }
     2463
     2464        psFree(object);
     2465
     2466            psFree(md);
     2467            exit(EXIT_FAILURE);
     2468        }
     2469            psFree(md);
     2470            exit(EXIT_FAILURE);
     2471        }
     2472        if (!psMetadataLookupS32(&status, md, "node") == -32) {
     2473            psFree(md);
     2474            exit(EXIT_FAILURE);
     2475        }
     2476
     2477        psFree(md);
     2478    }
     2479
     2480    {
     2481        psMetadata      *md;
     2482        magicTreeRow    *object;
     2483        bool            status;
     2484
     2485        object = magicTreeRowAlloc(-64, "a string", "a string");
     2486        if (!object) {
     2487            exit(EXIT_FAILURE);
     2488        }
     2489
     2490        md = magicTreeMetadataFromObject(object);
     2491        if (!md) {
     2492            exit(EXIT_FAILURE);
     2493        }
     2494
     2495        psFree(object);
     2496
     2497            psFree(md);
     2498            exit(EXIT_FAILURE);
     2499        }
     2500        if (strncmp(psMetadataLookupPtr(&status, md, "node"), "a string", MAX_STRING_LENGTH)) {
     2501            psFree(md);
     2502            exit(EXIT_FAILURE);
     2503        }
     2504        if (strncmp(psMetadataLookupPtr(&status, md, "dep"), "a string", MAX_STRING_LENGTH)) {
     2505            psFree(md);
     2506            exit(EXIT_FAILURE);
     2507        }
     2508
     2509        psFree(md);
     2510    }
     2511
     2512    {
     2513        psMetadata      *md;
     2514        magicNodeResultRow *object;
     2515        bool            status;
     2516
     2517        object = magicNodeResultRowAlloc(-64, "a string", "a string");
     2518        if (!object) {
     2519            exit(EXIT_FAILURE);
     2520        }
     2521
     2522        md = magicNodeResultMetadataFromObject(object);
     2523        if (!md) {
     2524            exit(EXIT_FAILURE);
     2525        }
     2526
     2527        psFree(object);
     2528
     2529            psFree(md);
     2530            exit(EXIT_FAILURE);
     2531        }
     2532        if (strncmp(psMetadataLookupPtr(&status, md, "node"), "a string", MAX_STRING_LENGTH)) {
     2533            psFree(md);
     2534            exit(EXIT_FAILURE);
     2535        }
     2536        if (strncmp(psMetadataLookupPtr(&status, md, "uri"), "a string", MAX_STRING_LENGTH)) {
     2537            psFree(md);
     2538            exit(EXIT_FAILURE);
     2539        }
     2540
     2541        psFree(md);
     2542    }
     2543
     2544    {
     2545        psMetadata      *md;
     2546        magicMaskRow    *object;
     2547        bool            status;
     2548
     2549        object = magicMaskRowAlloc(-64, "a string");
     2550        if (!object) {
     2551            exit(EXIT_FAILURE);
     2552        }
     2553
     2554        md = magicMaskMetadataFromObject(object);
     2555        if (!md) {
     2556            exit(EXIT_FAILURE);
     2557        }
     2558
     2559        psFree(object);
     2560
     2561            psFree(md);
     2562            exit(EXIT_FAILURE);
     2563        }
     2564        if (strncmp(psMetadataLookupPtr(&status, md, "uri"), "a string", MAX_STRING_LENGTH)) {
    23972565            psFree(md);
    23982566            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r14451 r14598  
    237237            exit(EXIT_FAILURE);
    238238        }
    239             psFree(md);
    240             exit(EXIT_FAILURE);
    241         }
    242239
    243240        object = pzPendingImfileObjectFromMetadata(md);
     
    269266            exit(EXIT_FAILURE);
    270267        }
    271             psFree(object);
    272             exit(EXIT_FAILURE);
    273         }
    274268
    275269        psFree(object);
     
    343337            exit(EXIT_FAILURE);
    344338        }
    345             psFree(md);
    346             exit(EXIT_FAILURE);
    347         }
    348339        if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
    349340            psFree(md);
     
    379370            exit(EXIT_FAILURE);
    380371        }
    381             psFree(object);
    382             exit(EXIT_FAILURE);
    383         }
    384372        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
    385373            psFree(object);
     
    18361824            exit(EXIT_FAILURE);
    18371825        }
     1826        if (!psMetadataAddF64(md, PS_LIST_TAIL, "pixel_fill", 0, NULL, 64.64)) {
     1827            psFree(md);
     1828            exit(EXIT_FAILURE);
     1829        }
    18381830            psFree(md);
    18391831            exit(EXIT_FAILURE);
     
    18751867            exit(EXIT_FAILURE);
    18761868        }
     1869        if (!object->pixel_fill == 64.64) {
     1870            psFree(object);
     1871            exit(EXIT_FAILURE);
     1872        }
    18771873            psFree(object);
    18781874            exit(EXIT_FAILURE);
     
    38533849            exit(EXIT_FAILURE);
    38543850        }
     3851            psFree(object);
     3852            exit(EXIT_FAILURE);
     3853        }
     3854
     3855        psFree(object);
     3856    }
     3857
     3858    {
     3859        psMetadata      *md;
     3860        magicRunRow     *object;
     3861
     3862        md = psMetadataAlloc();
     3863            psFree(md);
     3864            exit(EXIT_FAILURE);
     3865        }
     3866        if (!psMetadataAddStr(md, PS_LIST_TAIL, "state", 0, NULL, "a string")) {
     3867            psFree(md);
     3868            exit(EXIT_FAILURE);
     3869        }
     3870        if (!psMetadataAddStr(md, PS_LIST_TAIL, "workdir", 0, NULL, "a string")) {
     3871            psFree(md);
     3872            exit(EXIT_FAILURE);
     3873        }
     3874        if (!psMetadataAddStr(md, PS_LIST_TAIL, "workdir_state", 0, NULL, "a string")) {
     3875            psFree(md);
     3876            exit(EXIT_FAILURE);
     3877        }
     3878        if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) {
     3879            psFree(md);
     3880            exit(EXIT_FAILURE);
     3881        }
     3882        if (!psMetadataAddStr(md, PS_LIST_TAIL, "dvodb", 0, NULL, "a string")) {
     3883            psFree(md);
     3884            exit(EXIT_FAILURE);
     3885        }
     3886            psFree(md);
     3887            exit(EXIT_FAILURE);
     3888        }
     3889
     3890        object = magicRunObjectFromMetadata(md);
     3891        if (!object) {
     3892            psFree(md);
     3893            exit(EXIT_FAILURE);
     3894        }
     3895
     3896        psFree(md);
     3897
     3898            psFree(object);
     3899            exit(EXIT_FAILURE);
     3900        }
     3901        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
     3902            psFree(object);
     3903            exit(EXIT_FAILURE);
     3904        }
     3905        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
     3906            psFree(object);
     3907            exit(EXIT_FAILURE);
     3908        }
     3909        if (strncmp(object->workdir_state, "a string", MAX_STRING_LENGTH)) {
     3910            psFree(object);
     3911            exit(EXIT_FAILURE);
     3912        }
     3913        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
     3914            psFree(object);
     3915            exit(EXIT_FAILURE);
     3916        }
     3917        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
     3918            psFree(object);
     3919            exit(EXIT_FAILURE);
     3920        }
     3921            psFree(object);
     3922            exit(EXIT_FAILURE);
     3923        }
     3924
     3925        psFree(object);
     3926    }
     3927
     3928    {
     3929        psMetadata      *md;
     3930        magicInputSkyfileRow *object;
     3931
     3932        md = psMetadataAlloc();
     3933            psFree(md);
     3934            exit(EXIT_FAILURE);
     3935        }
     3936            psFree(md);
     3937            exit(EXIT_FAILURE);
     3938        }
     3939        if (!psMetadataAddS32(md, PS_LIST_TAIL, "node", 0, NULL, -32)) {
     3940            psFree(md);
     3941            exit(EXIT_FAILURE);
     3942        }
     3943
     3944        object = magicInputSkyfileObjectFromMetadata(md);
     3945        if (!object) {
     3946            psFree(md);
     3947            exit(EXIT_FAILURE);
     3948        }
     3949
     3950        psFree(md);
     3951
     3952            psFree(object);
     3953            exit(EXIT_FAILURE);
     3954        }
     3955            psFree(object);
     3956            exit(EXIT_FAILURE);
     3957        }
     3958        if (!object->node == -32) {
     3959            psFree(object);
     3960            exit(EXIT_FAILURE);
     3961        }
     3962
     3963        psFree(object);
     3964    }
     3965
     3966    {
     3967        psMetadata      *md;
     3968        magicTreeRow    *object;
     3969
     3970        md = psMetadataAlloc();
     3971            psFree(md);
     3972            exit(EXIT_FAILURE);
     3973        }
     3974        if (!psMetadataAddStr(md, PS_LIST_TAIL, "node", 0, NULL, "a string")) {
     3975            psFree(md);
     3976            exit(EXIT_FAILURE);
     3977        }
     3978        if (!psMetadataAddStr(md, PS_LIST_TAIL, "dep", 0, NULL, "a string")) {
     3979            psFree(md);
     3980            exit(EXIT_FAILURE);
     3981        }
     3982
     3983        object = magicTreeObjectFromMetadata(md);
     3984        if (!object) {
     3985            psFree(md);
     3986            exit(EXIT_FAILURE);
     3987        }
     3988
     3989        psFree(md);
     3990
     3991            psFree(object);
     3992            exit(EXIT_FAILURE);
     3993        }
     3994        if (strncmp(object->node, "a string", MAX_STRING_LENGTH)) {
     3995            psFree(object);
     3996            exit(EXIT_FAILURE);
     3997        }
     3998        if (strncmp(object->dep, "a string", MAX_STRING_LENGTH)) {
     3999            psFree(object);
     4000            exit(EXIT_FAILURE);
     4001        }
     4002
     4003        psFree(object);
     4004    }
     4005
     4006    {
     4007        psMetadata      *md;
     4008        magicNodeResultRow *object;
     4009
     4010        md = psMetadataAlloc();
     4011            psFree(md);
     4012            exit(EXIT_FAILURE);
     4013        }
     4014        if (!psMetadataAddStr(md, PS_LIST_TAIL, "node", 0, NULL, "a string")) {
     4015            psFree(md);
     4016            exit(EXIT_FAILURE);
     4017        }
     4018        if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
     4019            psFree(md);
     4020            exit(EXIT_FAILURE);
     4021        }
     4022
     4023        object = magicNodeResultObjectFromMetadata(md);
     4024        if (!object) {
     4025            psFree(md);
     4026            exit(EXIT_FAILURE);
     4027        }
     4028
     4029        psFree(md);
     4030
     4031            psFree(object);
     4032            exit(EXIT_FAILURE);
     4033        }
     4034        if (strncmp(object->node, "a string", MAX_STRING_LENGTH)) {
     4035            psFree(object);
     4036            exit(EXIT_FAILURE);
     4037        }
     4038        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     4039            psFree(object);
     4040            exit(EXIT_FAILURE);
     4041        }
     4042
     4043        psFree(object);
     4044    }
     4045
     4046    {
     4047        psMetadata      *md;
     4048        magicMaskRow    *object;
     4049
     4050        md = psMetadataAlloc();
     4051            psFree(md);
     4052            exit(EXIT_FAILURE);
     4053        }
     4054        if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
     4055            psFree(md);
     4056            exit(EXIT_FAILURE);
     4057        }
     4058
     4059        object = magicMaskObjectFromMetadata(md);
     4060        if (!object) {
     4061            psFree(md);
     4062            exit(EXIT_FAILURE);
     4063        }
     4064
     4065        psFree(md);
     4066
     4067            psFree(object);
     4068            exit(EXIT_FAILURE);
     4069        }
     4070        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
    38554071            psFree(object);
    38564072            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/selectrowsfits.c

    r14451 r14598  
    865865    }
    866866
     867    {
     868        psDB            *dbh;
     869        psFits          *fits;
     870
     871        dbh = psDBInit("localhost", "test", NULL, "test");
     872        if (!dbh) {
     873            exit(EXIT_FAILURE);
     874        }
     875
     876        fits = psFitsOpen(TMP_FILENAME, "w");
     877        if (!fits) {
     878            exit(EXIT_FAILURE);
     879        }
     880
     881        if (!magicRunSelectRowsFits(dbh, fits, NULL, 1)) {
     882            exit(EXIT_FAILURE);
     883        }
     884
     885        psFree(fits);
     886        psDBCleanup(dbh);
     887    }
     888
     889    {
     890        psDB            *dbh;
     891        psFits          *fits;
     892
     893        dbh = psDBInit("localhost", "test", NULL, "test");
     894        if (!dbh) {
     895            exit(EXIT_FAILURE);
     896        }
     897
     898        fits = psFitsOpen(TMP_FILENAME, "w");
     899        if (!fits) {
     900            exit(EXIT_FAILURE);
     901        }
     902
     903        if (!magicInputSkyfileSelectRowsFits(dbh, fits, NULL, 1)) {
     904            exit(EXIT_FAILURE);
     905        }
     906
     907        psFree(fits);
     908        psDBCleanup(dbh);
     909    }
     910
     911    {
     912        psDB            *dbh;
     913        psFits          *fits;
     914
     915        dbh = psDBInit("localhost", "test", NULL, "test");
     916        if (!dbh) {
     917            exit(EXIT_FAILURE);
     918        }
     919
     920        fits = psFitsOpen(TMP_FILENAME, "w");
     921        if (!fits) {
     922            exit(EXIT_FAILURE);
     923        }
     924
     925        if (!magicTreeSelectRowsFits(dbh, fits, NULL, 1)) {
     926            exit(EXIT_FAILURE);
     927        }
     928
     929        psFree(fits);
     930        psDBCleanup(dbh);
     931    }
     932
     933    {
     934        psDB            *dbh;
     935        psFits          *fits;
     936
     937        dbh = psDBInit("localhost", "test", NULL, "test");
     938        if (!dbh) {
     939            exit(EXIT_FAILURE);
     940        }
     941
     942        fits = psFitsOpen(TMP_FILENAME, "w");
     943        if (!fits) {
     944            exit(EXIT_FAILURE);
     945        }
     946
     947        if (!magicNodeResultSelectRowsFits(dbh, fits, NULL, 1)) {
     948            exit(EXIT_FAILURE);
     949        }
     950
     951        psFree(fits);
     952        psDBCleanup(dbh);
     953    }
     954
     955    {
     956        psDB            *dbh;
     957        psFits          *fits;
     958
     959        dbh = psDBInit("localhost", "test", NULL, "test");
     960        if (!dbh) {
     961            exit(EXIT_FAILURE);
     962        }
     963
     964        fits = psFitsOpen(TMP_FILENAME, "w");
     965        if (!fits) {
     966            exit(EXIT_FAILURE);
     967        }
     968
     969        if (!magicMaskSelectRowsFits(dbh, fits, NULL, 1)) {
     970            exit(EXIT_FAILURE);
     971        }
     972
     973        psFree(fits);
     974        psDBCleanup(dbh);
     975    }
     976
    867977    exit(EXIT_SUCCESS);
    868978}
Note: See TracChangeset for help on using the changeset viewer.