IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4891 for trunk/psLib/src


Ignore:
Timestamp:
Aug 26, 2005, 3:33:41 PM (21 years ago)
Author:
drobbin
Message:

psMetadataAddWhatever fxns now accept an int format parameter (bug504)

Location:
trunk/psLib/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/db/psDB.c

    r4612 r4891  
    1212 *  @author Joshua Hoblitt
    1313 *
    14  *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-07-26 20:00:57 $
     14 *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2005-08-27 01:33:40 $
    1616 *
    1717 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    502502            // copy field data and convert NULLs to the appropriate NaN value
    503503            if (pType == PS_META_STR) {
    504                 psMetadataAddStr(md, PS_LIST_TAIL, field[i].name, "", data);
     504                psMetadataAddStr(md, PS_LIST_TAIL, field[i].name, 0, "", data);
    505505            } else if (pType == PS_META_S32) {
    506                 psMetadataAddS32(md, PS_LIST_TAIL, field[i].name, "", atoll(data));
     506                psMetadataAddS32(md, PS_LIST_TAIL, field[i].name, 0, "", atoll(data));
    507507            } else if (pType == PS_META_F32) {
    508                 psMetadataAddF32(md, PS_LIST_TAIL, field[i].name, "", atof(data));
     508                psMetadataAddF32(md, PS_LIST_TAIL, field[i].name, 0, "", atof(data));
    509509            } else if (pType == PS_META_F64) {
    510                 psMetadataAddF64(md, PS_LIST_TAIL, field[i].name, "", atof(data));
     510                psMetadataAddF64(md, PS_LIST_TAIL, field[i].name, 0, "", atof(data));
    511511            } else if (pType == PS_META_BOOL) {
    512512                psMetadataAdd(md, PS_LIST_TAIL, field[i].name, pType, "", atoi(data));
    513513            } else {
    514514                // XXX: assume binary string ...
    515                 psMetadataAddStr(md, PS_LIST_TAIL, field[i].name, "", data);
     515                psMetadataAddStr(md, PS_LIST_TAIL, field[i].name, 0, "", data);
    516516            }
    517517
     
    713713            // PS_META_UNKNOWN -> PS_META_ARRAY ?
    714714            column = psDBSelectColumn(dbh, tableName, field[i].name, 0);
    715             psMetadataAddArray(table, PS_LIST_TAIL, field[i].name, "", column);
     715            psMetadataAddArray(table, PS_LIST_TAIL, field[i].name, 0, "", column);
    716716            //            psMetadataAddStr(table, PS_LIST_TAIL, field[i].name, "", column);
    717717            psFree(column);
    718718        } else {
    719719            column = psDBSelectColumnNum(dbh, tableName, field[i].name, pType, 0);
    720             psMetadataAddVector(table, PS_LIST_TAIL, field[i].name, "", column);
     720            psMetadataAddVector(table, PS_LIST_TAIL, field[i].name, 0, "", column);
    721721            psFree(column);
    722722        }
  • trunk/psLib/src/fits/psFits.c

    r4556 r4891  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-07-15 02:33:54 $
     9 *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-08-27 01:33:41 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    606606        psMetadata* header = psFitsReadHeader(NULL, fits);
    607607        if (name != NULL && header != NULL) {
    608             psMetadataAddMetadata(out, PS_LIST_HEAD, name, "FITS Header",
     608            psMetadataAddMetadata(out, PS_LIST_HEAD, name, 0, "FITS Header",
    609609                                  header);
    610610        } else { // XXX: is this a warning or error?
  • trunk/psLib/src/types/psMetadata.c

    r4870 r4891  
    1212*  @author Ross Harman, MHPCC
    1313*
    14 *  @version $Revision: 1.77 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2005-08-24 22:00:53 $
     14*  @version $Revision: 1.78 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2005-08-27 01:33:41 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    409409#define METADATA_ADD_TYPE(NAME,TYPE,METATYPE) \
    410410psBool psMetadataAdd##NAME(psMetadata* md, long where, const char* name, \
    411                            const char* comment, TYPE value) { \
    412     return psMetadataAdd(md,where,name, METATYPE,comment,value); \
     411                           int format, const char* comment, TYPE value) { \
     412    return psMetadataAdd(md,where,name, format | METATYPE,comment,value); \
    413413}
    414414
  • trunk/psLib/src/types/psMetadata.h

    r4817 r4891  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.58 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2005-08-18 23:41:45 $
     13*  @version $Revision: 1.59 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2005-08-27 01:33:41 $
    1515*
    1616*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    307307    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    308308    const char* name,                  ///< Name of metadata item
     309    int format,                        ///< psMetadataFlag options/flags
    309310    const char* comment,               ///< Comment for metadata item
    310311    psBool value                       ///< Value for metadata item data
     
    319320    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    320321    const char* name,                  ///< Name of metadata item
     322    int format,                        ///< psMetadataFlag options/flags
    321323    const char* comment,               ///< Comment for metadata item
    322324    psS32 value                        ///< Value for metadata item data
     
    331333    long location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    332334    const char* name,                  ///< Name of metadata item
     335    int format,                        ///< psMetadataFlag options/flags
    333336    const char* comment,               ///< Comment for metadata item
    334337    psF32 value                        ///< Value for metadata item data
     
    343346    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    344347    const char* name,                  ///< Name of metadata item
     348    int format,                        ///< psMetadataFlag options/flags
    345349    const char* comment,               ///< Comment for metadata item
    346350    psF64 value                        ///< Value for metadata item data
     
    355359    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    356360    const char* name,                  ///< Name of metadata item
     361    int format,                        ///< psMetadataFlag options/flags
    357362    const char* comment,               ///< Comment for metadata item
    358363    psList* value                      ///< psList for metadata item data
     
    367372    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    368373    const char* name,                  ///< Name of metadata item
     374    int format,                        ///< psMetadataFlag options/flags
    369375    const char* comment,               ///< Comment for metadata item
    370376    const char* value                  ///< String for metadata item data
     
    379385    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    380386    const char* name,                  ///< Name of metadata item
     387    int format,                        ///< psMetadataFlag options/flags
    381388    const char* comment,               ///< Comment for metadata item
    382389    psVector* value                    ///< Vector for metadata item data
     
    391398    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    392399    const char* name,                  ///< Name of metadata item
     400    int format,                        ///< psMetadataFlag options/flags
    393401    const char* comment,               ///< Comment for metadata item
    394402    psArray* value                     ///< Vector for metadata item data
     
    403411    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    404412    const char* name,                  ///< Name of metadata item
     413    int format,                        ///< psMetadataFlag options/flags
    405414    const char* comment,               ///< Comment for metadata item
    406415    psImage* value                     ///< Image for metadata item data
     
    415424    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    416425    const char* name,                  ///< Name of metadata item
     426    int format,                        ///< psMetadataFlag options/flags
    417427    const char* comment,               ///< Comment for metadata item
    418428    psHash* value                      ///< Hash for metadata item data
     
    427437    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    428438    const char* name,                  ///< Name of metadata item
     439    int format,                        ///< psMetadataFlag options/flags
    429440    const char* comment,               ///< Comment for metadata item
    430441    psLookupTable* value               ///< LookupTable for metadata item data
     
    439450    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    440451    const char* name,                  ///< Name of metadata item
     452    int format,                        ///< psMetadataFlag options/flags
    441453    const char* comment,               ///< Comment for metadata item
    442454    psPtr value                        ///< Unknown for metadata item data
     
    451463    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    452464    const char* name,                  ///< Name of metadata item
     465    int format,                        ///< psMetadataFlag options/flags
    453466    const char* comment,               ///< Comment for metadata item
    454467    psMetadata* value                  ///< Metadata for metadata item data
  • trunk/psLib/src/xml/psXML.c

    r4819 r4891  
    1010*  @author David Robbins, MHPCC
    1111*
    12 *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-08-19 00:31:42 $
     12*  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-08-27 01:33:41 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    347347                    strncpy(content,
    348348                            (char*)cur_node->properties->next->next->children->content, MAXSTR);
    349                     psMetadataAddS32(meta, PS_LIST_TAIL, name, "",
     349                    psMetadataAddS32(meta, PS_LIST_TAIL, name, 0, "",
    350350                                     (int)strtol(content, NULL, 10));
    351351                    break;
     
    354354                    strncpy(content,
    355355                            (const char*)cur_node->properties->next->next->children->content, MAXSTR);
    356                     psMetadataAddF32(meta, PS_LIST_TAIL, name, "", strtof(content, NULL));
     356                    psMetadataAddF32(meta, PS_LIST_TAIL, name, 0, "", strtof(content, NULL));
    357357                    break;
    358358                case PS_DATA_F64:
     
    360360                    strncpy(content,
    361361                            (const char*)cur_node->properties->next->next->children->content, MAXSTR);
    362                     psMetadataAddF64(meta, PS_LIST_TAIL, name, "", strtod(content, NULL));
     362                    psMetadataAddF64(meta, PS_LIST_TAIL, name, 0, "", strtod(content, NULL));
    363363                    break;
    364364                case PS_DATA_STRING:
    365365                    strncpy(name, (const char*)cur_node->properties->children->content, MAXSTR);
    366                     psMetadataAddStr(meta, PS_LIST_TAIL, name, "",
     366                    psMetadataAddStr(meta, PS_LIST_TAIL, name, 0, "",
    367367                                     (const char*)cur_node->properties->next->next->children->content);
    368368                    break;
     
    382382                    psVector *vec = psVectorAlloc(strlen(content), elemType);
    383383                    storeValues(vec, content, elemType);
    384                     psMetadataAddVector(meta, PS_LIST_TAIL, name, "", vec);
     384                    psMetadataAddVector(meta, PS_LIST_TAIL, name, 0, "", vec);
    385385                    psFree(vec);
    386386                    break;
     
    390390                    psMetadata *temp = NULL;
    391391                    temp = xml2metadata(cur_node->children, nodeNum);
    392                     psMetadataAddMetadata(meta, PS_LIST_TAIL, name, "", temp);
     392                    psMetadataAddMetadata(meta, PS_LIST_TAIL, name, 0, "", temp);
    393393                    psFree(temp);
    394394                    break;
     
    401401                            !strncmp(content, "T", MAXSTR) ||
    402402                            !strncmp(content, "t", MAXSTR) ) {
    403                         psMetadataAddBool(meta, PS_LIST_TAIL, name, "", true);
     403                        psMetadataAddBool(meta, PS_LIST_TAIL, name, 0, "", true);
    404404                    } else if ( !strncmp(content, "false", MAXSTR) ||
    405405                                !strncmp(content, "FALSE", MAXSTR) ||
    406406                                !strncmp(content, "F", MAXSTR) ||
    407407                                !strncmp(content, "f", MAXSTR) ) {
    408                         psMetadataAddBool(meta, PS_LIST_TAIL, name, "", false);
     408                        psMetadataAddBool(meta, PS_LIST_TAIL, name, 0, "", false);
    409409                    } else {
    410410                        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
Note: See TracChangeset for help on using the changeset viewer.