IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4401 for trunk/psLib/src/types


Ignore:
Timestamp:
Jun 27, 2005, 10:38:12 AM (21 years ago)
Author:
drobbin
Message:

made required changes based on apidelta-report-cycle6

Location:
trunk/psLib/src/types
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psMetadata.c

    r4392 r4401  
    1212*  @author Ross Harman, MHPCC
    1313*
    14 *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2005-06-25 02:02:05 $
     14*  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2005-06-27 20:38:12 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    268268}
    269269
    270 bool psMetadataAddItem(psMetadata *md, psMetadataItem *metadataItem, psS32 location, psS32 flags)
     270bool psMetadataAddItem(psMetadata *md, const psMetadataItem *item, psS32 location, psS32 flags)
    271271{
    272272    char * key = NULL;
     
    278278    PS_ASSERT_PTR_NON_NULL(md->table,NULL);
    279279    PS_ASSERT_PTR_NON_NULL(md->list,NULL);
    280     PS_ASSERT_PTR_NON_NULL(metadataItem,NULL);
    281     PS_ASSERT_PTR_NON_NULL(metadataItem->name,NULL);
     280    PS_ASSERT_PTR_NON_NULL(item,NULL);
     281    PS_ASSERT_PTR_NON_NULL(item->name,NULL);
    282282
    283283    mdTable = md->table;
    284284    mdList = md->list;
    285     key = metadataItem->name;
     285    key = item->name;
    286286
    287287    // See if key is already in table
    288288    existingEntry = (psMetadataItem*)psHashLookup(mdTable, key);
    289289
    290     if (metadataItem->type == PS_META_MULTI) {
     290    if (item->type == PS_META_MULTI) {
    291291        // the incoming entry is PS_META_MULTI
    292292
     
    295295
    296296        // add all the items in the incoming entry to metadata
    297         psList* list = metadataItem->data.list;
     297        psList* list = item->data.list;
    298298        if (list != NULL) {
    299299            psListIterator* iter = psListIteratorAlloc(list,PS_LIST_HEAD,true);
     
    317317
    318318            // add to the hash's list of duplicate entries
    319             if (! psListAdd(existingEntry->data.list, PS_LIST_TAIL, metadataItem) ) {
     319            if (! psListAdd(existingEntry->data.list, PS_LIST_TAIL, (psPtr)item) ) {
    320320                psError(PS_ERR_UNKNOWN,false,PS_ERRORTEXT_psMetadata_ADD_COLLECTION_FAILED,key);
    321321                return false;
     
    328328
    329329            // treat as if new (added to list below)
    330             if(!psHashAdd(mdTable, key, metadataItem)) {
     330            if(!psHashAdd(mdTable, key, (psPtr)item)) {
    331331                psError(PS_ERR_UNKNOWN,false,PS_ERRORTEXT_psMetadata_ADD_TABLE_FAILED,key);
    332332                return false;
     
    346346
    347347        // Node doesn't exist - Add new metadata item to metadata collection's hash
    348         if(!psHashAdd(mdTable, key, metadataItem)) {
     348        if(!psHashAdd(mdTable, key, (psPtr)item)) {
    349349            psError(PS_ERR_UNKNOWN,false,PS_ERRORTEXT_psMetadata_ADD_TABLE_FAILED,key);
    350350            return false;
     
    352352    }
    353353
    354     if(!psListAdd(mdList, location, metadataItem)) {
     354    if(!psListAdd(mdList, location, (psPtr)item)) {
    355355        psError(PS_ERR_UNKNOWN,false,PS_ERRORTEXT_psMetadata_ADD_COLLECTION_FAILED,key);
    356356        return false;
     
    580580psMetadataLookupNumTYPE(Bool)
    581581
    582 psMetadataItem* psMetadataGet(psMetadata *md, psS32 where)
     582psMetadataItem* psMetadataGet(const psMetadata *md, int location)
    583583{
    584584    psMetadataItem* entry = NULL;
     
    587587    PS_ASSERT_PTR_NON_NULL(md->list,NULL);
    588588
    589     entry = (psMetadataItem*) psListGet(md->list, where);
     589    entry = (psMetadataItem*) psListGet(md->list, location);
    590590    if (entry == NULL) {
    591         psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psMetadata_FIND_INDEX_FAILED, where);
     591        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psMetadata_FIND_INDEX_FAILED, location);
    592592        return NULL;
    593593    }
  • trunk/psLib/src/types/psMetadata.h

    r4370 r4401  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2005-06-24 01:44:18 $
     13*  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2005-06-27 20:38:12 $
    1515*
    1616*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    215215    const char* name,                  ///< Name of metadata item.
    216216    const char* comment,               ///< Comment for metadata item.
    217     bool value                       ///< the value of the metadata item.
     217    bool value                         ///< the value of the metadata item.
    218218);
    219219
     
    260260bool psMetadataAddItem(
    261261    psMetadata*  md,                   ///< Metadata collection to insert metadat item.
    262     psMetadataItem*  item,             ///< Metadata item to be added.
     262    const psMetadataItem* item,        ///< Metadata item to be added.
    263263    psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    264264    psS32 flags                        ///< Options flag mask, see psMetadataFlags enum
     
    334334
    335335/** Add a psList to metadata collection.
    336  * 
     336 *       
    337337 *  @return psBool:  True for success, False for failure.
    338338 */
     
    466466 */
    467467psMetadataItem* psMetadataLookup(
    468     const psMetadata * md,                   ///< Metadata collection to lookup metadata item.
     468    const psMetadata * md,             ///< Metadata collection to lookup metadata item.
    469469    const char * key                   ///< Name of metadata key.
    470470);
     
    479479 */
    480480psF64 psMetadataLookupF64(
    481     bool *status,                    ///< Status of lookup.
    482     const psMetadata *md,                    ///< Metadata collection to lookup metadata item.
     481    bool *status,                      ///< Status of lookup.
     482    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
    483483    const char *key                    ///< Name of metadata key.
    484484);
     
    493493 */
    494494psF32 psMetadataLookupF32(
    495     bool *status,                    ///< Status of lookup.
    496     const psMetadata *md,                    ///< Metadata collection to lookup metadata item.
     495    bool *status,                      ///< Status of lookup.
     496    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
    497497    const char *key                    ///< Name of metadata key.
    498498);
     
    507507 */
    508508psS32 psMetadataLookupS32(
    509     bool *status,                    ///< Status of lookup.
    510     const psMetadata *md,                    ///< Metadata collection to lookup metadata item.
     509    bool *status,                      ///< Status of lookup.
     510    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
    511511    const char *key                    ///< Name of metadata key.
    512512);
     
    521521 */
    522522bool psMetadataLookupBool(
    523     bool *status,                    ///< Status of lookup.
    524     const psMetadata *md,                    ///< Metadata collection to lookup metadata item.
     523    bool *status,                      ///< Status of lookup.
     524    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
    525525    const char *key                    ///< Name of metadata key.
    526526);
     
    535535 */
    536536psPtr psMetadataLookupPtr(
    537     bool *status,                    ///< Status of lookup.
    538     const psMetadata* md,                    ///< Metadata collection to lookup metadata item.
     537    bool *status,                      ///< Status of lookup.
     538    const psMetadata* md,              ///< Metadata collection to lookup metadata item.
    539539    const char *key                    ///< Name of metadata key.
    540540);
     
    548548 */
    549549psMetadataItem* psMetadataGet(
    550     psMetadata*  md,                   ///< Metadata collection to retrieve metadata item.
    551     psS32 location                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     550    const psMetadata* md,              ///< Metadata collection to retrieve metadata item.
     551    int location                       ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    552552);
    553553
     
    585585 */
    586586psMetadataItem* psMetadataGetAndIncrement(
    587     psMetadataIterator* iterator           ///< iterator to move
     587    psMetadataIterator* iterator       ///< iterator to move
    588588);
    589589
     
    596596 */
    597597psMetadataItem* psMetadataGetAndDecrement(
    598     psMetadataIterator* iterator           ///< iterator to move
     598    psMetadataIterator* iterator       ///< iterator to move
    599599);
    600600
  • trunk/psLib/src/types/psMetadataConfig.c

    r4392 r4401  
    1010*  @author Eric Van Alst, MHPCC
    1111*
    12 *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-06-25 02:02:05 $
     12*  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-06-27 20:38:12 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    363363}
    364364
    365 bool psMetadataItemPrint(FILE * fd, const char *format, const psMetadataItem* metadataItem)
     365bool psMetadataItemPrint(FILE * fd, const char *format, const psMetadataItem* item)
    366366{
    367367    psMetadataType type;
     
    370370    PS_ASSERT_PTR_NON_NULL(fd, success);
    371371    PS_ASSERT_PTR_NON_NULL(format, success);
    372     PS_ASSERT_PTR_NON_NULL(metadataItem, success);
    373 
    374     type = metadataItem->type;
     372    PS_ASSERT_PTR_NON_NULL(item, success);
     373
     374    type = item->type;
    375375
    376376    // determining the format type
     
    391391        switch(type) { \
    392392        case PS_META_BOOL: \
    393             fprintf(fd, format, (FORMAT_TYPE) metadataItem->data.B); \
     393            fprintf(fd, format, (FORMAT_TYPE) item->data.B); \
    394394            break; \
    395395        case PS_META_S32: \
    396             fprintf(fd,format,(FORMAT_TYPE)  metadataItem->data.S32); \
     396            fprintf(fd,format,(FORMAT_TYPE)  item->data.S32); \
    397397            break; \
    398398        case PS_META_F32: \
    399             fprintf(fd, format,(FORMAT_TYPE)  metadataItem->data.F32); \
     399            fprintf(fd, format,(FORMAT_TYPE)  item->data.F32); \
    400400            break; \
    401401        case PS_META_F64: \
    402             fprintf(fd, format,(FORMAT_TYPE) metadataItem->data.F64); \
     402            fprintf(fd, format,(FORMAT_TYPE) item->data.F64); \
    403403            break; \
    404404        default: \
     
    433433    case 's':
    434434        if (type == PS_META_STR) {
    435             fprintf(fd,format,(char*)metadataItem->data.V);
     435            fprintf(fd,format,(char*)item->data.V);
    436436        } else {
    437437            psError(PS_ERR_BAD_PARAMETER_TYPE,true,
     
    441441        break;
    442442    case 'p':
    443         fprintf(fd,format,metadataItem->data.V);
     443        fprintf(fd,format,item->data.V);
    444444        break;
    445445    default:
     
    10751075}
    10761076
    1077 psMetadata* psMetadataConfigParse(psMetadata* md, psU32 *nFail, const char *fileName, psBool overwrite)
     1077psMetadata* psMetadataConfigParse(psMetadata* md, int *nFail, const char *fileName, bool overwrite)
    10781078{
    10791079    FILE*               fp                   = NULL;
  • trunk/psLib/src/types/psMetadataConfig.h

    r4243 r4401  
    1010 *  @author Robert DeSonia, MHPCC
    1111 *
    12  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-06-14 02:54:07 $
     12 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-06-27 20:38:12 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5656    FILE * fd,                         ///< Pointer to file to write metadata item.
    5757    const char *format,                ///< Format to print metadata item.
    58     const psMetadataItem* metadataItem ///< Metadata item to print.
     58    const psMetadataItem* item        ///< Metadata item to print.
    5959);
    6060
     
    8181psMetadata* psMetadataConfigParse(
    8282    psMetadata* md,                    ///< Resulting metadata from read.
    83     psU32 *nFail,                      ///< Number of failed lines.
     83    int *nFail,                        ///< Number of failed lines.
    8484    const char *fileName,              ///< Name of file to read.
    85     psBool overwrite                   ///< Allow overwrite of duplicate specifications.
     85    bool overwrite                     ///< Allow overwrite of duplicate specifications.
    8686);
    8787
  • trunk/psLib/src/types/psPixels.c

    r4392 r4401  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-25 02:02:05 $
     9 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-06-27 20:38:12 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5555}
    5656
    57 psPixels* psPixelsAlloc(int size)
     57psPixels* psPixelsAlloc(psU32 nalloc)
    5858{
    5959    psPixels* out = psAlloc(sizeof(psPixels));
    6060
    61     if (size > 0) {
    62         out->data = psAlloc(sizeof(psPixelCoord)*size);
     61    if (nalloc > 0) {
     62        out->data = psAlloc(sizeof(psPixelCoord)*nalloc);
    6363    } else {
    6464        out->data = NULL;
    6565    }
    66     out->n = size;
    67     out->nalloc = size;
     66    out->n = nalloc;
     67    out->nalloc = nalloc;
    6868
    6969    psMemSetDeallocator(out, (psFreeFunc)pixelsFree);
     
    7272}
    7373
    74 psPixels* psPixelsRealloc(psPixels* pixels, int size)
    75 {
    76     if (pixels == NULL) {
    77         return psPixelsAlloc(size);
    78     }
    79 
    80     if (size > 0) {
    81         pixels->data = psRealloc(pixels->data, sizeof(psPixelCoord)*size);
     74psPixels* psPixelsRealloc(psPixels* pixels, psU32 nalloc)
     75{
     76    if (pixels == NULL) {
     77        return psPixelsAlloc(nalloc);
     78    }
     79
     80    if (nalloc > 0) {
     81        pixels->data = psRealloc(pixels->data, sizeof(psPixelCoord)*nalloc);
    8282    } else {
    8383        psFree(pixels->data);
     
    8585    }
    8686
    87     pixels->nalloc = size;
     87    pixels->nalloc = nalloc;
    8888
    8989    if (pixels->n > pixels->nalloc) {
     
    130130}
    131131
    132 psImage *psPixelsToMask(psImage *out, const psPixels *pixels, const psRegion region, unsigned int maskVal)
     132psImage *psPixelsToMask(psImage *out, const psPixels *pixels, psRegion region, psMaskType maskVal)
    133133{
    134134    // check that the input pixel vector is valid
     
    197197}
    198198
    199 psPixels* psPixelsFromMask(psPixels* out, const psImage* mask, unsigned int maskVal)
     199psPixels* psPixelsFromMask(psPixels* out, const psImage* mask, psMaskType maskVal)
    200200{
    201201    if (mask == NULL) {
  • trunk/psLib/src/types/psPixels.h

    r4321 r4401  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-20 22:42:29 $
     9 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-06-27 20:38:12 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5353 */
    5454psPixels* psPixelsAlloc(
    55     int size                           ///< the size of the coordinate vectors
     55    psU32 nalloc                       ///< the size of the coordinate vectors
    5656);
    5757
     
    6262psPixels* psPixelsRealloc(
    6363    psPixels* pixels,                  ///< psPixels to resize, or NULL to create new psPixels
    64     int size                           ///< the size of the coordinate vectors
     64    psU32 nalloc                       ///< the size of the coordinate vectors
    6565);
    6666
     
    103103    psImage* out,                      ///< psImage to recycle, or NULL
    104104    const psPixels* pixels,            ///< list of pixels to use
    105     const psRegion region,             ///< region to define the output mask image
    106     unsigned int maskVal               ///< the mask bit-values to act upon
     105    psRegion region,                   ///< region to define the output mask image
     106    psMaskType maskVal                 ///< the mask bit-values to act upon
    107107);
    108108
     
    119119    psPixels *out,                     ///< psPixels to recycle, or NULL
    120120    const psImage *mask,               ///< the input mask psImage
    121     unsigned int maskVal               ///< the mask bit-values to act upon
     121    psMaskType maskVal                 ///< the mask bit-values to act upon
    122122);
    123123
Note: See TracChangeset for help on using the changeset viewer.