Index: /trunk/psLib/src/types/psMetadataConfig.c
===================================================================
--- /trunk/psLib/src/types/psMetadataConfig.c	(revision 7934)
+++ /trunk/psLib/src/types/psMetadataConfig.c	(revision 7935)
@@ -10,6 +10,6 @@
 *  @author Eric Van Alst, MHPCC
 *
-*  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-07-18 21:53:25 $
+*  @version $Revision: 1.67 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-07-19 02:26:53 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -276,28 +276,17 @@
                         psS32 *status)
 {
-    psBool value = false;
-
-
-    /*    if(*inString=='T' || *inString=='t' || *inString=='1') {
-            value = true;
-        } else if(*inString=='F' || *inString=='f' || *inString=='0') {
-            value = false;
-        } else {
-            *status = 1;
-        }
-    */
     if ( !strncmp(inString, "T", 2) || !strncmp(inString, "t", 2) ||
             !strncmp(inString, "1", 2) || !strncmp(inString, "TRUE", 5) ||
             !strncmp(inString, "true", 5) || !strncmp(inString, "True", 5)) {
-        value = true;
-    } else if ( !strncmp(inString, "F", 2) || !strncmp(inString, "f", 2) ||
-                !strncmp(inString, "0", 2) || !strncmp(inString, "FALSE", 6) ||
-                !strncmp(inString, "false", 6) || !strncmp(inString, "False", 6) ) {
-        value = false;
-    } else {
-        *status = 1;
-    }
-
-    return value;
+        return true;
+    }
+    if ( !strncmp(inString, "F", 2) || !strncmp(inString, "f", 2) ||
+            !strncmp(inString, "0", 2) || !strncmp(inString, "FALSE", 6) ||
+            !strncmp(inString, "false", 6) || !strncmp(inString, "False", 6) ) {
+        return false;
+    }
+
+    *status = 1;
+    return false;
 }
 
@@ -679,5 +668,4 @@
             psFree(token);
         }
-        //        psFree(iter);
     }
     return md;
@@ -1028,6 +1016,4 @@
     // Check if the add status was successful
     if (! addStatus) {
-        //        psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_OVERWRITE_ITEM, keyName, lineCount,
-        //                fileName);
         returnValue = false;
     }
@@ -1247,251 +1233,4 @@
 }
 
