Index: /trunk/dbconfig/config.md
===================================================================
--- /trunk/dbconfig/config.md	(revision 14597)
+++ /trunk/dbconfig/config.md	(revision 14598)
@@ -2,4 +2,4 @@
     pkg_name        STR     ippdb
     pkg_namespace   STR     ippdb
-    pkg_version     STR     1.1.26
+    pkg_version     STR     1.1.27
 END
Index: /trunk/ippdb/Makefile.am
===================================================================
--- /trunk/ippdb/Makefile.am	(revision 14597)
+++ /trunk/ippdb/Makefile.am	(revision 14598)
@@ -48,8 +48,13 @@
     $(top_builddir)/docs/man/man3/detResidExpRow.3 \
     $(top_builddir)/docs/man/man3/detRunSummaryRow.3 \
-    $(top_builddir)/docs/man/man3/detRegisteredImfileRow.3 
+    $(top_builddir)/docs/man/man3/detRegisteredImfileRow.3 \
+    $(top_builddir)/docs/man/man3/magicRunRow.3 \
+    $(top_builddir)/docs/man/man3/magicInputSkyfileRow.3 \
+    $(top_builddir)/docs/man/man3/magicTreeRow.3 \
+    $(top_builddir)/docs/man/man3/magicNodeResultRow.3 \
+    $(top_builddir)/docs/man/man3/magicMaskRow.3 
 
 
-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:
+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 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:
 	$(DOXYGEN)
 
Index: /trunk/ippdb/configure.ac
===================================================================
--- /trunk/ippdb/configure.ac	(revision 14597)
+++ /trunk/ippdb/configure.ac	(revision 14598)
@@ -1,4 +1,4 @@
 dnl
-dnl This file was generated by glueforge 1.03
+dnl This file was generated by glueforge 1.01
 dnl
 dnl Do NOT directly edit this file.
@@ -7,5 +7,5 @@
 AC_PREREQ(2.61)
 
-AC_INIT([ippdb], [1.1.26], [pan-starrs.ifa.hawaii.edu])
+AC_INIT([ippdb], [1.1.27], [pan-starrs.ifa.hawaii.edu])
 AC_CONFIG_SRCDIR([ippdb.pc.in])
 
