Index: /trunk/dbconfig/config.md
===================================================================
--- /trunk/dbconfig/config.md	(revision 10151)
+++ /trunk/dbconfig/config.md	(revision 10152)
@@ -2,4 +2,4 @@
     pkg_name        STR     ippdb
     pkg_namespace   STR     ippdb
-    pkg_version     STR     0.0.57
+    pkg_version     STR     0.0.58
 END
Index: /trunk/dbconfig/tasks.md
===================================================================
--- /trunk/dbconfig/tasks.md	(revision 10151)
+++ /trunk/dbconfig/tasks.md	(revision 10152)
@@ -1,3 +1,3 @@
-# $Id: tasks.md,v 1.96 2006-11-20 23:57:07 jhoblitt Exp $
+# $Id: tasks.md,v 1.97 2006-11-23 01:42:57 jhoblitt Exp $
 
 # this table records all exposure ID ever seen from the summit
@@ -108,5 +108,5 @@
     exp_type    STR         64
     imfiles     S32         0
-    filter      STR         255
+    filter      STR         64
     airmass     F32         0.0
     ra          F64         0.0
@@ -132,5 +132,5 @@
     exp_type    STR         64
     imfiles     S32         0
-    filter      STR         255
+    filter      STR         64
     airmass     F32         0.0
     ra          F64         0.0
@@ -154,5 +154,5 @@
     uri         STR         255
     exp_type    STR         64
-    filter      STR         255
+    filter      STR         64
     airmass     F32         0.0
     ra          F64         0.0
@@ -268,8 +268,9 @@
     det_id      S32         0      # Primary Key AUTO_INCREMENT
     iteration   S32         0      # Key
-    det_type    STR         255    # Key
+    det_type    STR         64     # Key
+    det_mode    STR         64     # Key
     state       STR         64     # Key
     exp_type    STR         64
-    filter      STR         255
+    filter      STR         64
     airmass     F32         0.0
     exp_time    F32         0.0
Index: /trunk/ippdb/configure.ac
===================================================================
--- /trunk/ippdb/configure.ac	(revision 10151)
+++ /trunk/ippdb/configure.ac	(revision 10152)
@@ -7,5 +7,5 @@
 AC_PREREQ(2.59)
 
-AC_INIT([ippdb], [0.0.57], [pan-starrs.ifa.hawaii.edu])
+AC_INIT([ippdb], [0.0.58], [pan-starrs.ifa.hawaii.edu])
 AC_CONFIG_SRCDIR([ippdb.pc.in])
 
Index: /trunk/ippdb/src/ippdb.c
===================================================================
--- /trunk/ippdb/src/ippdb.c	(revision 10151)
+++ /trunk/ippdb/src/ippdb.c	(revision 10152)
@@ -3454,5 +3454,5 @@
         return false;
     }
-    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, "255")) {
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, "64")) {
         psError(PS_ERR_UNKNOWN, false, "failed to add item filter");
         psFree(md);
@@ -4100,5 +4100,5 @@
         return false;
     }
-    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, "255")) {
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, "64")) {
         psError(PS_ERR_UNKNOWN, false, "failed to add item filter");
         psFree(md);
@@ -4747,5 +4747,5 @@
         return false;
     }
