Index: trunk/ippTools/src/camtool.c
===================================================================
--- trunk/ippTools/src/camtool.c	(revision 18093)
+++ trunk/ippTools/src/camtool.c	(revision 18336)
@@ -97,26 +97,7 @@
     PS_ASSERT_PTR_NON_NULL(config, NULL);
 
-    PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false);
-    PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false);
-
     psMetadata *where = psMetadataAlloc();
-    // convert chip_id into a psS64
-    if (chip_id) {
-        if (!psMetadataAddS64(where, PS_LIST_TAIL, "chip_id", 0, "==", (psS64)atoll(chip_id))) {
-            psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id");
-            psFree(where);
-            return false;
-        }
-    }
-
-    // convert exp_id into a psS64
-    if (exp_id) {
-        if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(exp_id))) {
-            psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
-            psFree(where);
-            return false;
-        }
-    }
-
+    PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "==");
+    PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
     PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "==");
     PXOPT_COPY_STR(config->args, where, "-inst", "camera", "==");
@@ -268,36 +249,8 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
-    PXOPT_LOOKUP_STR(cam_id, config->args, "-cam_id", false, false);
-    PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false);
-    PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false);
-
     psMetadata *where = psMetadataAlloc();
-    // convert cam_id into a psS64
-    if (cam_id) {
-        if (!psMetadataAddS64(where, PS_LIST_TAIL, "cam_id", 0, "==", (psS64)atoll(cam_id))) {
-            psError(PS_ERR_UNKNOWN, false, "failed to add item cam_id");
-            psFree(where);
-            return false;
-        }
-    }
-
-    // convert chip_id into a psS64
-    if (chip_id) {
-        if (!psMetadataAddS64(where, PS_LIST_TAIL, "chip_id", 0, "==", (psS64)atoll(chip_id))) {
-            psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id");
-            psFree(where);
-            return false;
-        }
-    }
-
-    // convert exp_id into a psS64
-    if (exp_id) {
-        if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(exp_id))) {
-            psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
-            psFree(where);
-            return false;
-        }
-    }
-
+    PXOPT_COPY_S64(config->args, where, "-cam_id", "cam_id", "==");
+    PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "==");
+    PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
     PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "==");
     PXOPT_COPY_STR(config->args, where, "-inst", "camera", "==");
@@ -421,10 +374,4 @@
     }
 
-    if (!convertIdToStr(output)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
-        psFree(output);
-        return false;
-    }
-
     // negate simple so the default is true
     if (!ippdbPrintMetadatas(stdout, output, "camPendingExp", !simple)) {
@@ -475,10 +422,4 @@
     }
 
-    if (!convertIdToStr(output)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
-        psFree(output);
-        return false;
-    }
-
     // negate simple so the default is true
     if (!ippdbPrintMetadatas(stdout, output, "chipProcessedImfile", !simple)) {
@@ -498,5 +439,5 @@
 
     // required
-    PXOPT_LOOKUP_STR(cam_id, config->args, "-cam_id", true, false);
+    PXOPT_LOOKUP_S64(cam_id, config->args, "-cam_id", true, false);
     PXOPT_LOOKUP_STR(uri, config->args, "-uri", true, false);
 
@@ -554,5 +495,5 @@
         psMetadata *where = psMetadataAlloc();
         if (cam_id) {
-            if (!psMetadataAddS64(where, PS_LIST_TAIL, "cam_id", 0, "==", (psS64)atoll(cam_id))) {
+            if (!psMetadataAddS64(where, PS_LIST_TAIL, "cam_id", 0, "==", cam_id)) {
                 psError(PS_ERR_UNKNOWN, false, "failed to add item cam_id");
                 psFree(where);
@@ -746,10 +687,4 @@
     }
 
-    if (!convertIdToStr(output)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
-        psFree(output);
-        return false;
-    }
-
     // negate simple so the default is true
     if (!ippdbPrintMetadatas(stdout, output, "camProcessedExp", !simple)) {
@@ -769,36 +704,8 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
-    PXOPT_LOOKUP_STR(cam_id, config->args, "-cam_id", false, false);
-    PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false);
-    PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false);
-
     psMetadata *where = psMetadataAlloc();
-    // convert cam_id into a psS64
-    if (cam_id) {
-        if (!psMetadataAddS64(where, PS_LIST_TAIL, "cam_id", 0, "==", (psS64)atoll(cam_id))) {
-            psError(PS_ERR_UNKNOWN, false, "failed to add item cam_id");
-            psFree(where);
-            return false;
-        }
-    }
-
-    // convert chip_id into a psS64
-    if (chip_id) {
-        if (!psMetadataAddS64(where, PS_LIST_TAIL, "chip_id", 0, "==", (psS64)atoll(chip_id))) {
-            psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id");
-            psFree(where);
-            return false;
-        }
-    }
-
-    // convert exp_id into a psS64
-    if (exp_id) {
-        if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(exp_id))) {
-            psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
-            psFree(where);
-            return false;
-        }
-    }
-
+    PXOPT_COPY_S64(config->args, where, "-cam_id", "cam_id", "==");
+    PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "==");
+    PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
     PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "==");
     PXOPT_COPY_STR(config->args, where, "-inst", "camera", "==");
@@ -977,10 +884,4 @@
     }
 
-    if (!convertIdToStr(output)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
-        psFree(output);
-        return false;
-    }
-
     // negative simple so the default is true
     if (!ippdbPrintMetadatas(stdout, output, "camMask", !simple)) {
