Changeset 4457
- Timestamp:
- Jul 5, 2005, 5:04:35 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 28 edited
-
pslib.kdevses (modified) (1 diff)
-
src/collections/psArray.c (modified) (5 diffs)
-
src/collections/psArray.h (modified) (6 diffs)
-
src/collections/psBitSet.h (modified) (4 diffs)
-
src/collections/psHash.c (modified) (8 diffs)
-
src/collections/psHash.h (modified) (3 diffs)
-
src/collections/psList.c (modified) (12 diffs)
-
src/collections/psList.h (modified) (5 diffs)
-
src/collections/psMetadata.c (modified) (19 diffs)
-
src/collections/psMetadata.h (modified) (27 diffs)
-
src/collections/psMetadataIO.c (modified) (2 diffs)
-
src/collections/psPixels.c (modified) (4 diffs)
-
src/collections/psPixels.h (modified) (7 diffs)
-
src/dataIO/psDB.c (modified) (2 diffs)
-
src/dataIO/psFits.c (modified) (2 diffs)
-
src/dataIO/psLookupTable.c (modified) (6 diffs)
-
src/dataIO/psLookupTable.h (modified) (5 diffs)
-
src/sysUtils/psError.c (modified) (2 diffs)
-
src/sysUtils/psError.h (modified) (4 diffs)
-
src/sysUtils/psErrorCodes.h (modified) (2 diffs)
-
src/sysUtils/psLogMsg.h (modified) (2 diffs)
-
test/collections/tst_psArray.c (modified) (6 diffs)
-
test/collections/tst_psHash00.c (modified) (1 diff)
-
test/collections/tst_psList.c (modified) (23 diffs)
-
test/collections/tst_psMetadataIO.c (modified) (6 diffs)
-
test/collections/tst_psMetadata_01.c (modified) (2 diffs)
-
test/dataIO/tst_psDB.c (modified) (2 diffs)
-
test/dataIO/tst_psFits.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/pslib.kdevses
r4446 r4457 2 2 <!DOCTYPE KDevPrjSession> 3 3 <KDevPrjSession> 4 <DocsAndViews NumberOfDocuments=" 10" >5 <Doc0 NumberOfViews="1" URL="file:/home/d esonia/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" /> 7 7 </Doc0> 8 <Doc1 NumberOfViews="1" URL="file:/home/d esonia/panstarrs/psLib/src/db/Makefile.am" >9 <View0 line="1 4" Type="Source" />8 <Doc1 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/dataManip/psFunctions.c" > 9 <View0 line="1597" Type="Source" /> 10 10 </Doc1> 11 <Doc2 NumberOfViews="1" URL="file:/home/d esonia/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" /> 13 13 </Doc2> 14 <Doc3 NumberOfViews="1" URL="file:/home/d esonia/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" /> 16 16 </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>35 17 </DocsAndViews> 36 18 <pluginList> -
trunk/psLib/src/collections/psArray.c
r4392 r4457 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 6-25 02:02:04$11 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-07-06 03:04:35 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 49 49 FUNCTION IMPLEMENTATION - PUBLIC 50 50 *****************************************************************************/ 51 psArray* psArrayAlloc( unsignedlong nalloc)51 psArray* psArrayAlloc(long nalloc) 52 52 { 53 53 psArray* psArr = NULL; … … 66 66 } 67 67 68 psArray* psArrayRealloc(psArray* in, unsignedlong nalloc)68 psArray* psArrayRealloc(psArray* in, long nalloc) 69 69 { 70 70 if (in == NULL) { … … 160 160 /// Set an element in the array. 161 161 bool psArraySet(psArray* array, ///< input array to set element in 162 unsigned long position,///< the element position to set162 long position, ///< the element position to set 163 163 psPtr data) ///< the value to set it to 164 164 { … … 185 185 186 186 /// Get an element in the array. 187 psPtr psArrayGet(const psArray* array, unsignedlong position )187 psPtr psArrayGet(const psArray* array, long position ) 188 188 { 189 189 if (array == NULL) { -
trunk/psLib/src/collections/psArray.h
r4367 r4457 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 6-23 03:50:29$14 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-07-06 03:04:35 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 34 34 typedef struct 35 35 { 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. 38 38 psPtr* data; ///< An Array of pointer elements 39 void *lock; ///< Optional lock for thread safety 39 40 } 40 41 psArray; … … 55 56 */ 56 57 psArray* 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 ; 59 61 60 62 /** Reallocate an array. … … 68 70 psArray* psArrayRealloc( 69 71 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. 71 73 ); 72 74 … … 133 135 bool psArraySet( 134 136 psArray* array, ///< input array to set element in 135 unsigned long position,///< the element position to set137 long position, ///< the element position to set 136 138 psPtr data ///< the value to set it to 137 139 ); … … 143 145 psPtr psArrayGet( 144 146 const psArray* array, ///< input array to get element from 145 unsigned long position///< the element position to get147 long position ///< the element position to get 146 148 ); 147 149 -
trunk/psLib/src/collections/psBitSet.h
r4342 r4457 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 6-22 02:05:41$14 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-07-06 03:04:35 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 37 37 typedef struct 38 38 { 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 41 42 } 42 43 psBitSet; … … 57 58 psBitSet* psBitSetAlloc( 58 59 long nalloc ///< Number of bits in psBitSet array 59 ); 60 ) 61 ; 60 62 61 63 /** Set a bit. … … 70 72 /* @returned@ */ 71 73 psBitSet* bitSet, ///< Pointer to psBitSet to be set. 72 long bit ///< Bit to be set.74 long bit ///< Bit to be set. 73 75 ); 74 76 -
trunk/psLib/src/collections/psHash.c
r4392 r4457 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 6-25 02:02:05 $14 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-07-06 03:04:35 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 57 57 // Loop through every bucket in the hash table. If that bucket is not 58 58 // NULL, then add the bucket's key to the linked list. 59 for (i = 0; i < hash->n bucket; i++) {59 for (i = 0; i < hash->n; i++) { 60 60 if (hash->buckets[i] != NULL) { 61 61 // Since a bucket contains a linked list of keys/data, we must … … 128 128 129 129 /****************************************************************************** 130 psHashAlloc(n bucket): this procedure creates a new hash table with the130 psHashAlloc(n): this procedure creates a new hash table with the 131 131 specified number of buckets. 132 132 Inputs: 133 n bucket: initial number of buckets133 n: initial number of buckets 134 134 Return: 135 135 The new hash table. … … 146 146 // Allocate memory for the buckets. 147 147 table->buckets = psAlloc(nalloc * sizeof(psHashBucket* )); 148 table->n bucket= nalloc;148 table->n = nalloc; 149 149 150 150 psTrace("utils.hash", 1, "Creating %d-element hash table\n", nalloc); … … 179 179 // Loop through each bucket in the hash table. If that bucket is not 180 180 // NULL, then free the bucket via a function call to hashBucketFree(); 181 for (i = 0; i < table->n bucket; i++) {181 for (i = 0; i < table->n; i++) { 182 182 183 183 // A bucket is composed of a linked list of buckets. … … 238 238 // hash = (hash << 1) ^ key[i]; 239 239 // } 240 // hash &= (table->n bucket- 1);240 // hash &= (table->n - 1); 241 241 242 242 // This hash algorithm is from Sedgewick. NOTE: must reread to ensure that … … 244 244 tmpchar = (char *)key; 245 245 for (hash = 0; *tmpchar != '\0'; tmpchar++) { 246 hash = (64 * hash + *tmpchar) % (table->n bucket);246 hash = (64 * hash + *tmpchar) % (table->n); 247 247 } 248 248 249 249 // NOTE: This should not be necessary, but for now, I'm checking bounds 250 250 // anyway. 251 if ((hash < 0) || (hash >= table->n bucket)) {251 if ((hash < 0) || (hash >= table->n)) { 252 252 psError(PS_ERR_UNKNOWN, true, 253 253 "Internal hash function out of range (%d)", hash); … … 409 409 // psArray we need to allocate. 410 410 int nElements = 0; 411 int nbucket = hash->n bucket;411 int nbucket = hash->n; 412 412 for (int i = 0; i < nbucket; i++) { 413 413 psHashBucket* tmpBucket = hash->buckets[i]; -
trunk/psLib/src/collections/psHash.h
r4352 r4457 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 6-22 23:48:39$13 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-07-06 03:04:35 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 40 40 typedef struct psHash 41 41 { 42 psS32 nbucket;///< Number of buckets in hash table.42 long n; ///< Number of buckets in hash table. 43 43 psHashBucket* *buckets; ///< The bucket data. 44 void *lock; ///< Optional lock for thread safety. 44 45 } 45 46 psHash; … … 48 49 psHash* psHashAlloc( 49 50 long nalloc ///< The number of buckets to allocate. 50 ); 51 ) 52 ; 51 53 52 54 /// Insert entry into table. -
trunk/psLib/src/collections/psList.c
r4392 r4457 6 6 * @author Robert Daniel DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 39$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 6-25 02:02:05 $8 * @version $Revision: 1.40 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-07-06 03:04:35 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 113 113 } 114 114 115 list-> size--;115 list->n--; 116 116 117 117 pthread_mutex_unlock(&list->lock) … … 131 131 psMemSetDeallocator(list, (psFreeFunc) listFree); 132 132 133 list-> size= 0;133 list->n = 0; 134 134 list->head = list->tail = NULL; 135 135 list->iterators = psArrayAlloc(16); … … 182 182 183 183 bool psListIteratorSet(psListIterator* iterator, 184 intlocation)184 long location) 185 185 { 186 186 if (iterator == NULL) { … … 192 192 if (location == PS_LIST_TAIL) { 193 193 iterator->cursor = list->tail; 194 iterator->index = list-> size- 1;194 iterator->index = list->n - 1; 195 195 iterator->offEnd = false; 196 196 return true; … … 205 205 206 206 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) { 211 211 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 212 212 PS_ERRORTEXT_psList_LOCATION_INVALID, … … 218 218 int index = iterator->index; 219 219 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? 221 221 cursor = list->tail; 222 index = list-> size- 1;222 index = list->n - 1; 223 223 } else { 224 224 cursor = list->head; … … 262 262 } 263 263 264 if (location > 0 && location >= (int)list-> size) {264 if (location > 0 && location >= (int)list->n) { 265 265 psLogMsg(__func__,PS_LOG_WARN, 266 266 "Specified location, %d, is beyond the end of the list. " … … 337 337 elem->data = psMemIncrRefCounter(data); 338 338 339 list-> size++;339 list->n++; 340 340 341 341 if (cursor == list->tail) { … … 412 412 elem->data = psMemIncrRefCounter(data); 413 413 414 list-> size++;414 list->n++; 415 415 416 416 if (cursor == list->head) { … … 548 548 if ( (iterator->cursor == NULL) && (iterator->offEnd) ) { 549 549 iterator->cursor = iterator->list->tail; 550 iterator->index = iterator->list-> size-1;550 iterator->index = iterator->list->n-1; 551 551 iterator->offEnd = false; 552 552 return NULL; … … 574 574 } 575 575 576 if (list-> size> 0) {577 arr = psArrayAlloc(list-> size);576 if (list->n > 0) { 577 arr = psArrayAlloc(list->n); 578 578 } else { 579 579 arr = psArrayAlloc(1); 580 580 } 581 581 582 arr->n = list-> size;582 arr->n = list->n; 583 583 584 584 ptr = list->head; 585 n = list-> size;585 n = list->n; 586 586 for (psS32 i = 0; i < n; i++) { 587 587 arr->data[i] = psMemIncrRefCounter(ptr->data); -
trunk/psLib/src/collections/psList.h
r4367 r4457 7 7 * @ingroup LinkedList 8 8 * 9 * @version $Revision: 1.2 8$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 6-23 03:50:29$9 * @version $Revision: 1.29 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-07-06 03:04:35 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 52 52 typedef struct 53 53 { 54 psU32 size;///< number of elements on list54 long n; ///< number of elements on list 55 55 psListElem* head; ///< first element on list (may be NULL) 56 56 psListElem* tail; ///< last element on list (may be NULL) … … 61 61 62 62 pthread_mutex_t lock; ///< mutex to lock a node during changes 63 // void *lock; ///< Optional lock for thread safety 63 64 } 64 65 psList; … … 110 111 */ 111 112 bool psListIteratorSet( 112 psListIterator* iterator, ///< list iterator113 int location///< index number, PS_LIST_HEAD, or PS_LIST_TAIL113 psListIterator* iterator, ///< list iterator 114 long location ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL 114 115 ); 115 116 … … 120 121 bool psListAdd( 121 122 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. 123 124 psPtr data ///< data item to add. If NULL, list is not modified. 124 125 ); -
trunk/psLib/src/collections/psMetadata.c
r4401 r4457 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 69$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 6-27 20:38:12$14 * @version $Revision: 1.70 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-07-06 03:04:35 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 122 122 psFree(iter->iter); 123 123 124 if (iter-> preg!= NULL) {125 regfree(iter-> preg);124 if (iter->regex != NULL) { 125 regfree(iter->regex); 126 126 } 127 127 } … … 268 268 } 269 269 270 bool psMetadataAddItem(psMetadata *md, const psMetadataItem *item, psS32location, psS32 flags)270 bool psMetadataAddItem(psMetadata *md, const psMetadataItem *item, long location, psS32 flags) 271 271 { 272 272 char * key = NULL; … … 360 360 } 361 361 362 bool psMetadataAdd(psMetadata *md, intlocation, const char *name,362 bool psMetadataAdd(psMetadata *md, long location, const char *name, 363 363 int format, const char *comment, ...) 364 364 { … … 372 372 } 373 373 374 bool psMetadataAddV(psMetadata *md, intlocation, const char *name,374 bool psMetadataAddV(psMetadata *md, long location, const char *name, 375 375 int format, const char *comment, va_list list) 376 376 { … … 391 391 392 392 #define METADATA_ADD_TYPE(NAME,TYPE,METATYPE) \ 393 psBool psMetadataAdd##NAME(psMetadata* md, psS32where, const char* name, \393 psBool psMetadataAdd##NAME(psMetadata* md, long where, const char* name, \ 394 394 const char* comment, TYPE value) { \ 395 395 return psMetadataAdd(md,where,name, METATYPE,comment,value); \ … … 409 409 METADATA_ADD_TYPE(Array,psArray*,PS_META_ARRAY) 410 410 411 psBool psMetadataRemove(psMetadata *md, psS32where, const char *key)411 psBool psMetadataRemove(psMetadata *md, long where, const char *key) 412 412 { 413 413 PS_ASSERT_PTR_NON_NULL(md,NULL); … … 580 580 psMetadataLookupNumTYPE(Bool) 581 581 582 psMetadataItem* psMetadataGet(const psMetadata *md, intlocation)582 psMetadataItem* psMetadataGet(const psMetadata *md, long location) 583 583 { 584 584 psMetadataItem* entry = NULL; … … 597 597 598 598 psMetadataIterator* psMetadataIteratorAlloc(psMetadata* md, 599 intlocation,599 long location, 600 600 const char* regex) 601 601 { … … 604 604 605 605 psMetadataIterator* newIter = psAlloc(sizeof(psMetadataIterator)); 606 newIter-> preg= NULL;606 newIter->regex = NULL; 607 607 newIter->iter = NULL; 608 608 … … 614 614 return newIter; 615 615 } else { 616 int regRtn = regcomp(newIter-> preg,regex,0);616 int regRtn = regcomp(newIter->regex,regex,0); 617 617 if (regRtn != 0) { 618 618 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); 621 621 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 622 622 PS_ERRORTEXT_psMetadata_REGEX_INVALID, … … 633 633 634 634 bool psMetadataIteratorSet(psMetadataIterator* iterator, 635 intlocation)635 long location) 636 636 { 637 637 int match; … … 643 643 PS_ASSERT_PTR_NON_NULL(iterator->iter,NULL); 644 644 645 regex_t* preg = iterator->preg;645 regex_t* regex = iterator->regex; 646 646 647 647 // handle trivial case where no regex subsetting is required. 648 if ( preg== NULL) {648 if (regex == NULL) { 649 649 return psListIteratorSet(iter,location); 650 650 } … … 655 655 psListIteratorSet(iter,PS_LIST_TAIL); 656 656 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) { 658 658 // this key is a match 659 659 match--; … … 671 671 psListIteratorSet(iter,PS_LIST_HEAD); 672 672 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) { 674 674 // this key is a match 675 675 match++; … … 692 692 PS_ASSERT_PTR_NON_NULL(iterator->iter,NULL); 693 693 694 regex_t* preg = iterator->preg;694 regex_t* regex = iterator->regex; 695 695 696 696 // handle trivial case where no regex subsetting is required. 697 if ( preg== NULL) {697 if (regex == NULL) { 698 698 return (psMetadataItem*)psListGetAndIncrement(iter); 699 699 } … … 703 703 while (psListGetAndIncrement(iter) != NULL) { 704 704 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) { 706 706 // this key is a match 707 707 break; … … 720 720 PS_ASSERT_PTR_NON_NULL(iterator->iter,NULL); 721 721 722 regex_t* preg = iterator->preg;722 regex_t* regex = iterator->regex; 723 723 724 724 // handle trivial case where no regex subsetting is required. 725 if ( preg== NULL) {725 if (regex == NULL) { 726 726 return (psMetadataItem*)psListGetAndDecrement(iter); 727 727 } … … 731 731 while (psListGetAndDecrement(iter) != NULL) { 732 732 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) { 734 734 // this key is a match 735 735 break; -
trunk/psLib/src/collections/psMetadata.h
r4401 r4457 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.5 2$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 6-27 20:38:12$13 * @version $Revision: 1.53 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-07-06 03:04:35 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 55 55 PS_META_ARRAY ///< Array data (Stored as item.data.V). 56 56 } psMetadataType; 57 58 57 #define PS_META_IS_PRIMITIVE(TYPE) \ 59 58 (TYPE == PS_META_S32 || \ … … 77 76 PS_META_DEFAULT = 0, ///< default behaviour (duplicate entry is an error) 78 77 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 80 80 } psMetadataFlags; 81 81 … … 94 94 psList* list; ///< Metadata in linked-list 95 95 psHash* table; ///< Metadata in a hash table 96 void *lock; ///< Optional lock for thread safety 96 97 } 97 98 psMetadata; … … 104 105 { 105 106 psListIterator* iter; ///< iterator for the psMetadata's psList 106 regex_t* preg;///< the subsetting regular expression107 regex_t* regex; ///< the subsetting regular expression 107 108 } 108 109 psMetadataIterator; … … 116 117 { 117 118 const psS32 id; ///< Unique ID for metadata item. 118 char *name;///< Name of metadata item.119 psString name; ///< Name of metadata item. 119 120 psMetadataType type; ///< Type of metadata item. 120 121 union { … … 127 128 psPtr V; ///< Pointer to other type of data. 128 129 } data; ///< Union for data types. 129 char *comment;///< Optional comment ("", not NULL).130 psString comment; ///< Optional comment ("", not NULL). 130 131 } 131 132 psMetadataItem; … … 151 152 const char *comment, ///< Comment for metadata item. 152 153 ... ///< Arguments for name formatting and metadata item data. 153 ); 154 ) 155 ; 154 156 155 157 /** Create a metadata item with specified string data. … … 261 263 psMetadata* md, ///< Metadata collection to insert metadat item. 262 264 const psMetadataItem* item, ///< Metadata item to be added. 263 psS32 location,///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL265 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 264 266 psS32 flags ///< Options flag mask, see psMetadataFlags enum 265 267 ); … … 273 275 bool psMetadataAdd( 274 276 psMetadata* md, ///< Metadata collection to insert metadata item. 275 int location,///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL277 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 276 278 const char *name, ///< Name of metadata item. 277 279 int format, ///< Type of metadata item (psMetadataType) and options (psMetadataFlags) … … 289 291 bool psMetadataAddV( 290 292 psMetadata* md, ///< Metadata collection to insert metadata item. 291 int location,///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL293 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 292 294 const char *name, ///< Name of metadata item. 293 295 int format, ///< Type of metadata item (psMetadataType) and options (psMetadataFlags) … … 298 300 299 301 /** 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. 302 304 */ 303 305 bool psMetadataAddS32( 304 306 psMetadata* md, ///< Metadata collection to insert metadata item 305 psS32 location,///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL307 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 306 308 const char* name, ///< Name of metadata item 307 309 const char* comment, ///< Comment for metadata item … … 310 312 311 313 /** Add a psF32 value to metadata collection. 312 * 314 * 313 315 * @return bool: True for success, False for failure. 314 316 */ 315 317 bool psMetadataAddF32( 316 318 psMetadata* md, ///< Metadata collection to insert metadata item 317 psS32location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL319 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 318 320 const char* name, ///< Name of metadata item 319 321 const char* comment, ///< Comment for metadata item … … 322 324 323 325 /** Add a psF64 value to metadata collection. 324 * 326 * 325 327 * @return bool: True for success, False for failure. 326 328 */ 327 329 bool psMetadataAddF64( 328 330 psMetadata* md, ///< Metadata collection to insert metadata item 329 psS32location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL331 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 330 332 const char* name, ///< Name of metadata item 331 333 const char* comment, ///< Comment for metadata item … … 334 336 335 337 /** Add a psList to metadata collection. 336 * 338 * 337 339 * @return psBool: True for success, False for failure. 338 340 */ 339 341 psBool psMetadataAddList( 340 342 psMetadata* md, ///< Metadata collection to insert metadata item 341 psS32 location,///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL343 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 342 344 const char* name, ///< Name of metadata item 343 345 const char* comment, ///< Comment for metadata item … … 346 348 347 349 /** Add a string to metadata collection. 348 * 350 * 349 351 * @return bool: True for success, False for failure. 350 352 */ 351 353 bool psMetadataAddStr( 352 354 psMetadata* md, ///< Metadata collection to insert metadata item 353 psS32 location,///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL355 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 354 356 const char* name, ///< Name of metadata item 355 357 const char* comment, ///< Comment for metadata item … … 358 360 359 361 /** Add a vector to metadata collection. 360 * 362 * 361 363 * @return psBool: True for success, False for failure. 362 364 */ 363 365 psBool psMetadataAddVector( 364 366 psMetadata* md, ///< Metadata collection to insert metadata item 365 psS32 location,///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL367 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 366 368 const char* name, ///< Name of metadata item 367 369 const char* comment, ///< Comment for metadata item … … 370 372 371 373 /** Add a array to metadata collection. 372 * 374 * 373 375 * @return psBool: True for success, False for failure. 374 376 */ 375 377 psBool psMetadataAddArray( 376 378 psMetadata* md, ///< Metadata collection to insert metadata item 377 psS32 location,///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL379 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 378 380 const char* name, ///< Name of metadata item 379 381 const char* comment, ///< Comment for metadata item … … 382 384 383 385 /** Add an Image to metadata collection. 384 * 386 * 385 387 * @return psBool: True for success, False for failure. 386 388 */ 387 389 psBool psMetadataAddImage( 388 390 psMetadata* md, ///< Metadata collection to insert metadata item 389 psS32 location,///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL391 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 390 392 const char* name, ///< Name of metadata item 391 393 const char* comment, ///< Comment for metadata item … … 394 396 395 397 /** Add a Hash to metadata collection. 396 * 398 * 397 399 * @return psBool: True for success, False for failure. 398 400 */ 399 401 psBool psMetadataAddHash( 400 402 psMetadata* md, ///< Metadata collection to insert metadata item 401 psS32location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL403 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 402 404 const char* name, ///< Name of metadata item 403 405 const char* comment, ///< Comment for metadata item … … 406 408 407 409 /** Add a LookupTable to metadata collection. 408 * 410 * 409 411 * @return psBool: True for success, False for failure. 410 412 */ 411 413 psBool psMetadataAddLookupTable( 412 414 psMetadata* md, ///< Metadata collection to insert metadata item 413 psS32 location,///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL415 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 414 416 const char* name, ///< Name of metadata item 415 417 const char* comment, ///< Comment for metadata item … … 418 420 419 421 /** Add an Unknown (psPtr) to metadata collection. 420 * 422 * 421 423 * @return psBool: True for success, False for failure. 422 424 */ 423 425 psBool psMetadataAddUnknown( 424 426 psMetadata* md, ///< Metadata collection to insert metadata item 425 psS32 location,///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL427 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 426 428 const char* name, ///< Name of metadata item 427 429 const char* comment, ///< Comment for metadata item … … 430 432 431 433 /** Add Metadata to metadata collection. 432 * 434 * 433 435 * @return psBool: True for success, False for failure. 434 436 */ 435 437 psBool psMetadataAddMetadata( 436 438 psMetadata* md, ///< Metadata collection to insert metadata item 437 psS32 location,///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL439 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 438 440 const char* name, ///< Name of metadata item 439 441 const char* comment, ///< Comment for metadata item … … 453 455 bool psMetadataRemove( 454 456 psMetadata* md, ///< Metadata collection to remove metadata item. 455 int location,///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL457 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 456 458 const char * key ///< Name of metadata key. 457 459 ); … … 549 551 psMetadataItem* psMetadataGet( 550 552 const psMetadata* md, ///< Metadata collection to retrieve metadata item. 551 int location///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL553 long location ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 552 554 ); 553 555 … … 562 564 psMetadataIterator* psMetadataIteratorAlloc( 563 565 psMetadata* md, ///< the psMetadata to iterate with 564 int location,///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL566 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 565 567 const char* regex 566 568 ///< A regular expression for subsetting the psMetadata. If NULL, no … … 575 577 bool psMetadataIteratorSet( 576 578 psMetadataIterator* iterator, ///< psMetadata iterator 577 int location///< index number, PS_LIST_HEAD, or PS_LIST_TAIL579 long location ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL 578 580 ); 579 581 -
trunk/psLib/src/collections/psMetadataIO.c
r4432 r4457 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1.3 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 6-30 00:04:12$12 * @version $Revision: 1.35 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-07-06 03:04:35 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 619 619 620 620 // Determine the number of items in template 621 items = template->list-> size;621 items = template->list->n; 622 622 if(items > 0 ) { 623 623 -
trunk/psLib/src/collections/psPixels.c
r4401 r4457 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 6-27 20:38:12$9 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-07-06 03:04:35 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 55 55 } 56 56 57 psPixels* psPixelsAlloc( psU32nalloc)57 psPixels* psPixelsAlloc(long nalloc) 58 58 { 59 59 psPixels* out = psAlloc(sizeof(psPixels)); … … 72 72 } 73 73 74 psPixels* psPixelsRealloc(psPixels* pixels, psU32nalloc)74 psPixels* psPixelsRealloc(psPixels* pixels, long nalloc) 75 75 { 76 76 if (pixels == NULL) { … … 94 94 } 95 95 96 psPixels* p_psPixelsAppend(psPixels* pixels, int growth, psS32 x, psS32y)96 psPixels* p_psPixelsAppend(psPixels* pixels, long growth, int x, int y) 97 97 { 98 98 if (growth < 1) { -
trunk/psLib/src/collections/psPixels.h
r4401 r4457 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 6-27 20:38:12$9 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-07-06 03:04:35 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 24 24 typedef struct 25 25 { 26 psS32 x;///< x coordinate27 psS32 y;///< y coordinate26 int x; ///< x coordinate 27 int y; ///< y coordinate 28 28 } 29 29 psPixelCoord; … … 41 41 typedef struct 42 42 { 43 int n;///< Number in usa44 int nalloc;///< Number allocated43 long n; ///< Number in usa 44 long nalloc; ///< Number allocated 45 45 psPixelCoord* data; ///< The pixel coordinates 46 void *lock; ///< Option lock for thread safety 46 47 } 47 48 psPixels; … … 53 54 */ 54 55 psPixels* psPixelsAlloc( 55 psU32 nalloc ///< the size of the coordinate vectors 56 ); 56 long nalloc ///< the size of the coordinate vectors 57 ) 58 ; 57 59 58 60 /** resizes a psPixels structure … … 62 64 psPixels* psPixelsRealloc( 63 65 psPixels* pixels, ///< psPixels to resize, or NULL to create new psPixels 64 psU32nalloc ///< the size of the coordinate vectors66 long nalloc ///< the size of the coordinate vectors 65 67 ); 66 68 … … 71 73 psPixels* p_psPixelsAppend( 72 74 psPixels* pixels, ///< psPixels to append new coordinate to. NULL creates a new one. 73 intgrowth, ///< number of elements to grow the psPixels list, if necessary. if growth < 1, 10 is used.74 psS32 x,///< x coordinate to append75 psS32 y///< y coordinate to append75 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 76 78 ); 77 79 … … 138 140 139 141 /** Prints a psPixels to specified destination. 140 * 142 * 141 143 * @return bool: True if successful. 142 144 */ -
trunk/psLib/src/dataIO/psDB.c
r4430 r4457 12 12 * @author Joshua Hoblitt 13 13 * 14 * @version $Revision: 1.3 7$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 6-29 20:33:37$14 * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-07-06 03:04:35 $ 16 16 * 17 17 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 1409 1409 // invert the PSToSQL table 1410 1410 psToSQLTable = psDBGetPTypeToSQLTable(); 1411 lookupTable = psHashAlloc(psToSQLTable->n bucket);1411 lookupTable = psHashAlloc(psToSQLTable->n); 1412 1412 1413 1413 list = psHashKeyList(psToSQLTable); -
trunk/psLib/src/dataIO/psFits.c
r4392 r4457 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 39$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 6-25 02:02:05 $9 * @version $Revision: 1.40 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-07-06 03:04:35 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1474 1474 1475 1475 // 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); 1477 1477 columns->n=0; 1478 1478 -
trunk/psLib/src/dataIO/psLookupTable.c
r4392 r4457 7 7 * @author Ross Harman, MHPCC 8 8 * 9 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 6-25 02:02:05 $9 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-07-06 03:04:35 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 275 275 276 276 // 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; 279 279 outTable->indexCol = indexCol; 280 280 … … 291 291 switch (TABLE->index->type.type) { \ 292 292 case 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]; \ 295 295 break; \ 296 296 case 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]; \ 299 299 break; \ 300 300 case 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]; \ 303 303 break; \ 304 304 case 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]; \ 307 307 break; \ 308 308 case 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]; \ 311 311 break; \ 312 312 case 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]; \ 315 315 break; \ 316 316 case 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]; \ 319 319 break; \ 320 320 case 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]; \ 323 323 break; \ 324 324 case 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]; \ 327 327 break; \ 328 328 case 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]; \ 331 331 break; \ 332 332 default: \ 333 TABLE->validFrom = (psF64)0; \334 TABLE->validTo = (psF64)0; \333 *(double *)&TABLE->validFrom = (psF64)0; \ 334 *(double *)&TABLE->validTo = (psF64)0; \ 335 335 break; \ 336 336 } … … 641 641 long psLookupTableRead(psLookupTable* table) 642 642 { 643 psS32numRows = 0;643 long numRows = 0; 644 644 psArray* vectors = NULL; 645 645 psLookupTable* outTable = NULL; … … 745 745 } 746 746 747 psF64 psLookupTableInterpolate(const psLookupTable *table, psF64 index, psS32column)747 double psLookupTableInterpolate(const psLookupTable *table, double index, long column) 748 748 { 749 749 psU64 hiIdx = 0; 750 750 psU64 loIdx = 0; 751 psU64numRows = 0;752 psU64numCols = 0;751 long numRows = 0; 752 long numCols = 0; 753 753 psF64 out = 0.0; 754 754 psF64 denom = 0.0; … … 818 818 } 819 819 820 psVector* psLookupTableInterpolateAll( psLookupTable *table, psF64index)821 { 822 psU64numCols = 0;820 psVector* psLookupTableInterpolateAll(const psLookupTable *table, double index) 821 { 822 long numCols = 0; 823 823 psVector *outVector = NULL; 824 824 -
trunk/psLib/src/dataIO/psLookupTable.h
r4366 r4457 7 7 * @author Ross Harman, MHPCC 8 8 * 9 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 6-23 03:19:29$9 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-07-06 03:04:35 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 33 33 psVector *index; ///< Vector of independent index values 34 34 psArray *values; ///< Array of dependent table values corresponding to index values 35 psF64 validFrom;///< Lower bound for rable read36 psF64 validTo;///< Upper bound for table read35 const double validFrom; ///< Lower bound for rable read 36 const double validTo; ///< Upper bound for table read 37 37 } 38 38 psLookupTable; … … 100 100 * Reads a lookup table and fills corresponding psLookupTable struct. 101 101 * 102 * @return psS32Number of valid lines read102 * @return long: Number of valid lines read 103 103 */ 104 104 long psLookupTableRead( … … 111 111 * conditions. 112 112 * 113 * @return psLookupTable* New psLookupTable struct113 * @return double Interpolation value at index 114 114 */ 115 psF64psLookupTableInterpolate(116 const psLookupTable *table, ///< Table with data117 psF64 index,///< Value to be interpolated118 psS32 column///< Column in table to be interpolated115 double psLookupTableInterpolate( 116 const psLookupTable *table, ///< Table with data 117 double index, ///< Value to be interpolated 118 long column ///< Column in table to be interpolated 119 119 ); 120 120 … … 124 124 * conditions. 125 125 * 126 * @return ps LookupTable* New psLookupTable struct126 * @return psVector* Interpolation values calculated at index 127 127 */ 128 128 psVector* psLookupTableInterpolateAll( 129 psLookupTable *table,///< Table with data130 psF64 index///< Value to be interpolated129 const psLookupTable *table, ///< Table with data 130 double index ///< Value to be interpolated 131 131 ); 132 132 -
trunk/psLib/src/sysUtils/psError.c
r4392 r4457 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 6-25 02:02:05 $12 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-07-06 03:04:35 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 152 152 } 153 153 154 psS32psErrorGetStackSize()154 unsigned int psErrorGetStackSize() 155 155 { 156 156 return errorStackSize; -
trunk/psLib/src/sysUtils/psError.h
r4342 r4457 12 12 * @author Eric Van Alst, MHPCC 13 13 * 14 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 6-22 02:05:41$14 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-07-06 03:04:35 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 74 74 * @return psS32 The number of items on the error stack 75 75 */ 76 psS32psErrorGetStackSize();76 unsigned int psErrorGetStackSize(); 77 77 78 78 /** Prints error stack to specified open file descriptor … … 138 138 139 139 /** Reports an error message to the logging facility 140 * 140 * 141 141 * This function will invoke the psLogMsg function with a level of 142 142 * PS_LOG_ERROR and pass the parameters name and fmt to generate a proper 143 143 * log message. This function is used to check a specific code location. 144 * 144 * 145 145 * This function modifies the error stack. 146 146 * … … 158 158 159 159 /** Logs a warning message. 160 * 160 * 161 161 * 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 163 163 * PS_LOG_WARN. This function is used to check a specific code location. 164 * 164 * 165 165 */ 166 166 void p_psWarning( -
trunk/psLib/src/sysUtils/psErrorCodes.h
r4162 r4457 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 6-08 23:40:45 $9 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-07-06 03:04:35 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 96 96 void psErrorRegister( 97 97 const psErrorDescription* errors, ///< Array of error codes to register 98 psS32 nerror ///< number of errors in input array98 int errorCode ///< Error code to register 99 99 ); 100 100 -
trunk/psLib/src/sysUtils/psLogMsg.h
r4367 r4457 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.2 8$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 6-23 03:50:29$13 * @version $Revision: 1.29 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-07-06 03:04:35 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 67 67 void psLogMsg( 68 68 const char *name, ///< name of the log source 69 int level, ///< severity level of this log message70 const char *format, ///< printf-style format command69 int level, ///< severity level of this log message 70 const char *format, ///< printf-style format command 71 71 ... 72 72 ); -
trunk/psLib/test/collections/tst_psArray.c
r4308 r4457 17 17 * @author Ross Harman, MHPCC 18 18 * 19 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $20 * @date $Date: 2005-0 6-17 23:44:22$19 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2005-07-06 03:04:35 $ 21 21 * 22 22 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 103 103 } 104 104 } 105 fprintf(stderr,"array size = % d\n", psArr->nalloc);105 fprintf(stderr,"array size = %ld\n", psArr->nalloc); 106 106 if (psArr->nalloc != 5) { 107 107 psError(PS_ERR_UNKNOWN, true,"Array Size wrong"); 108 108 return 3; 109 109 } 110 fprintf(stderr,"array population = % d\n", psArr->n);110 fprintf(stderr,"array population = %ld\n", psArr->n); 111 111 if (psArr->n != 5) { 112 112 psError(PS_ERR_UNKNOWN, true,"Array population wrong"); … … 137 137 } 138 138 } 139 fprintf(stderr,"array size = % d\n", psArr->nalloc);139 fprintf(stderr,"array size = %ld\n", psArr->nalloc); 140 140 if (psArr->nalloc != 10) { 141 141 psError(PS_ERR_UNKNOWN, true,"Array Size wrong"); 142 142 return 6; 143 143 } 144 fprintf(stderr,"array population = % d\n", psArr->n);144 fprintf(stderr,"array population = %ld\n", psArr->n); 145 145 if (psArr->n != 10) { 146 146 psError(PS_ERR_UNKNOWN, true,"Array Population wrong"); … … 160 160 } 161 161 } 162 fprintf(stderr,"array size = % d\n", psArr->nalloc);162 fprintf(stderr,"array size = %ld\n", psArr->nalloc); 163 163 if (psArr->nalloc != 3) { 164 164 psError(PS_ERR_UNKNOWN, true,"Array Size wrong"); 165 165 return 9; 166 166 } 167 fprintf(stderr,"array population = % d\n", psArr->n);167 fprintf(stderr,"array population = %ld\n", psArr->n); 168 168 if (psArr->n != 3) { 169 169 psError(PS_ERR_UNKNOWN, true,"Array Population wrong"); … … 189 189 return 100; 190 190 } 191 fprintf(stderr,"Array size after removal = % d\n",psArr->n);191 fprintf(stderr,"Array size after removal = %ld\n",psArr->n); 192 192 if ( psArr->n != 2 ) { 193 193 psError(PS_ERR_UNKNOWN, true, "Items in array not decremented after removal"); … … 274 274 } 275 275 } 276 fprintf(stderr,"array size = % d\n", psArr->nalloc);276 fprintf(stderr,"array size = %ld\n", psArr->nalloc); 277 277 if (psArr->nalloc != 10) { 278 278 psError(PS_ERR_UNKNOWN, true,"Array Size wrong"); 279 279 return 3; 280 280 } 281 fprintf(stderr,"array population = % d\n", psArr->n);281 fprintf(stderr,"array population = %ld\n", psArr->n); 282 282 if (psArr->n != 10) { 283 283 psError(PS_ERR_UNKNOWN, true,"Array population wrong"); -
trunk/psLib/test/collections/tst_psHash00.c
r3682 r4457 26 26 } 27 27 28 if (myHashTable->n bucket!= NUM_HASH_TABLE_BUCKETS) {28 if (myHashTable->n != NUM_HASH_TABLE_BUCKETS) { 29 29 fprintf(stderr, "%s: myHashTable->nbucket not set properly.\n", 30 30 __func__); -
trunk/psLib/test/collections/tst_psList.c
r3682 r4457 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 4-07 20:27:41$8 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-07-06 03:04:35 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 77 77 return 2; 78 78 } 79 if (list-> size!= 0) {79 if (list->n != 0) { 80 80 psError(PS_ERR_UNKNOWN, true,"size of list wasn't zero for empty list."); 81 81 return 3; … … 101 101 } 102 102 103 if (list-> size!= 1) {103 if (list->n != 1) { 104 104 psError(PS_ERR_UNKNOWN, true,"size of list wasn't correctly set for new, one-element list."); 105 105 return 7; … … 310 310 list = psListAlloc(data); 311 311 psFree(data); 312 if (list-> size!= 1) {312 if (list->n != 1) { 313 313 psError(PS_ERR_UNKNOWN, true,"psListAlloc didn't create a list properly."); 314 314 return 2; … … 321 321 return 40; 322 322 } 323 if ( list-> size!= 1) {323 if ( list->n != 1) { 324 324 psError(PS_ERR_UNKNOWN, true,"psListAdd with a NULL data element changed the list size or returned success."); 325 325 return 3; … … 341 341 342 342 // verify that the size incremented 343 if (list-> size!= 2) {343 if (list->n != 2) { 344 344 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the size by one"); 345 345 return 4; … … 365 365 psFree(data); 366 366 // verify that the size incremented 367 if (list-> size!= 3) {367 if (list->n != 3) { 368 368 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the size by 1"); 369 369 return 6; … … 399 399 psFree(data); 400 400 // verify that the size wasn't incremented 401 if (list-> size!= 3) {401 if (list->n != 3) { 402 402 printListInt(list); 403 403 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to head when where was invalid."); … … 420 420 psFree(data); 421 421 // 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) { 423 423 printListInt(list); 424 424 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #1."); … … 439 439 psFree(data); 440 440 // 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) { 442 442 printListInt(list); 443 443 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #4."); … … 460 460 psFree(data); 461 461 // 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) { 463 463 printListInt(list); 464 464 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #2."); … … 480 480 return 29; 481 481 } 482 if(list-> size!= 7 || *(psS32 *)list->tail->data != 8) {482 if(list->n != 7 || *(psS32 *)list->tail->data != 8) { 483 483 printListInt(list); 484 484 psError(PS_ERR_UNKNOWN,true,"psListAdd didn't place added item at tail."); … … 660 660 } 661 661 662 if (list-> size!= --items) {662 if (list->n != --items) { 663 663 printListInt(list); 664 664 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items); … … 682 682 } 683 683 684 if (list-> size!= --items) {684 if (list->n != --items) { 685 685 printListInt(list); 686 686 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items); … … 697 697 } 698 698 699 if (list-> size!= --items) {699 if (list->n != --items) { 700 700 printListInt(list); 701 701 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items); … … 721 721 } 722 722 723 if (list-> size!= --items) {723 if (list->n != --items) { 724 724 printListInt(list); 725 725 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items); … … 736 736 } 737 737 738 if (list-> size!= --items) {738 if (list->n != --items) { 739 739 printListInt(list); 740 740 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items); … … 756 756 } 757 757 758 if (list-> size!= --items) {758 if (list->n != --items) { 759 759 printListInt(list); 760 760 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items); … … 771 771 } 772 772 773 if (list-> size!= items) {773 if (list->n != items) { 774 774 printListInt(list); 775 775 psError(PS_ERR_UNKNOWN, true,"size not %d, as expected.",items); … … 791 791 } 792 792 793 if (list-> size!= 0) {793 if (list->n != 0) { 794 794 printListInt(list); 795 795 psError(PS_ERR_UNKNOWN, true,"Didn't remove all the elements."); … … 835 835 arr = psListToArray(list); 836 836 837 if (arr->n != 15 || list-> size!= 15) {837 if (arr->n != 15 || list->n != 15) { 838 838 psError(PS_ERR_UNKNOWN, true,"The created array didn't have the proper size"); 839 839 return 1; … … 873 873 list = psArrayToList(arr); 874 874 875 if (arr->n != 15 || list-> size!= 15) {875 if (arr->n != 15 || list->n != 15) { 876 876 psError(PS_ERR_UNKNOWN, true,"The created array didn't have the proper size"); 877 877 return 1; … … 1112 1112 (not needed, as psListAdd is tested elsewhere, but check anyway.) 1113 1113 */ 1114 if (list-> size!= 15) {1114 if (list->n != 15) { 1115 1115 psError(PS_ERR_UNKNOWN, true,"List wasn't populated as expected?"); 1116 1116 return 2; -
trunk/psLib/test/collections/tst_psMetadataIO.c
r4209 r4457 13 13 * @author Eric Van Alst, MHPCC 14 14 * 15 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $16 * @date $Date: 2005-0 6-10 18:09:12$15 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2005-07-06 03:04:35 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 263 263 // Search list for another entry with same key name 264 264 // Check if last entry 265 if(iter->index != metadataItemList-> size) {265 if(iter->index != metadataItemList->n) { 266 266 // Set search iterator to index 267 267 if(!psListIteratorSet(searchIter,iter->index) ) { … … 422 422 423 423 // Verify the number of items in metadata 424 if(md->list-> size!= expectedItems) {424 if(md->list->n != expectedItems) { 425 425 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); 427 427 returnValue = false; 428 428 } … … 795 795 if(metaCounter == 0) { 796 796 // Check if number of items is as expected 797 if(entryChild->data.md->list-> size!= testConfig1ValueMetaItems1) {797 if(entryChild->data.md->list->n != testConfig1ValueMetaItems1) { 798 798 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); 800 800 return i*10+6; 801 801 } … … 824 824 } else if(metaCounter == 1) { 825 825 // Check if number of items is as expected 826 if(entryChild->data.md->list-> size!= testConfig1ValueMetaItems2) {826 if(entryChild->data.md->list->n != testConfig1ValueMetaItems2) { 827 827 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); 829 829 return i*10+6; 830 830 } … … 853 853 } else if(metaCounter == 2) { 854 854 // Check if number of items is as expected 855 if(entryChild->data.md->list-> size!= testConfig1ValueMetaItems3) {855 if(entryChild->data.md->list->n != testConfig1ValueMetaItems3) { 856 856 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); 858 858 return i*10+6; 859 859 } -
trunk/psLib/test/collections/tst_psMetadata_01.c
r3779 r4457 18 18 * @author Ross Harman, MHPCC 19 19 * 20 * @version $Revision: 1.2 5$ $Name: not supported by cvs2svn $21 * @date $Date: 2005-0 4-28 02:45:12$20 * @version $Revision: 1.26 $ $Name: not supported by cvs2svn $ 21 * @date $Date: 2005-07-06 03:04:35 $ 22 22 * 23 23 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 60 60 psS32 i; 61 61 psHashBucket* ptr = NULL; 62 for(i=0; i<mdTable->n bucket; i++) {62 for(i=0; i<mdTable->n; i++) { 63 63 ptr = mdTable->buckets[i]; 64 64 while (ptr != NULL) { -
trunk/psLib/test/dataIO/tst_psDB.c
r4427 r4457 9 9 * @author Aaron Culliney, MHPCC 10 10 * 11 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 6-29 19:39:56$11 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-07-06 03:04:35 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1600 1600 return 3; 1601 1601 } 1602 if(meta->list-> size!= 6) {1602 if(meta->list->n != 6) { 1603 1603 psError(PS_ERR_UNKNOWN,true,"Number of cols = %d not as expected %d", 1604 meta->list-> size,6);1604 meta->list->n,6); 1605 1605 psDBDropTable(dbh,table); 1606 1606 psDBCleanup(dbh); -
trunk/psLib/test/dataIO/tst_psFits.c
r4193 r4457 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 6-09 21:17:45 $8 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-07-06 03:04:35 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 650 650 } 651 651 652 if (header->list-> size < 1 || header->list->size != header2->list->size) {652 if (header->list->n < 1 || header->list->n != header2->list->n) { 653 653 psError(PS_ERR_UNKNOWN, true, 654 654 "Reading the header given a NULL input psMetadata differed "
Note:
See TracChangeset
for help on using the changeset viewer.