-    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, "255")) {
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, "64")) {
         psError(PS_ERR_UNKNOWN, false, "failed to add item filter");
         psFree(md);
@@ -8555,5 +8555,5 @@
 static void detRunRowFree(detRunRow *object);
 
-detRunRow *detRunRowAlloc(psS32 det_id, psS32 iteration, const char *det_type, const char *state, const char *exp_type, const char *filter, psF32 airmass, psF32 exp_time, psF32 ccd_temp, psF64 posang, const char *object, psTime* registered, psTime* use_begin, psTime* use_end)
+detRunRow *detRunRowAlloc(psS32 det_id, psS32 iteration, const char *det_type, const char *det_mode, const char *state, const char *exp_type, const char *filter, psF32 airmass, psF32 exp_time, psF32 ccd_temp, psF64 posang, const char *object, psTime* registered, psTime* use_begin, psTime* use_end)
 {
     detRunRow       *_object;
@@ -8565,4 +8565,5 @@
     _object->iteration = iteration;
     _object->det_type = psStringCopy(det_type);
+    _object->det_mode = psStringCopy(det_mode);
     _object->state = psStringCopy(state);
     _object->exp_type = psStringCopy(exp_type);
@@ -8583,4 +8584,5 @@
 {
     psFree(object->det_type);
+    psFree(object->det_mode);
     psFree(object->state);
     psFree(object->exp_type);
@@ -8605,6 +8607,11 @@
         return false;
     }
-    if (!psMetadataAdd(md, PS_LIST_TAIL, "det_type", PS_DATA_STRING, "Key", "255")) {
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "det_type", PS_DATA_STRING, "Key", "64")) {
         psError(PS_ERR_UNKNOWN, false, "failed to add item det_type");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "det_mode", PS_DATA_STRING, "Key", "64")) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item det_mode");
         psFree(md);
         return false;
@@ -8620,5 +8627,5 @@
         return false;
     }
-    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, "255")) {
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, "64")) {
         psError(PS_ERR_UNKNOWN, false, "failed to add item filter");
         psFree(md);
@@ -8687,5 +8694,5 @@
 }
 
-bool detRunInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *det_type, const char *state, const char *exp_type, const char *filter, psF32 airmass, psF32 exp_time, psF32 ccd_temp, psF64 posang, const char *object, psTime* registered, psTime* use_begin, psTime* use_end)
+bool detRunInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *det_type, const char *det_mode, const char *state, const char *exp_type, const char *filter, psF32 airmass, psF32 exp_time, psF32 ccd_temp, psF64 posang, const char *object, psTime* registered, psTime* use_begin, psTime* use_end)
 {
     psMetadata *md = psMetadataAlloc();
@@ -8702,4 +8709,9 @@
     if (!psMetadataAdd(md, PS_LIST_TAIL, "det_type", PS_DATA_STRING, NULL, det_type)) {
         psError(PS_ERR_UNKNOWN, false, "failed to add item det_type");
+        psFree(md);
+        return false;
+    }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "det_mode", PS_DATA_STRING, NULL, det_mode)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item det_mode");
         psFree(md);
         return false;
@@ -8783,5 +8795,5 @@
 bool detRunInsertObject(psDB *dbh, detRunRow *object)
 {
-    return detRunInsert(dbh, object->det_id, object->iteration, object->det_type, object->state, object->exp_type, object->filter, object->airmass, object->exp_time, object->ccd_temp, object->posang, object->object, object->registered, object->use_begin, object->use_end);
+    return detRunInsert(dbh, object->det_id, object->iteration, object->det_type, object->det_mode, object->state, object->exp_type, object->filter, object->airmass, object->exp_time, object->ccd_temp, object->posang, object->object, object->registered, object->use_begin, object->use_end);
 }
 
@@ -8871,4 +8883,9 @@
         return false;
     }
+    if (!psMetadataAdd(md, PS_LIST_TAIL, "det_mode", PS_DATA_STRING, NULL, object->det_mode)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item det_mode");
+        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");
@@ -8950,4 +8967,9 @@
         return false;
     }
+    char* det_mode = psMetadataLookupPtr(&status, md, "det_mode");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item det_mode");
+        return false;
+    }
     char* state = psMetadataLookupPtr(&status, md, "state");
     if (!status) {
@@ -9006,5 +9028,5 @@
     }
 
-    return detRunRowAlloc(det_id, iteration, det_type, state, exp_type, filter, airmass, exp_time, ccd_temp, posang, object, registered, use_begin, use_end);
+    return detRunRowAlloc(det_id, iteration, det_type, det_mode, state, exp_type, filter, airmass, exp_time, ccd_temp, posang, object, registered, use_begin, use_end);
 }
 psArray *detRunSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
