IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4457


Ignore:
Timestamp:
Jul 5, 2005, 5:04:35 PM (21 years ago)
Author:
drobbin
Message:

made changes based on revisions in psLib SDRS rev. 15

Location:
trunk/psLib
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/pslib.kdevses

    r4446 r4457  
    22<!DOCTYPE KDevPrjSession>
    33<KDevPrjSession>
    4  <DocsAndViews NumberOfDocuments="10" >
    5   <Doc0 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/astro/Makefile.am" >
    6    <View0 line="33" Type="Source" />
     4 <DocsAndViews NumberOfDocuments="4" >
     5  <Doc0 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/dataManip/psFunctions.h" >
     6   <View0 line="263" Type="Source" />
    77  </Doc0>
    8   <Doc1 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/db/Makefile.am" >
    9    <View0 line="14" Type="Source" />
     8  <Doc1 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/dataManip/psFunctions.c" >
     9   <View0 line="1597" Type="Source" />
    1010  </Doc1>
    11   <Doc2 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/fft/Makefile.am" >
    12    <View0 line="14" Type="Source" />
     11  <Doc2 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/collections/psVector.h" >
     12   <View0 line="53" Type="Source" />
    1313  </Doc2>
    14   <Doc3 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/fits/Makefile.am" >
    15    <View0 line="14" Type="Source" />
     14  <Doc3 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/image/psImage.h" >
     15   <View0 line="79" Type="Source" />
    1616  </Doc3>
    17   <Doc4 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/imageops/Makefile.am" >
    18    <View0 line="14" Type="Source" />
    19   </Doc4>
    20   <Doc5 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/math/Makefile.am" >
    21    <View0 line="14" Type="Source" />
    22   </Doc5>
    23   <Doc6 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/mathtypes/Makefile.am" >
    24    <View0 line="15" Type="Source" />
    25   </Doc6>
    26   <Doc7 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/sys/Makefile.am" >
    27    <View0 line="14" Type="Source" />
    28   </Doc7>
    29   <Doc8 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/types/Makefile.am" >
    30    <View0 line="15" Type="Source" />
    31   </Doc8>
    32   <Doc9 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/xml/Makefile.am" >
    33    <View0 line="15" Type="Source" />
    34   </Doc9>
    3517 </DocsAndViews>
    3618 <pluginList>
  • trunk/psLib/src/collections/psArray.c

    r4392 r4457  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-06-25 02:02:04 $
     11 *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-07-06 03:04:35 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4949  FUNCTION IMPLEMENTATION - PUBLIC
    5050 *****************************************************************************/
    51 psArray* psArrayAlloc(unsigned long nalloc)
     51psArray* psArrayAlloc(long nalloc)
    5252{
    5353    psArray* psArr = NULL;
     
    6666}
    6767
    68 psArray* psArrayRealloc(psArray* in, unsigned long nalloc)
     68psArray* psArrayRealloc(psArray* in, long nalloc)
    6969{
    7070    if (in == NULL) {
     
    160160/// Set an element in the array.
    161161bool psArraySet(psArray* array,                      ///< input array to set element in
    162                 unsigned long position,            ///< the element position to set
     162                long position,                      ///< the element position to set
    163163                psPtr data)                        ///< the value to set it to
    164164{
     
    185185
    186186/// Get an element in the array.
    187 psPtr psArrayGet(const psArray* array, unsigned long position )
     187psPtr psArrayGet(const psArray* array, long position )
    188188{
    189189    if (array == NULL) {
  • trunk/psLib/src/collections/psArray.h

    r4367 r4457  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-06-23 03:50:29 $
     14 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2005-07-06 03:04:35 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3434typedef struct
    3535{
    36     psU32 nalloc;                      ///< Total number of elements available.
    37     psU32 n;                           ///< Number of elements in use.
     36    long nalloc;                       ///< Total number of elements available.
     37    long n;                            ///< Number of elements in use.
    3838    psPtr* data;                       ///< An Array of pointer elements
     39    void *lock;                        ///< Optional lock for thread safety
    3940}
    4041psArray;
     
    5556 */
    5657psArray* psArrayAlloc(
    57     unsigned long nalloc               ///< Total number of elements to make available.
    58 );
     58    long nalloc                        ///< Total number of elements to make available.
     59)
     60;
    5961
    6062/** Reallocate an array.
     
    6870psArray* psArrayRealloc(
    6971    psArray* array,                    ///< array to reallocate.
    70     unsigned long nalloc               ///< Total number of elements to make available.
     72    long nalloc                        ///< Total number of elements to make available.
    7173);
    7274
     
    133135bool psArraySet(
    134136    psArray* array,                    ///< input array to set element in
    135     unsigned long position,            ///< the element position to set
     137    long position,                     ///< the element position to set
    136138    psPtr data                         ///< the value to set it to
    137139);
     
    143145psPtr psArrayGet(
    144146    const psArray* array,              ///< input array to get element from
    145     unsigned long position             ///< the element position to get
     147    long position                      ///< the element position to get
    146148);
    147149
  • trunk/psLib/src/collections/psBitSet.h

    r4342 r4457  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-06-22 02:05:41 $
     14 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2005-07-06 03:04:35 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3737typedef struct
    3838{
    39     psS32 n;                             ///< Number of bytes in the array
    40     char *bits;                        ///< Aray of bytes holding bits
     39    long n;                            ///< Number of bytes in the array
     40    psU8 *bits;                        ///< Aray of bytes holding bits
     41    void *lock;                        ///< Optional lock for thread safety
    4142}
    4243psBitSet;
     
    5758psBitSet* psBitSetAlloc(
    5859    long nalloc                            ///< Number of bits in psBitSet array
    59 );
     60)
     61;
    6062
    6163/** Set a bit.
     
    7072    /* @returned@ */
    7173    psBitSet* bitSet,                  ///< Pointer to psBitSet to be set.
    72     long bit                          ///< Bit to be set.
     74    long bit                           ///< Bit to be set.
    7375);
    7476
  • trunk/psLib/src/collections/psHash.c

    r4392 r4457  
    1212*  @author GLG, MHPCC
    1313*
    14 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2005-06-25 02:02:05 $
     14*  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2005-07-06 03:04:35 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5757    // Loop through every bucket in the hash table.  If that bucket is not
    5858    // NULL, then add the bucket's key to the linked list.
    59     for (i = 0; i < hash->nbucket; i++) {
     59    for (i = 0; i < hash->n; i++) {
    6060        if (hash->buckets[i] != NULL) {
    6161            // Since a bucket contains a linked list of keys/data, we must
     
    128128
    129129/******************************************************************************
    130 psHashAlloc(nbucket): this procedure creates a new hash table with the
     130psHashAlloc(n): this procedure creates a new hash table with the
    131131specified number of buckets.
    132132Inputs:
    133     nbucket: initial number of buckets
     133    n: initial number of buckets
    134134Return:
    135135    The new hash table.
     
    146146    // Allocate memory for the buckets.
    147147    table->buckets = psAlloc(nalloc * sizeof(psHashBucket* ));
    148     table->nbucket = nalloc;
     148    table->n = nalloc;
    149149
    150150    psTrace("utils.hash", 1, "Creating %d-element hash table\n", nalloc);
     
    179179    // Loop through each bucket in the hash table.  If that bucket is not
    180180    // NULL, then free the bucket via a function call to hashBucketFree();
    181     for (i = 0; i < table->nbucket; i++) {
     181    for (i = 0; i < table->n; i++) {
    182182
    183183        // A bucket is composed of a linked list of buckets.
     
    238238    // hash = (hash << 1) ^ key[i];
    239239    // }
    240     // hash &= (table->nbucket - 1);
     240    // hash &= (table->n - 1);
    241241
    242242    // This hash algorithm is from Sedgewick.  NOTE: must reread to ensure that
     
    244244    tmpchar = (char *)key;
    245245    for (hash = 0; *tmpchar != '\0'; tmpchar++) {
    246         hash = (64 * hash + *tmpchar) % (table->nbucket);
     246        hash = (64 * hash + *tmpchar) % (table->n);
    247247    }
    248248
    249249    // NOTE: This should not be necessary, but for now, I'm checking bounds
    250250    // anyway.
    251     if ((hash < 0) || (hash >= table->nbucket)) {
     251    if ((hash < 0) || (hash >= table->n)) {
    252252        psError(PS_ERR_UNKNOWN, true,
    253253                "Internal hash function out of range (%d)", hash);
     
    409409    // psArray we need to allocate.
    410410    int nElements = 0;
    411     int nbucket = hash->nbucket;
     411    int nbucket = hash->n;
    412412    for (int i = 0; i < nbucket; i++) {
    413413        psHashBucket* tmpBucket = hash->buckets[i];
  • trunk/psLib/src/collections/psHash.h

    r4352 r4457  
    1111 *  @author GLG, MHPCC
    1212 *
    13  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-06-22 23:48:39 $
     13 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-07-06 03:04:35 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4040typedef struct psHash
    4141{
    42     psS32 nbucket;                     ///< Number of buckets in hash table.
     42    long n;                            ///< Number of buckets in hash table.
    4343    psHashBucket* *buckets;            ///< The bucket data.
     44    void *lock;                        ///< Optional lock for thread safety.
    4445}
    4546psHash;
     
    4849psHash* psHashAlloc(
    4950    long nalloc                        ///< The number of buckets to allocate.
    50 );
     51)
     52;
    5153
    5254/// Insert entry into table.
  • trunk/psLib/src/collections/psList.c

    r4392 r4457  
    66 *  @author Robert Daniel DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-06-25 02:02:05 $
     8 *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-07-06 03:04:35 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    113113    }
    114114
    115     list->size--;
     115    list->n--;
    116116
    117117    pthread_mutex_unlock(&list->lock)
     
    131131    psMemSetDeallocator(list, (psFreeFunc) listFree);
    132132
    133     list->size = 0;
     133    list->n = 0;
    134134    list->head = list->tail = NULL;
    135135    list->iterators = psArrayAlloc(16);
     
    182182
    183183bool psListIteratorSet(psListIterator* iterator,
    184                        int location)
     184                       long location)
    185185{
    186186    if (iterator == NULL) {
     
    192192    if (location == PS_LIST_TAIL) {
    193193        iterator->cursor = list->tail;
    194         iterator->index = list->size - 1;
     194        iterator->index = list->n - 1;
    195195        iterator->offEnd = false;
    196196        return true;
     
    205205
    206206    if (location < 0) {
    207         location = list->size + location;
    208     }
    209 
    210     if (location < 0 || location >= (int)list->size) {
     207        location = list->n + location;
     208    }
     209
     210    if (location < 0 || location >= (int)list->n) {
    211211        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    212212                PS_ERRORTEXT_psList_LOCATION_INVALID,
     
    218218    int index = iterator->index;
    219219    if (cursor == NULL) {      // set the cursor to the head if it is NULL
    220         if (location > list->size/2) { // closer to tail or head?
     220        if (location > list->n/2) { // closer to tail or head?
    221221            cursor = list->tail;
    222             index = list->size - 1;
     222            index = list->n - 1;
    223223        } else {
    224224            cursor = list->head;
     
    262262    }
    263263
    264     if (location > 0 && location >= (int)list->size) {
     264    if (location > 0 && location >= (int)list->n) {
    265265        psLogMsg(__func__,PS_LOG_WARN,
    266266                 "Specified location, %d, is beyond the end of the list.  "
     
    337337    elem->data = psMemIncrRefCounter(data);
    338338
    339     list->size++;
     339    list->n++;
    340340
    341341    if (cursor == list->tail) {
     
    412412    elem->data = psMemIncrRefCounter(data);
    413413
    414     list->size++;
     414    list->n++;
    415415
    416416    if (cursor == list->head) {
     
    548548    if ( (iterator->cursor == NULL) && (iterator->offEnd) ) {
    549549        iterator->cursor = iterator->list->tail;
    550         iterator->index = iterator->list->size-1;
     550        iterator->index = iterator->list->n-1;
    551551        iterator->offEnd = false;
    552552        return NULL;
     
    574574    }
    575575
    576     if (list->size > 0) {
    577         arr = psArrayAlloc(list->size);
     576    if (list->n > 0) {
     577        arr = psArrayAlloc(list->n);
    578578    } else {
    579579        arr = psArrayAlloc(1);
    580580    }
    581581
    582     arr->n = list->size;
     582    arr->n = list->n;
    583583
    584584    ptr = list->head;
    585     n = list->size;
     585    n = list->n;
    586586    for (psS32 i = 0; i < n; i++) {
    587587        arr->data[i] = psMemIncrRefCounter(ptr->data);
  • trunk/psLib/src/collections/psList.h

    r4367 r4457  
    77 *  @ingroup LinkedList
    88 *
    9  *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-23 03:50:29 $
     9 *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-07-06 03:04:35 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5252typedef struct
    5353{
    54     psU32 size;                        ///< number of elements on list
     54    long n;                            ///< number of elements on list
    5555    psListElem* head;                  ///< first element on list (may be NULL)
    5656    psListElem* tail;                  ///< last element on list (may be NULL)
     
    6161
    6262    pthread_mutex_t lock;              ///< mutex to lock a node during changes
     63//    void *lock;                        ///< Optional lock for thread safety
    6364}
    6465psList;
     
    110111 */
    111112bool psListIteratorSet(
    112     psListIterator* iterator,            ///< list iterator
    113     int location                         ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL
     113    psListIterator* iterator,          ///< list iterator
     114    long location                      ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL
    114115);
    115116
     
    120121bool psListAdd(
    121122    psList* list,                      ///< list to add item to
    122     long location,                    ///< index, PS_LIST_HEAD, PS_LIST_TAIL, or numbered location.
     123    long location,                     ///< index, PS_LIST_HEAD, PS_LIST_TAIL, or numbered location.
    123124    psPtr data                         ///< data item to add.  If NULL, list is not modified.
    124125);
  • trunk/psLib/src/collections/psMetadata.c

    r4401 r4457  
    1212*  @author Ross Harman, MHPCC
    1313*
    14 *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2005-06-27 20:38:12 $
     14*  @version $Revision: 1.70 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2005-07-06 03:04:35 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    122122    psFree(iter->iter);
    123123
    124     if (iter->preg != NULL) {
    125         regfree(iter->preg);
     124    if (iter->regex != NULL) {
     125        regfree(iter->regex);
    126126    }
    127127}
     
    268268}
    269269
    270 bool psMetadataAddItem(psMetadata *md, const psMetadataItem *item, psS32 location, psS32 flags)
     270bool psMetadataAddItem(psMetadata *md, const psMetadataItem *item, long location, psS32 flags)
    271271{
    272272    char * key = NULL;
     
    360360}
    361361
    362 bool psMetadataAdd(psMetadata *md, int location, const char *name,
     362bool psMetadataAdd(psMetadata *md, long location, const char *name,
    363363                   int format, const char *comment, ...)
    364364{
     
    372372}
    373373
    374 bool psMetadataAddV(psMetadata *md, int location, const char *name,
     374bool psMetadataAddV(psMetadata *md, long location, const char *name,
    375375                    int format, const char *comment, va_list list)
    376376{
     
    391391
    392392#define METADATA_ADD_TYPE(NAME,TYPE,METATYPE) \
    393 psBool psMetadataAdd##NAME(psMetadata* md, psS32 where, const char* name, \
     393psBool psMetadataAdd##NAME(psMetadata* md, long where, const char* name, \
    394394                           const char* comment, TYPE value) { \
    395395    return psMetadataAdd(md,where,name, METATYPE,comment,value); \
     
    409409METADATA_ADD_TYPE(Array,psArray*,PS_META_ARRAY)
    410410
    411 psBool psMetadataRemove(psMetadata *md, psS32 where, const char *key)
     411psBool psMetadataRemove(psMetadata *md, long where, const char *key)
    412412{
    413413    PS_ASSERT_PTR_NON_NULL(md,NULL);
     
    580580psMetadataLookupNumTYPE(Bool)
    581581
    582 psMetadataItem* psMetadataGet(const psMetadata *md, int location)
     582psMetadataItem* psMetadataGet(const psMetadata *md, long location)
    583583{
    584584    psMetadataItem* entry = NULL;
     
    597597
    598598psMetadataIterator* psMetadataIteratorAlloc(psMetadata* md,
    599         int location,
     599        long location,
    600600        const char* regex)
    601601{
     
    604604
    605605    psMetadataIterator* newIter = psAlloc(sizeof(psMetadataIterator));
    606     newIter->preg = NULL;
     606    newIter->regex = NULL;
    607607    newIter->iter = NULL;
    608608
     
    614614        return newIter;
    615615    } else {
    616         int regRtn = regcomp(newIter->preg,regex,0);
     616        int regRtn = regcomp(newIter->regex,regex,0);
    617617        if (regRtn != 0) {
    618618            char errMsg[256];
    619             regerror(regRtn, newIter->preg, errMsg, 256);
    620             regfree(newIter->preg);
     619            regerror(regRtn, newIter->regex, errMsg, 256);
     620            regfree(newIter->regex);
    621621            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    622622                    PS_ERRORTEXT_psMetadata_REGEX_INVALID,
     
    633633
    634634bool psMetadataIteratorSet(psMetadataIterator* iterator,
    635                            int location)
     635                           long location)
    636636{
    637637    int match;
     
    643643    PS_ASSERT_PTR_NON_NULL(iterator->iter,NULL);
    644644
    645     regex_t* preg = iterator->preg;
     645    regex_t* regex = iterator->regex;
    646646
    647647    // handle trivial case where no regex subsetting is required.
    648     if (preg == NULL) {
     648    if (regex == NULL) {
    649649        return psListIteratorSet(iter,location);
    650650    }
     
    655655        psListIteratorSet(iter,PS_LIST_TAIL);
    656656        while ( (cursor=(psMetadataItem*)iter->cursor) != NULL) {
    657             if (regexec(preg, cursor->name, 0, NULL, 0) == 0) {
     657            if (regexec(regex, cursor->name, 0, NULL, 0) == 0) {
    658658                // this key is a match
    659659                match--;
     
    671671    psListIteratorSet(iter,PS_LIST_HEAD);
    672672    while ( (cursor=(psMetadataItem*)iter->cursor) != NULL) {
    673         if (regexec(preg, cursor->name, 0, NULL, 0) == 0) {
     673        if (regexec(regex, cursor->name, 0, NULL, 0) == 0) {
    674674            // this key is a match
    675675            match++;
     
    692692    PS_ASSERT_PTR_NON_NULL(iterator->iter,NULL);
    693693
    694     regex_t* preg = iterator->preg;
     694    regex_t* regex = iterator->regex;
    695695
    696696    // handle trivial case where no regex subsetting is required.
    697     if (preg == NULL) {
     697    if (regex == NULL) {
    698698        return (psMetadataItem*)psListGetAndIncrement(iter);
    699699    }
     
    703703    while (psListGetAndIncrement(iter) != NULL) {
    704704        if (iter->cursor != NULL &&
    705                 regexec(preg, ((psMetadataItem*)iter->cursor)->name, 0, NULL, 0) == 0) {
     705                regexec(regex, ((psMetadataItem*)iter->cursor)->name, 0, NULL, 0) == 0) {
    706706            // this key is a match
    707707            break;
     
    720720    PS_ASSERT_PTR_NON_NULL(iterator->iter,NULL);
    721721
    722     regex_t* preg = iterator->preg;
     722    regex_t* regex = iterator->regex;
    723723
    724724    // handle trivial case where no regex subsetting is required.
    725     if (preg == NULL) {
     725    if (regex == NULL) {
    726726        return (psMetadataItem*)psListGetAndDecrement(iter);
    727727    }
     
    731731    while (psListGetAndDecrement(iter) != NULL) {
    732732        if (iter->cursor != NULL &&
    733                 regexec(preg, ((psMetadataItem*)iter->cursor)->name, 0, NULL, 0) == 0) {
     733                regexec(regex, ((psMetadataItem*)iter->cursor)->name, 0, NULL, 0) == 0) {
    734734            // this key is a match
    735735            break;
  • trunk/psLib/src/collections/psMetadata.h

    r4401 r4457  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2005-06-27 20:38:12 $
     13*  @version $Revision: 1.53 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2005-07-06 03:04:35 $
    1515*
    1616*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5555    PS_META_ARRAY                      ///< Array data (Stored as item.data.V).
    5656} psMetadataType;
    57 
    5857#define PS_META_IS_PRIMITIVE(TYPE) \
    5958(TYPE == PS_META_S32 || \
     
    7776    PS_META_DEFAULT = 0,               ///< default behaviour (duplicate entry is an error)
    7877    PS_META_REPLACE = 0x1000000,       ///< allow entry to be replaced
    79     PS_META_DUPLICATE_OK = 0x2000000   ///< allow duplicate entries
     78    PS_META_DUPLICATE_OK = 0x2000000,  ///< allow duplicate entries
     79    PS_META_NULL = 0x4000000           ///< psMetadataItem.data is a NULL value
    8080} psMetadataFlags;
    8181
     
    9494    psList*  list;                     ///< Metadata in linked-list
    9595    psHash*  table;                    ///< Metadata in a hash table
     96    void *lock;                        ///< Optional lock for thread safety
    9697}
    9798psMetadata;
     
    104105{
    105106    psListIterator* iter;              ///< iterator for the psMetadata's psList
    106     regex_t* preg;                     ///< the subsetting regular expression
     107    regex_t* regex;                    ///< the subsetting regular expression
    107108}
    108109psMetadataIterator;
     
    116117{
    117118    const psS32 id;                    ///< Unique ID for metadata item.
    118     char *name;                        ///< Name of metadata item.
     119    psString name;                     ///< Name of metadata item.
    119120    psMetadataType type;               ///< Type of metadata item.
    120121    union {
     
    127128        psPtr V;                       ///< Pointer to other type of data.
    128129    } data;                            ///< Union for data types.
    129     char *comment;                     ///< Optional comment ("", not NULL).
     130    psString comment;                  ///< Optional comment ("", not NULL).
    130131}
    131132psMetadataItem;
     
    151152    const char *comment,               ///< Comment for metadata item.
    152153    ...                                ///< Arguments for name formatting and metadata item data.
    153 );
     154)
     155;
    154156
    155157/** Create a metadata item with specified string data.
     
    261263    psMetadata*  md,                   ///< Metadata collection to insert metadat item.
    262264    const psMetadataItem* item,        ///< Metadata item to be added.
    263     psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     265    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    264266    psS32 flags                        ///< Options flag mask, see psMetadataFlags enum
    265267);
     
    273275bool psMetadataAdd(
    274276    psMetadata* md,                    ///< Metadata collection to insert metadata item.
    275     int location,                      ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     277    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    276278    const char *name,                  ///< Name of metadata item.
    277279    int format,                        ///< Type of metadata item (psMetadataType) and options (psMetadataFlags)
     
    289291bool psMetadataAddV(
    290292    psMetadata* md,                    ///< Metadata collection to insert metadata item.
    291     int location,                      ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     293    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    292294    const char *name,                  ///< Name of metadata item.
    293295    int format,                        ///< Type of metadata item (psMetadataType) and options (psMetadataFlags)
     
    298300
    299301/** Add a psS32 value to metadata collection.
    300  * 
    301  *  @return bool:  True for success, False for failure. 
     302 *
     303 *  @return bool:  True for success, False for failure.
    302304 */
    303305bool psMetadataAddS32(
    304306    psMetadata* md,                    ///< Metadata collection to insert metadata item
    305     psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     307    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    306308    const char* name,                  ///< Name of metadata item
    307309    const char* comment,               ///< Comment for metadata item
     
    310312
    311313/** Add a psF32 value to metadata collection.
    312  * 
     314 *
    313315 *  @return bool:  True for success, False for failure.
    314316*/
    315317bool psMetadataAddF32(
    316318    psMetadata* md,                    ///< Metadata collection to insert metadata item
    317     psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     319    long location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    318320    const char* name,                  ///< Name of metadata item
    319321    const char* comment,               ///< Comment for metadata item
     
    322324
    323325/** Add a psF64 value to metadata collection.
    324  * 
     326 *
    325327 *  @return bool:  True for success, False for failure.
    326328*/
    327329bool psMetadataAddF64(
    328330    psMetadata* md,                    ///< Metadata collection to insert metadata item
    329     psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     331    long location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    330332    const char* name,                  ///< Name of metadata item
    331333    const char* comment,               ///< Comment for metadata item
     
    334336
    335337/** Add a psList to metadata collection.
    336  *       
     338 *
    337339 *  @return psBool:  True for success, False for failure.
    338340 */
    339341psBool psMetadataAddList(
    340342    psMetadata* md,                    ///< Metadata collection to insert metadata item
    341     psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     343    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    342344    const char* name,                  ///< Name of metadata item
    343345    const char* comment,               ///< Comment for metadata item
     
    346348
    347349/** Add a string to metadata collection.
    348  * 
     350 *
    349351 *  @return bool:  True for success, False for failure.
    350352 */
    351353bool psMetadataAddStr(
    352354    psMetadata* md,                    ///< Metadata collection to insert metadata item
    353     psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     355    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    354356    const char* name,                  ///< Name of metadata item
    355357    const char* comment,               ///< Comment for metadata item
     
    358360
    359361/** Add a vector to metadata collection.
    360  * 
     362 *
    361363 *  @return psBool:  True for success, False for failure.
    362364 */
    363365psBool psMetadataAddVector(
    364366    psMetadata* md,                    ///< Metadata collection to insert metadata item
    365     psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     367    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    366368    const char* name,                  ///< Name of metadata item
    367369    const char* comment,               ///< Comment for metadata item
     
    370372
    371373/** Add a array to metadata collection.
    372  * 
     374 *
    373375 *  @return psBool:  True for success, False for failure.
    374376 */
    375377psBool psMetadataAddArray(
    376378    psMetadata* md,                    ///< Metadata collection to insert metadata item
    377     psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     379    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    378380    const char* name,                  ///< Name of metadata item
    379381    const char* comment,               ///< Comment for metadata item
     
    382384
    383385/** Add an Image to metadata collection.
    384  * 
     386 *
    385387 *  @return psBool:  True for success, False for failure.
    386388 */
    387389psBool psMetadataAddImage(
    388390    psMetadata* md,                    ///< Metadata collection to insert metadata item
    389     psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     391    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    390392    const char* name,                  ///< Name of metadata item
    391393    const char* comment,               ///< Comment for metadata item
     
    394396
    395397/** Add a Hash to metadata collection.
    396  * 
     398 *
    397399 *  @return psBool:  True for success, False for failure.
    398400 */
    399401psBool psMetadataAddHash(
    400402    psMetadata* md,                    ///< Metadata collection to insert metadata item
    401     psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     403    long location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    402404    const char* name,                  ///< Name of metadata item
    403405    const char* comment,               ///< Comment for metadata item
     
    406408
    407409/** Add a LookupTable to metadata collection.
    408  * 
     410 *
    409411 *  @return psBool:  True for success, False for failure.
    410412 */
    411413psBool psMetadataAddLookupTable(
    412414    psMetadata* md,                    ///< Metadata collection to insert metadata item
    413     psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     415    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    414416    const char* name,                  ///< Name of metadata item
    415417    const char* comment,               ///< Comment for metadata item
     
    418420
    419421/** Add an Unknown (psPtr) to metadata collection.
    420  * 
     422 *
    421423 *  @return psBool:  True for success, False for failure.
    422424 */
    423425psBool psMetadataAddUnknown(
    424426    psMetadata* md,                    ///< Metadata collection to insert metadata item
    425     psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     427    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    426428    const char* name,                  ///< Name of metadata item
    427429    const char* comment,               ///< Comment for metadata item
     
    430432
    431433/** Add Metadata to metadata collection.
    432  * 
     434 *
    433435 *  @return psBool:  True for success, False for failure.
    434436 */
    435437psBool psMetadataAddMetadata(
    436438    psMetadata* md,                    ///< Metadata collection to insert metadata item
    437     psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     439    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    438440    const char* name,                  ///< Name of metadata item
    439441    const char* comment,               ///< Comment for metadata item
     
    453455bool psMetadataRemove(
    454456    psMetadata*  md,                   ///< Metadata collection to remove metadata item.
    455     int location,                      ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     457    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    456458    const char * key                   ///< Name of metadata key.
    457459);
     
    549551psMetadataItem* psMetadataGet(
    550552    const psMetadata* md,              ///< Metadata collection to retrieve metadata item.
    551     int location                       ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     553    long location                      ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    552554);
    553555
     
    562564psMetadataIterator* psMetadataIteratorAlloc(
    563565    psMetadata* md,                    ///< the psMetadata to iterate with
    564     int location,                      ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     566    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    565567    const char* regex
    566568    ///< A regular expression for subsetting the psMetadata.  If NULL, no
     
    575577bool psMetadataIteratorSet(
    576578    psMetadataIterator* iterator,      ///< psMetadata iterator
    577     int location                       ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL
     579    long location                      ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL
    578580);
    579581
  • trunk/psLib/src/collections/psMetadataIO.c

    r4432 r4457  
    1010*  @author Eric Van Alst, MHPCC
    1111*
    12 *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-06-30 00:04:12 $
     12*  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-07-06 03:04:35 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    619619
    620620    // Determine the number of items in template
    621     items = template->list->size;
     621    items = template->list->n;
    622622    if(items > 0 ) {
    623623
  • trunk/psLib/src/collections/psPixels.c

    r4401 r4457  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-27 20:38:12 $
     9 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-07-06 03:04:35 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5555}
    5656
    57 psPixels* psPixelsAlloc(psU32 nalloc)
     57psPixels* psPixelsAlloc(long nalloc)
    5858{
    5959    psPixels* out = psAlloc(sizeof(psPixels));
     
    7272}
    7373
    74 psPixels* psPixelsRealloc(psPixels* pixels, psU32 nalloc)
     74psPixels* psPixelsRealloc(psPixels* pixels, long nalloc)
    7575{
    7676    if (pixels == NULL) {
     
    9494}
    9595
    96 psPixels* p_psPixelsAppend(psPixels* pixels, int growth, psS32 x, psS32 y)
     96psPixels* p_psPixelsAppend(psPixels* pixels, long growth, int x, int y)
    9797{
    9898    if (growth < 1) {
  • trunk/psLib/src/collections/psPixels.h

    r4401 r4457  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-27 20:38:12 $
     9 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-07-06 03:04:35 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2424typedef struct
    2525{
    26     psS32 x;                           ///< x coordinate
    27     psS32 y;                           ///< y coordinate
     26    int x;                             ///< x coordinate
     27    int y;                             ///< y coordinate
    2828}
    2929psPixelCoord;
     
    4141typedef struct
    4242{
    43     int n;                             ///< Number in usa
    44     int nalloc;                        ///< Number allocated
     43    long n;                            ///< Number in usa
     44    long nalloc;                       ///< Number allocated
    4545    psPixelCoord* data;                ///< The pixel coordinates
     46    void *lock;                        ///< Option lock for thread safety
    4647}
    4748psPixels;
     
    5354 */
    5455psPixels* psPixelsAlloc(
    55     psU32 nalloc                       ///< the size of the coordinate vectors
    56 );
     56    long nalloc                       ///< the size of the coordinate vectors
     57)
     58;
    5759
    5860/** resizes a psPixels structure
     
    6264psPixels* psPixelsRealloc(
    6365    psPixels* pixels,                  ///< psPixels to resize, or NULL to create new psPixels
    64     psU32 nalloc                       ///< the size of the coordinate vectors
     66    long nalloc                       ///< the size of the coordinate vectors
    6567);
    6668
     
    7173psPixels* p_psPixelsAppend(
    7274    psPixels* pixels,                  ///< psPixels to append new coordinate to.  NULL creates a new one.
    73     int growth,                        ///< number of elements to grow the psPixels list, if necessary.  if growth < 1, 10 is used.
    74     psS32 x,                           ///< x coordinate to append
    75     psS32 y                            ///< y coordinate to append
     75    long growth,                        ///< number of elements to grow the psPixels list, if necessary.  if growth < 1, 10 is used.
     76    int x,                             ///< x coordinate to append
     77    int y                              ///< y coordinate to append
    7678);
    7779
     
    138140
    139141/** Prints a psPixels to specified destination.
    140  * 
     142 *
    141143 *  @return bool:    True if successful.
    142144*/
  • trunk/psLib/src/dataIO/psDB.c

    r4430 r4457  
    1212 *  @author Joshua Hoblitt
    1313 *
    14  *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-06-29 20:33:37 $
     14 *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2005-07-06 03:04:35 $
    1616 *
    1717 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    14091409        // invert the PSToSQL table
    14101410        psToSQLTable = psDBGetPTypeToSQLTable();
    1411         lookupTable = psHashAlloc(psToSQLTable->nbucket);
     1411        lookupTable = psHashAlloc(psToSQLTable->n);
    14121412
    14131413        list = psHashKeyList(psToSQLTable);
  • trunk/psLib/src/dataIO/psFits.c

    r4392 r4457  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-25 02:02:05 $
     9 *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-07-06 03:04:35 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    14741474
    14751475    // find all the columns needed
    1476     psArray* columns = psArrayAlloc(((psMetadata*)table->data[0])->list->size);
     1476    psArray* columns = psArrayAlloc(((psMetadata*)table->data[0])->list->n);
    14771477    columns->n=0;
    14781478
  • trunk/psLib/src/dataIO/psLookupTable.c

    r4392 r4457  
    77*  @author Ross Harman, MHPCC
    88*
    9 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2005-06-25 02:02:05 $
     9*  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2005-07-06 03:04:35 $
    1111*
    1212*  Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
     
    275275
    276276    // Valid ranges. Automatically set by table read if both zero.
    277     outTable->validFrom = 0;
    278     outTable->validTo = 0;
     277    *(double *)&outTable->validFrom = 0;
     278    *(double *)&outTable->validTo = 0;
    279279    outTable->indexCol = indexCol;
    280280
     
    291291switch (TABLE->index->type.type) {                                              \
    292292case PS_TYPE_U8:                                                                \
    293     TABLE->validFrom = (psF64)TABLE->index->data.U8[0];                         \
    294     TABLE->validTo   = (psF64)TABLE->index->data.U8[TABLE->index->n-1];         \
     293    *(double *)&TABLE->validFrom = (psF64)TABLE->index->data.U8[0];                         \
     294    *(double *)&TABLE->validTo   = (psF64)TABLE->index->data.U8[TABLE->index->n-1];         \
    295295    break;                                                                      \
    296296case PS_TYPE_S8:                                                                \
    297     TABLE->validFrom = (psF64)TABLE->index->data.S8[0];                         \
    298     TABLE->validTo   = (psF64)TABLE->index->data.S8[TABLE->index->n-1];         \
     297    *(double *)&TABLE->validFrom = (psF64)TABLE->index->data.S8[0];                         \
     298    *(double *)&TABLE->validTo   = (psF64)TABLE->index->data.S8[TABLE->index->n-1];         \
    299299    break;                                                                      \
    300300case PS_TYPE_U16:                                                               \
    301     TABLE->validFrom = (psF64)TABLE->index->data.U16[0];                        \
    302     TABLE->validTo   = (psF64)TABLE->index->data.U16[TABLE->index->n-1];        \
     301    *(double *)&TABLE->validFrom = (psF64)TABLE->index->data.U16[0];                        \
     302    *(double *)&TABLE->validTo   = (psF64)TABLE->index->data.U16[TABLE->index->n-1];        \
    303303    break;                                                                      \
    304304case PS_TYPE_S16:                                                               \
    305     TABLE->validFrom = (psF64)TABLE->index->data.S16[0];                        \
    306     TABLE->validTo   = (psF64)TABLE->index->data.S16[TABLE->index->n-1];        \
     305    *(double *)&TABLE->validFrom = (psF64)TABLE->index->data.S16[0];                        \
     306    *(double *)&TABLE->validTo   = (psF64)TABLE->index->data.S16[TABLE->index->n-1];        \
    307307    break;                                                                      \
    308308case PS_TYPE_U32:                                                               \
    309     TABLE->validFrom = (psF64)TABLE->index->data.U32[0];                        \
    310     TABLE->validTo   = (psF64)TABLE->index->data.U32[TABLE->index->n-1];        \
     309    *(double *)&TABLE->validFrom = (psF64)TABLE->index->data.U32[0];                        \
     310    *(double *)&TABLE->validTo   = (psF64)TABLE->index->data.U32[TABLE->index->n-1];        \
    311311    break;                                                                      \
    312312case PS_TYPE_S32:                                                               \
    313     TABLE->validFrom = (psF64)TABLE->index->data.S32[0];                        \
    314     TABLE->validTo   = (psF64)TABLE->index->data.S32[TABLE->index->n-1];        \
     313    *(double *)&TABLE->validFrom = (psF64)TABLE->index->data.S32[0];                        \
     314    *(double *)&TABLE->validTo   = (psF64)TABLE->index->data.S32[TABLE->index->n-1];        \
    315315    break;                                                                      \
    316316case PS_TYPE_U64:                                                               \
    317     TABLE->validFrom = (psF64)TABLE->index->data.U64[0];                        \
    318     TABLE->validTo   = (psF64)TABLE->index->data.U64[TABLE->index->n-1];        \
     317    *(double *)&TABLE->validFrom = (psF64)TABLE->index->data.U64[0];                        \
     318    *(double *)&TABLE->validTo   = (psF64)TABLE->index->data.U64[TABLE->index->n-1];        \
    319319    break;                                                                      \
    320320case PS_TYPE_S64:                                                               \
    321     TABLE->validFrom = (psF64)TABLE->index->data.S64[0];                        \
    322     TABLE->validTo   = (psF64)TABLE->index->data.S64[TABLE->index->n-1];        \
     321    *(double *)&TABLE->validFrom = (psF64)TABLE->index->data.S64[0];                        \
     322    *(double *)&TABLE->validTo   = (psF64)TABLE->index->data.S64[TABLE->index->n-1];        \
    323323    break;                                                                      \
    324324case PS_TYPE_F32:                                                               \
    325     TABLE->validFrom = (psF64)TABLE->index->data.F32[0];                        \
    326     TABLE->validTo   = (psF64)TABLE->index->data.F32[TABLE->index->n-1];        \
     325    *(double *)&TABLE->validFrom = (psF64)TABLE->index->data.F32[0];                        \
     326    *(double *)&TABLE->validTo   = (psF64)TABLE->index->data.F32[TABLE->index->n-1];        \
    327327    break;                                                                      \
    328328case PS_TYPE_F64:                                                               \
    329     TABLE->validFrom = (psF64)TABLE->index->data.F64[0];                        \
    330     TABLE->validTo   = (psF64)TABLE->index->data.F64[TABLE->index->n-1];        \
     329    *(double *)&TABLE->validFrom = (psF64)TABLE->index->data.F64[0];                        \
     330    *(double *)&TABLE->validTo   = (psF64)TABLE->index->data.F64[TABLE->index->n-1];        \
    331331    break;                                                                      \
    332332default:                                                                        \
    333     TABLE->validFrom = (psF64)0;                                                \
    334     TABLE->validTo   = (psF64)0;                                                \
     333    *(double *)&TABLE->validFrom = (psF64)0;                                                \
     334    *(double *)&TABLE->validTo   = (psF64)0;                                                \
    335335    break;                                                                      \
    336336}
     
    641641long psLookupTableRead(psLookupTable* table)
    642642{
    643     psS32           numRows  = 0;
     643    long            numRows  = 0;
    644644    psArray*        vectors  = NULL;
    645645    psLookupTable*  outTable = NULL;
     
    745745}
    746746
    747 psF64 psLookupTableInterpolate(const psLookupTable *table, psF64 index, psS32 column)
     747double psLookupTableInterpolate(const psLookupTable *table, double index, long column)
    748748{
    749749    psU64 hiIdx = 0;
    750750    psU64 loIdx = 0;
    751     psU64 numRows = 0;
    752     psU64 numCols = 0;
     751    long numRows = 0;
     752    long numCols = 0;
    753753    psF64 out = 0.0;
    754754    psF64 denom = 0.0;
     
    818818}
    819819
    820 psVector* psLookupTableInterpolateAll(psLookupTable *table, psF64 index)
    821 {
    822     psU64 numCols = 0;
     820psVector* psLookupTableInterpolateAll(const psLookupTable *table, double index)
     821{
     822    long numCols = 0;
    823823    psVector *outVector = NULL;
    824824
  • trunk/psLib/src/dataIO/psLookupTable.h

    r4366 r4457  
    77*  @author Ross Harman, MHPCC
    88*
    9 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2005-06-23 03:19:29 $
     9*  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2005-07-06 03:04:35 $
    1111*
    1212*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3333    psVector *index;                   ///< Vector of independent index values
    3434    psArray *values;                   ///< Array of dependent table values corresponding to index values
    35     psF64 validFrom;                   ///< Lower bound for rable read
    36     psF64 validTo;                     ///< Upper bound for table read
     35    const double validFrom;            ///< Lower bound for rable read
     36    const double validTo;              ///< Upper bound for table read
    3737}
    3838psLookupTable;
     
    100100 *  Reads a lookup table and fills corresponding psLookupTable struct.
    101101 *
    102  *  @return psS32     Number of valid lines read
     102 *  @return long:     Number of valid lines read
    103103 */
    104104long psLookupTableRead(
     
    111111 *  conditions.
    112112 *
    113  *  @return psLookupTable*     New psLookupTable struct
     113 *  @return double     Interpolation value at index
    114114 */
    115 psF64 psLookupTableInterpolate(
    116     const psLookupTable *table,     ///< Table with data
    117     psF64 index,                    ///< Value to be interpolated
    118     psS32 column                    ///< Column in table to be interpolated
     115double psLookupTableInterpolate(
     116    const psLookupTable *table,        ///< Table with data
     117    double index,                      ///< Value to be interpolated
     118    long column                        ///< Column in table to be interpolated
    119119);
    120120
     
    124124 *  conditions.
    125125 *
    126  *  @return psLookupTable*     New psLookupTable struct
     126 *  @return psVector*     Interpolation values calculated at index
    127127 */
    128128psVector* psLookupTableInterpolateAll(
    129     psLookupTable *table,           ///< Table with data
    130     psF64 index                     ///< Value to be interpolated
     129    const psLookupTable *table,        ///< Table with data
     130    double index                       ///< Value to be interpolated
    131131);
    132132
  • trunk/psLib/src/sysUtils/psError.c

    r4392 r4457  
    1010 *  @author Eric Van Alst, MHPCC
    1111 *
    12  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-06-25 02:02:05 $
     12 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-07-06 03:04:35 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    152152}
    153153
    154 psS32 psErrorGetStackSize()
     154unsigned int psErrorGetStackSize()
    155155{
    156156    return errorStackSize;
  • trunk/psLib/src/sysUtils/psError.h

    r4342 r4457  
    1212 *  @author Eric Van Alst, MHPCC
    1313 *
    14  *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-06-22 02:05:41 $
     14 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2005-07-06 03:04:35 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7474 *  @return psS32   The number of items on the error stack
    7575 */
    76 psS32 psErrorGetStackSize();
     76unsigned int psErrorGetStackSize();
    7777
    7878/** Prints error stack to specified open file descriptor
     
    138138
    139139/** Reports an error message to the logging facility
    140  * 
     140 *
    141141 *  This function will invoke the psLogMsg function with a level of
    142142 *  PS_LOG_ERROR and pass the parameters name and fmt to generate a proper
    143143 *  log message.  This function is used to check a specific code location.
    144  * 
     144 *
    145145 *  This function modifies the error stack.
    146146 *
     
    158158
    159159/** Logs a warning message.
    160  * 
     160 *
    161161 *  This procedure logs a message to the destination set by a prior call to
    162  *  psLogSetDestination().  This is equivalent to calling psLogMsg with a level of 
     162 *  psLogSetDestination().  This is equivalent to calling psLogMsg with a level of
    163163 *  PS_LOG_WARN.  This function is used to check a specific code location.
    164  * 
     164 *
    165165*/
    166166void p_psWarning(
  • trunk/psLib/src/sysUtils/psErrorCodes.h

    r4162 r4457  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-08 23:40:45 $
     9 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-07-06 03:04:35 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9696void psErrorRegister(
    9797    const psErrorDescription* errors,  ///< Array of error codes to register
    98     psS32 nerror                         ///< number of errors in input array
     98    int errorCode                      ///< Error code to register
    9999);
    100100
  • trunk/psLib/src/sysUtils/psLogMsg.h

    r4367 r4457  
    1111 *  @author GLG, MHPCC
    1212 *
    13  *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-06-23 03:50:29 $
     13 *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-07-06 03:04:35 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6767void psLogMsg(
    6868    const char *name,                  ///< name of the log source
    69     int level,                       ///< severity level of this log message
    70     const char *format,                   ///< printf-style format command
     69    int level,                         ///< severity level of this log message
     70    const char *format,                ///< printf-style format command
    7171    ...
    7272);
  • trunk/psLib/test/collections/tst_psArray.c

    r4308 r4457  
    1717 *  @author  Ross Harman, MHPCC
    1818 *
    19  *  @version $Revision: 1.14 $  $Name: not supported by cvs2svn $
    20  *  @date  $Date: 2005-06-17 23:44:22 $
     19 *  @version $Revision: 1.15 $  $Name: not supported by cvs2svn $
     20 *  @date  $Date: 2005-07-06 03:04:35 $
    2121 *
    2222 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    103103        }
    104104    }
    105     fprintf(stderr,"array size = %d\n", psArr->nalloc);
     105    fprintf(stderr,"array size = %ld\n", psArr->nalloc);
    106106    if (psArr->nalloc != 5) {
    107107        psError(PS_ERR_UNKNOWN, true,"Array Size wrong");
    108108        return 3;
    109109    }
    110     fprintf(stderr,"array population = %d\n", psArr->n);
     110    fprintf(stderr,"array population = %ld\n", psArr->n);
    111111    if (psArr->n != 5) {
    112112        psError(PS_ERR_UNKNOWN, true,"Array population wrong");
     
    137137        }
    138138    }
    139     fprintf(stderr,"array size = %d\n", psArr->nalloc);
     139    fprintf(stderr,"array size = %ld\n", psArr->nalloc);
    140140    if (psArr->nalloc != 10) {
    141141        psError(PS_ERR_UNKNOWN, true,"Array Size wrong");
    142142        return 6;
    143143    }
    144     fprintf(stderr,"array population = %d\n", psArr->n);
     144    fprintf(stderr,"array population = %ld\n", psArr->n);
    145145    if (psArr->n != 10) {
    146146        psError(PS_ERR_UNKNOWN, true,"Array Population wrong");
     
    160160        }
    161161    }
    162     fprintf(stderr,"array size = %d\n", psArr->nalloc);
     162    fprintf(stderr,"array size = %ld\n", psArr->nalloc);
    163163    if (psArr->nalloc != 3) {
    164164        psError(PS_ERR_UNKNOWN, true,"Array Size wrong");
    165165        return 9;
    166166    }
    167     fprintf(stderr,"array population = %d\n", psArr->n);
     167    fprintf(stderr,"array population = %ld\n", psArr->n);
    168168    if (psArr->n != 3) {
    169169        psError(PS_ERR_UNKNOWN, true,"Array Population wrong");
     
    189189        return 100;
    190190    }
    191     fprintf(stderr,"Array size after removal = %d\n",psArr->n);
     191    fprintf(stderr,"Array size after removal = %ld\n",psArr->n);
    192192    if ( psArr->n != 2 ) {
    193193        psError(PS_ERR_UNKNOWN, true, "Items in array not decremented after removal");
     
    274274        }
    275275    }
    276     fprintf(stderr,"array size = %d\n", psArr->nalloc);
     276    fprintf(stderr,"array size = %ld\n", psArr->nalloc);
    277277    if (psArr->nalloc != 10) {
    278278        psError(PS_ERR_UNKNOWN, true,"Array Size wrong");
    279279        return 3;
    280280    }
    281     fprintf(stderr,"array population = %d\n", psArr->n);
     281    fprintf(stderr,"array population = %ld\n", psArr->n);
    282282    if (psArr->n != 10) {
    283283        psError(PS_ERR_UNKNOWN, true,"Array population wrong");
  • trunk/psLib/test/collections/tst_psHash00.c

    r3682 r4457  
    2626    }
    2727
    28     if (myHashTable->nbucket != NUM_HASH_TABLE_BUCKETS) {
     28    if (myHashTable->n != NUM_HASH_TABLE_BUCKETS) {
    2929        fprintf(stderr, "%s: myHashTable->nbucket not set properly.\n",
    3030                __func__);
  • trunk/psLib/test/collections/tst_psList.c

    r3682 r4457  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-04-07 20:27:41 $
     8 *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-07-06 03:04:35 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7777        return 2;
    7878    }
    79     if (list->size != 0) {
     79    if (list->n != 0) {
    8080        psError(PS_ERR_UNKNOWN, true,"size of list wasn't zero for empty list.");
    8181        return 3;
     
    101101    }
    102102
    103     if (list->size != 1) {
     103    if (list->n != 1) {
    104104        psError(PS_ERR_UNKNOWN, true,"size of list wasn't correctly set for new, one-element list.");
    105105        return 7;
     
    310310    list = psListAlloc(data);
    311311    psFree(data);
    312     if (list->size != 1) {
     312    if (list->n != 1) {
    313313        psError(PS_ERR_UNKNOWN, true,"psListAlloc didn't create a list properly.");
    314314        return 2;
     
    321321        return 40;
    322322    }
    323     if ( list->size != 1) {
     323    if ( list->n != 1) {
    324324        psError(PS_ERR_UNKNOWN, true,"psListAdd with a NULL data element changed the list size or returned success.");
    325325        return 3;
     
    341341
    342342    // verify that the size incremented
    343     if (list->size != 2) {
     343    if (list->n != 2) {
    344344        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the size by one");
    345345        return 4;
     
    365365    psFree(data);
    366366    // verify that the size incremented
    367     if (list->size != 3) {
     367    if (list->n != 3) {
    368368        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the size by 1");
    369369        return 6;
     
    399399    psFree(data);
    400400    // verify that the size wasn't incremented
    401     if (list->size != 3) {
     401    if (list->n != 3) {
    402402        printListInt(list);
    403403        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to head when where was invalid.");
     
    420420    psFree(data);
    421421    // verify that the size incremented
    422     if (list->size != 4 || *(psS32*)list->head->next->data != 5) {
     422    if (list->n != 4 || *(psS32*)list->head->next->data != 5) {
    423423        printListInt(list);
    424424        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #1.");
     
    439439    psFree(data);
    440440    // verify that the size incremented
    441     if (list->size != 5  || *(psS32 *)list->head->next->next->next->data != 6) {
     441    if (list->n != 5  || *(psS32 *)list->head->next->next->next->data != 6) {
    442442        printListInt(list);
    443443        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #4.");
     
    460460    psFree(data);
    461461    // verify that the size incremented
    462     if (list->size != 6  || *(psS32 *)list->tail->prev->prev->data != 7) {
     462    if (list->n != 6  || *(psS32 *)list->tail->prev->prev->data != 7) {
    463463        printListInt(list);
    464464        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #2.");
     
    480480        return 29;
    481481    }
    482     if(list->size != 7 || *(psS32 *)list->tail->data != 8) {
     482    if(list->n != 7 || *(psS32 *)list->tail->data != 8) {
    483483        printListInt(list);
    484484        psError(PS_ERR_UNKNOWN,true,"psListAdd didn't place added item at tail.");
     
    660660    }
    661661
    662     if (list->size != --items) {
     662    if (list->n != --items) {
    663663        printListInt(list);
    664664        psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items);
     
    682682    }
    683683
    684     if (list->size != --items) {
     684    if (list->n != --items) {
    685685        printListInt(list);
    686686        psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items);
     
    697697    }
    698698
    699     if (list->size != --items) {
     699    if (list->n != --items) {
    700700        printListInt(list);
    701701        psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items);
     
    721721    }
    722722
    723     if (list->size != --items) {
     723    if (list->n != --items) {
    724724        printListInt(list);
    725725        psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items);
     
    736736    }
    737737
    738     if (list->size != --items) {
     738    if (list->n != --items) {
    739739        printListInt(list);
    740740        psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items);
     
    756756    }
    757757
    758     if (list->size != --items) {
     758    if (list->n != --items) {
    759759        printListInt(list);
    760760        psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items);
     
    771771    }
    772772
    773     if (list->size != items) {
     773    if (list->n != items) {
    774774        printListInt(list);
    775775        psError(PS_ERR_UNKNOWN, true,"size not %d, as expected.",items);
     
    791791    }
    792792
    793     if (list->size != 0) {
     793    if (list->n != 0) {
    794794        printListInt(list);
    795795        psError(PS_ERR_UNKNOWN, true,"Didn't remove all the elements.");
     
    835835    arr = psListToArray(list);
    836836
    837     if (arr->n != 15 || list->size != 15) {
     837    if (arr->n != 15 || list->n != 15) {
    838838        psError(PS_ERR_UNKNOWN, true,"The created array didn't have the proper size");
    839839        return 1;
     
    873873    list = psArrayToList(arr);
    874874
    875     if (arr->n != 15 || list->size != 15) {
     875    if (arr->n != 15 || list->n != 15) {
    876876        psError(PS_ERR_UNKNOWN, true,"The created array didn't have the proper size");
    877877        return 1;
     
    11121112    (not needed, as psListAdd is tested elsewhere, but check anyway.)
    11131113    */
    1114     if (list->size != 15) {
     1114    if (list->n != 15) {
    11151115        psError(PS_ERR_UNKNOWN, true,"List wasn't populated as expected?");
    11161116        return 2;
  • trunk/psLib/test/collections/tst_psMetadataIO.c

    r4209 r4457  
    1313 *  @author  Eric Van Alst, MHPCC
    1414 *
    15  *  @version $Revision: 1.19 $  $Name: not supported by cvs2svn $
    16  *  @date  $Date: 2005-06-10 18:09:12 $
     15 *  @version $Revision: 1.20 $  $Name: not supported by cvs2svn $
     16 *  @date  $Date: 2005-07-06 03:04:35 $
    1717 *
    1818 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    263263        // Search list for another entry with same key name
    264264        // Check if last entry
    265         if(iter->index != metadataItemList->size) {
     265        if(iter->index != metadataItemList->n) {
    266266            // Set search iterator to index
    267267            if(!psListIteratorSet(searchIter,iter->index) ) {
     
    422422
    423423    // Verify the number of items in metadata
    424     if(md->list->size != expectedItems) {
     424    if(md->list->n != expectedItems) {
    425425        psError(PS_ERR_UNKNOWN,true,"File: %s : Number of items = %d not as expected %d",
    426                 configFile,md->list->size, expectedItems);
     426                configFile,md->list->n, expectedItems);
    427427        returnValue = false;
    428428    }
     
    795795            if(metaCounter == 0) {
    796796                // Check if number of items is as expected
    797                 if(entryChild->data.md->list->size != testConfig1ValueMetaItems1) {
     797                if(entryChild->data.md->list->n != testConfig1ValueMetaItems1) {
    798798                    psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 1 items %d not as expected %d",
    799                             testConfig1,entryChild->data.md->list->size,testConfig1ValueMetaItems1);
     799                            testConfig1,entryChild->data.md->list->n,testConfig1ValueMetaItems1);
    800800                    return i*10+6;
    801801                }
     
    824824            } else if(metaCounter == 1) {
    825825                // Check if number of items is as expected
    826                 if(entryChild->data.md->list->size != testConfig1ValueMetaItems2) {
     826                if(entryChild->data.md->list->n != testConfig1ValueMetaItems2) {
    827827                    psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 2 items %d not as expected %d",
    828                             testConfig1,entryChild->data.md->list->size,testConfig1ValueMetaItems2);
     828                            testConfig1,entryChild->data.md->list->n,testConfig1ValueMetaItems2);
    829829                    return i*10+6;
    830830                }
     
    853853            } else if(metaCounter == 2) {
    854854                // Check if number of items is as expected
    855                 if(entryChild->data.md->list->size != testConfig1ValueMetaItems3) {
     855                if(entryChild->data.md->list->n != testConfig1ValueMetaItems3) {
    856856                    psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 3 items %d not as expected %d",
    857                             testConfig1,entryChild->data.md->list->size,testConfig1ValueMetaItems3);
     857                            testConfig1,entryChild->data.md->list->n,testConfig1ValueMetaItems3);
    858858                    return i*10+6;
    859859                }
  • trunk/psLib/test/collections/tst_psMetadata_01.c

    r3779 r4457  
    1818*  @author  Ross Harman, MHPCC
    1919*
    20 *  @version $Revision: 1.25 $  $Name: not supported by cvs2svn $
    21 *  @date  $Date: 2005-04-28 02:45:12 $
     20*  @version $Revision: 1.26 $  $Name: not supported by cvs2svn $
     21*  @date  $Date: 2005-07-06 03:04:35 $
    2222*
    2323*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6060    psS32 i;
    6161    psHashBucket* ptr = NULL;
    62     for(i=0; i<mdTable->nbucket; i++) {
     62    for(i=0; i<mdTable->n; i++) {
    6363        ptr = mdTable->buckets[i];
    6464        while (ptr != NULL) {
  • trunk/psLib/test/dataIO/tst_psDB.c

    r4427 r4457  
    99 *  @author Aaron Culliney, MHPCC
    1010 *
    11  *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-06-29 19:39:56 $
     11 *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-07-06 03:04:35 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    16001600        return 3;
    16011601    }
    1602     if(meta->list->size != 6) {
     1602    if(meta->list->n != 6) {
    16031603        psError(PS_ERR_UNKNOWN,true,"Number of cols = %d not as expected %d",
    1604                 meta->list->size,6);
     1604                meta->list->n,6);
    16051605        psDBDropTable(dbh,table);
    16061606        psDBCleanup(dbh);
  • trunk/psLib/test/dataIO/tst_psFits.c

    r4193 r4457  
    66*  @author Robert DeSonia, MHPCC
    77*
    8 *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2005-06-09 21:17:45 $
     8*  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2005-07-06 03:04:35 $
    1010*
    1111*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    650650        }
    651651
    652         if (header->list->size < 1 || header->list->size != header2->list->size) {
     652        if (header->list->n < 1 || header->list->n != header2->list->n) {
    653653            psError(PS_ERR_UNKNOWN, true,
    654654                    "Reading the header given a NULL input psMetadata differed "
Note: See TracChangeset for help on using the changeset viewer.