Index: /trunk/ippdb/src/ippdb.c
===================================================================
--- /trunk/ippdb/src/ippdb.c	(revision 14597)
+++ /trunk/ippdb/src/ippdb.c	(revision 14598)
@@ -20,5 +20,5 @@
 /*
  *
- * This file was generated by glueforge 1.03
+ * This file was generated by glueforge 1.01
  *
  * Do NOT directly edit this file.
@@ -70,4 +70,9 @@
 #define DETRUNSUMMARY_TABLE_NAME "detRunSummary"
 #define DETREGISTEREDIMFILE_TABLE_NAME "detRegisteredImfile"
+#define MAGICRUN_TABLE_NAME "magicRun"
+#define MAGICINPUTSKYFILE_TABLE_NAME "magicInputSkyfile"
+#define MAGICTREE_TABLE_NAME "magicTree"
+#define MAGICNODERESULT_TABLE_NAME "magicNodeResult"
+#define MAGICMASK_TABLE_NAME "magicMask"
 #define MAX_STRING_LENGTH 1024
 
@@ -1420,5 +1425,5 @@
 static void pzPendingImfileRowFree(pzPendingImfileRow *object);
 
-pzPendingImfileRow *pzPendingImfileRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, psS64 exp_id)
+pzPendingImfileRow *pzPendingImfileRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id)
 {
     pzPendingImfileRow *_object;
@@ -1432,5 +1437,4 @@
     _object->class = psStringCopy(class);
     _object->class_id = psStringCopy(class_id);
-    _object->exp_id = exp_id;
 
     return _object;
@@ -1474,9 +1478,4 @@
         return false;
     }
-    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, "Unique Key", 64)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
-        psFree(md);
-        return false;
-    }
 
     bool status = psDBCreateTable(dbh, PZPENDINGIMFILE_TABLE_NAME, md);
@@ -1492,5 +1491,5 @@
 }
 
-bool pzPendingImfileInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, psS64 exp_id)
+bool pzPendingImfileInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id)
 {
     psMetadata *md = psMetadataAlloc();
@@ -1517,9 +1516,4 @@
     if (!psMetadataAdd(md, PS_LIST_TAIL, "class_id", PS_DATA_STRING, NULL, class_id)) {
         psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
-        psFree(md);
-        return false;
-    }
-    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, NULL, exp_id)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
         psFree(md);
         return false;
@@ -1548,5 +1542,5 @@
 bool pzPendingImfileInsertObject(psDB *dbh, pzPendingImfileRow *object)
 {
-    return pzPendingImfileInsert(dbh, object->exp_name, object->camera, object->telescope, object->class, object->class_id, object->exp_id);
+    return pzPendingImfileInsert(dbh, object->exp_name, object->camera, object->telescope, object->class, object->class_id);
 }
 
@@ -1646,9 +1640,4 @@
         return false;
     }
-    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, NULL, object->exp_id)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
-        psFree(md);
-        return false;
-    }
 
 
@@ -1685,11 +1674,6 @@
         return false;
     }
-    psS64 exp_id = psMetadataLookupS64(&status, md, "exp_id");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item exp_id");
-        return false;
-    }
-
-    return pzPendingImfileRowAlloc(exp_name, camera, telescope, class, class_id, exp_id);
+
+    return pzPendingImfileRowAlloc(exp_name, camera, telescope, class, class_id);
 }
 psArray *pzPendingImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
@@ -2121,5 +2105,5 @@
 static void pzDoneImfileRowFree(pzDoneImfileRow *object);
 
-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)
+pzDoneImfileRow *pzDoneImfileRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, const char *uri)
 {
     pzDoneImfileRow *_object;
@@ -2133,5 +2117,4 @@
     _object->class = psStringCopy(class);
     _object->class_id = psStringCopy(class_id);
-    _object->exp_id = exp_id;
     _object->uri = psStringCopy(uri);
 
@@ -2177,9 +2160,4 @@
         return false;
     }
-    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, "Unique Key", 64)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
-        psFree(md);
-        return false;
-    }
     if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, "255")) {
         psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
@@ -2200,5 +2178,5 @@
 }
 
-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)
+bool pzDoneImfileInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, const char *uri)
 {
     psMetadata *md = psMetadataAlloc();
@@ -2225,9 +2203,4 @@
     if (!psMetadataAdd(md, PS_LIST_TAIL, "class_id", PS_DATA_STRING, NULL, class_id)) {
         psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
-        psFree(md);
-        return false;
-    }
-    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, NULL, exp_id)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
         psFree(md);
         return false;
@@ -2261,5 +2234,5 @@
 bool pzDoneImfileInsertObject(psDB *dbh, pzDoneImfileRow *object)
 {
-    return pzDoneImfileInsert(dbh, object->exp_name, object->camera, object->telescope, object->class, object->class_id, object->exp_id, object->uri);
+    return pzDoneImfileInsert(dbh, object->exp_name, object->camera, object->telescope, object->class, object->class_id, object->uri);
 }
 
@@ -2359,9 +2332,4 @@
         return false;
     }
-    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_S64, NULL, object->exp_id)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
-        psFree(md);
-        return false;
-    }
     if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, object->uri)) {
         psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
@@ -2403,9 +2371,4 @@
         return false;
     }
-    psS64 exp_id = psMetadataLookupS64(&status, md, "exp_id");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item exp_id");
-        return false;
-    }
     char* uri = psMetadataLookupPtr(&status, md, "uri");
     if (!status) {
@@ -2414,5 +2377,5 @@
     }
 
-    return pzDoneImfileRowAlloc(exp_name, camera, telescope, class, class_id, exp_id, uri);
+    return pzDoneImfileRowAlloc(exp_name, camera, telescope, class, class_id, uri);
 }
 psArray *pzDoneImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
@@ -9307,5 +9270,5 @@
 static void warpSkyfileRowFree(warpSkyfileRow *object);
 
-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)
+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, psF64 pixel_fill, psS16 fault)
 {
     warpSkyfileRow  *_object;
@@ -9321,4 +9284,5 @@
     _object->bg = bg;
     _object->bg_stdev = bg_stdev;
+    _object->pixel_fill = pixel_fill;
     _object->fault = fault;
 
@@ -9372,4 +9336,9 @@
         return false;
     }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "pixel_fill", PS_DATA_F64, "Key", 0.0)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item pixel_fill");
+        psFree(md);
+        return false;
+    }
     if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "Key", 0)) {
         psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
@@ -9390,5 +9359,5 @@
 }
 
-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)
+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, psF64 pixel_fill, psS16 fault)
 {
     psMetadata *md = psMetadataAlloc();
@@ -9425,4 +9394,9 @@
     if (!psMetadataAdd(md, PS_LIST_TAIL, "bg_stdev", PS_DATA_F64, NULL, bg_stdev)) {
         psError(PS_ERR_UNKNOWN, false, "failed to add item bg_stdev");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "pixel_fill", PS_DATA_F64, NULL, pixel_fill)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item pixel_fill");
         psFree(md);
         return false;
@@ -9456,5 +9430,5 @@
 bool warpSkyfileInsertObject(psDB *dbh, warpSkyfileRow *object)
 {
-    return warpSkyfileInsert(dbh, object->warp_id, object->skycell_id, object->tess_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->fault);
+    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);
 }
 
@@ -9564,4 +9538,9 @@
         return false;
     }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "pixel_fill", PS_DATA_F64, NULL, object->pixel_fill)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item pixel_fill");
+        psFree(md);
+        return false;
+    }
     if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
         psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
@@ -9613,4 +9592,9 @@
         return false;
     }
+    psF64 pixel_fill = psMetadataLookupF64(&status, md, "pixel_fill");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item pixel_fill");
+        return false;
+    }
     psS16 fault = psMetadataLookupS16(&status, md, "fault");
     if (!status) {
@@ -9619,5 +9603,5 @@
     }
 
-    return warpSkyfileRowAlloc(warp_id, skycell_id, tess_id, uri, path_base, bg, bg_stdev, fault);
+    return warpSkyfileRowAlloc(warp_id, skycell_id, tess_id, uri, path_base, bg, bg_stdev, pixel_fill, fault);
 }
 psArray *warpSkyfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
@@ -18902,2 +18886,1651 @@
     return true;
 }
+static void magicRunRowFree(magicRunRow *object);
+
+magicRunRow *magicRunRowAlloc(psS64 magic_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *dvodb, psTime* registered)
+{
+    magicRunRow     *_object;
+
+    _object = psAlloc(sizeof(magicRunRow));
+    psMemSetDeallocator(_object, (psFreeFunc)magicRunRowFree);
+
+    _object->magic_id = magic_id;
+    _object->state = psStringCopy(state);
+    _object->workdir = psStringCopy(workdir);
+    _object->workdir_state = psStringCopy(workdir_state);
+    _object->label = psStringCopy(label);
+    _object->dvodb = psStringCopy(dvodb);
+    _object->registered = psTimeCopy(registered);
+
+    return _object;
+}
+
+static void magicRunRowFree(magicRunRow *object)
+{
+    psFree(object->state);
+    psFree(object->workdir);
+    psFree(object->workdir_state);
+    psFree(object->label);
+    psFree(object->dvodb);
+    psFree(object->registered);
+}
+
+bool magicRunCreateTable(psDB *dbh)
+{
+    psMetadata *md = psMetadataAlloc();
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, "Primary Key AUTO_INCREMENT", 0)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "state", PS_DATA_STRING, "Key", "64")) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item state");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, "255")) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir_state", PS_DATA_STRING, "Key", "255")) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir_state");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, "key", "64")) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item label");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, "255")) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "registered", PS_DATA_TIME, NULL, NULL)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item registered");
+        psFree(md);
+        return false;
+    }
+
+    bool status = psDBCreateTable(dbh, MAGICRUN_TABLE_NAME, md);
+
+    psFree(md);
+
+    return status;
+}
+
+bool magicRunDropTable(psDB *dbh)
+{
+    return psDBDropTable(dbh, MAGICRUN_TABLE_NAME);
+}
+
+bool magicRunInsert(psDB * dbh, psS64 magic_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *dvodb, psTime* registered)
+{
+    psMetadata *md = psMetadataAlloc();
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, magic_id)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "state", PS_DATA_STRING, NULL, state)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item state");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, workdir)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir_state", PS_DATA_STRING, NULL, workdir_state)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir_state");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, NULL, label)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item label");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, dvodb)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "registered", PS_DATA_TIME, NULL, registered)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item registered");
+        psFree(md);
+        return false;
+    }
+
+    bool status = psDBInsertOneRow(dbh, MAGICRUN_TABLE_NAME, md);
+    psFree(md);
+
+    return status;
+}
+
+long long magicRunDelete(psDB *dbh, const psMetadata *where, unsigned long long limit)
+{
+    long long       deleted = 0;
+
+    long long count = psDBDeleteRows(dbh, MAGICRUN_TABLE_NAME, where, limit);
+    if (count < 0) {
+        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicRun");
+        return count;
+
+        deleted += count;
+    }
+
+    return deleted;
+}
+bool magicRunInsertObject(psDB *dbh, magicRunRow *object)
+{
+    return magicRunInsert(dbh, object->magic_id, object->state, object->workdir, object->workdir_state, object->label, object->dvodb, object->registered);
+}
+
+bool magicRunInsertObjects(psDB *dbh, psArray *objects)
+{
+    for (long i = 0; i < psArrayLength(objects); i++) {
+        if (!magicRunInsertObject(dbh, objects->data[i])) {
+            return false;
+        }
+    }
+
+    return true;
+}
+
+bool magicRunInsertFits(psDB *dbh, const psFits *fits)
+{
+    psArray         *rowSet;
+
+    // move to (the first?) extension named  MAGICRUN_TABLE_NAME
+    if (!psFitsMoveExtName(fits, MAGICRUN_TABLE_NAME)) {
+        psError(PS_ERR_UNKNOWN, true, "failed to find FITS extension %s", MAGICRUN_TABLE_NAME);
+        return false;
+    }
+
+    // check HDU type
+    if (psFitsGetExtType(fits) != PS_FITS_TYPE_BINARY_TABLE)  {
+        psError(PS_ERR_UNKNOWN, true, "FITS HDU type is not PS_FITS_TYPE_BINARY_TABLE");
+        return false;
+    }
+
+    // read fits table
+    rowSet = psFitsReadTable(fits);
+    if (!rowSet) {
+        psError(PS_ERR_UNKNOWN, true, "FITS read error or FITS table is empty");
+        psFree(rowSet);
+        return false;
+    }
+
+    if (!psDBInsertRows(dbh, MAGICRUN_TABLE_NAME, rowSet)) {
+        psError(PS_ERR_UNKNOWN, false, "databse insert failed");
+        psFree(rowSet);
+        return false;
+    }
+
+    psFree(rowSet);
+
+    return true;
+}
+
+bool magicRunSelectRowsFits(psDB *dbh, psFits *fits, const psMetadata *where, unsigned long long limit)
+{
+    psArray         *rowSet;
+
+    rowSet = psDBSelectRows(dbh, MAGICRUN_TABLE_NAME, where, limit);
+    if (!rowSet) {
+        return false;
+    }
+
+    // output to fits
+    if (!psFitsWriteTable(fits, NULL, rowSet, MAGICRUN_TABLE_NAME)) {
+        psError(PS_ERR_UNKNOWN, false, "FITS table write failed");
+        psFree(rowSet);
+        return false;
+    }
+
+    psFree(rowSet);
+
+    return true;
+}
+
+psMetadata *magicRunMetadataFromObject(const magicRunRow *object)
+{
+    psMetadata *md = psMetadataAlloc();
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, object->magic_id)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "state", PS_DATA_STRING, NULL, object->state)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item state");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, object->workdir)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir_state", PS_DATA_STRING, NULL, object->workdir_state)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir_state");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, NULL, object->label)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item label");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, object->dvodb)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "registered", PS_DATA_TIME, NULL, object->registered)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item registered");
+        psFree(md);
+        return false;
+    }
+
+
+    return md;
+}
+
+magicRunRow *magicRunObjectFromMetadata(psMetadata *md)
+{
+
+bool status = false;
+    psS64 magic_id = psMetadataLookupS64(&status, md, "magic_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item magic_id");
+        return false;
+    }
+    char* state = psMetadataLookupPtr(&status, md, "state");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item state");
+        return false;
+    }
+    char* workdir = psMetadataLookupPtr(&status, md, "workdir");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item workdir");
+        return false;
+    }
+    char* workdir_state = psMetadataLookupPtr(&status, md, "workdir_state");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item workdir_state");
+        return false;
+    }
+    char* label = psMetadataLookupPtr(&status, md, "label");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item label");
+        return false;
+    }
+    char* dvodb = psMetadataLookupPtr(&status, md, "dvodb");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item dvodb");
+        return false;
+    }
+    psTime* registered = psMetadataLookupPtr(&status, md, "registered");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item registered");
+        return false;
+    }
+
+    return magicRunRowAlloc(magic_id, state, workdir, workdir_state, label, dvodb, registered);
+}
+psArray *magicRunSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
+{
+    psArray         *rowSet;
+    psArray         *returnSet;
+    psU64           i;
+
+    rowSet = psDBSelectRows(dbh, MAGICRUN_TABLE_NAME, where, limit);
+    if (!rowSet) {
+        return NULL;
+    }
+
+    // convert psMetadata rows to row objects
+
+    returnSet = psArrayAllocEmpty(rowSet->n);
+
+    for (i = 0; i < rowSet->n; i++) {
+        magicRunRow *object = magicRunObjectFromMetadata(rowSet->data[i]);
+        psArrayAdd(returnSet, 0, object);
+        psFree(object);
+    }
+
+    psFree(rowSet);
+
+    return returnSet;
+}
+bool magicRunDeleteObject(psDB *dbh, const magicRunRow *object)
+{
+    psMetadata *where = magicRunMetadataFromObject(object);
+    long long count = psDBDeleteRows(dbh, MAGICRUN_TABLE_NAME, where, 0);
+    psFree(where);
+    if (count < 0) {
+        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicRun");
+        return false;
+    }
+    if (count > 1) {
+        // XXX should this be a psAbort() instead?  It is possible that
+        // having an object match multiple rows was by design.
+        psError(PS_ERR_UNKNOWN, true, "magicRunRow object matched more then one row.  Check your database schema");
+        return false;
+    }
+
+    return true;
+}
+long long magicRunDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
+{
+    long long       deleted = 0;
+
+    for (long long i = 0; i < objects->n; i++) {
+        magicRunRow *object = objects->data[i];
+        psMetadata *where = magicRunMetadataFromObject(object);
+        long long count = psDBDeleteRows(dbh, MAGICRUN_TABLE_NAME, where, limit);
+        psFree(where);
+        if (count < 0) {
+            psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicRun");
+            return count;
+        }
+
+        deleted += count;
+    }
+
+    return deleted;
+}
+bool magicRunPrintObjects(FILE *stream, psArray *objects, bool mdcf)
+{
+    PS_ASSERT_PTR_NON_NULL(objects, false);
+
+    psMetadata *output = psMetadataAlloc();
+    for (long i = 0; i < psArrayLength(objects); i++) {
+        psMetadata *md = magicRunMetadataFromObject(objects->data[i]);
+        if (!psMetadataAddMetadata(
+            output,
+            PS_LIST_TAIL,
+            MAGICRUN_TABLE_NAME,
+            PS_META_DUPLICATE_OK,
+            NULL,
+            md
+        )) {
+            psError(PS_ERR_UNKNOWN, false, "failed to add metadata");
+            psFree(md);
+            psFree(output);
+            return false;
+        }
+        psFree(md);
+    }
+
+    if (!ippdbPrintMetadataRaw(stream, output, mdcf)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
+        psFree(output);
+    }
+    psFree(output);
+
+    return true;
+}
+bool magicRunPrintObject(FILE *stream, magicRunRow *object, bool mdcf)
+{
+    PS_ASSERT_PTR_NON_NULL(object, false);
+
+    psMetadata *md = magicRunMetadataFromObject(object);
+
+    if (!ippdbPrintMetadataRaw(stream, md, mdcf)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
+        psFree(md);
+    }
+
+    psFree(md);
+
+    return true;
+}
+static void magicInputSkyfileRowFree(magicInputSkyfileRow *object);
+
+magicInputSkyfileRow *magicInputSkyfileRowAlloc(psS64 magic_id, psS64 diff_id, psS32 node)
+{
+    magicInputSkyfileRow *_object;
+
+    _object = psAlloc(sizeof(magicInputSkyfileRow));
+    psMemSetDeallocator(_object, (psFreeFunc)magicInputSkyfileRowFree);
+
+    _object->magic_id = magic_id;
+    _object->diff_id = diff_id;
+    _object->node = node;
+
+    return _object;
+}
+
+static void magicInputSkyfileRowFree(magicInputSkyfileRow *object)
+{
+}
+
+bool magicInputSkyfileCreateTable(psDB *dbh)
+{
+    psMetadata *md = psMetadataAlloc();
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, "Primary Key fkey(magic_id) ref magicRun(magic_id)", 0)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "diff_id", PS_DATA_S64, "Key fkey(diff_id) ref diffRun(diff_id)", 0)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item diff_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_S32, "AUTO_INCREMENT INDEX(magic_id, node)", 0)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
+        psFree(md);
+        return false;
+    }
+
+    bool status = psDBCreateTable(dbh, MAGICINPUTSKYFILE_TABLE_NAME, md);
+
+    psFree(md);
+
+    return status;
+}
+
+bool magicInputSkyfileDropTable(psDB *dbh)
+{
+    return psDBDropTable(dbh, MAGICINPUTSKYFILE_TABLE_NAME);
+}
+
+bool magicInputSkyfileInsert(psDB * dbh, psS64 magic_id, psS64 diff_id, psS32 node)
+{
+    psMetadata *md = psMetadataAlloc();
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, magic_id)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "diff_id", PS_DATA_S64, NULL, diff_id)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item diff_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_S32, NULL, node)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
+        psFree(md);
+        return false;
+    }
+
+    bool status = psDBInsertOneRow(dbh, MAGICINPUTSKYFILE_TABLE_NAME, md);
+    psFree(md);
+
+    return status;
+}
+
+long long magicInputSkyfileDelete(psDB *dbh, const psMetadata *where, unsigned long long limit)
+{
+    long long       deleted = 0;
+
+    long long count = psDBDeleteRows(dbh, MAGICINPUTSKYFILE_TABLE_NAME, where, limit);
+    if (count < 0) {
+        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicInputSkyfile");
+        return count;
+
+        deleted += count;
+    }
+
+    return deleted;
+}
+bool magicInputSkyfileInsertObject(psDB *dbh, magicInputSkyfileRow *object)
+{
+    return magicInputSkyfileInsert(dbh, object->magic_id, object->diff_id, object->node);
+}
+
+bool magicInputSkyfileInsertObjects(psDB *dbh, psArray *objects)
+{
+    for (long i = 0; i < psArrayLength(objects); i++) {
+        if (!magicInputSkyfileInsertObject(dbh, objects->data[i])) {
+            return false;
+        }
+    }
+
+    return true;
+}
+
+bool magicInputSkyfileInsertFits(psDB *dbh, const psFits *fits)
+{
+    psArray         *rowSet;
+
+    // move to (the first?) extension named  MAGICINPUTSKYFILE_TABLE_NAME
+    if (!psFitsMoveExtName(fits, MAGICINPUTSKYFILE_TABLE_NAME)) {
+        psError(PS_ERR_UNKNOWN, true, "failed to find FITS extension %s", MAGICINPUTSKYFILE_TABLE_NAME);
+        return false;
+    }
+
+    // check HDU type
+    if (psFitsGetExtType(fits) != PS_FITS_TYPE_BINARY_TABLE)  {
+        psError(PS_ERR_UNKNOWN, true, "FITS HDU type is not PS_FITS_TYPE_BINARY_TABLE");
+        return false;
+    }
+
+    // read fits table
+    rowSet = psFitsReadTable(fits);
+    if (!rowSet) {
+        psError(PS_ERR_UNKNOWN, true, "FITS read error or FITS table is empty");
+        psFree(rowSet);
+        return false;
+    }
+
+    if (!psDBInsertRows(dbh, MAGICINPUTSKYFILE_TABLE_NAME, rowSet)) {
+        psError(PS_ERR_UNKNOWN, false, "databse insert failed");
+        psFree(rowSet);
+        return false;
+    }
+
+    psFree(rowSet);
+
+    return true;
+}
+
+bool magicInputSkyfileSelectRowsFits(psDB *dbh, psFits *fits, const psMetadata *where, unsigned long long limit)
+{
+    psArray         *rowSet;
+
+    rowSet = psDBSelectRows(dbh, MAGICINPUTSKYFILE_TABLE_NAME, where, limit);
+    if (!rowSet) {
+        return false;
+    }
+
+    // output to fits
+    if (!psFitsWriteTable(fits, NULL, rowSet, MAGICINPUTSKYFILE_TABLE_NAME)) {
+        psError(PS_ERR_UNKNOWN, false, "FITS table write failed");
+        psFree(rowSet);
+        return false;
+    }
+
+    psFree(rowSet);
+
+    return true;
+}
+
+psMetadata *magicInputSkyfileMetadataFromObject(const magicInputSkyfileRow *object)
+{
+    psMetadata *md = psMetadataAlloc();
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, object->magic_id)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "diff_id", PS_DATA_S64, NULL, object->diff_id)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item diff_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_S32, NULL, object->node)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
+        psFree(md);
+        return false;
+    }
+
+
+    return md;
+}
+
+magicInputSkyfileRow *magicInputSkyfileObjectFromMetadata(psMetadata *md)
+{
+
+bool status = false;
+    psS64 magic_id = psMetadataLookupS64(&status, md, "magic_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item magic_id");
+        return false;
+    }
+    psS64 diff_id = psMetadataLookupS64(&status, md, "diff_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item diff_id");
+        return false;
+    }
+    psS32 node = psMetadataLookupS32(&status, md, "node");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item node");
+        return false;
+    }
+
+    return magicInputSkyfileRowAlloc(magic_id, diff_id, node);
+}
+psArray *magicInputSkyfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
+{
+    psArray         *rowSet;
+    psArray         *returnSet;
+    psU64           i;
+
+    rowSet = psDBSelectRows(dbh, MAGICINPUTSKYFILE_TABLE_NAME, where, limit);
+    if (!rowSet) {
+        return NULL;
+    }
+
+    // convert psMetadata rows to row objects
+
+    returnSet = psArrayAllocEmpty(rowSet->n);
+
+    for (i = 0; i < rowSet->n; i++) {
+        magicInputSkyfileRow *object = magicInputSkyfileObjectFromMetadata(rowSet->data[i]);
+        psArrayAdd(returnSet, 0, object);
+        psFree(object);
+    }
+
+    psFree(rowSet);
+
+    return returnSet;
+}
+bool magicInputSkyfileDeleteObject(psDB *dbh, const magicInputSkyfileRow *object)
+{
+    psMetadata *where = magicInputSkyfileMetadataFromObject(object);
+    long long count = psDBDeleteRows(dbh, MAGICINPUTSKYFILE_TABLE_NAME, where, 0);
+    psFree(where);
+    if (count < 0) {
+        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicInputSkyfile");
+        return false;
+    }
+    if (count > 1) {
+        // XXX should this be a psAbort() instead?  It is possible that
+        // having an object match multiple rows was by design.
+        psError(PS_ERR_UNKNOWN, true, "magicInputSkyfileRow object matched more then one row.  Check your database schema");
+        return false;
+    }
+
+    return true;
+}
+long long magicInputSkyfileDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
+{
+    long long       deleted = 0;
+
+    for (long long i = 0; i < objects->n; i++) {
+        magicInputSkyfileRow *object = objects->data[i];
+        psMetadata *where = magicInputSkyfileMetadataFromObject(object);
+        long long count = psDBDeleteRows(dbh, MAGICINPUTSKYFILE_TABLE_NAME, where, limit);
+        psFree(where);
+        if (count < 0) {
+            psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicInputSkyfile");
+            return count;
+        }
+
+        deleted += count;
+    }
+
+    return deleted;
+}
+bool magicInputSkyfilePrintObjects(FILE *stream, psArray *objects, bool mdcf)
+{
+    PS_ASSERT_PTR_NON_NULL(objects, false);
+
+    psMetadata *output = psMetadataAlloc();
+    for (long i = 0; i < psArrayLength(objects); i++) {
+        psMetadata *md = magicInputSkyfileMetadataFromObject(objects->data[i]);
+        if (!psMetadataAddMetadata(
+            output,
+            PS_LIST_TAIL,
+            MAGICINPUTSKYFILE_TABLE_NAME,
+            PS_META_DUPLICATE_OK,
+            NULL,
+            md
+        )) {
+            psError(PS_ERR_UNKNOWN, false, "failed to add metadata");
+            psFree(md);
+            psFree(output);
+            return false;
+        }
+        psFree(md);
+    }
+
+    if (!ippdbPrintMetadataRaw(stream, output, mdcf)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
+        psFree(output);
+    }
+    psFree(output);
+
+    return true;
+}
+bool magicInputSkyfilePrintObject(FILE *stream, magicInputSkyfileRow *object, bool mdcf)
+{
+    PS_ASSERT_PTR_NON_NULL(object, false);
+
+    psMetadata *md = magicInputSkyfileMetadataFromObject(object);
+
+    if (!ippdbPrintMetadataRaw(stream, md, mdcf)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
+        psFree(md);
+    }
+
+    psFree(md);
+
+    return true;
+}
+static void magicTreeRowFree(magicTreeRow *object);
+
+magicTreeRow *magicTreeRowAlloc(psS64 magic_id, const char *node, const char *dep)
+{
+    magicTreeRow    *_object;
+
+    _object = psAlloc(sizeof(magicTreeRow));
+    psMemSetDeallocator(_object, (psFreeFunc)magicTreeRowFree);
+
+    _object->magic_id = magic_id;
+    _object->node = psStringCopy(node);
+    _object->dep = psStringCopy(dep);
+
+    return _object;
+}
+
+static void magicTreeRowFree(magicTreeRow *object)
+{
+    psFree(object->node);
+    psFree(object->dep);
+}
+
+bool magicTreeCreateTable(psDB *dbh)
+{
+    psMetadata *md = psMetadataAlloc();
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, "Primary Key fkey(magic_id) ref magicRun(magic_id)", 0)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_STRING, "Primary Key fkey(magic_id, node) ref magicInputSkyfile(magic_id, node)", "64")) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "dep", PS_DATA_STRING, "fkey(magic_id, dep) ref magicInputSkyfile(magic_id, node)", "64")) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item dep");
+        psFree(md);
+        return false;
+    }
+
+    bool status = psDBCreateTable(dbh, MAGICTREE_TABLE_NAME, md);
+
+    psFree(md);
+
+    return status;
+}
+
+bool magicTreeDropTable(psDB *dbh)
+{
+    return psDBDropTable(dbh, MAGICTREE_TABLE_NAME);
+}
+
+bool magicTreeInsert(psDB * dbh, psS64 magic_id, const char *node, const char *dep)
+{
+    psMetadata *md = psMetadataAlloc();
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, magic_id)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_STRING, NULL, node)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "dep", PS_DATA_STRING, NULL, dep)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item dep");
+        psFree(md);
+        return false;
+    }
+
+    bool status = psDBInsertOneRow(dbh, MAGICTREE_TABLE_NAME, md);
+    psFree(md);
+
+    return status;
+}
+
+long long magicTreeDelete(psDB *dbh, const psMetadata *where, unsigned long long limit)
+{
+    long long       deleted = 0;
+
+    long long count = psDBDeleteRows(dbh, MAGICTREE_TABLE_NAME, where, limit);
+    if (count < 0) {
+        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicTree");
+        return count;
+
+        deleted += count;
+    }
+
+    return deleted;
+}
+bool magicTreeInsertObject(psDB *dbh, magicTreeRow *object)
+{
+    return magicTreeInsert(dbh, object->magic_id, object->node, object->dep);
+}
+
+bool magicTreeInsertObjects(psDB *dbh, psArray *objects)
+{
+    for (long i = 0; i < psArrayLength(objects); i++) {
+        if (!magicTreeInsertObject(dbh, objects->data[i])) {
+            return false;
+        }
+    }
+
+    return true;
+}
+
+bool magicTreeInsertFits(psDB *dbh, const psFits *fits)
+{
+    psArray         *rowSet;
+
+    // move to (the first?) extension named  MAGICTREE_TABLE_NAME
+    if (!psFitsMoveExtName(fits, MAGICTREE_TABLE_NAME)) {
+        psError(PS_ERR_UNKNOWN, true, "failed to find FITS extension %s", MAGICTREE_TABLE_NAME);
+        return false;
+    }
+
+    // check HDU type
+    if (psFitsGetExtType(fits) != PS_FITS_TYPE_BINARY_TABLE)  {
+        psError(PS_ERR_UNKNOWN, true, "FITS HDU type is not PS_FITS_TYPE_BINARY_TABLE");
+        return false;
+    }
+
+    // read fits table
+    rowSet = psFitsReadTable(fits);
+    if (!rowSet) {
+        psError(PS_ERR_UNKNOWN, true, "FITS read error or FITS table is empty");
+        psFree(rowSet);
+        return false;
+    }
+
+    if (!psDBInsertRows(dbh, MAGICTREE_TABLE_NAME, rowSet)) {
+        psError(PS_ERR_UNKNOWN, false, "databse insert failed");
+        psFree(rowSet);
+        return false;
+    }
+
+    psFree(rowSet);
+
+    return true;
+}
+
+bool magicTreeSelectRowsFits(psDB *dbh, psFits *fits, const psMetadata *where, unsigned long long limit)
+{
+    psArray         *rowSet;
+
+    rowSet = psDBSelectRows(dbh, MAGICTREE_TABLE_NAME, where, limit);
+    if (!rowSet) {
+        return false;
+    }
+
+    // output to fits
+    if (!psFitsWriteTable(fits, NULL, rowSet, MAGICTREE_TABLE_NAME)) {
+        psError(PS_ERR_UNKNOWN, false, "FITS table write failed");
+        psFree(rowSet);
+        return false;
+    }
+
+    psFree(rowSet);
+
+    return true;
+}
+
+psMetadata *magicTreeMetadataFromObject(const magicTreeRow *object)
+{
+    psMetadata *md = psMetadataAlloc();
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, object->magic_id)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_STRING, NULL, object->node)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "dep", PS_DATA_STRING, NULL, object->dep)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item dep");
+        psFree(md);
+        return false;
+    }
+
+
+    return md;
+}
+
+magicTreeRow *magicTreeObjectFromMetadata(psMetadata *md)
+{
+
+bool status = false;
+    psS64 magic_id = psMetadataLookupS64(&status, md, "magic_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item magic_id");
+        return false;
+    }
+    char* node = psMetadataLookupPtr(&status, md, "node");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item node");
+        return false;
+    }
+    char* dep = psMetadataLookupPtr(&status, md, "dep");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item dep");
+        return false;
+    }
+
+    return magicTreeRowAlloc(magic_id, node, dep);
+}
+psArray *magicTreeSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
+{
+    psArray         *rowSet;
+    psArray         *returnSet;
+    psU64           i;
+
+    rowSet = psDBSelectRows(dbh, MAGICTREE_TABLE_NAME, where, limit);
+    if (!rowSet) {
+        return NULL;
+    }
+
+    // convert psMetadata rows to row objects
+
+    returnSet = psArrayAllocEmpty(rowSet->n);
+
+    for (i = 0; i < rowSet->n; i++) {
+        magicTreeRow *object = magicTreeObjectFromMetadata(rowSet->data[i]);
+        psArrayAdd(returnSet, 0, object);
+        psFree(object);
+    }
+
+    psFree(rowSet);
+
+    return returnSet;
+}
+bool magicTreeDeleteObject(psDB *dbh, const magicTreeRow *object)
+{
+    psMetadata *where = magicTreeMetadataFromObject(object);
+    long long count = psDBDeleteRows(dbh, MAGICTREE_TABLE_NAME, where, 0);
+    psFree(where);
+    if (count < 0) {
+        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicTree");
+        return false;
+    }
+    if (count > 1) {
+        // XXX should this be a psAbort() instead?  It is possible that
+        // having an object match multiple rows was by design.
+        psError(PS_ERR_UNKNOWN, true, "magicTreeRow object matched more then one row.  Check your database schema");
+        return false;
+    }
+
+    return true;
+}
+long long magicTreeDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
+{
+    long long       deleted = 0;
+
+    for (long long i = 0; i < objects->n; i++) {
+        magicTreeRow *object = objects->data[i];
+        psMetadata *where = magicTreeMetadataFromObject(object);
+        long long count = psDBDeleteRows(dbh, MAGICTREE_TABLE_NAME, where, limit);
+        psFree(where);
+        if (count < 0) {
+            psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicTree");
+            return count;
+        }
+
+        deleted += count;
+    }
+
+    return deleted;
+}
+bool magicTreePrintObjects(FILE *stream, psArray *objects, bool mdcf)
+{
+    PS_ASSERT_PTR_NON_NULL(objects, false);
+
+    psMetadata *output = psMetadataAlloc();
+    for (long i = 0; i < psArrayLength(objects); i++) {
+        psMetadata *md = magicTreeMetadataFromObject(objects->data[i]);
+        if (!psMetadataAddMetadata(
+            output,
+            PS_LIST_TAIL,
+            MAGICTREE_TABLE_NAME,
+            PS_META_DUPLICATE_OK,
+            NULL,
+            md
+        )) {
+            psError(PS_ERR_UNKNOWN, false, "failed to add metadata");
+            psFree(md);
+            psFree(output);
+            return false;
+        }
+        psFree(md);
+    }
+
+    if (!ippdbPrintMetadataRaw(stream, output, mdcf)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
+        psFree(output);
+    }
+    psFree(output);
+
+    return true;
+}
+bool magicTreePrintObject(FILE *stream, magicTreeRow *object, bool mdcf)
+{
+    PS_ASSERT_PTR_NON_NULL(object, false);
+
+    psMetadata *md = magicTreeMetadataFromObject(object);
+
+    if (!ippdbPrintMetadataRaw(stream, md, mdcf)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
+        psFree(md);
+    }
+
+    psFree(md);
+
+    return true;
+}
+static void magicNodeResultRowFree(magicNodeResultRow *object);
+
+magicNodeResultRow *magicNodeResultRowAlloc(psS64 magic_id, const char *node, const char *uri)
+{
+    magicNodeResultRow *_object;
+
+    _object = psAlloc(sizeof(magicNodeResultRow));
+    psMemSetDeallocator(_object, (psFreeFunc)magicNodeResultRowFree);
+
+    _object->magic_id = magic_id;
+    _object->node = psStringCopy(node);
+    _object->uri = psStringCopy(uri);
+
+    return _object;
+}
+
+static void magicNodeResultRowFree(magicNodeResultRow *object)
+{
+    psFree(object->node);
+    psFree(object->uri);
+}
+
+bool magicNodeResultCreateTable(psDB *dbh)
+{
+    psMetadata *md = psMetadataAlloc();
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, "Primary Key fkey(magic_id) ref magicRun(magic_id)", 0)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_STRING, "Primary Key fkey(magic_id, node) ref magicInputSkyfile(magic_id, node)", "64")) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, "255")) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
+        psFree(md);
+        return false;
+    }
+
+    bool status = psDBCreateTable(dbh, MAGICNODERESULT_TABLE_NAME, md);
+
+    psFree(md);
+
+    return status;
+}
+
+bool magicNodeResultDropTable(psDB *dbh)
+{
+    return psDBDropTable(dbh, MAGICNODERESULT_TABLE_NAME);
+}
+
+bool magicNodeResultInsert(psDB * dbh, psS64 magic_id, const char *node, const char *uri)
+{
+    psMetadata *md = psMetadataAlloc();
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, magic_id)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_STRING, NULL, node)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, uri)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
+        psFree(md);
+        return false;
+    }
+
+    bool status = psDBInsertOneRow(dbh, MAGICNODERESULT_TABLE_NAME, md);
+    psFree(md);
+
+    return status;
+}
+
+long long magicNodeResultDelete(psDB *dbh, const psMetadata *where, unsigned long long limit)
+{
+    long long       deleted = 0;
+
+    long long count = psDBDeleteRows(dbh, MAGICNODERESULT_TABLE_NAME, where, limit);
+    if (count < 0) {
+        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicNodeResult");
+        return count;
+
+        deleted += count;
+    }
+
+    return deleted;
+}
+bool magicNodeResultInsertObject(psDB *dbh, magicNodeResultRow *object)
+{
+    return magicNodeResultInsert(dbh, object->magic_id, object->node, object->uri);
+}
+
+bool magicNodeResultInsertObjects(psDB *dbh, psArray *objects)
+{
+    for (long i = 0; i < psArrayLength(objects); i++) {
+        if (!magicNodeResultInsertObject(dbh, objects->data[i])) {
+            return false;
+        }
+    }
+
+    return true;
+}
+
+bool magicNodeResultInsertFits(psDB *dbh, const psFits *fits)
+{
+    psArray         *rowSet;
+
+    // move to (the first?) extension named  MAGICNODERESULT_TABLE_NAME
+    if (!psFitsMoveExtName(fits, MAGICNODERESULT_TABLE_NAME)) {
+        psError(PS_ERR_UNKNOWN, true, "failed to find FITS extension %s", MAGICNODERESULT_TABLE_NAME);
+        return false;
+    }
+
+    // check HDU type
+    if (psFitsGetExtType(fits) != PS_FITS_TYPE_BINARY_TABLE)  {
+        psError(PS_ERR_UNKNOWN, true, "FITS HDU type is not PS_FITS_TYPE_BINARY_TABLE");
+        return false;
+    }
+
+    // read fits table
+    rowSet = psFitsReadTable(fits);
+    if (!rowSet) {
+        psError(PS_ERR_UNKNOWN, true, "FITS read error or FITS table is empty");
+        psFree(rowSet);
+        return false;
+    }
+
+    if (!psDBInsertRows(dbh, MAGICNODERESULT_TABLE_NAME, rowSet)) {
+        psError(PS_ERR_UNKNOWN, false, "databse insert failed");
+        psFree(rowSet);
+        return false;
+    }
+
+    psFree(rowSet);
+
+    return true;
+}
+
+bool magicNodeResultSelectRowsFits(psDB *dbh, psFits *fits, const psMetadata *where, unsigned long long limit)
+{
+    psArray         *rowSet;
+
+    rowSet = psDBSelectRows(dbh, MAGICNODERESULT_TABLE_NAME, where, limit);
+    if (!rowSet) {
+        return false;
+    }
+
+    // output to fits
+    if (!psFitsWriteTable(fits, NULL, rowSet, MAGICNODERESULT_TABLE_NAME)) {
+        psError(PS_ERR_UNKNOWN, false, "FITS table write failed");
+        psFree(rowSet);
+        return false;
+    }
+
+    psFree(rowSet);
+
+    return true;
+}
+
+psMetadata *magicNodeResultMetadataFromObject(const magicNodeResultRow *object)
+{
+    psMetadata *md = psMetadataAlloc();
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, object->magic_id)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "node", PS_DATA_STRING, NULL, object->node)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item node");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, object->uri)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
+        psFree(md);
+        return false;
+    }
+
+
+    return md;
+}
+
+magicNodeResultRow *magicNodeResultObjectFromMetadata(psMetadata *md)
+{
+
+bool status = false;
+    psS64 magic_id = psMetadataLookupS64(&status, md, "magic_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item magic_id");
+        return false;
+    }
+    char* node = psMetadataLookupPtr(&status, md, "node");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item node");
+        return false;
+    }
+    char* uri = psMetadataLookupPtr(&status, md, "uri");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item uri");
+        return false;
+    }
+
+    return magicNodeResultRowAlloc(magic_id, node, uri);
+}
+psArray *magicNodeResultSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
+{
+    psArray         *rowSet;
+    psArray         *returnSet;
+    psU64           i;
+
+    rowSet = psDBSelectRows(dbh, MAGICNODERESULT_TABLE_NAME, where, limit);
+    if (!rowSet) {
+        return NULL;
+    }
+
+    // convert psMetadata rows to row objects
+
+    returnSet = psArrayAllocEmpty(rowSet->n);
+
+    for (i = 0; i < rowSet->n; i++) {
+        magicNodeResultRow *object = magicNodeResultObjectFromMetadata(rowSet->data[i]);
+        psArrayAdd(returnSet, 0, object);
+        psFree(object);
+    }
+
+    psFree(rowSet);
+
+    return returnSet;
+}
+bool magicNodeResultDeleteObject(psDB *dbh, const magicNodeResultRow *object)
+{
+    psMetadata *where = magicNodeResultMetadataFromObject(object);
+    long long count = psDBDeleteRows(dbh, MAGICNODERESULT_TABLE_NAME, where, 0);
+    psFree(where);
+    if (count < 0) {
+        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicNodeResult");
+        return false;
+    }
+    if (count > 1) {
+        // XXX should this be a psAbort() instead?  It is possible that
+        // having an object match multiple rows was by design.
+        psError(PS_ERR_UNKNOWN, true, "magicNodeResultRow object matched more then one row.  Check your database schema");
+        return false;
+    }
+
+    return true;
+}
+long long magicNodeResultDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
+{
+    long long       deleted = 0;
+
+    for (long long i = 0; i < objects->n; i++) {
+        magicNodeResultRow *object = objects->data[i];
+        psMetadata *where = magicNodeResultMetadataFromObject(object);
+        long long count = psDBDeleteRows(dbh, MAGICNODERESULT_TABLE_NAME, where, limit);
+        psFree(where);
+        if (count < 0) {
+            psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicNodeResult");
+            return count;
+        }
+
+        deleted += count;
+    }
+
+    return deleted;
+}
+bool magicNodeResultPrintObjects(FILE *stream, psArray *objects, bool mdcf)
+{
+    PS_ASSERT_PTR_NON_NULL(objects, false);
+
+    psMetadata *output = psMetadataAlloc();
+    for (long i = 0; i < psArrayLength(objects); i++) {
+        psMetadata *md = magicNodeResultMetadataFromObject(objects->data[i]);
+        if (!psMetadataAddMetadata(
+            output,
+            PS_LIST_TAIL,
+            MAGICNODERESULT_TABLE_NAME,
+            PS_META_DUPLICATE_OK,
+            NULL,
+            md
+        )) {
+            psError(PS_ERR_UNKNOWN, false, "failed to add metadata");
+            psFree(md);
+            psFree(output);
+            return false;
+        }
+        psFree(md);
+    }
+
+    if (!ippdbPrintMetadataRaw(stream, output, mdcf)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
+        psFree(output);
+    }
+    psFree(output);
+
+    return true;
+}
+bool magicNodeResultPrintObject(FILE *stream, magicNodeResultRow *object, bool mdcf)
+{
+    PS_ASSERT_PTR_NON_NULL(object, false);
+
+    psMetadata *md = magicNodeResultMetadataFromObject(object);
+
+    if (!ippdbPrintMetadataRaw(stream, md, mdcf)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
+        psFree(md);
+    }
+
+    psFree(md);
+
+    return true;
+}
+static void magicMaskRowFree(magicMaskRow *object);
+
+magicMaskRow *magicMaskRowAlloc(psS64 magic_id, const char *uri)
+{
+    magicMaskRow    *_object;
+
+    _object = psAlloc(sizeof(magicMaskRow));
+    psMemSetDeallocator(_object, (psFreeFunc)magicMaskRowFree);
+
+    _object->magic_id = magic_id;
+    _object->uri = psStringCopy(uri);
+
+    return _object;
+}
+
+static void magicMaskRowFree(magicMaskRow *object)
+{
+    psFree(object->uri);
+}
+
+bool magicMaskCreateTable(psDB *dbh)
+{
+    psMetadata *md = psMetadataAlloc();
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, "Primary Key fkey(magic_id) ref magicRun(magic_id)", 0)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, "255")) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
+        psFree(md);
+        return false;
+    }
+
+    bool status = psDBCreateTable(dbh, MAGICMASK_TABLE_NAME, md);
+
+    psFree(md);
+
+    return status;
+}
+
+bool magicMaskDropTable(psDB *dbh)
+{
+    return psDBDropTable(dbh, MAGICMASK_TABLE_NAME);
+}
+
+bool magicMaskInsert(psDB * dbh, psS64 magic_id, const char *uri)
+{
+    psMetadata *md = psMetadataAlloc();
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, magic_id)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, uri)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
+        psFree(md);
+        return false;
+    }
+
+    bool status = psDBInsertOneRow(dbh, MAGICMASK_TABLE_NAME, md);
+    psFree(md);
+
+    return status;
+}
+
+long long magicMaskDelete(psDB *dbh, const psMetadata *where, unsigned long long limit)
+{
+    long long       deleted = 0;
+
+    long long count = psDBDeleteRows(dbh, MAGICMASK_TABLE_NAME, where, limit);
+    if (count < 0) {
+        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicMask");
+        return count;
+
+        deleted += count;
+    }
+
+    return deleted;
+}
+bool magicMaskInsertObject(psDB *dbh, magicMaskRow *object)
+{
+    return magicMaskInsert(dbh, object->magic_id, object->uri);
+}
+
+bool magicMaskInsertObjects(psDB *dbh, psArray *objects)
+{
+    for (long i = 0; i < psArrayLength(objects); i++) {
+        if (!magicMaskInsertObject(dbh, objects->data[i])) {
+            return false;
+        }
+    }
+
+    return true;
+}
+
+bool magicMaskInsertFits(psDB *dbh, const psFits *fits)
+{
+    psArray         *rowSet;
+
+    // move to (the first?) extension named  MAGICMASK_TABLE_NAME
+    if (!psFitsMoveExtName(fits, MAGICMASK_TABLE_NAME)) {
+        psError(PS_ERR_UNKNOWN, true, "failed to find FITS extension %s", MAGICMASK_TABLE_NAME);
+        return false;
+    }
+
+    // check HDU type
+    if (psFitsGetExtType(fits) != PS_FITS_TYPE_BINARY_TABLE)  {
+        psError(PS_ERR_UNKNOWN, true, "FITS HDU type is not PS_FITS_TYPE_BINARY_TABLE");
+        return false;
+    }
+
+    // read fits table
+    rowSet = psFitsReadTable(fits);
+    if (!rowSet) {
+        psError(PS_ERR_UNKNOWN, true, "FITS read error or FITS table is empty");
+        psFree(rowSet);
+        return false;
+    }
+
+    if (!psDBInsertRows(dbh, MAGICMASK_TABLE_NAME, rowSet)) {
+        psError(PS_ERR_UNKNOWN, false, "databse insert failed");
+        psFree(rowSet);
+        return false;
+    }
+
+    psFree(rowSet);
+
+    return true;
+}
+
+bool magicMaskSelectRowsFits(psDB *dbh, psFits *fits, const psMetadata *where, unsigned long long limit)
+{
+    psArray         *rowSet;
+
+    rowSet = psDBSelectRows(dbh, MAGICMASK_TABLE_NAME, where, limit);
+    if (!rowSet) {
+        return false;
+    }
+
+    // output to fits
+    if (!psFitsWriteTable(fits, NULL, rowSet, MAGICMASK_TABLE_NAME)) {
+        psError(PS_ERR_UNKNOWN, false, "FITS table write failed");
+        psFree(rowSet);
+        return false;
+    }
+
+    psFree(rowSet);
+
+    return true;
+}
+
+psMetadata *magicMaskMetadataFromObject(const magicMaskRow *object)
+{
+    psMetadata *md = psMetadataAlloc();
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "magic_id", PS_DATA_S64, NULL, object->magic_id)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item magic_id");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, object->uri)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
+        psFree(md);
+        return false;
+    }
+
+
+    return md;
+}
+
+magicMaskRow *magicMaskObjectFromMetadata(psMetadata *md)
+{
+
+bool status = false;
+    psS64 magic_id = psMetadataLookupS64(&status, md, "magic_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item magic_id");
+        return false;
+    }
+    char* uri = psMetadataLookupPtr(&status, md, "uri");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item uri");
+        return false;
+    }
+
+    return magicMaskRowAlloc(magic_id, uri);
+}
+psArray *magicMaskSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
+{
+    psArray         *rowSet;
+    psArray         *returnSet;
+    psU64           i;
+
+    rowSet = psDBSelectRows(dbh, MAGICMASK_TABLE_NAME, where, limit);
+    if (!rowSet) {
+        return NULL;
+    }
+
+    // convert psMetadata rows to row objects
+
+    returnSet = psArrayAllocEmpty(rowSet->n);
+
+    for (i = 0; i < rowSet->n; i++) {
+        magicMaskRow *object = magicMaskObjectFromMetadata(rowSet->data[i]);
+        psArrayAdd(returnSet, 0, object);
+        psFree(object);
+    }
+
+    psFree(rowSet);
+
+    return returnSet;
+}
+bool magicMaskDeleteObject(psDB *dbh, const magicMaskRow *object)
+{
+    psMetadata *where = magicMaskMetadataFromObject(object);
+    long long count = psDBDeleteRows(dbh, MAGICMASK_TABLE_NAME, where, 0);
+    psFree(where);
+    if (count < 0) {
+        psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicMask");
+        return false;
+    }
+    if (count > 1) {
+        // XXX should this be a psAbort() instead?  It is possible that
+        // having an object match multiple rows was by design.
+        psError(PS_ERR_UNKNOWN, true, "magicMaskRow object matched more then one row.  Check your database schema");
+        return false;
+    }
+
+    return true;
+}
+long long magicMaskDeleteRowObjects(psDB *dbh, const psArray *objects, unsigned long long limit)
+{
+    long long       deleted = 0;
+
+    for (long long i = 0; i < objects->n; i++) {
+        magicMaskRow *object = objects->data[i];
+        psMetadata *where = magicMaskMetadataFromObject(object);
+        long long count = psDBDeleteRows(dbh, MAGICMASK_TABLE_NAME, where, limit);
+        psFree(where);
+        if (count < 0) {
+            psError(PS_ERR_UNKNOWN, true, "failed to delete row from magicMask");
+            return count;
+        }
+
+        deleted += count;
+    }
+
+    return deleted;
+}
+bool magicMaskPrintObjects(FILE *stream, psArray *objects, bool mdcf)
+{
+    PS_ASSERT_PTR_NON_NULL(objects, false);
+
+    psMetadata *output = psMetadataAlloc();
+    for (long i = 0; i < psArrayLength(objects); i++) {
+        psMetadata *md = magicMaskMetadataFromObject(objects->data[i]);
+        if (!psMetadataAddMetadata(
+            output,
+            PS_LIST_TAIL,
+            MAGICMASK_TABLE_NAME,
+            PS_META_DUPLICATE_OK,
+            NULL,
+            md
+        )) {
+            psError(PS_ERR_UNKNOWN, false, "failed to add metadata");
+            psFree(md);
+            psFree(output);
+            return false;
+        }
+        psFree(md);
+    }
+
+    if (!ippdbPrintMetadataRaw(stream, output, mdcf)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
+        psFree(output);
+    }
+    psFree(output);
+
+    return true;
+}
+bool magicMaskPrintObject(FILE *stream, magicMaskRow *object, bool mdcf)
+{
+    PS_ASSERT_PTR_NON_NULL(object, false);
+
+    psMetadata *md = magicMaskMetadataFromObject(object);
+
+    if (!ippdbPrintMetadataRaw(stream, md, mdcf)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
+        psFree(md);
+    }
+
+    psFree(md);
+
+    return true;
+}
Index: /trunk/ippdb/src/ippdb.h
===================================================================
--- /trunk/ippdb/src/ippdb.h	(revision 14597)
+++ /trunk/ippdb/src/ippdb.h	(revision 14598)
@@ -20,5 +20,5 @@
 /*
  *
- * This file was generated by glueforge 1.03
+ * This file was generated by glueforge 1.01
  *
  * Do NOT directly edit this file.
@@ -769,5 +769,4 @@
     char            *class;
     char            *class_id;
-    psS64           exp_id;
 } pzPendingImfileRow;
 
@@ -782,6 +781,5 @@
     const char      *telescope,
     const char      *class,
-    const char      *class_id,
-    psS64           exp_id
+    const char      *class_id
 );
 
@@ -817,6 +815,5 @@
     const char      *telescope,
     const char      *class,
-    const char      *class_id,
-    psS64           exp_id
+    const char      *class_id
 );
 
@@ -1180,5 +1177,4 @@
     char            *class;
     char            *class_id;
-    psS64           exp_id;
     char            *uri;
 } pzDoneImfileRow;
@@ -1195,5 +1191,4 @@
     const char      *class,
     const char      *class_id,
-    psS64           exp_id,
     const char      *uri
 );
@@ -1231,5 +1226,4 @@
     const char      *class,
     const char      *class_id,
-    psS64           exp_id,
     const char      *uri
 );
@@ -4539,4 +4533,5 @@
     psF64           bg;
     psF64           bg_stdev;
+    psF64           pixel_fill;
     psS16           fault;
 } warpSkyfileRow;
@@ -4555,4 +4550,5 @@
     psF64           bg,
     psF64           bg_stdev,
+    psF64           pixel_fill,
     psS16           fault
 );
@@ -4592,4 +4588,5 @@
     psF64           bg,
     psF64           bg_stdev,
+    psF64           pixel_fill,
     psS16           fault
 );
@@ -8852,4 +8849,1018 @@
     bool            mdcf                ///< format as mdconfig or simple
 );
+/** magicRunRow data structure
+ *
+ * Structure for representing a single row of magicRun table data.
+ */
+
+typedef struct {
+    psS64           magic_id;
+    char            *state;
+    char            *workdir;
+    char            *workdir_state;
+    char            *label;
+    char            *dvodb;
+    psTime*         registered;
+} magicRunRow;
+
+/** Creates a new magicRunRow object
+ *
+ *  @return A new magicRunRow object or NULL on failure.
+ */
+
+magicRunRow *magicRunRowAlloc(
+    psS64           magic_id,
+    const char      *state,
+    const char      *workdir,
+    const char      *workdir_state,
+    const char      *label,
+    const char      *dvodb,
+    psTime*         registered
+);
+
+/** Creates a new magicRun table
+ *
+ * @return true on success
+ */
+
+bool magicRunCreateTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Deletes a magicRun table
+ *
+ * @return true on success
+ */
+
+bool magicRunDropTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Insert a single row into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicRunInsert(
+    psDB            *dbh,               ///< Database handle
+    psS64           magic_id,
+    const char      *state,
+    const char      *workdir,
+    const char      *workdir_state,
+    const char      *label,
+    const char      *dvodb,
+    psTime*         registered
+);
+
+/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+long long magicRunDelete(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+
+/** Insert a single magicRunRow object into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicRunInsertObject(
+    psDB            *dbh,               ///< Database handle
+    magicRunRow     *object             ///< magicRunRow object
+);
+
+/** Insert an array of magicRunRow object into a table
+ *
+ * This function constructs and inserts multiple rows based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicRunInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of magicRunRow objects
+);
+
+/** Insert data from a binary FITS table magicRunRow into the database
+ *
+ * This function expects a psFits object with a FITS table as the first
+ * extension.  The table must have at least one row of data in it, that is of
+ * the appropriate format (number of columns and their type).  All other
+ * extensions are ignored.
+ *
+ * @return true on success
+ */
+
+bool magicRunInsertFits(
+    psDB            *dbh,               ///< Database handle
+    const psFits    *fits               ///< psFits object
+);
+
+/** Selects up to limit from the database and returns them in a binary FITS table
+ *
+ * This function assumes an empty psFits object and will create a FITS table
+ * as the first extension.
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return true on success
+ */
+
+bool magicRunSelectRowsFits(
+    psDB            *dbh,               ///< Database handle
+    psFits          *fits,              ///< psFits object
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to return
+);
+
+/** Convert a magicRunRow into an equivalent psMetadata
+ *
+ * @return A psMetadata pointer or NULL on error
+ */
+
+psMetadata *magicRunMetadataFromObject(
+    const magicRunRow *object             ///< fooRow to convert into a psMetadata
+);
+
+/** Convert a psMetadata into an equivalent fooRow
+ *
+ * @return A magicRunRow pointer or NULL on error
+ */
+
+magicRunRow *magicRunObjectFromMetadata(
+    psMetadata      *md                 ///< psMetadata to convert into a fooRow
+);
+/** Selects up to limit rows from the database and returns as magicRunRow objects in a psArray
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return A psArray pointer or NULL on error
+ */
+
+psArray *magicRunSelectRowObjects(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to return
+);
+/** Deletes a row from the database coresponding to an magicRun
+ *
+ *  Note that a 'where' search psMetadata is constructed from each object and
+ *  used to find rows to delete.
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+bool magicRunDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const magicRunRow *object    ///< Object to delete
+);
+/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
+ *
+ *  Note that a 'where' search psMetadata is constructed from each object and
+ *  used to find rows to delete.
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+long long magicRunDeleteRowObjects(
+    psDB            *dbh,               ///< Database handle
+    const psArray   *objects,           ///< Array of objects to delete
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+/** Formats and prints an array of magicRunRow objects
+ *
+ * When mdcf is set the formated output is in psMetadataConfig
+ * format, otherwise it is in a simple tabular format.
+ *
+ * @return true on success
+ */
+
+bool magicRunPrintObjects(
+    FILE            *stream,            ///< a stream
+    psArray         *objects,           ///< An array of magicRunRow objects
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** Formats and prints an magicRunRow object
+ *
+ * When mdcf is set the formated output is in psMetadataConfig
+ * format, otherwise it is in a simple tabular format.
+ *
+ * @return true on success
+ */
+
+bool magicRunPrintObject(
+    FILE            *stream,            ///< a stream
+    magicRunRow *object,    ///< an magicRunRow object
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** magicInputSkyfileRow data structure
+ *
+ * Structure for representing a single row of magicInputSkyfile table data.
+ */
+
+typedef struct {
+    psS64           magic_id;
+    psS64           diff_id;
+    psS32           node;
+} magicInputSkyfileRow;
+
+/** Creates a new magicInputSkyfileRow object
+ *
+ *  @return A new magicInputSkyfileRow object or NULL on failure.
+ */
+
+magicInputSkyfileRow *magicInputSkyfileRowAlloc(
+    psS64           magic_id,
+    psS64           diff_id,
+    psS32           node
+);
+
+/** Creates a new magicInputSkyfile table
+ *
+ * @return true on success
+ */
+
+bool magicInputSkyfileCreateTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Deletes a magicInputSkyfile table
+ *
+ * @return true on success
+ */
+
+bool magicInputSkyfileDropTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Insert a single row into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicInputSkyfileInsert(
+    psDB            *dbh,               ///< Database handle
+    psS64           magic_id,
+    psS64           diff_id,
+    psS32           node
+);
+
+/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+long long magicInputSkyfileDelete(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+
+/** Insert a single magicInputSkyfileRow object into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicInputSkyfileInsertObject(
+    psDB            *dbh,               ///< Database handle
+    magicInputSkyfileRow *object             ///< magicInputSkyfileRow object
+);
+
+/** Insert an array of magicInputSkyfileRow object into a table
+ *
+ * This function constructs and inserts multiple rows based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicInputSkyfileInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of magicInputSkyfileRow objects
+);
+
+/** Insert data from a binary FITS table magicInputSkyfileRow into the database
+ *
+ * This function expects a psFits object with a FITS table as the first
+ * extension.  The table must have at least one row of data in it, that is of
+ * the appropriate format (number of columns and their type).  All other
+ * extensions are ignored.
+ *
+ * @return true on success
+ */
+
+bool magicInputSkyfileInsertFits(
+    psDB            *dbh,               ///< Database handle
+    const psFits    *fits               ///< psFits object
+);
+
+/** Selects up to limit from the database and returns them in a binary FITS table
+ *
+ * This function assumes an empty psFits object and will create a FITS table
+ * as the first extension.
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return true on success
+ */
+
+bool magicInputSkyfileSelectRowsFits(
+    psDB            *dbh,               ///< Database handle
+    psFits          *fits,              ///< psFits object
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to return
+);
+
+/** Convert a magicInputSkyfileRow into an equivalent psMetadata
+ *
+ * @return A psMetadata pointer or NULL on error
+ */
+
+psMetadata *magicInputSkyfileMetadataFromObject(
+    const magicInputSkyfileRow *object             ///< fooRow to convert into a psMetadata
+);
+
+/** Convert a psMetadata into an equivalent fooRow
+ *
+ * @return A magicInputSkyfileRow pointer or NULL on error
+ */
+
+magicInputSkyfileRow *magicInputSkyfileObjectFromMetadata(
+    psMetadata      *md                 ///< psMetadata to convert into a fooRow
+);
+/** Selects up to limit rows from the database and returns as magicInputSkyfileRow objects in a psArray
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return A psArray pointer or NULL on error
+ */
+
+psArray *magicInputSkyfileSelectRowObjects(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to return
+);
+/** Deletes a row from the database coresponding to an magicInputSkyfile
+ *
+ *  Note that a 'where' search psMetadata is constructed from each object and
+ *  used to find rows to delete.
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+bool magicInputSkyfileDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const magicInputSkyfileRow *object    ///< Object to delete
+);
+/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
+ *
+ *  Note that a 'where' search psMetadata is constructed from each object and
+ *  used to find rows to delete.
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+long long magicInputSkyfileDeleteRowObjects(
+    psDB            *dbh,               ///< Database handle
+    const psArray   *objects,           ///< Array of objects to delete
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+/** Formats and prints an array of magicInputSkyfileRow objects
+ *
+ * When mdcf is set the formated output is in psMetadataConfig
+ * format, otherwise it is in a simple tabular format.
+ *
+ * @return true on success
+ */
+
+bool magicInputSkyfilePrintObjects(
+    FILE            *stream,            ///< a stream
+    psArray         *objects,           ///< An array of magicInputSkyfileRow objects
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** Formats and prints an magicInputSkyfileRow object
+ *
+ * When mdcf is set the formated output is in psMetadataConfig
+ * format, otherwise it is in a simple tabular format.
+ *
+ * @return true on success
+ */
+
+bool magicInputSkyfilePrintObject(
+    FILE            *stream,            ///< a stream
+    magicInputSkyfileRow *object,    ///< an magicInputSkyfileRow object
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** magicTreeRow data structure
+ *
+ * Structure for representing a single row of magicTree table data.
+ */
+
+typedef struct {
+    psS64           magic_id;
+    char            *node;
+    char            *dep;
+} magicTreeRow;
+
+/** Creates a new magicTreeRow object
+ *
+ *  @return A new magicTreeRow object or NULL on failure.
+ */
+
+magicTreeRow *magicTreeRowAlloc(
+    psS64           magic_id,
+    const char      *node,
+    const char      *dep
+);
+
+/** Creates a new magicTree table
+ *
+ * @return true on success
+ */
+
+bool magicTreeCreateTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Deletes a magicTree table
+ *
+ * @return true on success
+ */
+
+bool magicTreeDropTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Insert a single row into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicTreeInsert(
+    psDB            *dbh,               ///< Database handle
+    psS64           magic_id,
+    const char      *node,
+    const char      *dep
+);
+
+/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+long long magicTreeDelete(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+
+/** Insert a single magicTreeRow object into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicTreeInsertObject(
+    psDB            *dbh,               ///< Database handle
+    magicTreeRow    *object             ///< magicTreeRow object
+);
+
+/** Insert an array of magicTreeRow object into a table
+ *
+ * This function constructs and inserts multiple rows based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicTreeInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of magicTreeRow objects
+);
+
+/** Insert data from a binary FITS table magicTreeRow into the database
+ *
+ * This function expects a psFits object with a FITS table as the first
+ * extension.  The table must have at least one row of data in it, that is of
+ * the appropriate format (number of columns and their type).  All other
+ * extensions are ignored.
+ *
+ * @return true on success
+ */
+
+bool magicTreeInsertFits(
+    psDB            *dbh,               ///< Database handle
+    const psFits    *fits               ///< psFits object
+);
+
+/** Selects up to limit from the database and returns them in a binary FITS table
+ *
+ * This function assumes an empty psFits object and will create a FITS table
+ * as the first extension.
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return true on success
+ */
+
+bool magicTreeSelectRowsFits(
+    psDB            *dbh,               ///< Database handle
+    psFits          *fits,              ///< psFits object
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to return
+);
+
+/** Convert a magicTreeRow into an equivalent psMetadata
+ *
+ * @return A psMetadata pointer or NULL on error
+ */
+
+psMetadata *magicTreeMetadataFromObject(
+    const magicTreeRow *object             ///< fooRow to convert into a psMetadata
+);
+
+/** Convert a psMetadata into an equivalent fooRow
+ *
+ * @return A magicTreeRow pointer or NULL on error
+ */
+
+magicTreeRow *magicTreeObjectFromMetadata(
+    psMetadata      *md                 ///< psMetadata to convert into a fooRow
+);
+/** Selects up to limit rows from the database and returns as magicTreeRow objects in a psArray
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return A psArray pointer or NULL on error
+ */
+
+psArray *magicTreeSelectRowObjects(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to return
+);
+/** Deletes a row from the database coresponding to an magicTree
+ *
+ *  Note that a 'where' search psMetadata is constructed from each object and
+ *  used to find rows to delete.
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+bool magicTreeDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const magicTreeRow *object    ///< Object to delete
+);
+/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
+ *
+ *  Note that a 'where' search psMetadata is constructed from each object and
+ *  used to find rows to delete.
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+long long magicTreeDeleteRowObjects(
+    psDB            *dbh,               ///< Database handle
+    const psArray   *objects,           ///< Array of objects to delete
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+/** Formats and prints an array of magicTreeRow objects
+ *
+ * When mdcf is set the formated output is in psMetadataConfig
+ * format, otherwise it is in a simple tabular format.
+ *
+ * @return true on success
+ */
+
+bool magicTreePrintObjects(
+    FILE            *stream,            ///< a stream
+    psArray         *objects,           ///< An array of magicTreeRow objects
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** Formats and prints an magicTreeRow object
+ *
+ * When mdcf is set the formated output is in psMetadataConfig
+ * format, otherwise it is in a simple tabular format.
+ *
+ * @return true on success
+ */
+
+bool magicTreePrintObject(
+    FILE            *stream,            ///< a stream
+    magicTreeRow *object,    ///< an magicTreeRow object
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** magicNodeResultRow data structure
+ *
+ * Structure for representing a single row of magicNodeResult table data.
+ */
+
+typedef struct {
+    psS64           magic_id;
+    char            *node;
+    char            *uri;
+} magicNodeResultRow;
+
+/** Creates a new magicNodeResultRow object
+ *
+ *  @return A new magicNodeResultRow object or NULL on failure.
+ */
+
+magicNodeResultRow *magicNodeResultRowAlloc(
+    psS64           magic_id,
+    const char      *node,
+    const char      *uri
+);
+
+/** Creates a new magicNodeResult table
+ *
+ * @return true on success
+ */
+
+bool magicNodeResultCreateTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Deletes a magicNodeResult table
+ *
+ * @return true on success
+ */
+
+bool magicNodeResultDropTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Insert a single row into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicNodeResultInsert(
+    psDB            *dbh,               ///< Database handle
+    psS64           magic_id,
+    const char      *node,
+    const char      *uri
+);
+
+/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+long long magicNodeResultDelete(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+
+/** Insert a single magicNodeResultRow object into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicNodeResultInsertObject(
+    psDB            *dbh,               ///< Database handle
+    magicNodeResultRow *object             ///< magicNodeResultRow object
+);
+
+/** Insert an array of magicNodeResultRow object into a table
+ *
+ * This function constructs and inserts multiple rows based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicNodeResultInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of magicNodeResultRow objects
+);
+
+/** Insert data from a binary FITS table magicNodeResultRow into the database
+ *
+ * This function expects a psFits object with a FITS table as the first
+ * extension.  The table must have at least one row of data in it, that is of
+ * the appropriate format (number of columns and their type).  All other
+ * extensions are ignored.
+ *
+ * @return true on success
+ */
+
+bool magicNodeResultInsertFits(
+    psDB            *dbh,               ///< Database handle
+    const psFits    *fits               ///< psFits object
+);
+
+/** Selects up to limit from the database and returns them in a binary FITS table
+ *
+ * This function assumes an empty psFits object and will create a FITS table
+ * as the first extension.
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return true on success
+ */
+
+bool magicNodeResultSelectRowsFits(
+    psDB            *dbh,               ///< Database handle
+    psFits          *fits,              ///< psFits object
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to return
+);
+
+/** Convert a magicNodeResultRow into an equivalent psMetadata
+ *
+ * @return A psMetadata pointer or NULL on error
+ */
+
+psMetadata *magicNodeResultMetadataFromObject(
+    const magicNodeResultRow *object             ///< fooRow to convert into a psMetadata
+);
+
+/** Convert a psMetadata into an equivalent fooRow
+ *
+ * @return A magicNodeResultRow pointer or NULL on error
+ */
+
+magicNodeResultRow *magicNodeResultObjectFromMetadata(
+    psMetadata      *md                 ///< psMetadata to convert into a fooRow
+);
+/** Selects up to limit rows from the database and returns as magicNodeResultRow objects in a psArray
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return A psArray pointer or NULL on error
+ */
+
+psArray *magicNodeResultSelectRowObjects(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to return
+);
+/** Deletes a row from the database coresponding to an magicNodeResult
+ *
+ *  Note that a 'where' search psMetadata is constructed from each object and
+ *  used to find rows to delete.
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+bool magicNodeResultDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const magicNodeResultRow *object    ///< Object to delete
+);
+/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
+ *
+ *  Note that a 'where' search psMetadata is constructed from each object and
+ *  used to find rows to delete.
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+long long magicNodeResultDeleteRowObjects(
+    psDB            *dbh,               ///< Database handle
+    const psArray   *objects,           ///< Array of objects to delete
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+/** Formats and prints an array of magicNodeResultRow objects
+ *
+ * When mdcf is set the formated output is in psMetadataConfig
+ * format, otherwise it is in a simple tabular format.
+ *
+ * @return true on success
+ */
+
+bool magicNodeResultPrintObjects(
+    FILE            *stream,            ///< a stream
+    psArray         *objects,           ///< An array of magicNodeResultRow objects
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** Formats and prints an magicNodeResultRow object
+ *
+ * When mdcf is set the formated output is in psMetadataConfig
+ * format, otherwise it is in a simple tabular format.
+ *
+ * @return true on success
+ */
+
+bool magicNodeResultPrintObject(
+    FILE            *stream,            ///< a stream
+    magicNodeResultRow *object,    ///< an magicNodeResultRow object
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** magicMaskRow data structure
+ *
+ * Structure for representing a single row of magicMask table data.
+ */
+
+typedef struct {
+    psS64           magic_id;
+    char            *uri;
+} magicMaskRow;
+
+/** Creates a new magicMaskRow object
+ *
+ *  @return A new magicMaskRow object or NULL on failure.
+ */
+
+magicMaskRow *magicMaskRowAlloc(
+    psS64           magic_id,
+    const char      *uri
+);
+
+/** Creates a new magicMask table
+ *
+ * @return true on success
+ */
+
+bool magicMaskCreateTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Deletes a magicMask table
+ *
+ * @return true on success
+ */
+
+bool magicMaskDropTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Insert a single row into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicMaskInsert(
+    psDB            *dbh,               ///< Database handle
+    psS64           magic_id,
+    const char      *uri
+);
+
+/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+long long magicMaskDelete(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+
+/** Insert a single magicMaskRow object into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicMaskInsertObject(
+    psDB            *dbh,               ///< Database handle
+    magicMaskRow    *object             ///< magicMaskRow object
+);
+
+/** Insert an array of magicMaskRow object into a table
+ *
+ * This function constructs and inserts multiple rows based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicMaskInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of magicMaskRow objects
+);
+
+/** Insert data from a binary FITS table magicMaskRow into the database
+ *
+ * This function expects a psFits object with a FITS table as the first
+ * extension.  The table must have at least one row of data in it, that is of
+ * the appropriate format (number of columns and their type).  All other
+ * extensions are ignored.
+ *
+ * @return true on success
+ */
+
+bool magicMaskInsertFits(
+    psDB            *dbh,               ///< Database handle
+    const psFits    *fits               ///< psFits object
+);
+
+/** Selects up to limit from the database and returns them in a binary FITS table
+ *
+ * This function assumes an empty psFits object and will create a FITS table
+ * as the first extension.
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return true on success
+ */
+
+bool magicMaskSelectRowsFits(
+    psDB            *dbh,               ///< Database handle
+    psFits          *fits,              ///< psFits object
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to return
+);
+
+/** Convert a magicMaskRow into an equivalent psMetadata
+ *
+ * @return A psMetadata pointer or NULL on error
+ */
+
+psMetadata *magicMaskMetadataFromObject(
+    const magicMaskRow *object             ///< fooRow to convert into a psMetadata
+);
+
+/** Convert a psMetadata into an equivalent fooRow
+ *
+ * @return A magicMaskRow pointer or NULL on error
+ */
+
+magicMaskRow *magicMaskObjectFromMetadata(
+    psMetadata      *md                 ///< psMetadata to convert into a fooRow
+);
+/** Selects up to limit rows from the database and returns as magicMaskRow objects in a psArray
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return A psArray pointer or NULL on error
+ */
+
+psArray *magicMaskSelectRowObjects(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to return
+);
+/** Deletes a row from the database coresponding to an magicMask
+ *
+ *  Note that a 'where' search psMetadata is constructed from each object and
+ *  used to find rows to delete.
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+bool magicMaskDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const magicMaskRow *object    ///< Object to delete
+);
+/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
+ *
+ *  Note that a 'where' search psMetadata is constructed from each object and
+ *  used to find rows to delete.
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+long long magicMaskDeleteRowObjects(
+    psDB            *dbh,               ///< Database handle
+    const psArray   *objects,           ///< Array of objects to delete
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+/** Formats and prints an array of magicMaskRow objects
+ *
+ * When mdcf is set the formated output is in psMetadataConfig
+ * format, otherwise it is in a simple tabular format.
+ *
+ * @return true on success
+ */
+
+bool magicMaskPrintObjects(
+    FILE            *stream,            ///< a stream
+    psArray         *objects,           ///< An array of magicMaskRow objects
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** Formats and prints an magicMaskRow object
+ *
+ * When mdcf is set the formated output is in psMetadataConfig
+ * format, otherwise it is in a simple tabular format.
+ *
+ * @return true on success
+ */
+
+bool magicMaskPrintObject(
+    FILE            *stream,            ///< a stream
+    magicMaskRow *object,    ///< an magicMaskRow object
+    bool            mdcf                ///< format as mdconfig or simple
+);
 
 /// @}
@@ -8859,3 +9870,3 @@
 #endif
 
-#endif // DETREGISTEREDIMFILE_DB_H
+#endif // MAGICMASK_DB_H
Index: /trunk/ippdb/tests/alloc.c
===================================================================
--- /trunk/ippdb/tests/alloc.c	(revision 14597)
+++ /trunk/ippdb/tests/alloc.c	(revision 14598)
@@ -125,5 +125,5 @@
         pzPendingImfileRow *object;
 
-        object = pzPendingImfileRowAlloc("a string", "a string", "a string", "a string", "a string", -64    );
+        object = pzPendingImfileRowAlloc("a string", "a string", "a string", "a string", "a string"    );
 
         if (!object) {
@@ -151,21 +151,153 @@
             exit(EXIT_FAILURE);
         }
+
+        psFree(object);
+    }
+
+    {
+        pzDoneExpRow    *object;
+
+        object = pzDoneExpRowAlloc("a string", "a string", "a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (strncmp(object->exp_name, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        pzDoneImfileRow *object;
+
+        object = pzDoneImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (strncmp(object->exp_name, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        newExpRow       *object;
+
+        object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
         if (!object->exp_id == -64) {
             psFree(object);
             exit(EXIT_FAILURE);
         }
-
-        psFree(object);
-    }
-
-    {
-        pzDoneExpRow    *object;
-
-        object = pzDoneExpRowAlloc("a string", "a string", "a string"    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
+        if (strncmp(object->tmp_exp_name, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->tmp_camera, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->tmp_telescope, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->workdir_state, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        newImfileRow    *object;
+
+        object = newImfileRowAlloc(-64, "a string", "a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->exp_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->tmp_class_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        rawExpRow       *object;
+
+        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    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->exp_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
         if (strncmp(object->exp_name, "a string", MAX_STRING_LENGTH)) {
             psFree(object);
@@ -180,17 +312,128 @@
             exit(EXIT_FAILURE);
         }
-
-        psFree(object);
-    }
-
-    {
-        pzDoneImfileRow *object;
-
-        object = pzDoneImfileRowAlloc("a string", "a string", "a string", "a string", "a string", -64, "a string"    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->exp_tag, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->filelevel, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->airmass == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->ra == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->decl == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->exp_time == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->sat_pixel_frac == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_mean_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->alt == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->az == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->ccd_temp == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->posang == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_1 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_2 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_3 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_4 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_5 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->object, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->solang == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        rawImfileRow    *object;
+
+        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    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->exp_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
         if (strncmp(object->exp_name, "a string", MAX_STRING_LENGTH)) {
             psFree(object);
@@ -205,5 +448,8 @@
             exit(EXIT_FAILURE);
         }
-        if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->tmp_class_id, "a string", MAX_STRING_LENGTH)) {
             psFree(object);
             exit(EXIT_FAILURE);
@@ -213,38 +459,1707 @@
             exit(EXIT_FAILURE);
         }
+        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->filelevel, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->airmass == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->ra == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->decl == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->exp_time == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->sat_pixel_frac == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_mean_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->alt == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->az == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->ccd_temp == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->posang == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_1 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_2 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_3 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_4 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_5 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->object, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        guidePendingExpRow *object;
+
+        object = guidePendingExpRowAlloc(-64, -64, "a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->guide_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
         if (!object->exp_id == -64) {
             psFree(object);
             exit(EXIT_FAILURE);
         }
+        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        chipRunRow      *object;
+
+        object = chipRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->chip_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->exp_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->workdir_state, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->expgroup, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        chipProcessedImfileRow *object;
+
+        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    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->chip_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->exp_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
         if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
             psFree(object);
             exit(EXIT_FAILURE);
         }
-
-        psFree(object);
-    }
-
-    {
-        newExpRow       *object;
-
-        object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
+        if (!object->bg == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_stdev == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_mean_stdev == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bias == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bias_stdev == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_0 == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_1 == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_2 == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->sigma_ra == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->sigma_dec == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->ap_resid == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->ap_resid_stdev == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fwhm == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fwhm_range == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->n_stars == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->n_extended == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->n_cr == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->n_astrom == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        chipMaskRow     *object;
+
+        object = chipMaskRowAlloc("a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        camRunRow       *object;
+
+        object = camRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->cam_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->chip_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->workdir_state, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->expgroup, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        camProcessedExpRow *object;
+
+        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    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->cam_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->chip_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_stdev == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_mean_stdev == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->sigma_ra == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->sigma_dec == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->zp_mean == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->zp_stdev == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fwhm == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fwhm_range == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->n_stars == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->n_extended == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->n_cr == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->n_astrom == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        camMaskRow      *object;
+
+        object = camMaskRowAlloc("a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        warpRunRow      *object;
+
+        object = warpRunRowAlloc(-64, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->warp_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->mode, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        warpInputExpRow *object;
+
+        object = warpInputExpRowAlloc(-64, -64, true    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->warp_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->cam_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->magiced == true) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        warpSkyCellMapRow *object;
+
+        object = warpSkyCellMapRowAlloc(-64, "a string", "a string", -64, "a string", -16    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->warp_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->cam_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        warpSkyfileRow  *object;
+
+        object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, -16    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->warp_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->pixel_fill == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        diffRunRow      *object;
+
+        object = diffRunRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->diff_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        diffInputSkyfileRow *object;
+
+        object = diffInputSkyfileRowAlloc(-64, true, -64, -64, "a string", "a string", "a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->diff_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->template == true) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->stack_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->warp_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->kind, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        diffSkyfileRow  *object;
+
+        object = diffSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, -16    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->diff_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        stackRunRow     *object;
+
+        object = stackRunRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->stack_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        stackInputSkyfileRow *object;
+
+        object = stackInputSkyfileRowAlloc(-64, -64    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->stack_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->warp_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        stackSumSkyfileRow *object;
+
+        object = stackSumSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, -16    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->stack_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        detRunRow       *object;
+
+        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    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->det_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->iteration == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->det_type, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->mode, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->filelevel, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->airmass_min == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->airmass_max == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->exp_time_min == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->exp_time_max == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->ccd_temp_min == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->ccd_temp_max == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->posang_min == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->posang_max == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->solang_min == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->solang_max == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->parent == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        detInputExpRow  *object;
+
+        object = detInputExpRowAlloc(-64, -32, -64, true    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->det_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->iteration == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
         if (!object->exp_id == -64) {
             psFree(object);
             exit(EXIT_FAILURE);
         }
-        if (strncmp(object->tmp_exp_name, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->tmp_camera, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->tmp_telescope, "a string", MAX_STRING_LENGTH)) {
+        if (!object->include == true) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        detProcessedImfileRow *object;
+
+        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    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->det_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->exp_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_mean_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_0 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_1 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_2 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_1 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_2 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_3 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_4 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_5 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        detProcessedExpRow *object;
+
+        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    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->det_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->exp_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_mean_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_0 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_1 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_2 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_1 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_2 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_3 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_4 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_5 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        detStackedImfileRow *object;
+
+        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    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->det_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->iteration == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_mean_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_1 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_2 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_3 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_4 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_5 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        detNormalizedStatImfileRow *object;
+
+        object = detNormalizedStatImfileRowAlloc(-64, -32, "a string", 32.32, -16    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->det_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->iteration == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->norm == 32.32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        detNormalizedImfileRow *object;
+
+        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    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->det_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->iteration == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_mean_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_1 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_2 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_3 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_4 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_5 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        detNormalizedExpRow *object;
+
+        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    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->det_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->iteration == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_mean_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_1 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_2 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_3 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_4 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_5 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        detResidImfileRow *object;
+
+        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    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->det_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->iteration == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->exp_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_mean_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_skewness == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_kurtosis == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bin_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_0 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_1 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_2 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_resid_0 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_resid_1 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_resid_2 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_1 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_2 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_3 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_4 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_5 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        detResidExpRow  *object;
+
+        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    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->det_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->iteration == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->exp_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_mean_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_skewness == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_kurtosis == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bin_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_0 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_1 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_2 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_resid_0 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_resid_1 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fringe_resid_2 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_1 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_2 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_3 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_4 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_5 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->accept == true) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        detRunSummaryRow *object;
+
+        object = detRunSummaryRowAlloc(-64, -32, 64.64, 64.64, 64.64, true, -16    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->det_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->iteration == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_mean_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->accept == true) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        detRegisteredImfileRow *object;
+
+        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    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->det_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->iteration == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->bg_mean_stdev == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_1 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_2 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_3 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_4 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->user_5 == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->fault == -16) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        magicRunRow     *object;
+
+        object = magicRunRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->magic_id == -64) {
             psFree(object);
             exit(EXIT_FAILURE);
@@ -262,26 +2177,83 @@
             exit(EXIT_FAILURE);
         }
-        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        newImfileRow    *object;
-
-        object = newImfileRowAlloc(-64, "a string", "a string"    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->exp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->tmp_class_id, "a string", MAX_STRING_LENGTH)) {
+        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        magicInputSkyfileRow *object;
+
+        object = magicInputSkyfileRowAlloc(-64, -64, -32    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->magic_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->diff_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->node == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        magicTreeRow    *object;
+
+        object = magicTreeRowAlloc(-64, "a string", "a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->magic_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->node, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->dep, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        magicNodeResultRow *object;
+
+        object = magicNodeResultRowAlloc(-64, "a string", "a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->magic_id == -64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->node, "a string", MAX_STRING_LENGTH)) {
             psFree(object);
             exit(EXIT_FAILURE);
@@ -296,1857 +2268,17 @@
 
     {
-        rawExpRow       *object;
-
-        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    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->exp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->exp_name, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->exp_tag, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->filelevel, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->airmass == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->ra == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->decl == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->exp_time == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->sat_pixel_frac == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_mean_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->alt == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->az == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->ccd_temp == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->posang == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_1 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_2 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_3 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_4 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_5 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->object, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->solang == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        rawImfileRow    *object;
-
-        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    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->exp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->exp_name, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->tmp_class_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
+        magicMaskRow    *object;
+
+        object = magicMaskRowAlloc(-64, "a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->magic_id == -64) {
             psFree(object);
             exit(EXIT_FAILURE);
         }
         if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->filelevel, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->airmass == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->ra == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->decl == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->exp_time == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->sat_pixel_frac == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_mean_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->alt == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->az == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->ccd_temp == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->posang == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_1 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_2 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_3 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_4 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_5 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->object, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        guidePendingExpRow *object;
-
-        object = guidePendingExpRowAlloc(-64, -64, "a string"    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->guide_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->exp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        chipRunRow      *object;
-
-        object = chipRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->chip_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->exp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->workdir_state, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->expgroup, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        chipProcessedImfileRow *object;
-
-        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    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->chip_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->exp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_stdev == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_mean_stdev == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bias == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bias_stdev == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_0 == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_1 == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_2 == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->sigma_ra == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->sigma_dec == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->ap_resid == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->ap_resid_stdev == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fwhm == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fwhm_range == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->n_stars == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->n_extended == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->n_cr == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->n_astrom == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        chipMaskRow     *object;
-
-        object = chipMaskRowAlloc("a string"    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        camRunRow       *object;
-
-        object = camRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->cam_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->chip_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->workdir_state, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->expgroup, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        camProcessedExpRow *object;
-
-        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    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->cam_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->chip_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_stdev == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_mean_stdev == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->sigma_ra == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->sigma_dec == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->zp_mean == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->zp_stdev == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fwhm == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fwhm_range == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->n_stars == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->n_extended == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->n_cr == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->n_astrom == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        camMaskRow      *object;
-
-        object = camMaskRowAlloc("a string"    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        warpRunRow      *object;
-
-        object = warpRunRowAlloc(-64, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z"    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->warp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->mode, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        warpInputExpRow *object;
-
-        object = warpInputExpRowAlloc(-64, -64, true    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->warp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->cam_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->magiced == true) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        warpSkyCellMapRow *object;
-
-        object = warpSkyCellMapRowAlloc(-64, "a string", "a string", -64, "a string", -16    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->warp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->cam_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        warpSkyfileRow  *object;
-
-        object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, -16    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->warp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        diffRunRow      *object;
-
-        object = diffRunRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string"    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->diff_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        diffInputSkyfileRow *object;
-
-        object = diffInputSkyfileRowAlloc(-64, true, -64, -64, "a string", "a string", "a string"    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->diff_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->template == true) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->stack_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->warp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->kind, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        diffSkyfileRow  *object;
-
-        object = diffSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, -16    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->diff_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        stackRunRow     *object;
-
-        object = stackRunRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string"    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->stack_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->skycell_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        stackInputSkyfileRow *object;
-
-        object = stackInputSkyfileRowAlloc(-64, -64    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->stack_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->warp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        stackSumSkyfileRow *object;
-
-        object = stackSumSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, -16    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->stack_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        detRunRow       *object;
-
-        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    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->det_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->iteration == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->det_type, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->mode, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->filelevel, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->airmass_min == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->airmass_max == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->exp_time_min == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->exp_time_max == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->ccd_temp_min == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->ccd_temp_max == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->posang_min == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->posang_max == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->solang_min == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->solang_max == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->parent == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        detInputExpRow  *object;
-
-        object = detInputExpRowAlloc(-64, -32, -64, true    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->det_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->iteration == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->exp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->include == true) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        detProcessedImfileRow *object;
-
-        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    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->det_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->exp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_mean_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_0 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_1 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_2 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_1 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_2 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_3 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_4 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_5 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        detProcessedExpRow *object;
-
-        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    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->det_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->exp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_mean_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_0 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_1 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_2 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_1 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_2 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_3 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_4 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_5 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        detStackedImfileRow *object;
-
-        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    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->det_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->iteration == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_mean_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_1 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_2 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_3 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_4 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_5 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        detNormalizedStatImfileRow *object;
-
-        object = detNormalizedStatImfileRowAlloc(-64, -32, "a string", 32.32, -16    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->det_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->iteration == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->norm == 32.32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        detNormalizedImfileRow *object;
-
-        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    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->det_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->iteration == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_mean_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_1 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_2 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_3 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_4 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_5 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        detNormalizedExpRow *object;
-
-        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    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->det_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->iteration == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_mean_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_1 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_2 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_3 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_4 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_5 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        detResidImfileRow *object;
-
-        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    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->det_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->iteration == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->exp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_mean_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_skewness == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_kurtosis == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bin_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_0 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_1 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_2 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_resid_0 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_resid_1 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_resid_2 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_1 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_2 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_3 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_4 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_5 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        detResidExpRow  *object;
-
-        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    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->det_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->iteration == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->exp_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_mean_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_skewness == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_kurtosis == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bin_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_0 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_1 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_2 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_resid_0 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_resid_1 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fringe_resid_2 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_1 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_2 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_3 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_4 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_5 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->accept == true) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        detRunSummaryRow *object;
-
-        object = detRunSummaryRowAlloc(-64, -32, 64.64, 64.64, 64.64, true, -16    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->det_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->iteration == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_mean_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->accept == true) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-    }
-
-    {
-        detRegisteredImfileRow *object;
-
-        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    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!object->det_id == -64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->iteration == -32) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->bg_mean_stdev == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_1 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_2 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_3 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_4 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->user_5 == 64.64) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (strncmp(object->path_base, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->fault == -16) {
             psFree(object);
             exit(EXIT_FAILURE);
Index: /trunk/ippdb/tests/createtable.c
===================================================================
--- /trunk/ippdb/tests/createtable.c	(revision 14597)
+++ /trunk/ippdb/tests/createtable.c	(revision 14598)
@@ -590,4 +590,79 @@
     }
 
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if(!magicRunCreateTable(dbh)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if(!magicInputSkyfileCreateTable(dbh)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if(!magicTreeCreateTable(dbh)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if(!magicNodeResultCreateTable(dbh)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if(!magicMaskCreateTable(dbh)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
     exit(EXIT_SUCCESS);
 }
Index: /trunk/ippdb/tests/dbcleanup.c
===================================================================
--- /trunk/ippdb/tests/dbcleanup.c	(revision 14597)
+++ /trunk/ippdb/tests/dbcleanup.c	(revision 14598)
@@ -50,4 +50,9 @@
     p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detRunSummary");
     p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detRegisteredImfile");
+    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicRun");
+    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicInputSkyfile");
+    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicTree");
+    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicNodeResult");
+    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicMask");
 
     psDBCleanup(dbh);
Index: /trunk/ippdb/tests/dbsetup.c
===================================================================
--- /trunk/ippdb/tests/dbsetup.c	(revision 14597)
+++ /trunk/ippdb/tests/dbsetup.c	(revision 14598)
@@ -130,4 +130,19 @@
     detRegisteredImfileCreateTable(dbh);
 
+    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicRun");
+    magicRunCreateTable(dbh);
+
+    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicInputSkyfile");
+    magicInputSkyfileCreateTable(dbh);
+
+    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicTree");
+    magicTreeCreateTable(dbh);
+
+    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicNodeResult");
+    magicNodeResultCreateTable(dbh);
+
+    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS magicMask");
+    magicMaskCreateTable(dbh);
+
     psDBCleanup(dbh);
 
Index: /trunk/ippdb/tests/droptable.c
===================================================================
--- /trunk/ippdb/tests/droptable.c	(revision 14597)
+++ /trunk/ippdb/tests/droptable.c	(revision 14598)
@@ -590,4 +590,79 @@
     }
 
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicRunDropTable(dbh)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicInputSkyfileDropTable(dbh)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicTreeDropTable(dbh)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicNodeResultDropTable(dbh)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicMaskDropTable(dbh)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
     exit(EXIT_SUCCESS);
 }
Index: /trunk/ippdb/tests/insert.c
===================================================================
--- /trunk/ippdb/tests/insert.c	(revision 14597)
+++ /trunk/ippdb/tests/insert.c	(revision 14598)
@@ -58,5 +58,5 @@
         }
 
-        if (!pzPendingImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", -64)) {
+        if (!pzPendingImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string")) {
             exit(EXIT_FAILURE);
         }
@@ -88,5 +88,5 @@
         }
 
-        if (!pzDoneImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", -64, "a string")) {
+        if (!pzDoneImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", "a string")) {
             exit(EXIT_FAILURE);
         }
@@ -313,5 +313,5 @@
         }
 
-        if (!warpSkyfileInsert(dbh, -64, "a string", "a string", "a string", "a string", 64.64, 64.64, -16)) {
+        if (!warpSkyfileInsert(dbh, -64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, -16)) {
             exit(EXIT_FAILURE);
         }
@@ -584,4 +584,79 @@
 
         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)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicRunInsert(dbh, -64, "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z")) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicInputSkyfileInsert(dbh, -64, -64, -32)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicTreeInsert(dbh, -64, "a string", "a string")) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicNodeResultInsert(dbh, -64, "a string", "a string")) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicMaskInsert(dbh, -64, "a string")) {
             exit(EXIT_FAILURE);
         }
Index: /trunk/ippdb/tests/insertfits.c
===================================================================
--- /trunk/ippdb/tests/insertfits.c	(revision 14597)
+++ /trunk/ippdb/tests/insertfits.c	(revision 14598)
@@ -1023,4 +1023,134 @@
     }
 
+    {
+        psDB            *dbh;
+        psFits          *fits;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        // open a temp
+        fits = psFitsOpen(TMP_FILENAME, "r");
+        if (!fits) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicRunInsertFits(dbh, fits)) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!psFitsClose(fits)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        psFits          *fits;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        // open a temp
+        fits = psFitsOpen(TMP_FILENAME, "r");
+        if (!fits) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicInputSkyfileInsertFits(dbh, fits)) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!psFitsClose(fits)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        psFits          *fits;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        // open a temp
+        fits = psFitsOpen(TMP_FILENAME, "r");
+        if (!fits) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicTreeInsertFits(dbh, fits)) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!psFitsClose(fits)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        psFits          *fits;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        // open a temp
+        fits = psFitsOpen(TMP_FILENAME, "r");
+        if (!fits) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicNodeResultInsertFits(dbh, fits)) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!psFitsClose(fits)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        psFits          *fits;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        // open a temp
+        fits = psFitsOpen(TMP_FILENAME, "r");
+        if (!fits) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicMaskInsertFits(dbh, fits)) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!psFitsClose(fits)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
     exit(EXIT_SUCCESS);
 }
Index: /trunk/ippdb/tests/insertobject.c
===================================================================
--- /trunk/ippdb/tests/insertobject.c	(revision 14597)
+++ /trunk/ippdb/tests/insertobject.c	(revision 14598)
@@ -80,5 +80,5 @@
         }
 
-        object = pzPendingImfileRowAlloc("a string", "a string", "a string", "a string", "a string", -64);
+        object = pzPendingImfileRowAlloc("a string", "a string", "a string", "a string", "a string");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -124,5 +124,5 @@
         }
 
-        object = pzDoneImfileRowAlloc("a string", "a string", "a string", "a string", "a string", -64, "a string");
+        object = pzDoneImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -454,5 +454,5 @@
         }
 
-        object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, -16);
+        object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, -16);
         if (!object) {
             exit(EXIT_FAILURE);
@@ -856,4 +856,114 @@
 
         if (!detRegisteredImfileInsertObject(dbh, object)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        magicRunRow     *object;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        object = magicRunRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z");
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicRunInsertObject(dbh, object)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        magicInputSkyfileRow *object;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        object = magicInputSkyfileRowAlloc(-64, -64, -32);
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicInputSkyfileInsertObject(dbh, object)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        magicTreeRow    *object;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        object = magicTreeRowAlloc(-64, "a string", "a string");
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicTreeInsertObject(dbh, object)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        magicNodeResultRow *object;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        object = magicNodeResultRowAlloc(-64, "a string", "a string");
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicNodeResultInsertObject(dbh, object)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        magicMaskRow    *object;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        object = magicMaskRowAlloc(-64, "a string");
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicMaskInsertObject(dbh, object)) {
             exit(EXIT_FAILURE);
         }
Index: /trunk/ippdb/tests/metadatafromobject.c
===================================================================
--- /trunk/ippdb/tests/metadatafromobject.c	(revision 14597)
+++ /trunk/ippdb/tests/metadatafromobject.c	(revision 14598)
@@ -151,5 +151,5 @@
         bool            status;
 
-        object = pzPendingImfileRowAlloc("a string", "a string", "a string", "a string", "a string", -64);
+        object = pzPendingImfileRowAlloc("a string", "a string", "a string", "a string", "a string");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -183,7 +183,4 @@
             exit(EXIT_FAILURE);
         }
-            psFree(md);
-            exit(EXIT_FAILURE);
-        }
 
         psFree(md);
@@ -228,5 +225,5 @@
         bool            status;
 
-        object = pzDoneImfileRowAlloc("a string", "a string", "a string", "a string", "a string", -64, "a string");
+        object = pzDoneImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -260,7 +257,4 @@
             exit(EXIT_FAILURE);
         }
-            psFree(md);
-            exit(EXIT_FAILURE);
-        }
         if (strncmp(psMetadataLookupPtr(&status, md, "uri"), "a string", MAX_STRING_LENGTH)) {
             psFree(md);
@@ -1151,5 +1145,5 @@
         bool            status;
 
-        object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, -16);
+        object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, -16);
         if (!object) {
             exit(EXIT_FAILURE);
@@ -1190,4 +1184,8 @@
             exit(EXIT_FAILURE);
         }
+        if (!psMetadataLookupF64(&status, md, "pixel_fill") == 64.64) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
             psFree(md);
             exit(EXIT_FAILURE);
@@ -2395,4 +2393,174 @@
             exit(EXIT_FAILURE);
         }
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(md);
+    }
+
+    {
+        psMetadata      *md;
+        magicRunRow     *object;
+        bool            status;
+
+        object = magicRunRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z");
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        md = magicRunMetadataFromObject(object);
+        if (!md) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(psMetadataLookupPtr(&status, md, "state"), "a string", MAX_STRING_LENGTH)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(psMetadataLookupPtr(&status, md, "workdir"), "a string", MAX_STRING_LENGTH)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(psMetadataLookupPtr(&status, md, "workdir_state"), "a string", MAX_STRING_LENGTH)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(psMetadataLookupPtr(&status, md, "dvodb"), "a string", MAX_STRING_LENGTH)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(md);
+    }
+
+    {
+        psMetadata      *md;
+        magicInputSkyfileRow *object;
+        bool            status;
+
+        object = magicInputSkyfileRowAlloc(-64, -64, -32);
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        md = magicInputSkyfileMetadataFromObject(object);
+        if (!md) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (!psMetadataLookupS32(&status, md, "node") == -32) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(md);
+    }
+
+    {
+        psMetadata      *md;
+        magicTreeRow    *object;
+        bool            status;
+
+        object = magicTreeRowAlloc(-64, "a string", "a string");
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        md = magicTreeMetadataFromObject(object);
+        if (!md) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(psMetadataLookupPtr(&status, md, "node"), "a string", MAX_STRING_LENGTH)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(psMetadataLookupPtr(&status, md, "dep"), "a string", MAX_STRING_LENGTH)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(md);
+    }
+
+    {
+        psMetadata      *md;
+        magicNodeResultRow *object;
+        bool            status;
+
+        object = magicNodeResultRowAlloc(-64, "a string", "a string");
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        md = magicNodeResultMetadataFromObject(object);
+        if (!md) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(psMetadataLookupPtr(&status, md, "node"), "a string", MAX_STRING_LENGTH)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(psMetadataLookupPtr(&status, md, "uri"), "a string", MAX_STRING_LENGTH)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(md);
+    }
+
+    {
+        psMetadata      *md;
+        magicMaskRow    *object;
+        bool            status;
+
+        object = magicMaskRowAlloc(-64, "a string");
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        md = magicMaskMetadataFromObject(object);
+        if (!md) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(psMetadataLookupPtr(&status, md, "uri"), "a string", MAX_STRING_LENGTH)) {
             psFree(md);
             exit(EXIT_FAILURE);
Index: /trunk/ippdb/tests/objectfrommetadata.c
===================================================================
--- /trunk/ippdb/tests/objectfrommetadata.c	(revision 14597)
+++ /trunk/ippdb/tests/objectfrommetadata.c	(revision 14598)
@@ -237,7 +237,4 @@
             exit(EXIT_FAILURE);
         }
-            psFree(md);
-            exit(EXIT_FAILURE);
-        }
 
         object = pzPendingImfileObjectFromMetadata(md);
@@ -269,7 +266,4 @@
             exit(EXIT_FAILURE);
         }
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
 
         psFree(object);
@@ -343,7 +337,4 @@
             exit(EXIT_FAILURE);
         }
-            psFree(md);
-            exit(EXIT_FAILURE);
-        }
         if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
             psFree(md);
@@ -379,7 +370,4 @@
             exit(EXIT_FAILURE);
         }
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
         if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
             psFree(object);
@@ -1836,4 +1824,8 @@
             exit(EXIT_FAILURE);
         }
+        if (!psMetadataAddF64(md, PS_LIST_TAIL, "pixel_fill", 0, NULL, 64.64)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
             psFree(md);
             exit(EXIT_FAILURE);
@@ -1875,4 +1867,8 @@
             exit(EXIT_FAILURE);
         }
+        if (!object->pixel_fill == 64.64) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
             psFree(object);
             exit(EXIT_FAILURE);
@@ -3853,4 +3849,224 @@
             exit(EXIT_FAILURE);
         }
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        psMetadata      *md;
+        magicRunRow     *object;
+
+        md = psMetadataAlloc();
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "state", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "workdir", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "workdir_state", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "dvodb", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        object = magicRunObjectFromMetadata(md);
+        if (!object) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(md);
+
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->workdir_state, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        psMetadata      *md;
+        magicInputSkyfileRow *object;
+
+        md = psMetadataAlloc();
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (!psMetadataAddS32(md, PS_LIST_TAIL, "node", 0, NULL, -32)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        object = magicInputSkyfileObjectFromMetadata(md);
+        if (!object) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(md);
+
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (!object->node == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        psMetadata      *md;
+        magicTreeRow    *object;
+
+        md = psMetadataAlloc();
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "node", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "dep", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        object = magicTreeObjectFromMetadata(md);
+        if (!object) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(md);
+
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->node, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->dep, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        psMetadata      *md;
+        magicNodeResultRow *object;
+
+        md = psMetadataAlloc();
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "node", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        object = magicNodeResultObjectFromMetadata(md);
+        if (!object) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(md);
+
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->node, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        psMetadata      *md;
+        magicMaskRow    *object;
+
+        md = psMetadataAlloc();
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        object = magicMaskObjectFromMetadata(md);
+        if (!object) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(md);
+
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
             psFree(object);
             exit(EXIT_FAILURE);
Index: /trunk/ippdb/tests/selectrowsfits.c
===================================================================
--- /trunk/ippdb/tests/selectrowsfits.c	(revision 14597)
+++ /trunk/ippdb/tests/selectrowsfits.c	(revision 14598)
@@ -865,4 +865,114 @@
     }
 
+    {
+        psDB            *dbh;
+        psFits          *fits;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        fits = psFitsOpen(TMP_FILENAME, "w");
+        if (!fits) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicRunSelectRowsFits(dbh, fits, NULL, 1)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(fits);
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        psFits          *fits;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        fits = psFitsOpen(TMP_FILENAME, "w");
+        if (!fits) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicInputSkyfileSelectRowsFits(dbh, fits, NULL, 1)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(fits);
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        psFits          *fits;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        fits = psFitsOpen(TMP_FILENAME, "w");
+        if (!fits) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicTreeSelectRowsFits(dbh, fits, NULL, 1)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(fits);
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        psFits          *fits;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        fits = psFitsOpen(TMP_FILENAME, "w");
+        if (!fits) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicNodeResultSelectRowsFits(dbh, fits, NULL, 1)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(fits);
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        psFits          *fits;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        fits = psFitsOpen(TMP_FILENAME, "w");
+        if (!fits) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!magicMaskSelectRowsFits(dbh, fits, NULL, 1)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(fits);
+        psDBCleanup(dbh);
+    }
+
     exit(EXIT_SUCCESS);
 }