Index: /trunk/ippdb/src/ippdb.h
===================================================================
--- /trunk/ippdb/src/ippdb.h	(revision 10151)
+++ /trunk/ippdb/src/ippdb.h	(revision 10152)
@@ -4355,4 +4355,5 @@
     psS32           iteration;
     char            *det_type;
+    char            *det_mode;
     char            *state;
     char            *exp_type;
@@ -4377,4 +4378,5 @@
     psS32           iteration,
     const char      *det_type,
+    const char      *det_mode,
     const char      *state,
     const char      *exp_type,
@@ -4420,4 +4422,5 @@
     psS32           iteration,
     const char      *det_type,
+    const char      *det_mode,
     const char      *state,
     const char      *exp_type,
Index: /trunk/ippdb/tests/alloc.c
===================================================================
--- /trunk/ippdb/tests/alloc.c	(revision 10151)
+++ /trunk/ippdb/tests/alloc.c	(revision 10152)
@@ -894,5 +894,5 @@
         detRunRow       *object;
 
-        object = detRunRowAlloc(-32, -32, "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 64.64, "a string", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z"    );
+        object = detRunRowAlloc(-32, -32, "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 64.64, "a string", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z"    );
 
         if (!object) {
@@ -909,4 +909,8 @@
         }
         if (strncmp(object->det_type, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->det_mode, "a string", MAX_STRING_LENGTH)) {
             psFree(object);
             exit(EXIT_FAILURE);
Index: /trunk/ippdb/tests/insert.c
===================================================================
--- /trunk/ippdb/tests/insert.c	(revision 10151)
+++ /trunk/ippdb/tests/insert.c	(revision 10152)
@@ -328,5 +328,5 @@
         }
 
-        if (!detRunInsert(dbh, -32, -32, "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 64.64, "a string", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z")) {
+        if (!detRunInsert(dbh, -32, -32, "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 64.64, "a string", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z")) {
             exit(EXIT_FAILURE);
         }
Index: /trunk/ippdb/tests/insertobject.c
===================================================================
--- /trunk/ippdb/tests/insertobject.c	(revision 10151)
+++ /trunk/ippdb/tests/insertobject.c	(revision 10152)
@@ -476,5 +476,5 @@
         }
 
-        object = detRunRowAlloc(-32, -32, "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 64.64, "a string", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z");
+        object = detRunRowAlloc(-32, -32, "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 64.64, "a string", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z");
         if (!object) {
             exit(EXIT_FAILURE);
Index: /trunk/ippdb/tests/metadatafromobject.c
===================================================================
--- /trunk/ippdb/tests/metadatafromobject.c	(revision 10151)
+++ /trunk/ippdb/tests/metadatafromobject.c	(revision 10152)
@@ -1064,5 +1064,5 @@
         bool            status;
 
-        object = detRunRowAlloc(-32, -32, "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 64.64, "a string", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z");
+        object = detRunRowAlloc(-32, -32, "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 64.64, "a string", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -1085,4 +1085,8 @@
         }
         if (strncmp(psMetadataLookupPtr(&status, md, "det_type"), "a string", MAX_STRING_LENGTH)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(psMetadataLookupPtr(&status, md, "det_mode"), "a string", MAX_STRING_LENGTH)) {
             psFree(md);
             exit(EXIT_FAILURE);
Index: /trunk/ippdb/tests/objectfrommetadata.c
===================================================================
--- /trunk/ippdb/tests/objectfrommetadata.c	(revision 10151)
+++ /trunk/ippdb/tests/objectfrommetadata.c	(revision 10152)
@@ -1623,4 +1623,8 @@
             exit(EXIT_FAILURE);
         }
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "det_mode", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
         if (!psMetadataAddStr(md, PS_LIST_TAIL, "state", 0, NULL, "a string")) {
             psFree(md);
@@ -1682,4 +1686,8 @@
         }
         if (strncmp(object->det_type, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->det_mode, "a string", MAX_STRING_LENGTH)) {
             psFree(object);
             exit(EXIT_FAILURE);
