IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4401


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
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/pslib.kdevses

    r4385 r4401  
    22<!DOCTYPE KDevPrjSession>
    33<KDevPrjSession>
    4  <DocsAndViews NumberOfDocuments="2" >
    5   <Doc0 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/dataManip/psMatrix.h" >
    6    <View0 line="77" Type="Source" />
    7   </Doc0>
    8   <Doc1 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/dataManip/psMatrix.c" >
    9    <View0 line="345" Type="Source" />
    10   </Doc1>
    11  </DocsAndViews>
     4 <DocsAndViews NumberOfDocuments="0" />
    125 <pluginList>
    136  <kdevbookmarks>
  • trunk/psLib/src/astro/psCoord.c

    r4392 r4401  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.77 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-06-25 02:02:04 $
     12*  @version $Revision: 1.78 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-06-27 20:38:11 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    288288 *****************************************************************************/
    289289psPlane* psPlaneDistortApply(psPlane* out,
    290                              const psPlaneDistort* transform,
     290                             const psPlaneDistort* distort,
    291291                             const psPlane* coords,
    292292                             float mag,
    293293                             float color)
    294294{
    295     PS_ASSERT_PTR_NON_NULL(transform, NULL);
    296     PS_ASSERT_PTR_NON_NULL(transform->x, NULL);
    297     PS_ASSERT_PTR_NON_NULL(transform->y, NULL);
     295    PS_ASSERT_PTR_NON_NULL(distort, NULL);
     296    PS_ASSERT_PTR_NON_NULL(distort->x, NULL);
     297    PS_ASSERT_PTR_NON_NULL(distort->y, NULL);
    298298    PS_ASSERT_PTR_NON_NULL(coords, NULL);
    299299
     
    302302    }
    303303    out->x = psDPolynomial4DEval(
    304                  transform->x,
     304                 distort->x,
    305305                 coords->x,
    306306                 coords->y,
     
    309309             );
    310310    out->y = psDPolynomial4DEval(
    311                  transform->y,
     311                 distort->y,
    312312                 coords->x,
    313313                 coords->y,
  • trunk/psLib/src/astro/psCoord.h

    r4330 r4401  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-06-21 03:01:37 $
     12*  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-06-27 20:38:11 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    221221psPlane* psPlaneDistortApply(
    222222    psPlane* out,                      ///< a psPlane to recycle.  If NULL, a new one is generated.
    223     const psPlaneDistort* transform,   ///< the transform to apply
     223    const psPlaneDistort* distort,     ///< the transform to apply
    224224    const psPlane* coords,             ///< the coordinate to apply the transform above.
    225225    float mag,                         ///< third term -- maybe magnitude
  • trunk/psLib/src/astronomy/psCoord.c

    r4392 r4401  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.77 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-06-25 02:02:04 $
     12*  @version $Revision: 1.78 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-06-27 20:38:11 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    288288 *****************************************************************************/
    289289psPlane* psPlaneDistortApply(psPlane* out,
    290                              const psPlaneDistort* transform,
     290                             const psPlaneDistort* distort,
    291291                             const psPlane* coords,
    292292                             float mag,
    293293                             float color)
    294294{
    295     PS_ASSERT_PTR_NON_NULL(transform, NULL);
    296     PS_ASSERT_PTR_NON_NULL(transform->x, NULL);
    297     PS_ASSERT_PTR_NON_NULL(transform->y, NULL);
     295    PS_ASSERT_PTR_NON_NULL(distort, NULL);
     296    PS_ASSERT_PTR_NON_NULL(distort->x, NULL);
     297    PS_ASSERT_PTR_NON_NULL(distort->y, NULL);
    298298    PS_ASSERT_PTR_NON_NULL(coords, NULL);
    299299
     
    302302    }
    303303    out->x = psDPolynomial4DEval(
    304                  transform->x,
     304                 distort->x,
    305305                 coords->x,
    306306                 coords->y,
     
    309309             );
    310310    out->y = psDPolynomial4DEval(
    311                  transform->y,
     311                 distort->y,
    312312                 coords->x,
    313313                 coords->y,
  • trunk/psLib/src/astronomy/psCoord.h

    r4330 r4401  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-06-21 03:01:37 $
     12*  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-06-27 20:38:11 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    221221psPlane* psPlaneDistortApply(
    222222    psPlane* out,                      ///< a psPlane to recycle.  If NULL, a new one is generated.
    223     const psPlaneDistort* transform,   ///< the transform to apply
     223    const psPlaneDistort* distort,     ///< the transform to apply
    224224    const psPlane* coords,             ///< the coordinate to apply the transform above.
    225225    float mag,                         ///< third term -- maybe magnitude
  • trunk/psLib/src/collections/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/collections/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/collections/psMetadataIO.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/collections/psMetadataIO.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/collections/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/collections/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
  • trunk/psLib/src/sys/psMemory.c

    r4397 r4401  
    88*  @author Robert Lupton, Princeton University
    99*
    10 *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2005-06-25 03:32:42 $
     10*  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2005-06-27 20:38:12 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    342342
    343343    ptr->file = file;
    344     ptr->freeFcn = NULL;
     344    ptr->freeFunc = NULL;
    345345    ptr->persistent = false;
    346346    *(psU32 *)&ptr->lineno = lineno;
     
    576576        pthread_mutex_unlock(&ptr->refCounterMutex);
    577577
    578         if (ptr->freeFcn != NULL) {
    579             ptr->freeFcn(vptr);
     578        if (ptr->freeFunc != NULL) {
     579            ptr->freeFunc(vptr);
    580580        }
    581581
     
    640640}
    641641
    642 void psMemSetDeallocator(psPtr vptr, psFreeFunc freeFcn)
     642void psMemSetDeallocator(psPtr ptr, psFreeFunc freeFunc)
     643{
     644    if (ptr == NULL) {
     645        return;
     646    }
     647
     648    psMemBlock* PTR = ((psMemBlock* ) ptr) - 1;
     649
     650    if (checkMemBlock(PTR, __func__) != 0) {
     651        memProblemCallback(PTR, __func__, __LINE__);
     652    }
     653
     654    PTR->freeFunc = freeFunc;
     655
     656}
     657psFreeFunc psMemGetDeallocator(psPtr ptr)
     658{
     659    if (ptr == NULL) {
     660        return NULL;
     661    }
     662
     663    psMemBlock* PTR = ((psMemBlock* ) ptr) - 1;
     664
     665    if (checkMemBlock(PTR, __func__) != 0) {
     666        memProblemCallback(PTR, __func__, __LINE__);
     667    }
     668
     669    return PTR->freeFunc;
     670}
     671
     672bool p_psMemGetPersistent(psPtr vptr)
     673{
     674    if (vptr == NULL) {
     675        return NULL;
     676    }
     677
     678    psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
     679
     680    if (checkMemBlock(ptr, __func__) != 0) {
     681        memProblemCallback(ptr, __func__, __LINE__);
     682    }
     683
     684    return ptr->persistent;
     685}
     686
     687void p_psMemSetPersistent(psPtr vptr, bool value)
    643688{
    644689    if (vptr == NULL) {
     
    652697    }
    653698
    654     ptr->freeFcn = freeFcn;
    655 
    656 }
    657 psFreeFunc psMemGetDeallocator(psPtr vptr)
    658 {
    659     if (vptr == NULL) {
    660         return NULL;
    661     }
    662 
    663     psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
    664 
    665     if (checkMemBlock(ptr, __func__) != 0) {
    666         memProblemCallback(ptr, __func__, __LINE__);
    667     }
    668 
    669     return ptr->freeFcn;
    670 }
    671 
    672 bool p_psMemGetPersistent(psPtr vptr)
    673 {
    674     if (vptr == NULL) {
    675         return NULL;
    676     }
    677 
    678     psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
    679 
    680     if (checkMemBlock(ptr, __func__) != 0) {
    681         memProblemCallback(ptr, __func__, __LINE__);
    682     }
    683 
    684     return ptr->persistent;
    685 }
    686 
    687 void p_psMemSetPersistent(psPtr vptr, bool value)
    688 {
    689     if (vptr == NULL) {
    690         return;
    691     }
    692 
    693     psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
    694 
    695     if (checkMemBlock(ptr, __func__) != 0) {
    696         memProblemCallback(ptr, __func__, __LINE__);
    697     }
    698 
    699699    ptr->persistent = value;
    700700}
  • trunk/psLib/src/sys/psMemory.h

    r4397 r4401  
    1212 *  @ingroup MemoryManagement
    1313 *
    14  *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-06-25 03:32:42 $
     14 *  @version $Revision: 1.44 $ $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
     
    6767    struct psMemBlock* previousBlock;  ///< previous block in allocation list
    6868    struct psMemBlock* nextBlock;      ///< next block allocation list
    69     psFreeFunc freeFcn;                 ///< deallocator.  If NULL, use generic deallocation.
     69    psFreeFunc freeFunc;               ///< deallocator.  If NULL, use generic deallocation.
    7070    size_t userMemorySize;             ///< the size of the user-portion of the memory block
    71     const psMemId id;               ///< a unique ID for this allocation
     71    const psMemId id;                  ///< a unique ID for this allocation
    7272    const char *file;                  ///< set from __FILE__ in e.g. p_psAlloc
    73     const psS32 lineno;                  ///< set from __LINE__ in e.g. p_psAlloc
     73    const psS32 lineno;                ///< set from __LINE__ in e.g. p_psAlloc
    7474    pthread_mutex_t refCounterMutex;   ///< mutex to ensure exclusive access to reference counter
    7575    psReferenceCount refCounter;       ///< how many times pointer is referenced
    76     psBool persistent;                   ///< marks if this non-user persistent data like error stack, etc.
     76    psBool persistent;                 ///< marks if this non-user persistent data like error stack, etc.
    7777    const psPtr endblock;              ///< initialised to p_psMEMMAGIC
    7878}
     
    152152void psMemSetDeallocator(
    153153    psPtr ptr,                         ///< the memory block to operate on
    154     psFreeFunc freeFcn                  ///< the function to be executed at deallocation
     154    psFreeFunc freeFunc                ///< the function to be executed at deallocation
    155155);
    156156
  • trunk/psLib/src/sysUtils/psMemory.c

    r4397 r4401  
    88*  @author Robert Lupton, Princeton University
    99*
    10 *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2005-06-25 03:32:42 $
     10*  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2005-06-27 20:38:12 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    342342
    343343    ptr->file = file;
    344     ptr->freeFcn = NULL;
     344    ptr->freeFunc = NULL;
    345345    ptr->persistent = false;
    346346    *(psU32 *)&ptr->lineno = lineno;
     
    576576        pthread_mutex_unlock(&ptr->refCounterMutex);
    577577
    578         if (ptr->freeFcn != NULL) {
    579             ptr->freeFcn(vptr);
     578        if (ptr->freeFunc != NULL) {
     579            ptr->freeFunc(vptr);
    580580        }
    581581
     
    640640}
    641641
    642 void psMemSetDeallocator(psPtr vptr, psFreeFunc freeFcn)
     642void psMemSetDeallocator(psPtr ptr, psFreeFunc freeFunc)
     643{
     644    if (ptr == NULL) {
     645        return;
     646    }
     647
     648    psMemBlock* PTR = ((psMemBlock* ) ptr) - 1;
     649
     650    if (checkMemBlock(PTR, __func__) != 0) {
     651        memProblemCallback(PTR, __func__, __LINE__);
     652    }
     653
     654    PTR->freeFunc = freeFunc;
     655
     656}
     657psFreeFunc psMemGetDeallocator(psPtr ptr)
     658{
     659    if (ptr == NULL) {
     660        return NULL;
     661    }
     662
     663    psMemBlock* PTR = ((psMemBlock* ) ptr) - 1;
     664
     665    if (checkMemBlock(PTR, __func__) != 0) {
     666        memProblemCallback(PTR, __func__, __LINE__);
     667    }
     668
     669    return PTR->freeFunc;
     670}
     671
     672bool p_psMemGetPersistent(psPtr vptr)
     673{
     674    if (vptr == NULL) {
     675        return NULL;
     676    }
     677
     678    psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
     679
     680    if (checkMemBlock(ptr, __func__) != 0) {
     681        memProblemCallback(ptr, __func__, __LINE__);
     682    }
     683
     684    return ptr->persistent;
     685}
     686
     687void p_psMemSetPersistent(psPtr vptr, bool value)
    643688{
    644689    if (vptr == NULL) {
     
    652697    }
    653698
    654     ptr->freeFcn = freeFcn;
    655 
    656 }
    657 psFreeFunc psMemGetDeallocator(psPtr vptr)
    658 {
    659     if (vptr == NULL) {
    660         return NULL;
    661     }
    662 
    663     psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
    664 
    665     if (checkMemBlock(ptr, __func__) != 0) {
    666         memProblemCallback(ptr, __func__, __LINE__);
    667     }
    668 
    669     return ptr->freeFcn;
    670 }
    671 
    672 bool p_psMemGetPersistent(psPtr vptr)
    673 {
    674     if (vptr == NULL) {
    675         return NULL;
    676     }
    677 
    678     psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
    679 
    680     if (checkMemBlock(ptr, __func__) != 0) {
    681         memProblemCallback(ptr, __func__, __LINE__);
    682     }
    683 
    684     return ptr->persistent;
    685 }
    686 
    687 void p_psMemSetPersistent(psPtr vptr, bool value)
    688 {
    689     if (vptr == NULL) {
    690         return;
    691     }
    692 
    693     psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
    694 
    695     if (checkMemBlock(ptr, __func__) != 0) {
    696         memProblemCallback(ptr, __func__, __LINE__);
    697     }
    698 
    699699    ptr->persistent = value;
    700700}
  • trunk/psLib/src/sysUtils/psMemory.h

    r4397 r4401  
    1212 *  @ingroup MemoryManagement
    1313 *
    14  *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-06-25 03:32:42 $
     14 *  @version $Revision: 1.44 $ $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
     
    6767    struct psMemBlock* previousBlock;  ///< previous block in allocation list
    6868    struct psMemBlock* nextBlock;      ///< next block allocation list
    69     psFreeFunc freeFcn;                 ///< deallocator.  If NULL, use generic deallocation.
     69    psFreeFunc freeFunc;               ///< deallocator.  If NULL, use generic deallocation.
    7070    size_t userMemorySize;             ///< the size of the user-portion of the memory block
    71     const psMemId id;               ///< a unique ID for this allocation
     71    const psMemId id;                  ///< a unique ID for this allocation
    7272    const char *file;                  ///< set from __FILE__ in e.g. p_psAlloc
    73     const psS32 lineno;                  ///< set from __LINE__ in e.g. p_psAlloc
     73    const psS32 lineno;                ///< set from __LINE__ in e.g. p_psAlloc
    7474    pthread_mutex_t refCounterMutex;   ///< mutex to ensure exclusive access to reference counter
    7575    psReferenceCount refCounter;       ///< how many times pointer is referenced
    76     psBool persistent;                   ///< marks if this non-user persistent data like error stack, etc.
     76    psBool persistent;                 ///< marks if this non-user persistent data like error stack, etc.
    7777    const psPtr endblock;              ///< initialised to p_psMEMMAGIC
    7878}
     
    152152void psMemSetDeallocator(
    153153    psPtr ptr,                         ///< the memory block to operate on
    154     psFreeFunc freeFcn                  ///< the function to be executed at deallocation
     154    psFreeFunc freeFunc                ///< the function to be executed at deallocation
    155155);
    156156
  • 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
  • trunk/psLib/src/xml/psXML.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/xml/psXML.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/test/astronomy/verified/tst_psCoord.stderr

    r3471 r4401  
    8484    Following should generate an error message for null psPlaneDistort
    8585<DATE><TIME>|<HOST>|E|psPlaneDistortApply (FILE:LINENO)
    86     Unallowable operation: transform is NULL.
     86    Unallowable operation: distort is NULL.
    8787<DATE><TIME>|<HOST>|I|testPlaneDistortApply
    8888    Following should generate an error message for null x member psPlaneDistort
    8989<DATE><TIME>|<HOST>|E|psPlaneDistortApply (FILE:LINENO)
    90     Unallowable operation: transform->x is NULL.
     90    Unallowable operation: distort->x is NULL.
    9191<DATE><TIME>|<HOST>|I|testPlaneDistortApply
    9292    Following should generate an error message for null y member psPlaneDistort
    9393<DATE><TIME>|<HOST>|E|psPlaneDistortApply (FILE:LINENO)
    94     Unallowable operation: transform->y is NULL.
     94    Unallowable operation: distort->y is NULL.
    9595<DATE><TIME>|<HOST>|I|testPlaneDistortApply
    9696    Following should generate an error message for null input psPlane
  • trunk/psLib/test/collections/verified/tst_psMetadata_02.stderr

    r3690 r4401  
    88    Unallowable operation: md is NULL.
    99<DATE><TIME>|<HOST>|E|psMetadataAddItem (FILE:LINENO)
    10     Unallowable operation: metadataItem is NULL.
     10    Unallowable operation: item is NULL.
  • trunk/psLib/test/collections/verified/tst_psMetadata_03.stderr

    r3690 r4401  
    1414    Unallowable operation: md->list is NULL.
    1515<DATE><TIME>|<HOST>|E|psMetadataAddItem (FILE:LINENO)
    16     Unallowable operation: metadataItem->name is NULL.
     16    Unallowable operation: item->name is NULL.
    1717<DATE><TIME>|<HOST>|E|psMetadataAddItem (FILE:LINENO)
    1818    Unallowable operation: md->table is NULL.
  • trunk/psLib/test/collections/verified/tst_psMetadata_05.stderr

    r3690 r4401  
    44    Unallowable operation: format is NULL.
    55<DATE><TIME>|<HOST>|E|psMetadataItemPrint (FILE:LINENO)
    6     Unallowable operation: metadataItem is NULL.
     6    Unallowable operation: item is NULL.
Note: See TracChangeset for help on using the changeset viewer.