IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8232 for trunk/psLib/src/types


Ignore:
Timestamp:
Aug 8, 2006, 1:32:23 PM (20 years ago)
Author:
jhoblitt
Message:

bug #790 - remove psErrorText.h and inline all error codes. all newly inlined error codes are wrapped with the _() macro from future gettextification

Location:
trunk/psLib/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src

    • Property svn:ignore
      •  

        old new  
        1010libpslib.la.temp
        1111config.h.in
        12 psErrorText.h
        1312*.bb
        1413*.bbg
  • trunk/psLib/src/types/psArguments.c

    r8049 r8232  
    77 *  @author David Robbins, MHPCC
    88 *
    9  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-08-02 02:28:04 $
     9 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-08-08 23:32:23 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2121#include "psError.h"
    2222#include "psAbort.h"
    23 #include "psErrorText.h"
     23
    2424#include "psLogMsg.h"
    2525#include "psTrace.h"
  • trunk/psLib/src/types/psArray.c

    r7914 r8232  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2006-07-15 02:57:12 $
     11 *  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2006-08-08 23:32:23 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2828#include "psLogMsg.h"
    2929
    30 #include "psErrorText.h"
     30
    3131
    3232/*****************************************************************************
     
    7979{
    8080    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."));
    8282        return NULL;
    8383    } else if (in->nalloc != nalloc) {     // No need to realloc to same size
     
    132132    if (array == NULL) {
    133133        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    134                 PS_ERRORTEXT_psArray_ARRAY_NULL);
     134                _("Specified psArray can not be NULL."));
    135135        return false;
    136136    }
     
    184184    {
    185185        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    186                 PS_ERRORTEXT_psArray_ARRAY_NULL);
     186                _("Specified psArray can not be NULL."));
    187187        return false;
    188188    }
     
    208208        if (position >= array->nalloc) {
    209209            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."),
    211211                    position, array->nalloc);
    212212            return false;
     
    226226    if (array == NULL) {
    227227        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    228                 PS_ERRORTEXT_psArray_ARRAY_NULL);
     228                _("Specified psArray can not be NULL."));
    229229        return NULL;
    230230    }
  • trunk/psLib/src/types/psBitSet.c

    r7914 r8232  
    1111 *  @author Robert DeSonia, MHPCC
    1212 *
    13  *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2006-07-15 02:57:12 $
     13 *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2006-08-08 23:32:23 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2828#include "psString.h"
    2929
    30 #include "psErrorText.h"
     30
    3131
    3232enum {
     
    8282    if (nalloc < 0) {
    8383        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."),
    8585                nalloc);
    8686        return NULL;
     
    108108    if (bitSet == NULL) {
    109109        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    110                 PS_ERRORTEXT_psBitSet_SET_NULL);
     110                _("Can not operate on a NULL psBitSet."));
    111111        return bitSet;
    112112    } else if ( (bit < 0) ||
    113113                (bit > bitSet->n * 8 - 1) ) {
    114114        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."),
    116116                bit,bitSet->n * 8 - 1);
    117117        return bitSet;
     
    131131    if (bitSet == NULL) {
    132132        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    133                 PS_ERRORTEXT_psBitSet_SET_NULL);
     133                _("Can not operate on a NULL psBitSet."));
    134134        return bitSet;
    135135    } else if ( (bit < 0) ||
    136136                (bit > bitSet->n * 8 - 1) ) {
    137137        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."),
    139139                bit,bitSet->n * 8 - 1);
    140140        return bitSet;
     
    154154    if (bitSet == NULL) {
    155155        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    156                 PS_ERRORTEXT_psBitSet_SET_NULL);
     156                _("Can not operate on a NULL psBitSet."));
    157157        return false;
    158158    } else if ( (bit < 0) ||
    159159                (bit > bitSet->n * 8 - 1) ) {
    160160        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."),
    162162                bit,bitSet->n * 8 - 1);
    163163        return false;
     
    183183    if (inBitSet1 == NULL) {
    184184        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    185                 PS_ERRORTEXT_psBitSet_FIRST_OPERAND_NULL);
     185                _("First psBitSet operand can not be NULL."));
    186186        psFree(outBitSet);
    187187        return NULL;
     
    191191    if (operator == NULL) {
    192192        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    193                 PS_ERRORTEXT_psBitSet_OPERATOR_NULL);
     193                _("Specified operator is NULL.  Must specify desired operator."));
    194194        psFree(outBitSet);
    195195        return NULL;
     
    208208        psFree(outBitSet);
    209209        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."),
    211211                operator);
    212212        return NULL;
     
    216216        if (inBitSet2 == NULL) {
    217217            psError(PS_ERR_BAD_PARAMETER_NULL, true,
    218                     PS_ERRORTEXT_psBitSet_SECOND_OPERAND_NULL);
     218                    _("Second psBitSet operand can not be NULL."));
    219219            psFree(outBitSet);
    220220            return NULL;
     
    223223        if (inBitSet1->n != inBitSet2->n) {
    224224            psError(PS_ERR_BAD_PARAMETER_SIZE, true,
    225                     PS_ERRORTEXT_psBitSet_OPERANDS_SIZE_DIFFER);
     225                    _("The psBitSet operand must be the same size."));
    226226            psFree(outBitSet);
    227227            return NULL;
     
    274274    if (inBitSet == NULL) {
    275275        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    276                 PS_ERRORTEXT_psBitSet_OPERAND_NULL);
     276                _("Operand can not be NULL."));
    277277        psFree(outBitSet);
    278278        return NULL;
     
    283283    if (outBitSet == NULL) {
    284284        psError(PS_ERR_UNKNOWN, false,
    285                 PS_ERRORTEXT_psBitSet_NOT_OP_FAILED);
     285                _("Could not perform NOT operation."));
    286286    }
    287287
  • trunk/psLib/src/types/psHash.c

    r7914 r8232  
    1212*  @author GLG, MHPCC
    1313*
    14 *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2006-07-15 02:57:12 $
     14*  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2006-08-08 23:32:23 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2727#include "psAssert.h"
    2828
    29 #include "psErrorText.h"
     29
    3030
    3131static psHashBucket* hashBucketAlloc(const char *key, psPtr data, psHashBucket* next);
     
    240240    if ((table == NULL) || (key == NULL)) {
    241241        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    242                 PS_ERRORTEXT_psHash_KEY_NULL);
     242                _("Input key can not be NULL."));
    243243        return NULL;
    244244    }
  • trunk/psLib/src/types/psList.c

    r7914 r8232  
    66 *  @author Robert Daniel DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.50 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2006-07-15 02:57:12 $
     8 *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2006-08-08 23:32:23 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2121#include "psLogMsg.h"
    2222
    23 #include "psErrorText.h"
     23
    2424
    2525#define ITER_INIT_HEAD ((psPtr )1)         // next iteration should return head
     
    206206    if (location < 0 || location >= (int)list->n) {
    207207        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    208                 PS_ERRORTEXT_psList_LOCATION_INVALID,
     208                _("Specified location, %d, is invalid."),
    209209                location);
    210210        return false;
     
    248248    if (list == NULL) {
    249249        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    250                 PS_ERRORTEXT_psList_LIST_NULL);
     250                _("Specified psList reference is NULL."));
    251251        return false;
    252252    }
     
    254254    if (data == NULL) {
    255255        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    256                 PS_ERRORTEXT_psList_DATA_NULL);
     256                _("Specified data item is NULL."));
    257257        return false;
    258258    }
     
    283283    if (data == NULL) {
    284284        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    285                 PS_ERRORTEXT_psList_DATA_NULL);
     285                _("Specified data item is NULL."));
    286286        return false;
    287287    }
     
    289289    if (iterator == NULL) {
    290290        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    291                 PS_ERRORTEXT_psList_ITERATOR_NULL);
     291                _("Specified iterator is NULL."));
    292292        return false;
    293293    }
     
    296296    if (!iterator->mutable) {
    297297        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    298                 PS_ERRORTEXT_psList_ITERATOR_NONMUTABLE);
     298                _("Specified iterator indicates list is non-mutable."));
    299299        return false;
    300300    }
     
    305305    if (cursor == NULL && list->head != NULL) {
    306306        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    307                 PS_ERRORTEXT_psList_ITERATOR_INVALID);
     307                _("Specified iterator is not valid."));
    308308        return false;
    309309    }
     
    352352    if (data == NULL) {
    353353        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    354                 PS_ERRORTEXT_psList_DATA_NULL);
     354                _("Specified data item is NULL."));
    355355        return false;
    356356    }
     
    358358    if (iterator == NULL) {
    359359        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    360                 PS_ERRORTEXT_psList_ITERATOR_NULL);
     360                _("Specified iterator is NULL."));
    361361        return false;
    362362    }
     
    365365    if (!iterator->mutable) {
    366366        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    367                 PS_ERRORTEXT_psList_ITERATOR_NONMUTABLE);
     367                _("Specified iterator indicates list is non-mutable."));
    368368        return false;
    369369    }
     
    374374    if (cursor == NULL && list->head != NULL) {
    375375        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    376                 PS_ERRORTEXT_psList_ITERATOR_INVALID);
     376                _("Specified iterator is not valid."));
    377377        return false;
    378378    }
     
    422422    if (list == NULL) {
    423423        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    424                 PS_ERRORTEXT_psList_LIST_NULL);
     424                _("Specified psList reference is NULL."));
    425425        return false;
    426426    }
     
    440440    if (list == NULL) {
    441441        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    442                 PS_ERRORTEXT_psList_LIST_NULL);
     442                _("Specified psList reference is NULL."));
    443443        return false;
    444444    }
     
    446446    if (data == NULL) {
    447447        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    448                 PS_ERRORTEXT_psList_DATA_NULL);
     448                _("Specified data item is NULL."));
    449449        return false;
    450450    }
     
    458458    if (elem == NULL) {
    459459        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    460                 PS_ERRORTEXT_psList_DATA_NOT_FOUND);
     460                _("Specified data item is not found in the psList."));
    461461        return false;
    462462    }
     
    473473    if (list == NULL) {
    474474        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    475                 PS_ERRORTEXT_psList_LIST_NULL);
     475                _("Specified psList reference is NULL."));
    476476        return NULL;
    477477    }
     
    485485    if (! psListIteratorSet(iterator,location)) {
    486486        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    487                 PS_ERRORTEXT_psList_LOCATION_INVALID,
     487                _("Specified location, %d, is invalid."),
    488488                location);
    489489        return NULL;
  • trunk/psLib/src/types/psLookupTable.c

    r7943 r8232  
    77*  @author Ross Harman, MHPCC
    88*
    9 *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2006-07-20 13:00:10 $
     9*  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2006-08-08 23:32:23 $
    1111*
    1212*  Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
     
    2525#include "psError.h"
    2626#include "psLookupTable.h"
    27 #include "psErrorText.h"
     27
    2828#include "psAssert.h"
    2929
     
    487487        // Open specified file
    488488        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."),
    490490                    filename);
    491491            psFree(outputArray);
     
    813813        if(hiIdx >= numRows) {
    814814            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    815                     PS_ERRORTEXT_psLookupTable_INTERPOLATE_HIGH, hiIdx);
     815                    _("High index too big, %d."), hiIdx);
    816816            return NAN;
    817817        }
     
    823823    if(loIdx < 0) {
    824824        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    825                 PS_ERRORTEXT_psLookupTable_INTERPOLATE_LOW, loIdx);
     825                _("Low index too small, %d."), loIdx);
    826826        return NAN;
    827827    }
     
    832832    denom -= convertVal;
    833833    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."));
    835835        return NAN;
    836836    } else {
  • trunk/psLib/src/types/psMetadata.c

    r7937 r8232  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.120 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2006-07-19 03:43:14 $
     14 *  @version $Revision: 1.121 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-08-08 23:32:23 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3636#include "psLookupTable.h"
    3737#include "psString.h"
    38 #include "psErrorText.h"
     38
    3939#include "psAssert.h"
    4040#include "psLogMsg.h"
     
    319319        break;
    320320    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);
    322322        psFree(metadataItem);
    323323        metadataItem = NULL;
     
    554554            // add to the hash's list of duplicate entries
    555555            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);
    557557                return false;
    558558            }
     
    565565            // treat as if new (added to list below)
    566566            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);
    568568                return false;
    569569            }
     
    578578            }
    579579            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."));
    581581            return false;
    582582        }
     
    586586        // Node doesn't exist - Add new metadata item to metadata collection's hash
    587587        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);
    589589            return false;
    590590        }
     
    597597
    598598    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);
    600600        return false;
    601601    }
     
    635635
    636636    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."));
    638638        psFree(metadataItem);
    639639        return false;
     
    717717        psMetadataItem* entry = psHashLookup(mdTable,key);
    718718        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);
    720720            return false;
    721721        }
     
    739739        psMetadataItem* entry = psListGet(mdList, where);
    740740        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);
    742742            return false;
    743743        }
     
    745745
    746746        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);
    748748            return false;
    749749        }
     
    751751        psMetadataItem* tableItem = psHashLookup(mdTable, key);
    752752        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);
    754754            return false;
    755755        }
     
    760760        } else {
    761761            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);
    763763                return false;
    764764            }
     
    828828        }
    829829        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    830                 PS_ERRORTEXT_psMetadata_METATYPE_INVALID,
     830                _("Specified psDataType, %d, is not supported."),
    831831                metadataItem->type);
    832832        return NULL;
     
    928928    entry = (psMetadataItem*) psListGet(md->list, location);
    929929    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);
    931931        return NULL;
    932932    }
     
    954954            regerror(regRtn, newIter->regex, errMsg, 256);
    955955            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    956                     PS_ERRORTEXT_psMetadata_REGEX_INVALID,
     956                    _("Specified regular expression is invalid.  %s."),
    957957                    errMsg);
    958958            psFree(newIter);
     
    13331333                default:
    13341334                    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);
    13361336                    return false;
    13371337                }
  • trunk/psLib/src/types/psMetadataConfig.c

    r8146 r8232  
    1010*  @author Eric Van Alst, MHPCC
    1111*
    12 *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2006-08-04 22:58:58 $
     12*  @version $Revision: 1.70 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2006-08-08 23:32:23 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3232#include "psMetadataConfig.h"
    3333#include "psAssert.h"
    34 #include "psErrorText.h"
     34
    3535
    3636/******************************************************************************/
     
    399399                *status = 1;
    400400                psError(PS_ERR_BAD_PARAMETER_VALUE,true,
    401                         PS_ERRORTEXT_psMetadataIO_TYPE_INVALID,
     401                        _("Specified type, %d, is not supported."),
    402402                        elemType);
    403403            }
     
    510510        default: \
    511511            psError(PS_ERR_BAD_PARAMETER_TYPE,true, \
    512                     PS_ERRORTEXT_psMetadata_METATYPE_INVALID, (int)type); \
     512                    _("Specified psDataType, %d, is not supported."), (int)type); \
    513513            success = false; \
    514514        } \
     
    542542        } else {
    543543            psError(PS_ERR_BAD_PARAMETER_TYPE,true,
    544                     PS_ERRORTEXT_psMetadata_METATYPE_INVALID, (int)type);
     544                    _("Specified psDataType, %d, is not supported."), (int)type);
    545545            success = false;
    546546        }
     
    551551    default:
    552552        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
    553                 PS_ERRORTEXT_psMetadata_FORMAT_INVALID, *fType);
     553                _("Specified print format, %%%c, is not supported."), *fType);
    554554        break;
    555555    }
     
    709709    // Check for no type
    710710    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,
    712712                fileName);
    713713        returnValue = false;
     
    741741                vectorType = PS_TYPE_F64;
    742742            } 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,
    744744                        strType, lineCount, fileName);
    745745                psFree(strType);
     
    786786                        // Check for add failure
    787787                        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."),
    789789                                    keyName, lineCount, fileName);
    790790                            psFree(strType);
     
    795795                    } else {
    796796                        // 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."),
    798798                                keyName,lineCount,fileName);
    799799                        psFree(strType);
     
    805805            }
    806806            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."),
    808808                        strType, lineCount,fileName);
    809809                psFree(strType);
     
    822822        strValue = getToken(&linePtr, "#", &status,true);
    823823        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,
    825825                    fileName);
    826826            psFree(strType);
     
    829829        }
    830830        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,
    832832                    fileName);
    833833            psFree(strType);
     
    839839        strComment = getToken(&linePtr,"~", &status,true);
    840840        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,
    842842                    fileName);
    843843            psFree(strType);
     
    864864                                      strComment, tempBool);
    865865        } 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,
    867867                    strType, lineCount, fileName);
    868868            returnValue = false;
     
    878878        } else {
    879879            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,
    881881                    fileName);
    882882            returnValue = false;
     
    888888            addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, mdType | flags, strComment, tempInt);
    889889        } 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,
    891891                    strType, lineCount, fileName);
    892892            returnValue = false;
     
    898898            addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, mdType | flags, strComment, tempInt);
    899899        } 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,
    901901                    strType, lineCount, fileName);
    902902            returnValue = false;
     
    908908            addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, mdType | flags, strComment, tempInt);
    909909        } 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,
    911911                    strType, lineCount, fileName);
    912912            returnValue = false;
     
    918918            addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, mdType | flags, strComment, tempUint);
    919919        } 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,
    921921                    strType, lineCount, fileName);
    922922            returnValue = false;
     
    928928            addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, mdType | flags, strComment, tempUint);
    929929        } 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,
    931931                    strType, lineCount, fileName);
    932932            returnValue = false;
     
    938938            addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, mdType | flags, strComment, tempUint);
    939939        } 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,
    941941                    strType, lineCount, fileName);
    942942            returnValue = false;
     
    958958                                      strComment, mTime);
    959959        } 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,
    961961                    strType, lineCount, fileName);
    962962            returnValue = false;
     
    971971                                      strComment, tempVec);
    972972        } 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,
    974974                    strType, lineCount, fileName);
    975975            returnValue = false;
     
    983983        for(psS32 k=0; k < nonUniqueKeys->n; k++) {
    984984            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."),
    986986                        lineCount,fileName);
    987987                psFree(strType);
     
    10091009        break;
    10101010    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."),
    10121012                lineCount,fileName);
    10131013        break;
     
    10571057        if(repeatedChars(linePtr, '@') > 1) {
    10581058            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);
    10601060            return false;
    10611061        }
     
    10651065        if(status) {
    10661066            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);
    10681068            psFree(keyName);
    10691069            return false;
     
    10751075            strType = getToken(&linePtr," ",&status,true);
    10761076            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,
    10781078                        fileName);
    10791079                psFree(keyName);
     
    10891089                    // Compare type name with the list of current types
    10901090                    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."),
    10921092                                strType,lineCount,fileName);
    10931093                        psFree(tempTemplate);
     
    11041104                psFree(tempTemplate);
    11051105            } 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."),
    11071107                        strType,lineCount,fileName);
    11081108                psFree(keyName);
     
    11871187    // Attempt to open specified file
    11881188    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);
    11901190        return NULL;
    11911191    }
     
    12461246            // XXX : this is probably not the right error value
    12471247            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);
    12491249            psFree(keys);
    12501250            psFree(format);
     
    13851385            psStringAppend(&content, "PS_TIME_TT  ");
    13861386        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);
    13881388            psFree(content);
    13891389            return NULL;
     
    14691469        default:
    14701470            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);
    14721472            psFree(content);
    14731473            return NULL;
     
    14811481    default:
    14821482        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    1483                 PS_ERRORTEXT_psMetadata_METATYPE_INVALID, item->type);
     1483                _("Specified psDataType, %d, is not supported."), item->type);
    14841484        psFree(content);
    14851485        return NULL;
  • trunk/psLib/src/types/psPixels.c

    r7914 r8232  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-07-15 02:57:12 $
     9 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-08-08 23:32:23 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2020
    2121#include "psError.h"
    22 #include "psErrorText.h"
     22
    2323
    2424typedef int(*qsortCompareFcn)(const void *, const void *);
     
    133133{
    134134    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."));
    136136        psFree(out);
    137137        return NULL;
     
    154154    if (pixels == NULL) {
    155155        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    156                 PS_ERRORTEXT_psPixels_NULL);
     156                _("Input psPixels can not be NULL."));
    157157        psFree(out);
    158158        return NULL;
     
    161161    if (data == NULL) {
    162162        psError(PS_ERR_BAD_PARAMETER_SIZE, true,
    163                 PS_ERRORTEXT_psPixels_DATA_NULL);
     163                _("Input psPixels contains no data."));
    164164        psFree(out);
    165165        return NULL;
     
    173173    if ( (x0 < 0 || x1 < 0) || (y0 < 0 || y1 < 0) ) {
    174174        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."),
    176176                (int)y0,(int)y1,(int)x0,(int)x1);
    177177        psFree(out);
     
    186186    if (numRows < 1 || numCols < 1) {
    187187        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."),
    189189                (int)y0,(int)y1,(int)x0,(int)x1);
    190190        psFree(out);
     
    196196    if (out == NULL) {
    197197        psError(PS_ERR_UNKNOWN, false,
    198                 PS_ERRORTEXT_psPixels_FAILED_IMAGE_CREATE,
     198                _("Failed to create image of size %dx%d."),
    199199                numCols, numRows);
    200200        return NULL;
     
    232232    if (mask == NULL) {
    233233        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    234                 PS_ERRORTEXT_psPixels_MASK_NULL);
     234                _("Specified mask can not be NULL."));
    235235        psFree(out);
    236236        return NULL;
     
    240240        PS_TYPE_NAME(typeStr,mask->type.type);
    241241        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."),
    243243                typeStr);
    244244        psFree(out);
     
    295295    if (pixels == NULL) {
    296296        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    297                 PS_ERRORTEXT_psPixels_NULL);
     297                _("Input psPixels can not be NULL."));
    298298        return NULL;
    299299    }
     
    363363{
    364364    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."));
    366366        return false;
    367367    }
     
    397397    psPixelCoord out;
    398398    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."));
    400400        out.x = 0; //XXX: should be NAN when changed to float
    401401        out.y = 0; //XXX: should be NAN when changed to float
Note: See TracChangeset for help on using the changeset viewer.