-// very dangerous to use comments to block out a very long section...
-# if 0
-psString psMetadataConfigFormat(psMetadata *md)
-{
-    PS_ASSERT_PTR_NON_NULL(md, NULL);
-
-    psString newString = NULL;
-    psString newStr = NULL;
-    char mdString[16000];
-    psMetadataItem *item = NULL;
-    psMetadataIterator *iter = psMetadataIteratorAlloc(md, PS_LIST_HEAD, NULL);
-    psDataType type = PS_DATA_UNKNOWN;
-    //    int size = 0;
-    int i = 0;
-    char content[MAXSTR];
-    char buffer[MAXSTR];
-    char *buffer2;
-    strcpy(content, "\0");
-    strcpy(mdString, "\0");
-
-    while ( (item = psMetadataGetAndIncrement(iter)) ) {
-        type = item->type;
-        if ( type == PS_DATA_STRING) {
-            type = PS_DATA_STRING;
-        }
-        if ( type == PS_DATA_VECTOR) {
-            type = PS_DATA_VECTOR;
-        }
-        if ( type == PS_DATA_TIME) {
-            type = PS_DATA_TIME;
-        }
-        if ( item->type == PS_DATA_METADATA) {
-            type = PS_DATA_METADATA;
-        }
-        if (item == NULL) {
-            type = PS_DATA_UNKNOWN;
-        }
-
-        switch (type) {
-        case PS_DATA_BOOL:
-            //            size = strlen(item->name);
-            snprintf(content, MAXSTR, "%s BOOL  ", item->name);
-            strncat(mdString, content, MAXSTR);
-            if ( item->data.B )
-                strncat(mdString, "TRUE", MAXSTR);
-            else
-                strncat(mdString, "FALSE", MAXSTR);
-            if ( item->comment != NULL ) {
-                //                size = strlen(item->comment);
-                snprintf(content, MAXSTR, " #%s \n", item->comment);
-                strncat(mdString, content, MAXSTR);
-            } else {
-                snprintf(content, MAXSTR, "\n");
-                strncat(mdString, content, MAXSTR);
-            }
-            break;
-        case PS_DATA_S32:
-            //            size = strlen(item->name);
-            snprintf(content, MAXSTR, "%s S32  ", item->name);
-            strncat(mdString, content, MAXSTR);
-            snprintf(content, MAXSTR, "%d ", item->data.S32);
-            strncat(mdString, content, MAXSTR);
-            if ( strncmp(item->comment,"",2) ) {
-                //                size = strlen(item->comment);
-                snprintf(content, MAXSTR, " #%s \n", item->comment);
-                strncat(mdString, content, MAXSTR);
-            } else {
-                snprintf(content, MAXSTR, "\n");
-                strncat(mdString, content, MAXSTR);
-            }
-            break;
-        case PS_DATA_F32:
-            //            size = strlen(item->name);
-            snprintf(content, MAXSTR, "%s F32  ", item->name);
-            strncat(mdString, content, MAXSTR);
-            snprintf(content, MAXSTR, "%22.15g ", item->data.F32);
-            strncat(mdString, content, MAXSTR);
-            if ( strncmp(item->comment,"",2) ) {
-                //            if ( item->comment != NULL ) {
-                //                size = strlen(item->comment);
-                snprintf(content, MAXSTR, " #%s \n", item->comment);
-                strncat(mdString, content, MAXSTR);
-            } else {
-                snprintf(content, MAXSTR, "\n");
-                strncat(mdString, content, MAXSTR);
-            }
-            break;
-        case PS_DATA_F64:
-            //            size = strlen(item->name);
-            snprintf(content, MAXSTR, "%s F64  ", item->name);
-            strncat(mdString, content, MAXSTR);
-            snprintf(content, MAXSTR, "%22.15g ", item->data.F64);
-            strncat(mdString, content, MAXSTR);
-            if ( strncmp(item->comment,"",2) ) {
-                //            if ( item->comment != NULL ) {
-                //            if ( !strncmp((char*)item->comment, "", 2) ) {
-                //                size = strlen(item->comment);
-                snprintf(content, MAXSTR, " #%s \n", item->comment);
-                strncat(mdString, content, MAXSTR);
-            } else {
-                snprintf(content, MAXSTR, "\n");
-                strncat(mdString, content, MAXSTR);
-            }
-            break;
-        case PS_DATA_STRING:
-            //            size = strlen(item->name);
-            snprintf(content, MAXSTR, "%s STR  ", item->name);
-            strncat(mdString, content, MAXSTR);
-            //            size = strlen(((char *)(item->data.V)));
-            snprintf(content, MAXSTR, "%s ", ((char *)(item->data.V)));
-            strncat(mdString, content, MAXSTR);
-            if ( strncmp(item->comment,"",2) ) {
-                //            if ( item->comment != NULL ) {
-                //                size = strlen(item->comment);
-                snprintf(content, MAXSTR, " #%s \n", item->comment);
-                strncat(mdString, content, MAXSTR);
-            } else {
-                snprintf(content, MAXSTR, "\n");
-                strncat(mdString, content, MAXSTR);
-            }
-            break;
-        case PS_DATA_METADATA:
-            snprintf(content, MAXSTR, "\n%s  METADATA  ", item->name);
-            strncat(mdString, content, MAXSTR);
-
-            newStr = psMetadataConfigFormat(item->data.md);
-            strncpy(buffer, (char *)newStr, MAXSTR);
-            buffer2 = strtok(buffer, "\n");
-            while( buffer2 != NULL ) {
-                snprintf(content, MAXSTR, "\n   %s", buffer2);
-                strncat(mdString, content, MAXSTR);
-                buffer2 = strtok(NULL, "\n");
-            }
-            if ( strncmp(item->comment,"",2) ) {
-                //            if ( item->comment != NULL ) {
-                snprintf(content, MAXSTR, "\nEND   #%s\n\n", item->comment);
-                strncat(mdString, content, MAXSTR);
-            } else {
-                snprintf(content, MAXSTR, "\nEND\n\n");
-                strncat(mdString, content, MAXSTR);
-            }
-            psFree(newStr);
-            break;
-        case PS_DATA_TIME:
-            snprintf(content, MAXSTR, "%s ", item->name);
-            if ( ((psTime*)(item->data.V))->type == PS_TIME_UTC )
-                strncat(content, "PS_TIME_UTC  ", MAXSTR);
-            else if ( ((psTime*)(item->data.V))->type == PS_TIME_TAI )
-                strncat(content, "PS_TIME_TAI  ", MAXSTR);
-            else if ( ((psTime*)(item->data.V))->type == PS_TIME_UT1 )
-                strncat(content, "PS_TIME_UT1  ", MAXSTR);
-            else if ( ((psTime*)(item->data.V))->type == PS_TIME_TT )
-                strncat(content, "PS_TIME_TT  ", MAXSTR);
-            else {
-                psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                        PS_ERRORTEXT_psMetadata_METATYPE_INVALID, type);
-                psFree(iter);
-                return NULL;
-            }
-            strncat(mdString, content, MAXSTR);
-
-            snprintf(content, MAXSTR, "%ld, ", (long)((psTime*)(item->data.V))->sec);
-            strncat(mdString, content, MAXSTR);
-            snprintf(content, MAXSTR, "%u, ", ((psTime*)(item->data.V))->nsec);
-            strncat(mdString, content, MAXSTR);
-            if ( ((psTime*)(item->data.V))->leapsecond )
-                strncat(mdString, "T ", MAXSTR);
-            else
-                strncat(mdString, "F ", MAXSTR);
-            if ( strncmp(item->comment,"",2) ) {
-                //            if ( item->comment != NULL ) {
-                snprintf(content, MAXSTR, " #%s \n", item->comment);
-                strncat(mdString, content, MAXSTR);
-            } else {
-                snprintf(content, MAXSTR, "\n");
-                strncat(mdString, content, MAXSTR);
-            }
-            break;
-        case PS_DATA_VECTOR:
-            //            size = strlen(item->name);
-            snprintf(content, MAXSTR, "@%s ", item->name);
-            strncat(mdString, content, MAXSTR);
-            type = ((psVector*)(item->data.V))->type.type;
-            switch (type) {
-            case PS_DATA_S32:
-                strncat(mdString, "S32 ", MAXSTR);
-                for (i = 0; ((psVector*)(item->data.V))->data.S32[i] != 0; i++) {
-                    snprintf(content, MAXSTR, "%d",
-                             ((psVector*)(item->data.V))->data.S32[i]);
-                    if ( ((psVector*)(item->data.V))->data.S32[i+1] != 0 ) {
-                        strncat(content, ", ", MAXSTR);
-                    }
-                    strncat(mdString, content, MAXSTR);
-                }
-                break;
-            case PS_DATA_F32:
-                strncat(mdString, "F32 ", MAXSTR);
-                for (i = 0; ((psVector*)(item->data.V))->data.F32[i] != 0; i++) {
-                    snprintf(content, MAXSTR, "%22.15g",
-                             ((psVector*)(item->data.V))->data.F32[i]);
-                    if ( ((psVector*)(item->data.V))->data.F32[i+1] != 0 ) {
-                        strncat(content, ", ", MAXSTR);
-                    }
-                    strncat(mdString, content, MAXSTR);
-                }
-                break;
-            case PS_DATA_F64:
-                strncat(mdString, "F64 ", MAXSTR);
-                for (i = 0; ((psVector*)(item->data.V))->data.F64[i] != 0; i++) {
-                    snprintf(content, MAXSTR, "%22.15g",
-                             ((psVector*)(item->data.V))->data.F64[i]);
-                    if ( ((psVector*)(item->data.V))->data.F64[i+1] != 0 ) {
-                        strncat(content, ", ", MAXSTR);
-                    }
-                    strncat(mdString, content, MAXSTR);
-                }
-                break;
-            case PS_DATA_UNKNOWN:
-            default:
-                psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                        PS_ERRORTEXT_psMetadata_METATYPE_INVALID, type);
-                psFree(iter);
-                return NULL;
-            }
-            if ( strncmp(item->comment,"",2) ) {
-                //            if ( item->comment != NULL ) {
-                //                size = strlen(item->comment);
-                snprintf(content, MAXSTR, " #%s \n", item->comment);
-                strncat(mdString, content, MAXSTR);
-            } else {
-                snprintf(content, MAXSTR, "\n");
-                strncat(mdString, content, MAXSTR);
-            }
-            break;
-        case PS_DATA_UNKNOWN:
-        default:
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                    PS_ERRORTEXT_psMetadata_METATYPE_INVALID, type);
-            psFree(iter);
-            return NULL;
-        }
-    }
-    newString = psStringNCopy(mdString, 16000);
-    psFree(iter);
-    return newString;
-}
-# endif // old version of psMetadataConfigFormat
 
 psString psMetadataConfigFormat(psMetadata *md)
