Changeset 8232 for trunk/psLib/src/types
- Timestamp:
- Aug 8, 2006, 1:32:23 PM (20 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 10 edited
-
. (modified) (1 prop)
-
types/psArguments.c (modified) (2 diffs)
-
types/psArray.c (modified) (7 diffs)
-
types/psBitSet.c (modified) (13 diffs)
-
types/psHash.c (modified) (3 diffs)
-
types/psList.c (modified) (19 diffs)
-
types/psLookupTable.c (modified) (6 diffs)
-
types/psMetadata.c (modified) (18 diffs)
-
types/psMetadataConfig.c (modified) (36 diffs)
-
types/psPixels.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src
- Property svn:ignore
-
old new 10 10 libpslib.la.temp 11 11 config.h.in 12 psErrorText.h13 12 *.bb 14 13 *.bbg
-
- Property svn:ignore
-
trunk/psLib/src/types/psArguments.c
r8049 r8232 7 7 * @author David Robbins, MHPCC 8 8 * 9 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-08-0 2 02:28:04$9 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-08-08 23:32:23 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 21 21 #include "psError.h" 22 22 #include "psAbort.h" 23 #include "psErrorText.h" 23 24 24 #include "psLogMsg.h" 25 25 #include "psTrace.h" -
trunk/psLib/src/types/psArray.c
r7914 r8232 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.4 5$ $Name: not supported by cvs2svn $12 * @date $Date: 2006-0 7-15 02:57:12$11 * @version $Revision: 1.46 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2006-08-08 23:32:23 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 28 28 #include "psLogMsg.h" 29 29 30 #include "psErrorText.h" 30 31 31 32 32 /***************************************************************************** … … 79 79 { 80 80 if (in == NULL) { 81 psError(PS_ERR_BAD_PARAMETER_NULL,true, PS_ERRORTEXT_psArray_REALLOC_NULL);81 psError(PS_ERR_BAD_PARAMETER_NULL,true,_("psArrayRealloc must be given a non-NULL psArray to resize.")); 82 82 return NULL; 83 83 } else if (in->nalloc != nalloc) { // No need to realloc to same size … … 132 132 if (array == NULL) { 133 133 psError(PS_ERR_BAD_PARAMETER_NULL, true, 134 PS_ERRORTEXT_psArray_ARRAY_NULL);134 _("Specified psArray can not be NULL.")); 135 135 return false; 136 136 } … … 184 184 { 185 185 psError(PS_ERR_BAD_PARAMETER_NULL, true, 186 PS_ERRORTEXT_psArray_ARRAY_NULL);186 _("Specified psArray can not be NULL.")); 187 187 return false; 188 188 } … … 208 208 if (position >= array->nalloc) { 209 209 psError(PS_ERR_BAD_PARAMETER_NULL, true, 210 PS_ERRORTEXT_psArray_POSITION_BEYOND_NALLOC,210 _("Specified position, %d, is greater than the allocated size of the array, %d."), 211 211 position, array->nalloc); 212 212 return false; … … 226 226 if (array == NULL) { 227 227 psError(PS_ERR_BAD_PARAMETER_NULL, true, 228 PS_ERRORTEXT_psArray_ARRAY_NULL);228 _("Specified psArray can not be NULL.")); 229 229 return NULL; 230 230 } -
trunk/psLib/src/types/psBitSet.c
r7914 r8232 11 11 * @author Robert DeSonia, MHPCC 12 12 * 13 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-0 7-15 02:57:12$13 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-08-08 23:32:23 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 28 28 #include "psString.h" 29 29 30 #include "psErrorText.h" 30 31 31 32 32 enum { … … 82 82 if (nalloc < 0) { 83 83 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 84 PS_ERRORTEXT_psBitSet_ALLOC_NEG_SIZE,84 _("The number of bit in a psBitSet (%d) must be greater than zero."), 85 85 nalloc); 86 86 return NULL; … … 108 108 if (bitSet == NULL) { 109 109 psError(PS_ERR_BAD_PARAMETER_NULL, true, 110 PS_ERRORTEXT_psBitSet_SET_NULL);110 _("Can not operate on a NULL psBitSet.")); 111 111 return bitSet; 112 112 } else if ( (bit < 0) || 113 113 (bit > bitSet->n * 8 - 1) ) { 114 114 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 115 PS_ERRORTEXT_psBitSet_BIT_OUTOFRANGE,115 _("The specified bit position (%d) is invalid. Position must be between 0 and %d."), 116 116 bit,bitSet->n * 8 - 1); 117 117 return bitSet; … … 131 131 if (bitSet == NULL) { 132 132 psError(PS_ERR_BAD_PARAMETER_NULL, true, 133 PS_ERRORTEXT_psBitSet_SET_NULL);133 _("Can not operate on a NULL psBitSet.")); 134 134 return bitSet; 135 135 } else if ( (bit < 0) || 136 136 (bit > bitSet->n * 8 - 1) ) { 137 137 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 138 PS_ERRORTEXT_psBitSet_BIT_OUTOFRANGE,138 _("The specified bit position (%d) is invalid. Position must be between 0 and %d."), 139 139 bit,bitSet->n * 8 - 1); 140 140 return bitSet; … … 154 154 if (bitSet == NULL) { 155 155 psError(PS_ERR_BAD_PARAMETER_NULL, true, 156 PS_ERRORTEXT_psBitSet_SET_NULL);156 _("Can not operate on a NULL psBitSet.")); 157 157 return false; 158 158 } else if ( (bit < 0) || 159 159 (bit > bitSet->n * 8 - 1) ) { 160 160 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 161 PS_ERRORTEXT_psBitSet_BIT_OUTOFRANGE,161 _("The specified bit position (%d) is invalid. Position must be between 0 and %d."), 162 162 bit,bitSet->n * 8 - 1); 163 163 return false; … … 183 183 if (inBitSet1 == NULL) { 184 184 psError(PS_ERR_BAD_PARAMETER_NULL, true, 185 PS_ERRORTEXT_psBitSet_FIRST_OPERAND_NULL);185 _("First psBitSet operand can not be NULL.")); 186 186 psFree(outBitSet); 187 187 return NULL; … … 191 191 if (operator == NULL) { 192 192 psError(PS_ERR_BAD_PARAMETER_NULL, true, 193 PS_ERRORTEXT_psBitSet_OPERATOR_NULL);193 _("Specified operator is NULL. Must specify desired operator.")); 194 194 psFree(outBitSet); 195 195 return NULL; … … 208 208 psFree(outBitSet); 209 209 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 210 PS_ERRORTEXT_psBitSet_OPERATOR_INVALID,210 _("Specified operator, %s, is invalid. Valid operators are AND, OR, and XOR."), 211 211 operator); 212 212 return NULL; … … 216 216 if (inBitSet2 == NULL) { 217 217 psError(PS_ERR_BAD_PARAMETER_NULL, true, 218 PS_ERRORTEXT_psBitSet_SECOND_OPERAND_NULL);218 _("Second psBitSet operand can not be NULL.")); 219 219 psFree(outBitSet); 220 220 return NULL; … … 223 223 if (inBitSet1->n != inBitSet2->n) { 224 224 psError(PS_ERR_BAD_PARAMETER_SIZE, true, 225 PS_ERRORTEXT_psBitSet_OPERANDS_SIZE_DIFFER);225 _("The psBitSet operand must be the same size.")); 226 226 psFree(outBitSet); 227 227 return NULL; … … 274 274 if (inBitSet == NULL) { 275 275 psError(PS_ERR_BAD_PARAMETER_NULL, true, 276 PS_ERRORTEXT_psBitSet_OPERAND_NULL);276 _("Operand can not be NULL.")); 277 277 psFree(outBitSet); 278 278 return NULL; … … 283 283 if (outBitSet == NULL) { 284 284 psError(PS_ERR_UNKNOWN, false, 285 PS_ERRORTEXT_psBitSet_NOT_OP_FAILED);285 _("Could not perform NOT operation.")); 286 286 } 287 287 -
trunk/psLib/src/types/psHash.c
r7914 r8232 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-0 7-15 02:57:12$14 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-08-08 23:32:23 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 27 27 #include "psAssert.h" 28 28 29 #include "psErrorText.h" 29 30 30 31 31 static psHashBucket* hashBucketAlloc(const char *key, psPtr data, psHashBucket* next); … … 240 240 if ((table == NULL) || (key == NULL)) { 241 241 psError(PS_ERR_BAD_PARAMETER_NULL, true, 242 PS_ERRORTEXT_psHash_KEY_NULL);242 _("Input key can not be NULL.")); 243 243 return NULL; 244 244 } -
trunk/psLib/src/types/psList.c
r7914 r8232 6 6 * @author Robert Daniel DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.5 0$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-0 7-15 02:57:12$8 * @version $Revision: 1.51 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-08-08 23:32:23 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 21 21 #include "psLogMsg.h" 22 22 23 #include "psErrorText.h" 23 24 24 25 25 #define ITER_INIT_HEAD ((psPtr )1) // next iteration should return head … … 206 206 if (location < 0 || location >= (int)list->n) { 207 207 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 208 PS_ERRORTEXT_psList_LOCATION_INVALID,208 _("Specified location, %d, is invalid."), 209 209 location); 210 210 return false; … … 248 248 if (list == NULL) { 249 249 psError(PS_ERR_BAD_PARAMETER_NULL, true, 250 PS_ERRORTEXT_psList_LIST_NULL);250 _("Specified psList reference is NULL.")); 251 251 return false; 252 252 } … … 254 254 if (data == NULL) { 255 255 psError(PS_ERR_BAD_PARAMETER_NULL, true, 256 PS_ERRORTEXT_psList_DATA_NULL);256 _("Specified data item is NULL.")); 257 257 return false; 258 258 } … … 283 283 if (data == NULL) { 284 284 psError(PS_ERR_BAD_PARAMETER_NULL, true, 285 PS_ERRORTEXT_psList_DATA_NULL);285 _("Specified data item is NULL.")); 286 286 return false; 287 287 } … … 289 289 if (iterator == NULL) { 290 290 psError(PS_ERR_BAD_PARAMETER_NULL, true, 291 PS_ERRORTEXT_psList_ITERATOR_NULL);291 _("Specified iterator is NULL.")); 292 292 return false; 293 293 } … … 296 296 if (!iterator->mutable) { 297 297 psError(PS_ERR_BAD_PARAMETER_NULL, true, 298 PS_ERRORTEXT_psList_ITERATOR_NONMUTABLE);298 _("Specified iterator indicates list is non-mutable.")); 299 299 return false; 300 300 } … … 305 305 if (cursor == NULL && list->head != NULL) { 306 306 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 307 PS_ERRORTEXT_psList_ITERATOR_INVALID);307 _("Specified iterator is not valid.")); 308 308 return false; 309 309 } … … 352 352 if (data == NULL) { 353 353 psError(PS_ERR_BAD_PARAMETER_NULL, true, 354 PS_ERRORTEXT_psList_DATA_NULL);354 _("Specified data item is NULL.")); 355 355 return false; 356 356 } … … 358 358 if (iterator == NULL) { 359 359 psError(PS_ERR_BAD_PARAMETER_NULL, true, 360 PS_ERRORTEXT_psList_ITERATOR_NULL);360 _("Specified iterator is NULL.")); 361 361 return false; 362 362 } … … 365 365 if (!iterator->mutable) { 366 366 psError(PS_ERR_BAD_PARAMETER_NULL, true, 367 PS_ERRORTEXT_psList_ITERATOR_NONMUTABLE);367 _("Specified iterator indicates list is non-mutable.")); 368 368 return false; 369 369 } … … 374 374 if (cursor == NULL && list->head != NULL) { 375 375 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 376 PS_ERRORTEXT_psList_ITERATOR_INVALID);376 _("Specified iterator is not valid.")); 377 377 return false; 378 378 } … … 422 422 if (list == NULL) { 423 423 psError(PS_ERR_BAD_PARAMETER_NULL, true, 424 PS_ERRORTEXT_psList_LIST_NULL);424 _("Specified psList reference is NULL.")); 425 425 return false; 426 426 } … … 440 440 if (list == NULL) { 441 441 psError(PS_ERR_BAD_PARAMETER_NULL, true, 442 PS_ERRORTEXT_psList_LIST_NULL);442 _("Specified psList reference is NULL.")); 443 443 return false; 444 444 } … … 446 446 if (data == NULL) { 447 447 psError(PS_ERR_BAD_PARAMETER_NULL, true, 448 PS_ERRORTEXT_psList_DATA_NULL);448 _("Specified data item is NULL.")); 449 449 return false; 450 450 } … … 458 458 if (elem == NULL) { 459 459 psError(PS_ERR_BAD_PARAMETER_NULL, true, 460 PS_ERRORTEXT_psList_DATA_NOT_FOUND);460 _("Specified data item is not found in the psList.")); 461 461 return false; 462 462 } … … 473 473 if (list == NULL) { 474 474 psError(PS_ERR_BAD_PARAMETER_NULL, true, 475 PS_ERRORTEXT_psList_LIST_NULL);475 _("Specified psList reference is NULL.")); 476 476 return NULL; 477 477 } … … 485 485 if (! psListIteratorSet(iterator,location)) { 486 486 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 487 PS_ERRORTEXT_psList_LOCATION_INVALID,487 _("Specified location, %d, is invalid."), 488 488 location); 489 489 return NULL; -
trunk/psLib/src/types/psLookupTable.c
r7943 r8232 7 7 * @author Ross Harman, MHPCC 8 8 * 9 * @version $Revision: 1.3 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-0 7-20 13:00:10$9 * @version $Revision: 1.35 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-08-08 23:32:23 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 25 25 #include "psError.h" 26 26 #include "psLookupTable.h" 27 #include "psErrorText.h" 27 28 28 #include "psAssert.h" 29 29 … … 487 487 // Open specified file 488 488 if((fp=fopen(filename, "r")) == NULL) { 489 psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psLookupTable_FILE_NOT_FOUND,489 psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed to open file %s."), 490 490 filename); 491 491 psFree(outputArray); … … 813 813 if(hiIdx >= numRows) { 814 814 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 815 PS_ERRORTEXT_psLookupTable_INTERPOLATE_HIGH, hiIdx);815 _("High index too big, %d."), hiIdx); 816 816 return NAN; 817 817 } … … 823 823 if(loIdx < 0) { 824 824 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 825 PS_ERRORTEXT_psLookupTable_INTERPOLATE_LOW, loIdx);825 _("Low index too small, %d."), loIdx); 826 826 return NAN; 827 827 } … … 832 832 denom -= convertVal; 833 833 if(fabs(denom) < FLT_EPSILON) { 834 psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psLookupTable_DIVIDE_BY_ZERO);834 psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Divide by zero error during interpolation.")); 835 835 return NAN; 836 836 } else { -
trunk/psLib/src/types/psMetadata.c
r7937 r8232 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.12 0$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-0 7-19 03:43:14$14 * @version $Revision: 1.121 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-08-08 23:32:23 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 36 36 #include "psLookupTable.h" 37 37 #include "psString.h" 38 #include "psErrorText.h" 38 39 39 #include "psAssert.h" 40 40 #include "psLogMsg.h" … … 319 319 break; 320 320 default: 321 psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psMetadata_METATYPE_INVALID, type);321 psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Specified psDataType, %d, is not supported."), type); 322 322 psFree(metadataItem); 323 323 metadataItem = NULL; … … 554 554 // add to the hash's list of duplicate entries 555 555 if (! psListAdd(existingEntry->data.list, PS_LIST_TAIL, (psPtr)item) ) { 556 psError(PS_ERR_UNKNOWN,false, PS_ERRORTEXT_psMetadata_ADD_COLLECTION_FAILED,key);556 psError(PS_ERR_UNKNOWN,false,_("Failed to add metadata item, %s, to metadata collection list."),key); 557 557 return false; 558 558 } … … 565 565 // treat as if new (added to list below) 566 566 if(!psHashAdd(mdTable, key, (psPtr)item)) { 567 psError(PS_ERR_UNKNOWN,false, PS_ERRORTEXT_psMetadata_ADD_TABLE_FAILED,key);567 psError(PS_ERR_UNKNOWN,false,_("Failed to add metadata item, %s, to items table."),key); 568 568 return false; 569 569 } … … 578 578 } 579 579 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 580 PS_ERRORTEXT_psMetadata_DUPLICATE_NOT_ALLOWED);580 _("Duplicate metadata item name is not allowed. Use a psMetadataFlags option to allow such action.")); 581 581 return false; 582 582 } … … 586 586 // Node doesn't exist - Add new metadata item to metadata collection's hash 587 587 if(!psHashAdd(mdTable, key, (psPtr)item)) { 588 psError(PS_ERR_UNKNOWN,false, PS_ERRORTEXT_psMetadata_ADD_TABLE_FAILED,key);588 psError(PS_ERR_UNKNOWN,false,_("Failed to add metadata item, %s, to items table."),key); 589 589 return false; 590 590 } … … 597 597 598 598 if(!psListAdd(mdList, location, (psPtr)item)) { 599 psError(PS_ERR_UNKNOWN,false, PS_ERRORTEXT_psMetadata_ADD_COLLECTION_FAILED,key);599 psError(PS_ERR_UNKNOWN,false,_("Failed to add metadata item, %s, to metadata collection list."),key); 600 600 return false; 601 601 } … … 635 635 636 636 if (!psMetadataAddItem(md, metadataItem, location, format & PS_METADATA_FLAGS_MASK)) { 637 psError(PS_ERR_UNKNOWN,false, PS_ERRORTEXT_psMetadata_ADD_FAILED);637 psError(PS_ERR_UNKNOWN,false,_("Failed to add metadata item to metadata collection list.")); 638 638 psFree(metadataItem); 639 639 return false; … … 717 717 psMetadataItem* entry = psHashLookup(mdTable,key); 718 718 if (entry == NULL) { 719 psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psMetadata_REMOVE_TABLE_FAILED, key);719 psError(PS_ERR_UNKNOWN, false, _("Failed to remove metadata item, %s, from metadata table."), key); 720 720 return false; 721 721 } … … 739 739 psMetadataItem* entry = psListGet(mdList, where); 740 740 if (entry == NULL) { 741 psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psMetadata_FIND_INDEX_FAILED, where);741 psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Could not find metadata item at index %d."), where); 742 742 return false; 743 743 } … … 745 745 746 746 if (key == NULL) { 747 psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psMetadata_REMOVE_LIST_INDEX_FAILED, where);747 psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed to remove metadata item, at index %d, from metadata list."), where); 748 748 return false; 749 749 } … … 751 751 psMetadataItem* tableItem = psHashLookup(mdTable, key); 752 752 if (tableItem == NULL) { 753 psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psMetadata_REMOVE_TABLE_FAILED, key);753 psError(PS_ERR_UNKNOWN, false, _("Failed to remove metadata item, %s, from metadata table."), key); 754 754 return false; 755 755 } … … 760 760 } else { 761 761 if (!psHashRemove(mdTable, key)) { 762 psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psMetadata_REMOVE_TABLE_FAILED, key);762 psError(PS_ERR_UNKNOWN, false, _("Failed to remove metadata item, %s, from metadata table."), key); 763 763 return false; 764 764 } … … 828 828 } 829 829 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 830 PS_ERRORTEXT_psMetadata_METATYPE_INVALID,830 _("Specified psDataType, %d, is not supported."), 831 831 metadataItem->type); 832 832 return NULL; … … 928 928 entry = (psMetadataItem*) psListGet(md->list, location); 929 929 if (entry == NULL) { 930 psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psMetadata_FIND_INDEX_FAILED, location);930 psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Could not find metadata item at index %d."), location); 931 931 return NULL; 932 932 } … … 954 954 regerror(regRtn, newIter->regex, errMsg, 256); 955 955 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 956 PS_ERRORTEXT_psMetadata_REGEX_INVALID,956 _("Specified regular expression is invalid. %s."), 957 957 errMsg); 958 958 psFree(newIter); … … 1333 1333 default: 1334 1334 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 1335 PS_ERRORTEXT_psMetadata_METATYPE_INVALID, vector->type.type);1335 _("Specified psDataType, %d, is not supported."), vector->type.type); 1336 1336 return false; 1337 1337 } -
trunk/psLib/src/types/psMetadataConfig.c
r8146 r8232 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1. 69$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-08-0 4 22:58:58$12 * @version $Revision: 1.70 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-08-08 23:32:23 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 32 32 #include "psMetadataConfig.h" 33 33 #include "psAssert.h" 34 #include "psErrorText.h" 34 35 35 36 36 /******************************************************************************/ … … 399 399 *status = 1; 400 400 psError(PS_ERR_BAD_PARAMETER_VALUE,true, 401 PS_ERRORTEXT_psMetadataIO_TYPE_INVALID,401 _("Specified type, %d, is not supported."), 402 402 elemType); 403 403 } … … 510 510 default: \ 511 511 psError(PS_ERR_BAD_PARAMETER_TYPE,true, \ 512 PS_ERRORTEXT_psMetadata_METATYPE_INVALID, (int)type); \512 _("Specified psDataType, %d, is not supported."), (int)type); \ 513 513 success = false; \ 514 514 } \ … … 542 542 } else { 543 543 psError(PS_ERR_BAD_PARAMETER_TYPE,true, 544 PS_ERRORTEXT_psMetadata_METATYPE_INVALID, (int)type);544 _("Specified psDataType, %d, is not supported."), (int)type); 545 545 success = false; 546 546 } … … 551 551 default: 552 552 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 553 PS_ERRORTEXT_psMetadata_FORMAT_INVALID, *fType);553 _("Specified print format, %%%c, is not supported."), *fType); 554 554 break; 555 555 } … … 709 709 // Check for no type 710 710 if(strType==NULL) { 711 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_FILE_ELEMENT_NULL, "type",lineCount,711 psError(PS_ERR_IO, true, _("Failed to read a metadata %s on line %u of %s."), "type",lineCount, 712 712 fileName); 713 713 returnValue = false; … … 741 741 vectorType = PS_TYPE_F64; 742 742 } else { 743 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, "", keyName,743 psError(PS_ERR_IO, true, _("Failed to parse the value '%s' of metadata item %s, type %s, on line %u of %s."), "", keyName, 744 744 strType, lineCount, fileName); 745 745 psFree(strType); … … 786 786 // Check for add failure 787 787 if (! addStatus) { 788 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_OVERWRITE_ITEM,788 psError(PS_ERR_IO, true, _("Duplicate Metadata item, %s, found on line %u of %s. Overwrite not allowed."), 789 789 keyName, lineCount, fileName); 790 790 psFree(strType); … … 795 795 } else { 796 796 // Metadata type read error 797 psError(PS_ERR_IO,true, PS_ERRORTEXT_psMetadataIO_FILE_ELEMENT_NULL,797 psError(PS_ERR_IO,true,_("Failed to read a metadata %s on line %u of %s."), 798 798 keyName,lineCount,fileName); 799 799 psFree(strType); … … 805 805 } 806 806 if(!typeFound) { 807 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_FILE_TYPE_INVALID,807 psError(PS_ERR_IO, true, _("Metadata type '%s', found on line %u of %s, is invalid."), 808 808 strType, lineCount,fileName); 809 809 psFree(strType); … … 822 822 strValue = getToken(&linePtr, "#", &status,true); 823 823 if(status) { 824 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_FILE_ELEMENT_NULL, "value", lineCount,824 psError(PS_ERR_IO, true, _("Failed to read a metadata %s on line %u of %s."), "value", lineCount, 825 825 fileName); 826 826 psFree(strType); … … 829 829 } 830 830 if(strValue==NULL) { 831 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_FILE_ELEMENT_NULL, "value", lineCount,831 psError(PS_ERR_IO, true, _("Failed to read a metadata %s on line %u of %s."), "value", lineCount, 832 832 fileName); 833 833 psFree(strType); … … 839 839 strComment = getToken(&linePtr,"~", &status,true); 840 840 if(status) { 841 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_FILE_ELEMENT_NULL, "comment", lineCount,841 psError(PS_ERR_IO, true, _("Failed to read a metadata %s on line %u of %s."), "comment", lineCount, 842 842 fileName); 843 843 psFree(strType); … … 864 864 strComment, tempBool); 865 865 } else { 866 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, keyName,866 psError(PS_ERR_IO, true, _("Failed to parse the value '%s' of metadata item %s, type %s, on line %u of %s."), strValue, keyName, 867 867 strType, lineCount, fileName); 868 868 returnValue = false; … … 878 878 } else { 879 879 psError(PS_ERR_IO, true, 880 PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, keyName, strType, lineCount,880 _("Failed to parse the value '%s' of metadata item %s, type %s, on line %u of %s."), strValue, keyName, strType, lineCount, 881 881 fileName); 882 882 returnValue = false; … … 888 888 addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, mdType | flags, strComment, tempInt); 889 889 } else { 890 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, keyName,890 psError(PS_ERR_IO, true, _("Failed to parse the value '%s' of metadata item %s, type %s, on line %u of %s."), strValue, keyName, 891 891 strType, lineCount, fileName); 892 892 returnValue = false; … … 898 898 addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, mdType | flags, strComment, tempInt); 899 899 } else { 900 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, keyName,900 psError(PS_ERR_IO, true, _("Failed to parse the value '%s' of metadata item %s, type %s, on line %u of %s."), strValue, keyName, 901 901 strType, lineCount, fileName); 902 902 returnValue = false; … … 908 908 addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, mdType | flags, strComment, tempInt); 909 909 } else { 910 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, keyName,910 psError(PS_ERR_IO, true, _("Failed to parse the value '%s' of metadata item %s, type %s, on line %u of %s."), strValue, keyName, 911 911 strType, lineCount, fileName); 912 912 returnValue = false; … … 918 918 addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, mdType | flags, strComment, tempUint); 919 919 } else { 920 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, keyName,920 psError(PS_ERR_IO, true, _("Failed to parse the value '%s' of metadata item %s, type %s, on line %u of %s."), strValue, keyName, 921 921 strType, lineCount, fileName); 922 922 returnValue = false; … … 928 928 addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, mdType | flags, strComment, tempUint); 929 929 } else { 930 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, keyName,930 psError(PS_ERR_IO, true, _("Failed to parse the value '%s' of metadata item %s, type %s, on line %u of %s."), strValue, keyName, 931 931 strType, lineCount, fileName); 932 932 returnValue = false; … … 938 938 addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, mdType | flags, strComment, tempUint); 939 939 } else { 940 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, keyName,940 psError(PS_ERR_IO, true, _("Failed to parse the value '%s' of metadata item %s, type %s, on line %u of %s."), strValue, keyName, 941 941 strType, lineCount, fileName); 942 942 returnValue = false; … … 958 958 strComment, mTime); 959 959 } else { 960 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, keyName,960 psError(PS_ERR_IO, true, _("Failed to parse the value '%s' of metadata item %s, type %s, on line %u of %s."), strValue, keyName, 961 961 strType, lineCount, fileName); 962 962 returnValue = false; … … 971 971 strComment, tempVec); 972 972 } else { 973 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, keyName,973 psError(PS_ERR_IO, true, _("Failed to parse the value '%s' of metadata item %s, type %s, on line %u of %s."), strValue, keyName, 974 974 strType, lineCount, fileName); 975 975 returnValue = false; … … 983 983 for(psS32 k=0; k < nonUniqueKeys->n; k++) { 984 984 if(strcmp(keyName,(char*)nonUniqueKeys->data[k]) == 0) { 985 psError(PS_ERR_IO,true, PS_ERRORTEXT_psMetadataIO_DUPLICATE_MULTI,985 psError(PS_ERR_IO,true,_("Duplicate MULTI specifier on line %u of %s."), 986 986 lineCount,fileName); 987 987 psFree(strType); … … 1009 1009 break; 1010 1010 default: 1011 psError(PS_ERR_IO,true, PS_ERRORTEXT_psMetadataIO_FILE_TYPE_INVALID,1011 psError(PS_ERR_IO,true,_("Metadata type '%s', found on line %u of %s, is invalid."), 1012 1012 lineCount,fileName); 1013 1013 break; … … 1057 1057 if(repeatedChars(linePtr, '@') > 1) { 1058 1058 psError(PS_ERR_IO, true, 1059 PS_ERRORTEXT_psMetadataIO_FILE_MULTIPLE_CHAR, '@', lineCount, fileName);1059 _("More than one '%c' character not allowed. Found on line %u of %s."), '@', lineCount, fileName); 1060 1060 return false; 1061 1061 } … … 1065 1065 if(status) { 1066 1066 psError(PS_ERR_IO, true, 1067 PS_ERRORTEXT_psMetadataIO_FILE_ELEMENT_NULL, "keyName", lineCount, fileName);1067 _("Failed to read a metadata %s on line %u of %s."), "keyName", lineCount, fileName); 1068 1068 psFree(keyName); 1069 1069 return false; … … 1075 1075 strType = getToken(&linePtr," ",&status,true); 1076 1076 if(strType == NULL) { 1077 psError(PS_ERR_IO,true, PS_ERRORTEXT_psMetadataIO_FILE_ELEMENT_NULL,"type",lineCount,1077 psError(PS_ERR_IO,true,_("Failed to read a metadata %s on line %u of %s."),"type",lineCount, 1078 1078 fileName); 1079 1079 psFree(keyName); … … 1089 1089 // Compare type name with the list of current types 1090 1090 if(strcmp(strType,(char*)typeArray->data[k]) == 0) { 1091 psError(PS_ERR_IO,true, PS_ERRORTEXT_psMetadataIO_TYPE_DUPLICATE,1091 psError(PS_ERR_IO,true,_("Specified type, %s, on line %u of %s is already defined."), 1092 1092 strType,lineCount,fileName); 1093 1093 psFree(tempTemplate); … … 1104 1104 psFree(tempTemplate); 1105 1105 } else { 1106 psError(PS_ERR_IO,true, PS_ERRORTEXT_psMetadataIO_FILE_TYPE_INVALID,1106 psError(PS_ERR_IO,true,_("Metadata type '%s', found on line %u of %s, is invalid."), 1107 1107 strType,lineCount,fileName); 1108 1108 psFree(keyName); … … 1187 1187 // Attempt to open specified file 1188 1188 if((fp=fopen(filename, "r")) == NULL) { 1189 psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_FILE_OPEN_FAILED, filename);1189 psError(PS_ERR_IO, true, _("Failed to open file '%s'. Check if it exists and it has the proper permissions."), filename); 1190 1190 return NULL; 1191 1191 } … … 1246 1246 // XXX : this is probably not the right error value 1247 1247 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 1248 PS_ERRORTEXT_psMetadata_METATYPE_INVALID, PS_DATA_UNKNOWN);1248 _("Specified psDataType, %d, is not supported."), PS_DATA_UNKNOWN); 1249 1249 psFree(keys); 1250 1250 psFree(format); … … 1385 1385 psStringAppend(&content, "PS_TIME_TT "); 1386 1386 else { 1387 psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psMetadata_METATYPE_INVALID, time->type);1387 psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Specified psDataType, %d, is not supported."), time->type); 1388 1388 psFree(content); 1389 1389 return NULL; … … 1469 1469 default: 1470 1470 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 1471 PS_ERRORTEXT_psMetadata_METATYPE_INVALID, vector->type.type);1471 _("Specified psDataType, %d, is not supported."), vector->type.type); 1472 1472 psFree(content); 1473 1473 return NULL; … … 1481 1481 default: 1482 1482 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 1483 PS_ERRORTEXT_psMetadata_METATYPE_INVALID, item->type);1483 _("Specified psDataType, %d, is not supported."), item->type); 1484 1484 psFree(content); 1485 1485 return NULL; -
trunk/psLib/src/types/psPixels.c
r7914 r8232 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-0 7-15 02:57:12$9 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-08-08 23:32:23 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 20 20 21 21 #include "psError.h" 22 #include "psErrorText.h" 22 23 23 24 24 typedef int(*qsortCompareFcn)(const void *, const void *); … … 133 133 { 134 134 if (pixels == NULL) { 135 psError(PS_ERR_BAD_PARAMETER_NULL,true, PS_ERRORTEXT_psPixels_NULL);135 psError(PS_ERR_BAD_PARAMETER_NULL,true,_("Input psPixels can not be NULL.")); 136 136 psFree(out); 137 137 return NULL; … … 154 154 if (pixels == NULL) { 155 155 psError(PS_ERR_BAD_PARAMETER_NULL, true, 156 PS_ERRORTEXT_psPixels_NULL);156 _("Input psPixels can not be NULL.")); 157 157 psFree(out); 158 158 return NULL; … … 161 161 if (data == NULL) { 162 162 psError(PS_ERR_BAD_PARAMETER_SIZE, true, 163 PS_ERRORTEXT_psPixels_DATA_NULL);163 _("Input psPixels contains no data.")); 164 164 psFree(out); 165 165 return NULL; … … 173 173 if ( (x0 < 0 || x1 < 0) || (y0 < 0 || y1 < 0) ) { 174 174 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 175 PS_ERRORTEXT_psPixels_REGION_INVALID,175 _("Specified psRegion, [%d:%d,%d:%d], does not specify a valid region."), 176 176 (int)y0,(int)y1,(int)x0,(int)x1); 177 177 psFree(out); … … 186 186 if (numRows < 1 || numCols < 1) { 187 187 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 188 PS_ERRORTEXT_psPixels_REGION_INVALID,188 _("Specified psRegion, [%d:%d,%d:%d], does not specify a valid region."), 189 189 (int)y0,(int)y1,(int)x0,(int)x1); 190 190 psFree(out); … … 196 196 if (out == NULL) { 197 197 psError(PS_ERR_UNKNOWN, false, 198 PS_ERRORTEXT_psPixels_FAILED_IMAGE_CREATE,198 _("Failed to create image of size %dx%d."), 199 199 numCols, numRows); 200 200 return NULL; … … 232 232 if (mask == NULL) { 233 233 psError(PS_ERR_BAD_PARAMETER_NULL, true, 234 PS_ERRORTEXT_psPixels_MASK_NULL);234 _("Specified mask can not be NULL.")); 235 235 psFree(out); 236 236 return NULL; … … 240 240 PS_TYPE_NAME(typeStr,mask->type.type); 241 241 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 242 PS_ERRORTEXT_psPixels_MASK_TYPE,242 _("Specified mask's type, %s, is invalid. Should be PS_TYPE_MASK."), 243 243 typeStr); 244 244 psFree(out); … … 295 295 if (pixels == NULL) { 296 296 psError(PS_ERR_BAD_PARAMETER_NULL, true, 297 PS_ERRORTEXT_psPixels_NULL);297 _("Input psPixels can not be NULL.")); 298 298 return NULL; 299 299 } … … 363 363 { 364 364 if (pixels == NULL) { 365 psError(PS_ERR_BAD_PARAMETER_NULL, true, PS_ERRORTEXT_psPixels_NULL);365 psError(PS_ERR_BAD_PARAMETER_NULL, true, _("Input psPixels can not be NULL.")); 366 366 return false; 367 367 } … … 397 397 psPixelCoord out; 398 398 if (pixels == NULL) { 399 psError(PS_ERR_BAD_PARAMETER_NULL, true, PS_ERRORTEXT_psPixels_NULL);399 psError(PS_ERR_BAD_PARAMETER_NULL, true, _("Input psPixels can not be NULL.")); 400 400 out.x = 0; //XXX: should be NAN when changed to float 401 401 out.y = 0; //XXX: should be NAN when changed to float
Note:
See TracChangeset
for help on using the changeset viewer.
