IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 3, 2004, 3:05:00 PM (22 years ago)
Author:
desonia
Message:

changed the psError signature to match SDRS. Also made misc. cleanups as
I was combing the files.

Location:
trunk/psLib/src/astronomy
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astronomy/psAstrometry.c

    r2222 r2273  
    88 *  @author George Gusciora, MHPCC
    99 *
    10  *  @version $Revision: 1.49 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-10-27 23:49:00 $
     10 *  @version $Revision: 1.50 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-11-04 01:04:57 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2525#include "psError.h"
    2626#include "psConstants.h"
     27#include "psAstronomyErrors.h"
     28
    2729#include "slalib.h"
    2830
     
    868870    // generate an error if cell->toTP is not linear.
    869871    if (0 == isProjectionLinear(cell->toTP)) {
    870         psError(__func__, "the cell->toTP transfrom is not linear.\n");
     872        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     873                PS_ERRORTEXT_psAstrometry_NONLINEAR_TRANSFORM,
     874                "cell to tangent plane");
    871875    }
    872876
  • trunk/psLib/src/astronomy/psAstronomyErrors.dat

    r2204 r2273  
    77#  N.B. in code, the ERRORNAME appears as PS_ERRORTEXT_ERRORNAME
    88####################################################################
     9psTime_FILE_NOT_FOUND                  Failed to open file %s.  No %s information is available.
     10psTime_FILE_TOO_MANY_ROWS              Too many rows found in file %s. Max number of rows allowed is %d.
     11psTime_TIME_POSTDATES_TABLE            Specified psTime postdates (%g) the table of %s information.
     12psTime_TIME_PREDATES_TABLE             Specified psTime predates (%g) the table of %s information.
     13psTime_TABLE_DUPLICATE_ROWS            The %s table was found to have two rows of the same time value.
     14psTime_TYPE_UNKNOWN                    Specified type, %d, is not supported.
     15psTime_TYPE_MISMATCH                   Specified psTime parameters must have same type.
     16psTime_GET_TOD_FAILED                  Failed to determine the current time from gettimeofday function.
     17psTime_CONVERT_TIME_TO_STRING_FAILED   Failed to convert a time via strftime function.
     18psTime_APPEND_MSEC_FAILED              Failed to append millisecond to time string with snprintf function.
     19psTime_USEC_INVALID                    The psTime usec attribute value, %u, is invalid.  Must be less than 1e6.
     20psTime_ISOTIME_MALFORMED               Specified ISO Time string, '%s', is malformed.  Must be in 'YYYY-MM-DDThh:mm:ss.sss' format.
     21#
     22psCoord_PROJECTION_TYPE_UNDEFINED      The projection type, %s, is undefined.
     23psCoord_PROJECTION_TYPE_UNKNOWN        The projection type, %d, is unknown.
     24psCoord_UNITS_UNKNOWN                  Specified units, 0x%x, is not supported.
     25psCoord_OFFSET_MODE_UNKNOWN            Specified offset mode, 0x%x, is not supported.
     26#
     27psAstrometry_NONLINEAR_TRANSFORM       The %s transfrom is not linear.  Only linear transforms are supported.
     28#
     29psMetadata_METATYPE_INVALID            Specified psMetadataType, %d, is not supported.
     30psMetadata_ADD_LIST_FAILED             Failed to add metadata item, %s, to items list.
     31psMetadata_ADD_TABLE_FAILED            Failed to add metadata item, %s, to items table.
     32psMetadata_REMOVE_LIST_FAILED          Failed to remove metadata item, %s, from metadata list.
     33psMetadata_REMOVE_LIST_INDEX_FAILED    Failed to remove metadata item, at index %d, from metadata list.
     34psMetadata_REMOVE_TABLE_FAILED         Failed to remove metadata item, %s, from metadata table.
     35psMetadata_ADD_COLLECTION_FAILED       Failed to add metadata item, %s, to metadata collection list.
     36psMetadata_ADD_FAILED                  Failed to add metadata item to metadata collection list.
     37psMetadata_FIND_FAILED                 Could not find metadata item, %s.
     38psMetadata_FIND_INDEX_FAILED           Could not find metadata item at index %d.
     39#
     40psMetadataIO_TYPE_INVALID              Specified type, %d, is not supported.
     41psMetadataIO_EXTNUM_NOTPOSITIVE        Specified extension number, %d, is invalid.  Value must be positive if no extension name is given.
     42psMetadataIO_FITS_METATYPE_INVALID     Specified FITS metadata type, %c, is not supported.
     43psMetadataIO_ADD_FAILED                Failed to add metadata item, %s.
     44psMetadataIO_FILE_OPEN_FAILED          Failed to open file '%s'.  Check if it exists and it has the proper permissions.
     45psMetadataIO_FILE_MULTIPLE_CHAR        More than one '%c' character not allowed.  Found on line %d of %s.
     46psMetadataIO_FILE_ELEMENT_NULL         Failed to read a metadata %s on line %d of %s.
     47psMetadataIO_FILE_TYPE_INVALID         Metadata type '%s', found on line %d of %s, is not invalid.
     48psMetadataIO_OVERWRITE_ITEM            Duplicate Metadata item, %s, found on line %d of %s.  Overwrite not allowed.
     49psMetadataIO_PARSE_FAILED              Failed to parse the value '%s' of metadata item %s, type %s, on line %d of %s.
     50
     51
  • trunk/psLib/src/astronomy/psAstronomyErrors.h

    r2210 r2273  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-10-27 19:35:55 $
     9 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-11-04 01:04:57 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3030
    3131//~Start #define PS_ERRORTEXT_$1 "$2"
     32#define PS_ERRORTEXT_psTime_FILE_NOT_FOUND "Failed to open file %s.  No %s information is available."
     33#define PS_ERRORTEXT_psTime_FILE_TOO_MANY_ROWS "Too many rows found in file %s. Max number of rows allowed is %d."
     34#define PS_ERRORTEXT_psTime_TIME_POSTDATES_TABLE "Specified psTime postdates (%g) the table of %s information."
     35#define PS_ERRORTEXT_psTime_TIME_PREDATES_TABLE "Specified psTime predates (%g) the table of %s information."
     36#define PS_ERRORTEXT_psTime_TABLE_DUPLICATE_ROWS "The %s table was found to have two rows of the same time value."
     37#define PS_ERRORTEXT_psTime_TYPE_UNKNOWN "Specified type, %d, is not supported."
     38#define PS_ERRORTEXT_psTime_TYPE_MISMATCH "Specified psTime parameters must have same type."
     39#define PS_ERRORTEXT_psTime_GET_TOD_FAILED "Failed to determine the current time from gettimeofday function."
     40#define PS_ERRORTEXT_psTime_CONVERT_TIME_TO_STRING_FAILED "Failed to convert a time via strftime function."
     41#define PS_ERRORTEXT_psTime_APPEND_MSEC_FAILED "Failed to append millisecond to time string with snprintf function."
     42#define PS_ERRORTEXT_psTime_USEC_INVALID "The psTime usec attribute value, %u, is invalid.  Must be less than 1e6."
     43#define PS_ERRORTEXT_psTime_ISOTIME_MALFORMED "Specified ISO Time string, '%s', is malformed.  Must be in 'YYYY-MM-DDThh:mm:ss.sss' format."
     44#define PS_ERRORTEXT_psCoord_PROJECTION_TYPE_UNDEFINED "The projection type, %s, is undefined."
     45#define PS_ERRORTEXT_psCoord_PROJECTION_TYPE_UNKNOWN "The projection type, %d, is unknown."
     46#define PS_ERRORTEXT_psCoord_UNITS_UNKNOWN "Specified units, 0x%x, is not supported."
     47#define PS_ERRORTEXT_psCoord_OFFSET_MODE_UNKNOWN "Specified offset mode, 0x%x, is not supported."
     48#define PS_ERRORTEXT_psAstrometry_NONLINEAR_TRANSFORM "The %s transfrom is not linear.  Only linear transforms are supported. "
     49#define PS_ERRORTEXT_psMetadata_METATYPE_INVALID "Specified psMetadataType, %d, is not supported."
     50#define PS_ERRORTEXT_psMetadata_ADD_LIST_FAILED "Failed to add metadata item, %s, to items list."
     51#define PS_ERRORTEXT_psMetadata_ADD_TABLE_FAILED "Failed to add metadata item, %s, to items table."
     52#define PS_ERRORTEXT_psMetadata_REMOVE_LIST_FAILED "Failed to remove metadata item, %s, from metadata list."
     53#define PS_ERRORTEXT_psMetadata_REMOVE_LIST_INDEX_FAILED "Failed to remove metadata item, at index %d, from metadata list."
     54#define PS_ERRORTEXT_psMetadata_REMOVE_TABLE_FAILED "Failed to remove metadata item, %s, from metadata table."
     55#define PS_ERRORTEXT_psMetadata_ADD_COLLECTION_FAILED "Failed to add metadata item, %s, to metadata collection list."
     56#define PS_ERRORTEXT_psMetadata_ADD_FAILED "Failed to add metadata item to metadata collection list."
     57#define PS_ERRORTEXT_psMetadata_FIND_FAILED "Could not find metadata item, %s."
     58#define PS_ERRORTEXT_psMetadata_FIND_INDEX_FAILED "Could not find metadata item at index %d."
     59#define PS_ERRORTEXT_psMetadataIO_TYPE_INVALID "Specified type, %d, is not supported."
     60#define PS_ERRORTEXT_psMetadataIO_EXTNUM_NOTPOSITIVE "Specified extension number, %d, is invalid.  Value must be positive if no extension name is given."
     61#define PS_ERRORTEXT_psMetadataIO_FITS_METATYPE_INVALID "Specified FITS metadata type, %c, is not supported."
     62#define PS_ERRORTEXT_psMetadataIO_ADD_FAILED "Failed to add metadata item, %s."
     63#define PS_ERRORTEXT_psMetadataIO_FILE_OPEN_FAILED "Failed to open file '%s'.  Check if it exists and it has the proper permissions."
     64#define PS_ERRORTEXT_psMetadataIO_FILE_MULTIPLE_CHAR "More than one '%c' character not allowed.  Found on line %d of %s."
     65#define PS_ERRORTEXT_psMetadataIO_FILE_ELEMENT_NULL "Failed to read a metadata %s on line %d of %s."
     66#define PS_ERRORTEXT_psMetadataIO_FILE_TYPE_INVALID "Metadata type '%s', found on line %d of %s, is not invalid."
     67#define PS_ERRORTEXT_psMetadataIO_OVERWRITE_ITEM "Duplicate Metadata item, %s, found on line %d of %s.  Overwrite not allowed."
     68#define PS_ERRORTEXT_psMetadataIO_PARSE_FAILED "Failed to parse the value '%s' of metadata item %s, type %s, on line %d of %s."
    3269//~End
    3370
  • trunk/psLib/src/astronomy/psCoord.c

    r2221 r2273  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-10-27 23:31:43 $
     12*  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-11-04 01:04:57 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2727#include "psConstants.h"
    2828#include "psError.h"
     29#include "psAstronomyErrors.h"
    2930#include <math.h>
    3031#include <float.h>
     
    278279
    279280    } else if (projection->type == PS_PROJ_PAR) {
    280         psError(__func__, "The projection type PS_PROJ_PAR is undefined.\n");
     281        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     282                PS_ERRORTEXT_psCoord_PROJECTION_TYPE_UNDEFINED,
     283                "PS_PROJ_PAR");
    281284
    282285    } else if (projection->type == PS_PROJ_GLS) {
    283         psError(__func__, "The projection type PS_PROJ_GLS is undefined.\n");
     286        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     287                PS_ERRORTEXT_psCoord_PROJECTION_TYPE_UNDEFINED,
     288                "PS_PROJ_GLS");
    284289    } else {
    285         psError(__func__, "Unknown projection type.\n");
     290        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     291                PS_ERRORTEXT_psCoord_PROJECTION_TYPE_UNKNOWN,
     292                projection->type);
    286293    }
    287294
     
    333340
    334341    } else if (projection->type == PS_PROJ_PAR) {
    335         psError(__func__, "The projection type PS_PROJ_PAR is undefined.\n");
     342        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     343                PS_ERRORTEXT_psCoord_PROJECTION_TYPE_UNDEFINED,
     344                "PS_PROJ_PAR");
    336345
    337346    } else if (projection->type == PS_PROJ_GLS) {
    338         psError(__func__, "The projection type PS_PROJ_GLG is undefined.\n");
     347        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     348                PS_ERRORTEXT_psCoord_PROJECTION_TYPE_UNDEFINED,
     349                "PS_PROJ_GLS");
    339350    } else {
    340         psError(__func__, "Unknown projection type.\n");
     351        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     352                PS_ERRORTEXT_psCoord_PROJECTION_TYPE_UNKNOWN,
     353                projection->type);
    341354    }
    342355
     
    407420        } else if (unit == PS_RADIAN) {}
    408421        else {
    409             psError(__func__, "Unknown offset unit: 0x%x\n", unit);
     422            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     423                    PS_ERRORTEXT_psCoord_UNITS_UNKNOWN,
     424                    unit);
    410425        }
    411426
     
    413428    }
    414429
    415     psError(__func__, "Unrecognized offset mode\n");
     430    psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     431            PS_ERRORTEXT_psCoord_OFFSET_MODE_UNKNOWN,
     432            mode);
    416433    return (NULL);
    417434}
     
    469486            tmpD = offset->d;
    470487        } else {
    471             psError(__func__, "Unknown offset unit: 0x%x\n", unit);
     488            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     489                    PS_ERRORTEXT_psCoord_UNITS_UNKNOWN,
     490                    unit);
    472491        }
    473492
     
    483502    }
    484503
    485     psError(__func__, "Unrecognized offset mode\n");
     504    psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     505            PS_ERRORTEXT_psCoord_OFFSET_MODE_UNKNOWN,
     506            mode);
     507
    486508    return (NULL);
    487509}
  • trunk/psLib/src/astronomy/psMetadata.c

    r2204 r2273  
    1212*  @author Ross Harman, MHPCC
    1313*
    14 *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2004-10-27 00:57:30 $
     14*  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2004-11-04 01:04:57 $
    1616*
    1717*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3535#include "psMetadata.h"
    3636#include "psString.h"
     37#include "psAstronomyErrors.h"
     38#include "psConstants.h"
    3739
    3840/******************************************************************************/
     
    123125
    124126
    125     if (name == NULL) {
    126         psError(__func__, "Null value for name not allowed");
    127         return NULL;
    128     }
     127    PS_PTR_CHECK_NULL(name,NULL);
     128
    129129    // Allocate metadata item
    130130    metadataItem = (psMetadataItem* ) psAlloc(sizeof(psMetadataItem));
     
    147147    // Set metadata item type
    148148    metadataItem->type = type;
     149    metadataItem->data.V = NULL;
     150
     151    // Allocate metadata items with same name.
     152    metadataItem->items = psListAlloc(NULL);
     153
     154    // Allocate and set metadata item name
     155    metadataItem->name = (char *)psAlloc(sizeof(char) * MAX_STRING_LENGTH);
     156    vsprintf(metadataItem->name, name, argPtr);
    149157
    150158    // Set metadata item value
    151159    switch (type) {
    152160    case PS_META_ITEM_SET:
    153         metadataItem->data.V = NULL;
    154161        break;
    155162    case PS_META_BOOL:
     
    180187    case PS_META_UNKNOWN:
    181188    default:
    182         psError(__func__, "Invalid psMetadataType: %d", type);
    183     }
    184 
    185     // Allocate and set metadata item name
    186     metadataItem->name = (char *)psAlloc(sizeof(char) * MAX_STRING_LENGTH);
    187     vsprintf(metadataItem->name, name, argPtr);
    188 
    189     // Allocate metadata items with same name.
    190     metadataItem->items = psListAlloc(NULL);
     189        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     190                PS_ERRORTEXT_psMetadata_METATYPE_INVALID,
     191                type);
     192        psFree(metadataItem);
     193        metadataItem = NULL;
     194    }
    191195
    192196    return metadataItem;
     
    224228    psMetadataType newType = PS_META_ITEM_SET;
    225229
    226     if(md == NULL) {
    227         psError( __func__, "Null metadata collection not allowed" );
    228         return false;
    229     }
    230 
    231     if(metadataItem == NULL) {
    232         psError( __func__, "Null metadata item not allowed" );
    233         return false;
    234     }
     230    PS_PTR_CHECK_NULL(md,NULL);
     231    PS_PTR_CHECK_NULL(md->table,NULL);
     232    PS_PTR_CHECK_NULL(md->list,NULL);
     233    PS_PTR_CHECK_NULL(metadataItem,NULL);
     234    PS_PTR_CHECK_NULL(metadataItem->name,NULL);
    235235
    236236    newType = metadataItem->type;
    237 
    238237    mdTable = md->table;
    239     if(mdTable == NULL) {
    240         psError( __func__, "Null metadata table not allowed" );
    241         return false;
    242     }
    243 
    244238    mdList = md->list;
    245     if(mdList == NULL) {
    246         psError( __func__, "Null metadata list not allowed");
    247         return false;
    248     }
    249 
    250239    key = metadataItem->name;
    251     if(key == NULL) {
    252         psError(__func__, "Null key item not allowed");
    253         return false;
    254     }
    255240
    256241    // See if key is already in table
     
    262247            // Add leaf node to existing folder node
    263248            if(!psListAdd(existingEntry->items, PS_LIST_TAIL, metadataItem)) {
    264                 psError( __func__, "Couldn't add metadata item to items list. Name: %s",
    265                          metadataItem->name );
     249                psError(PS_ERR_UNKNOWN,false,
     250                        PS_ERRORTEXT_psMetadata_ADD_LIST_FAILED,
     251                        metadataItem->name );
    266252                return false;
    267253            }
     
    272258
    273259            if(!psListAdd(newFolderEntry->items, PS_LIST_TAIL, existingEntry)) {
    274                 psError( __func__, "Couldn't add metadata item to items list. Name: %s", key);
     260                psError(PS_ERR_UNKNOWN,false,
     261                        PS_ERRORTEXT_psMetadata_ADD_LIST_FAILED,
     262                        key);
    275263                psFree(newFolderEntry);
    276264                return false;
     
    278266
    279267            if(!psListAdd(newFolderEntry->items, PS_LIST_TAIL, metadataItem)) {
    280                 psError( __func__, "Couldn't add metadata item to items list. Name: %s", key);
     268                psError(PS_ERR_UNKNOWN,false,
     269                        PS_ERRORTEXT_psMetadata_ADD_LIST_FAILED,
     270                        key);
    281271                psFree(newFolderEntry);
    282272                return false;
     
    284274
    285275            if(!psHashRemove(mdTable, key)) {
    286                 psError( __func__, "Couldn't remove metadata item from metadata table. Name: %s", key);
     276                psError(PS_ERR_UNKNOWN,false,
     277                        PS_ERRORTEXT_psMetadata_REMOVE_TABLE_FAILED,
     278                        key);
    287279                psFree(newFolderEntry);
    288280                return false;
     
    290282
    291283            if(!psHashAdd(mdTable, key, newFolderEntry)) {
    292                 psError( __func__, "Couldn't add metadata item to metadata table. Name: %s", key);
     284                psError(PS_ERR_UNKNOWN,false,
     285                        PS_ERRORTEXT_psMetadata_ADD_TABLE_FAILED,
     286                        key);
    293287                psFree(newFolderEntry);
    294288                return false;
     
    301295            // Folder node replaces leaf or folder node - Put old node into new folder and remove from table
    302296            if(!psListAdd(metadataItem->items, PS_LIST_TAIL, existingEntry)) {
    303                 psError( __func__, "Couldn't add metadata item to items list. Name: %s", key);
     297                psError(PS_ERR_UNKNOWN,false,
     298                        PS_ERRORTEXT_psMetadata_ADD_LIST_FAILED,
     299                        key);
    304300                return false;
    305301            }
    306302
    307303            if(!psHashRemove(mdTable, key)) {
    308                 psError( __func__, "Couldn't remove metadata item from metadata table. Name: %s", key);
     304                psError(PS_ERR_UNKNOWN,false,
     305                        PS_ERRORTEXT_psMetadata_REMOVE_TABLE_FAILED,
     306                        key);
    309307                return false;
    310308            }
    311309
    312310            if(!psHashAdd(mdTable, key, metadataItem)) {
    313                 psError( __func__, "Couldn't add metadata item to metadata table. Name: %s", key);
     311                psError(PS_ERR_UNKNOWN,false,
     312                        PS_ERRORTEXT_psMetadata_ADD_TABLE_FAILED,
     313                        key);
    314314                return false;
    315315            }
     
    319319        // Node doesn't exist - Add new metadata item to metadata collection's hash
    320320        if(!psHashAdd(mdTable, key, metadataItem)) {
    321             psError( __func__, "Couldn't add metadata item to metadata table. Name: %s", key);
     321            psError(PS_ERR_UNKNOWN,false,
     322                    PS_ERRORTEXT_psMetadata_ADD_TABLE_FAILED,
     323                    key);
    322324            return false;
    323325        }
     
    328330    if(metadataItem->type != PS_META_ITEM_SET) {
    329331        if(!psListAdd(mdList, location, metadataItem)) {
    330             psError( __func__, "Couldn't add metadata item to metadata collection list. Name: %s",
    331                      metadataItem->name );
     332            psError(PS_ERR_UNKNOWN,false,
     333                    PS_ERRORTEXT_psMetadata_ADD_COLLECTION_FAILED,
     334                    key);
    332335            return false;
    333336        }
     
    348351
    349352    if (!psMetadataAddItem(md, metadataItem, where)) {
    350         psError(__func__, "Couldn't add metadata item to metadata collection list. Name: %s",
    351                 metadataItem->name);
     353        psError(PS_ERR_UNKNOWN,false,
     354                PS_ERRORTEXT_psMetadata_ADD_FAILED);
    352355        psFree(metadataItem);
    353356        return false;
     
    368371
    369372
    370     if (md == NULL) {
    371         psError(__func__, "Null metadata collection not allowed");
    372         return false;
    373     }
     373    PS_PTR_CHECK_NULL(md,NULL);
     374    PS_PTR_CHECK_NULL(md->table,NULL);
     375    PS_PTR_CHECK_NULL(md->list,NULL);
    374376
    375377    mdList = md->list;
    376     if (mdList == NULL) {
    377         psError(__func__, "Null metadata list not allowed");
    378         return false;
    379     }
    380 
    381378    mdTable = md->table;
    382     if (mdTable == NULL) {
    383         psError(__func__, "Null metadata table not allowed");
    384         return false;
    385     }
     379
    386380    // Select removal by key or index
    387381    if (key != NULL) {
     
    390384        entry = (psMetadataItem* ) psHashLookup(mdTable, key);
    391385        if (entry == NULL) {
    392             psError(__func__, "Couldn't find metadata item. Name: %s", key);
     386            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     387                    PS_ERRORTEXT_psMetadata_FIND_FAILED,
     388                    key);
    393389            return false;
    394390        }
     
    402398            while (entryChild != NULL) {
    403399                if (!psListRemove(mdList, PS_LIST_UNKNOWN, entryChild)) {
    404                     psError(__func__, "Couldn't remove metadata item from list. Name: %s", key);
     400                    psError(PS_ERR_UNKNOWN,false,
     401                            PS_ERRORTEXT_psMetadata_REMOVE_LIST_FAILED,
     402                            key);
    405403                    return false;
    406404                }
     
    411409            // Table entry has no children. Remove entry from metadata collection's list
    412410            if (!psListRemove(mdList, PS_LIST_UNKNOWN, entry)) {
    413                 psError(__func__, "Couldn't remove metadata item from list. Name: %s", key);
     411                psError(PS_ERR_UNKNOWN,false,
     412                        PS_ERRORTEXT_psMetadata_REMOVE_LIST_FAILED,
     413                        key);
    414414                return false;
    415415            }
     
    417417        // Remove entry from metadata collection's table
    418418        if (!psHashRemove(mdTable, key)) {
    419             psError(__func__, "Couldn't remove metadata item from table. Name: %s", key);
     419            psError(PS_ERR_UNKNOWN,false,
     420                    PS_ERRORTEXT_psMetadata_REMOVE_TABLE_FAILED,
     421                    key);
    420422            return false;
    421423        }
     
    425427        entry = psListGet(mdList, where);
    426428        if (entry == NULL) {
    427             psError(__func__, "Couldn't find metadata item in list. Index: %d", where);
     429            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     430                    PS_ERRORTEXT_psMetadata_FIND_INDEX_FAILED,
     431                    where);
    428432            return false;
    429433        }
     
    431435        key = entry->name;
    432436        if (key == NULL) {
    433             psError(__func__, "Null key name not allowed. Index: %d", where);
     437            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     438                    PS_ERRORTEXT_psMetadata_REMOVE_LIST_INDEX_FAILED,
     439                    where);
    434440            return false;
    435441        }
     
    447453
    448454
    449     if (md == NULL) {
    450         psError(__func__, "Null metadata collection not allowed");
    451         return NULL;
    452     }
     455    PS_PTR_CHECK_NULL(md,NULL);
     456    PS_PTR_CHECK_NULL(md->table,NULL);
     457    PS_PTR_CHECK_NULL(key,NULL);
    453458
    454459    mdTable = md->table;
    455     if (mdTable == NULL) {
    456         psError(__func__, "Null metadata table not allowed");
    457         return NULL;
    458     }
    459 
    460     if (key == NULL) {
    461         psError(__func__, "Null key name not allowed");
    462         return NULL;
    463     }
    464460
    465461    entry = (psMetadataItem* ) psHashLookup(mdTable, key);
     
    473469psMetadataItem* psMetadataGet(psMetadata* restrict md, psS32 where)
    474470{
     471    psMetadataItem* entry = NULL;
     472
     473    PS_PTR_CHECK_NULL(md,NULL);
     474    PS_PTR_CHECK_NULL(md->list,NULL);
     475
     476    entry = (psMetadataItem* ) psListGet(md->list, where);
     477    if (entry == NULL) {
     478        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     479                PS_ERRORTEXT_psMetadata_FIND_INDEX_FAILED,
     480                where);
     481        return NULL;
     482    }
     483
     484    return entry;
     485}
     486
     487psBool psMetadataSetIterator(psMetadata* restrict md, psS32 where)
     488{
     489    PS_PTR_CHECK_NULL(md,NULL);
     490    PS_PTR_CHECK_NULL(md->list,NULL);
     491
     492    psListSetIterator(md->list, where);
     493
     494    return true;
     495}
     496
     497psMetadataItem* psMetadataGetNext(psMetadata* restrict md, const char *restrict match, psS32 which)
     498{
    475499    psList* mdList = NULL;
    476500    psMetadataItem* entry = NULL;
    477501
    478502
    479     if (md == NULL) {
    480         psError(__func__, "Null metadata collection not allowed");
    481         return NULL;
    482     }
     503    PS_PTR_CHECK_NULL(md,NULL);
     504    PS_PTR_CHECK_NULL(md->list,NULL);
    483505
    484506    mdList = md->list;
    485     if (mdList == NULL) {
    486         psError(__func__, "Null metadata list not allowed");
    487         return NULL;
    488     }
    489 
    490     entry = (psMetadataItem* ) psListGet(mdList, where);
    491     if (entry == NULL) {
    492         psError(__func__, "Couldn't find metadata item with given index. Index: %d", where);
    493         return NULL;
    494     }
    495 
    496     return entry;
    497 }
    498 
    499 psBool psMetadataSetIterator(psMetadata* restrict md, psS32 where)
    500 {
    501     psList* mdList = NULL;
    502 
    503     if (md == NULL) {
    504         psError(__func__, "Null metadata collection not allowed");
    505         return false;
    506     }
    507 
    508     mdList = md->list;
    509     if (mdList == NULL) {
    510         psError(__func__, "Null metadata list not allowed");
    511         return false;
    512     }
    513 
    514     psListSetIterator(mdList, where);
    515 
    516     return true;
    517 }
    518 
    519 psMetadataItem* psMetadataGetNext(psMetadata* restrict md, const char *restrict match, psS32 which)
    520 {
    521     psList* mdList = NULL;
    522     psMetadataItem* entry = NULL;
    523 
    524 
    525     if (md == NULL) {
    526         psError(__func__, "Null metadata collection not allowed");
    527         return NULL;
    528     }
    529 
    530     mdList = md->list;
    531     if (mdList == NULL) {
    532         psError(__func__, "Null metadata list not allowed");
    533         return NULL;
    534     }
    535507
    536508    psListSetIterator(mdList, which);
     
    559531
    560532
    561     if (md == NULL) {
    562         psError(__func__, "Null metadata collection not allowed");
    563         return NULL;
    564     }
     533    PS_PTR_CHECK_NULL(md,NULL);
     534    PS_PTR_CHECK_NULL(md->list,NULL);
    565535
    566536    mdList = md->list;
    567     if (mdList == NULL) {
    568         psError(__func__, "Null metadata list not allowed");
    569         return NULL;
    570     }
    571537
    572538    psListSetIterator(mdList, which);
  • trunk/psLib/src/astronomy/psMetadataIO.c

    r2204 r2273  
    99*  @author Ross Harman, MHPCC
    1010*
    11 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-10-27 00:57:30 $
     11*  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2004-11-04 01:04:57 $
    1313*
    1414*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2929#include "psMetadata.h"
    3030#include "psMetadataIO.h"
     31#include "psConstants.h"
     32#include "psAstronomyErrors.h"
    3133
    3234
     
    3840#define FITS_ERROR(STRING,PS_ERROR) \
    3941fits_get_errstatus(status, fitsErr); \
    40 psError(__func__, STRING, PS_ERROR, fitsErr); \
     42psError(PS_ERR_IO,true, STRING, PS_ERROR, fitsErr); \
    4143status = 0; \
    4244fits_close_file(fd, &status); \
    4345if(status){ \
    4446    fits_get_errstatus(status, fitsErr); \
    45     psError(__func__, "Couldn't close FITS file. FITS error: %s", fitsErr); \
     47    psError(PS_ERR_IO,true, "Couldn't close FITS file. FITS error: %s", fitsErr); \
    4648} \
    4749status = 0; \
     
    281283            default:
    282284                *status = 1;
    283                 psError(__func__, "Invalid type: %d", elemType);
     285                psError(PS_ERR_BAD_PARAMETER_VALUE,true,
     286                        PS_ERRORTEXT_psMetadataIO_TYPE_INVALID,
     287                        elemType);
    284288            }
    285289
     
    302306    psMetadataType type;
    303307
    304     if (fd == NULL) {
    305         psError(__func__, "Null file descriptor not allowed");
    306         return;
    307     }
    308 
    309     if (format == NULL) {
    310         psError(__func__, "Null format not allowed");
    311         return;
    312     }
    313 
    314     if (metadataItem == NULL) {
    315         psError(__func__, "Null metadata not allowed");
    316         return;
    317     }
     308    PS_PTR_CHECK_NULL(fd,);
     309    PS_PTR_CHECK_NULL(format,);
     310    PS_PTR_CHECK_NULL(metadataItem,);
    318311
    319312    type = metadataItem->type;
     
    336329        break;
    337330    default:
    338         psError(__func__, " Invalid psMetadataType to print: %d", type);
     331        psError(PS_ERR_BAD_PARAMETER_TYPE,true,
     332                PS_ERRORTEXT_psMetadata_METATYPE_INVALID,
     333                (int)type);
    339334    }
    340335}
     
    358353    fitsfile *fd = NULL;
    359354
    360     if(fileName == NULL) {
    361         psError(__func__, "Null fileName not allowed");
    362         return NULL;
    363     }
     355    PS_PTR_CHECK_NULL(fileName,NULL);
    364356
    365357    fits_open_file(&fd, fileName, READONLY, &status);
     
    369361    }
    370362
    371     if (extName == NULL && extNum == 0) {
    372         psError(__func__, "Null extName and extNum = 0 not allowed");
    373         return NULL;
    374     } else if (extName && (extNum != -1) ) {
    375         psError(__func__, "If extName specified, extNum arguments should be -1.");
     363    if (extName == NULL && extNum < 1) {
     364        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     365                PS_ERRORTEXT_psMetadataIO_EXTNUM_NOTPOSITIVE,
     366                extNum);
    376367        return NULL;
    377368    }
     
    435426        case 'X':
    436427        default:
    437             psError(__func__, "Invalid psMetadataType: %c", keyType);
     428            psError(PS_ERR_IO, true,
     429                    PS_ERRORTEXT_psMetadataIO_FITS_METATYPE_INVALID,
     430                    keyType);
    438431            return output;
    439432        }
    440433
    441434        if (!success) {
    442             psError(__func__, "Failed to add metadata item. Name: %s", keyName);
     435            psError(PS_ERR_UNKNOWN, false,
     436                    PS_ERRORTEXT_psMetadataIO_ADD_FAILED,
     437                    keyName);
    443438            return output;
    444439        }
     
    471466
    472467    // Check for nulls
    473     if(fileName == NULL) {
    474         psError(__func__, "Null fileName not allowed");
    475         return -1;
    476     } else if((fp=fopen(fileName, "r")) == NULL) {
    477         psError(__func__, "Couldn't open file. Name: %s", fileName);
     468    PS_PTR_CHECK_NULL(fileName,-1);
     469    if((fp=fopen(fileName, "r")) == NULL) {
     470        psError(PS_ERR_IO, true,
     471                PS_ERRORTEXT_psMetadataIO_FILE_OPEN_FAILED,
     472                fileName);
    478473        return -1;
    479474    }
     
    486481    // Create reusable line for continuous read
    487482    line = (char*)psAlloc(MAX_STRING_LENGTH*sizeof(char));
    488     if (line == NULL) {
    489         psAbort(__func__, "Failed to allocate reusable line");
    490     }
    491483
    492484    // While loop to parse the file
     
    504496            if(repeatedChars(linePtr, '@') > 1) {
    505497                failedLines++;
    506                 psError(__func__, "More than one @ charecter not allowed. Line %d: %s", lineCount, line);
     498                psError(PS_ERR_IO, true,
     499                        PS_ERRORTEXT_psMetadataIO_FILE_MULTIPLE_CHAR,
     500                        '@', lineCount, fileName);
    507501                continue;
    508502            } else if(repeatedChars(linePtr, '*') > 1) {
    509503                failedLines++;
    510                 psError(__func__, "More than one * charecter not allowed. Line %d: %s", lineCount, line);
     504                psError(PS_ERR_IO, true,
     505                        PS_ERRORTEXT_psMetadataIO_FILE_MULTIPLE_CHAR,
     506                        '*', lineCount, fileName);
    511507                continue;
    512508            } else if(repeatedChars(linePtr, '~') > 0) {
    513509                failedLines++;
    514                 psError(__func__, "Illegal character. Character:~ Line %d: %s", lineCount, line);
     510                psError(PS_ERR_IO, true,
     511                        PS_ERRORTEXT_psMetadataIO_FILE_MULTIPLE_CHAR,
     512                        '~', lineCount, fileName);
    515513                continue;
    516514            }
     
    521519                failedLines++;
    522520                status = 0;
    523                 psError(__func__, "Null name not allowed. Line %d: %s", lineCount, line);
     521                psError(PS_ERR_IO, true,
     522                        PS_ERRORTEXT_psMetadataIO_FILE_ELEMENT_NULL,
     523                        "name",lineCount, fileName);
    524524                continue;
    525525            }
     
    530530                failedLines++;
    531531                status = 0;
    532                 psError(__func__, "Null type not allowed. Line %d: %s", lineCount, line);
     532                psError(PS_ERR_IO, true,
     533                        PS_ERRORTEXT_psMetadataIO_FILE_ELEMENT_NULL,
     534                        "type",lineCount, fileName);
    533535                continue;
    534536            } else if(!strncmp(strType, "*", 1)) {
     
    551553            } else {
    552554                failedLines++;
    553                 psError(__func__, "Invalid psMetadataType. Type: %s Line %d: %s", strType, lineCount, line);
     555                psError(PS_ERR_IO, true,
     556                        PS_ERRORTEXT_psMetadataIO_FILE_TYPE_INVALID,
     557                        strType, lineCount, fileName);
    554558                continue;
    555559            }
     
    565569                    failedLines++;
    566570                    status = 0;
    567                     psError(__func__, "Null value not allowed. Line %d: %s", lineCount, line);
     571                    psError(PS_ERR_IO, true,
     572                            PS_ERRORTEXT_psMetadataIO_FILE_ELEMENT_NULL,
     573                            "value",lineCount, fileName);
    568574                    continue;
    569575                }
     
    575581                failedLines++;
    576582                status = 0;
    577                 psError(__func__, "Failed to parse comment. Line %d: %s", lineCount, line);
     583                psError(PS_ERR_IO, true,
     584                        PS_ERRORTEXT_psMetadataIO_FILE_ELEMENT_NULL,
     585                        "comment",lineCount, fileName);
    578586                continue;
    579587            }
     
    589597                    } else {
    590598                        failedLines++;
    591                         psError(__func__, "Overwrite for name not allowed. Name: %s. Line %d: %s", strName,
    592                                 lineCount, line);
     599                        psError(PS_ERR_IO, true,
     600                                PS_ERRORTEXT_psMetadataIO_OVERWRITE_ITEM,
     601                                strName, lineCount, fileName);
    593602                        continue;
    594603                    }
     
    608617                    status = 0;
    609618                    failedLines++;
    610                     psError(__func__, "Failed to parse value. Value: %s Line %d: %s", strValue, lineCount, line);
     619                    psError(PS_ERR_IO, true,
     620                            PS_ERRORTEXT_psMetadataIO_PARSE_FAILED,
     621                            strValue, strName, strType, lineCount, fileName);
    611622                    continue;
    612623                }
     
    619630                    status = 0;
    620631                    failedLines++;
    621                     psError(__func__, "Failed to parse value. Value: %s Line %d: %s", strValue, lineCount, line);
     632                    psError(PS_ERR_IO, true,
     633                            PS_ERRORTEXT_psMetadataIO_PARSE_FAILED,
     634                            strValue, strName, strType, lineCount, fileName);
    622635                    continue;
    623636                }
     
    631644                    status = 0;
    632645                    failedLines++;
    633                     psError(__func__, "Failed to parse value. Value: %s Line %d: %s", strValue, lineCount, line);
     646                    psError(PS_ERR_IO, true,
     647                            PS_ERRORTEXT_psMetadataIO_PARSE_FAILED,
     648                            strValue, strName, strType, lineCount, fileName);
    634649                    continue;
    635650                }
     
    645660                    status = 0;
    646661                    failedLines++;
    647                     psError(__func__, "Failed to parse value. Value: %s Line %d: %s", strValue, lineCount, line);
     662                    psError(PS_ERR_IO, true,
     663                            PS_ERRORTEXT_psMetadataIO_PARSE_FAILED,
     664                            strValue, strName, strType, lineCount, fileName);
    648665                    continue;
    649666                }
     
    651668            default:
    652669                failedLines++;
    653                 psError(__func__, "Invalid psMetadataType. Type: %d Line %d: %s", mdType, lineCount, line);
     670                psError(PS_ERR_IO, true,
     671                        PS_ERRORTEXT_psMetadataIO_FILE_TYPE_INVALID,
     672                        mdType, lineCount, fileName);
    654673                continue;
    655674            } // switch
  • trunk/psLib/src/astronomy/psTime.c

    r2204 r2273  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-10-27 00:57:30 $
     13 *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-11-04 01:04:57 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3131#include "psMetadata.h"
    3232#include "psMetadataIO.h"
    33 
     33#include "psConstants.h"
    3434#include "psAstronomyErrors.h"
    3535
     
    151151    char line[LINESIZE];
    152152    psS32 j = 0;
    153     psS32 maxLines = 100;
     153    psS32 maxLines = 1000;
    154154    psF64 *ptr = NULL;
    155155    psImage *table = NULL;
     
    159159    fd=fopen(fileName, "r");
    160160    if(fd==NULL) {
    161         psError(__func__, " : Line %d - Couldn't open %s", __LINE__, fileName);
     161        psError(PS_ERR_IO,true,
     162                PS_ERRORTEXT_psTime_FILE_NOT_FOUND,
     163                fileName,"Tai-Utc");
    162164        return NULL;
    163165    }
     
    168170    while(fgets(line, LINESIZE, fd) != NULL) {
    169171        if(j>=maxLines) {
    170             psError(__func__, " : Line %d - Too many rows in file. Max size: %d", __LINE__, maxLines);
     172            psError(PS_ERR_IO,true,
     173                    PS_ERRORTEXT_psTime_FILE_TOO_MANY_ROWS,
     174                    fileName,maxLines);
    171175            return NULL;
    172176            psFree(table);
     
    201205    fd=fopen(fileName, "r");
    202206    if(fd==NULL) {
    203         psError(__func__, " : Line %d - Couldn't open %s", __LINE__, fileName);
     207        psError(PS_ERR_IO,true,
     208                PS_ERRORTEXT_psTime_FILE_NOT_FOUND,
     209                fileName,"Ser7");
    204210        return NULL ;
    205211    }
     
    218224
    219225            if(j>=maxLines) {
    220                 psError(__func__, " : Line %d - Too many rows in file. Max size: %d", __LINE__, maxLines);
     226                psError(PS_ERR_IO,true,
     227                        PS_ERRORTEXT_psTime_FILE_TOO_MANY_ROWS,
     228                        fileName,maxLines);
    221229                return NULL;
    222230                psFree(table);
     
    240248}
    241249
    242 /* Not yet used...
    243 static psImage* readEopcFile(char *fileName)
    244 {
    245     char line[LINESIZE];
    246     psS32 i = 0;
    247     psS32 j = 0;
    248     psS32 maxLines = 2500;
    249     psImage *table = NULL;
    250     FILE *fd = NULL;
    251  
    252  
    253     fd=fopen(fileName, "r");
    254     if(fd==NULL) {
    255         psError(__func__, " : Line %d - Couldn't open %s", __LINE__, fileName);
    256         return NULL ;
    257     }
    258  
    259     // Table shouldn't be larger than 2500 rows. All columns are read.
    260     table  = psImageAlloc(11, maxLines, PS_TYPE_F64);
    261     for(i=0; i<3; i++) {
    262         if((fgets(line, LINESIZE, fd) != NULL)) {
    263             psError(__func__, " : Line %d - Error reading %s", __LINE__, fileName);
    264         }
    265     }
    266  
    267     while(fgets(line, LINESIZE, fd) != NULL) {
    268         if(j>=maxLines) {
    269             psError(__func__, " : Line %d - Too many rows in file. Max size: %d", __LINE__, maxLines);
    270             return NULL;
    271             psFree(table);
    272         }
    273         psF64 *ptr = table->data.F64[j++];
    274         sscanf(line, "%lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
    275                ptr, ptr+1, ptr+2, ptr+3, ptr+4, ptr+5, ptr+6, ptr+7, ptr+8, ptr+9, ptr+10);
    276     }
    277  
    278     *(psU32 *)&table->numRows = j;
    279  
    280     return table;
    281 }
    282  
    283 static psImage* readFinalsFile(char *fileName)
    284 {
    285     char line[LINESIZE];
    286     psS32 j = 0;
    287     psS32 maxLines = 15000;
    288     psImage *table = NULL;
    289     FILE *fd = NULL;
    290  
    291  
    292     fd=fopen(fileName, "r");
    293     if(fd==NULL) {
    294         psError(__func__, " : Line %d - Couldn't open %s", __LINE__, fileName);
    295         return NULL ;
    296     }
    297  
    298     // Table shouldn't be larger than 15000 rows. Select columns are read.
    299     table  = psImageAlloc(6, maxLines, PS_TYPE_F64);
    300     while(fgets(line, LINESIZE, fd) != NULL) {
    301         if(j>=maxLines) {
    302             psError(__func__, " : Line %d - Too many rows in file. Max size: %d", __LINE__, maxLines);
    303             return NULL;
    304             psFree(table);
    305         }
    306  
    307         psF64 *ptr = table->data.F64[j++];
    308         ptr = table->data.F64[j++];
    309  
    310         // Sometimes there are blank entries in this table, so check for a space to determine if there is no entry
    311         if(*(line+7) == ' ') {                   // MJD
    312             *ptr = 0.0;
    313         } else {
    314             *ptr = atof(line+7);
    315         }
    316  
    317         if(*(line+18) == ' ') {                  // Polar motion X
    318             *(ptr+1) = 0.0;
    319         } else {
    320             *(ptr+1) = atof(line+18);
    321         }
    322  
    323         if(*(line+27) == ' ') {                  // Polar motion X error
    324             *(ptr+2) = 0.0;
    325         } else {
    326             *(ptr+2) = atof(line+27);
    327         }
    328  
    329         if(*(line+37) == ' ') {                  // Polar motion Y
    330             *(ptr+3) = 0.0;
    331         } else {
    332             *(ptr+3) = atof(line+37);
    333         }
    334  
    335         if(*(line+46) == ' ') {                  // Polar motion Y error
    336             *(ptr+4) = 0.0;
    337         } else {
    338             *(ptr+4) = atof(line+46);
    339         }
    340  
    341         if(*(line+58) == ' ') {                  // UT1-UTC
    342             *(ptr+5) = 0.0;
    343         } else {
    344             *(ptr+5) = atof(line+58);
    345         }
    346     }
    347  
    348     *(psU32 *)&table->numRows = j;
    349  
    350     return table;
    351 }
    352 */
    353250
    354251static double lookupTaiUtcTable(const psTime *time)
     
    389286            hiIdx++;
    390287            if(hiIdx >= numRows) {
    391                 psError(__func__, " : Line %d - High index too big. Value: %d", __LINE__, hiIdx);
     288                psError(PS_ERR_BAD_PARAMETER_VALUE,true,
     289                        PS_ERRORTEXT_psTime_TIME_POSTDATES_TABLE,
     290                        jd, "TAI-UTC");
    392291                return 0.0;
    393292            }
     
    395294        loIdx = hiIdx--;
    396295        if(loIdx < 0) {
    397             psError(__func__, " : Line %d - Low index too small. Value: %d", __LINE__, loIdx);
     296            psError(PS_ERR_BAD_PARAMETER_VALUE,true,
     297                    PS_ERRORTEXT_psTime_TIME_PREDATES_TABLE,
     298                    jd, "TAI-UTC");
    398299            return 0.0;
    399300        }
    400301
     302        // since rows of table can not have same jd, this check is probably not needed.
    401303        denom = table->data.F64[hiIdx][0]-table->data.F64[loIdx][0];
    402304        if(fabs(denom) < FLT_EPSILON) {
    403             psError(__func__, " : Line %d - Divide by zero error during interpolation", __LINE__);
     305            psError(PS_ERR_UNKNOWN,true,
     306                    PS_ERRORTEXT_psTime_TABLE_DUPLICATE_ROWS
     307                    "Ser7");
    404308            return 0.0;
    405309        } else {
    406 
    407310            // Interpolate three constants required to calculate TAI-UTC
    408311            const1 = table->data.F64[loIdx][1]+(table->data.F64[hiIdx][1]-table->data.F64[loIdx][1])
     
    445348    mjdUtc = psTimeToMJD(time);
    446349    if(mjdUtc < table->data.F64[0][3]) {                                    // MJD time before start of table
    447         psError(__func__, " : Line %d - MJD too small. Value: %d", __LINE__, mjdUtc);
     350        psError(PS_ERR_BAD_PARAMETER_VALUE,true,
     351                PS_ERRORTEXT_psTime_TIME_PREDATES_TABLE,
     352                mjdUtc, "Ser7");
    448353
    449354    } else if(mjdUtc > table->data.F64[numRows-1][3]) {                     // MJD time after end of table
    450         psError(__func__, " : Line %d - MJD too big. Value: %d", __LINE__, mjdUtc);
     355        psError(PS_ERR_BAD_PARAMETER_VALUE,true,
     356                PS_ERRORTEXT_psTime_TIME_POSTDATES_TABLE,
     357                mjdUtc, "Ser7");
    451358    } else {                                                                // All other times..interpolate
    452359        while(mjdUtc > table->data.F64[hiIdx][3]) {
    453360            hiIdx++;
    454361            if(hiIdx >= numRows) {
    455                 psError(__func__, " : Line %d - High index too big. Value: %d", __LINE__, hiIdx);
     362                psError(PS_ERR_BAD_PARAMETER_VALUE,true,
     363                        PS_ERRORTEXT_psTime_TIME_POSTDATES_TABLE,
     364                        mjdUtc, "Ser7");
    456365                return 0.0;
    457366            }
     
    460369        loIdx = hiIdx--;
    461370        if(loIdx < 0) {
    462             psError(__func__, " : Line %d - Low index too small. Value: %d", __LINE__, loIdx);
     371            psError(PS_ERR_BAD_PARAMETER_VALUE,true,
     372                    PS_ERRORTEXT_psTime_TIME_PREDATES_TABLE,
     373                    mjdUtc, "Ser7");
    463374        }
    464375
    465376        denom = table->data.F64[hiIdx][3] - table->data.F64[loIdx][3];
    466377        if(fabs(denom) < FLT_EPSILON) {
    467             psError(__func__, " : Line %d - Divide by zero error during interpolation", __LINE__);
     378            psError(PS_ERR_UNKNOWN,true,
     379                    PS_ERRORTEXT_psTime_TABLE_DUPLICATE_ROWS,
     380                    "Ser7");
    468381        } else {
    469382            out = table->data.F64[loIdx][col]+(table->data.F64[hiIdx][col]-table->data.F64[loIdx][col])
     
    525438    // Error checks
    526439    if(type!=PS_TIME_TAI && type!=PS_TIME_UTC) {
    527         psError(__func__, " : Line %d - Incorrect type. Type: %d", __LINE__, type);
     440        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     441                PS_ERRORTEXT_psTime_TYPE_UNKNOWN,
     442                type);
    528443        return NULL;
    529444    }
    530445
    531446    outTime = (psTime*)psAlloc(sizeof(psTime));
    532     if(outTime == NULL) {
    533         psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);
    534     }
    535447
    536448    outTime->sec = 0;
     
    551463
    552464    if (gettimeofday(&now, (struct timezone *)0) == -1) {
    553         psError(__func__, " : Line %d - Failed to get time", __LINE__);
     465        psError(PS_ERR_OS_CALL_FAILED, true,
     466                PS_ERRORTEXT_psTime_GET_TOD_FAILED);
    554467        return NULL;
    555468    }
     
    573486
    574487    // Error checks
    575     if(time == NULL) {
    576         psError(__func__, " : Line %d - NULL value not allowed", __LINE__);
    577         return NULL;
    578     } else if(time->usec >= 1e6) {
    579         psError(__func__, " : Line %d - Input time microseconds too big. Value %u", __LINE__, time->usec);
    580         return NULL;
    581     } else if(time->type == type) {
    582         psError(__func__, " : Line %d - Time already in correct psTime type. Time type: %d", __LINE__, type);
    583         return NULL;
     488    PS_PTR_CHECK_NULL(time,NULL);
     489    PS_INT_CHECK_RANGE(time->usec,0,1e6-1,NULL);
     490
     491    if (time->type == type) { // time already right type.  That was easy!
     492        return time;
    584493    }
    585494
    586495    delta = psTimeGetTAIDelta(time);
    587496
    588     if(type == PS_TIME_UTC) {
     497    if (type == PS_TIME_UTC) {
    589498        time->sec = time->sec - delta;    // User wants UTC time. Subtract leapseconds.
    590499    } else if(type == PS_TIME_TAI) {
    591500        time->sec = time->sec + delta;    // User wants TAI time. Add leapseconds.
    592501    } else {
    593         psError(__func__, " : Line %d - Invalid psTimeType: %d", __LINE__, type);
     502        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     503                PS_ERRORTEXT_psTime_TYPE_UNKNOWN,
     504                type);
    594505    }
    595506
     
    623534
    624535    // Error checks
    625     if(time == NULL) {
    626         psError(__func__, " : Line %d - NULL value not allowed", __LINE__);
    627         return 0;
    628     } else if(time->usec >= 1e6) {
    629         psError(__func__, " : Line %d - Input time microseconds too big. Value %u", __LINE__, time->usec);
    630         return 0;
    631     }
     536    PS_PTR_CHECK_NULL(time,NAN);
     537    PS_INT_CHECK_RANGE(time->usec,0,1e6-1,NAN);
    632538
    633539    // Calculate TAI or UTC time based on type of time user passes
     
    698604
    699605    // Error checks
    700     if(time == NULL) {
    701         psError(__func__, " : Line %d - NULL value not allowed", __LINE__);
    702         return 0.0;
    703     } else if(time->usec >= 1e6) {
    704         psError(__func__, " : Line %d - Input time microseconds too big. Value %u", __LINE__, time->usec);
    705         return 0.0;
    706     }
     606    PS_PTR_CHECK_NULL(time,NAN);
     607    PS_INT_CHECK_RANGE(time->usec,0,1e6-1,NAN);
    707608
    708609    return lookupSer7Table(time, 6);
     
    717618
    718619    // Error checks
    719     if(time == NULL)
    720     {
    721         psError(__func__, " : Line %d - NULL value not allowed", __LINE__);
    722         return NULL;
    723     } else if(time->usec >= 1e6)
    724     {
    725         psError(__func__, " : Line %d - Input time microseconds too big. Value %u", __LINE__, time->usec);
    726         return NULL;
    727     }
     620    PS_PTR_CHECK_NULL(time,NULL);
     621    PS_INT_CHECK_RANGE(time->usec,0,1e6-1,NULL);
    728622
    729623    x = lookupSer7Table((psTime*)time, 4);
     
    741635
    742636    // Error checks
    743     if(time == NULL) {
    744         psError(__func__, " : Line %d - NULL value not allowed", __LINE__);
    745         return 0.0;
    746     } else if(time->usec >= 1e6) {
    747         psError(__func__, " : Line %d - Input time microseconds too big. Value %u", __LINE__, time->usec);
    748         return 0.0;
    749     }
     637    PS_PTR_CHECK_NULL(time,NAN);
     638    PS_INT_CHECK_RANGE(time->usec,0,1e6-1,NAN);
    750639
    751640    return lookupTaiUtcTable(time);
     
    758647
    759648    // Error checks
    760     if(time1 == NULL) {
    761         psError(__func__, " : Line %d - NULL value not allowed for first input", __LINE__);
    762         return 0;
    763     } else if(time1->usec >= 1e6) {
    764         psError(__func__, " : Line %d - First input time microseconds too big. Value %u", __LINE__, time1->usec);
    765         return 0;
    766     } else if(time2 == NULL) {
    767         psError(__func__, " : Line %d - NULL value not allowed for second input", __LINE__);
    768         return 0;
    769     } else if(time2->usec >= 1e6) {
    770         psError(__func__, " : Line %d - First input time microseconds too big. Value %u", __LINE__, time2->usec);
    771         return 0;
    772     }
     649    PS_PTR_CHECK_NULL(time1,0);
     650    PS_PTR_CHECK_NULL(time2,0);
     651    PS_INT_CHECK_RANGE(time1->usec,0,1e6-1,0);
     652    PS_INT_CHECK_RANGE(time1->usec,0,1e6-1,0);
    773653
    774654    diff = abs(psTimeGetTAIDelta((psTime*)time1)-psTimeGetTAIDelta((psTime*)time2));
     
    781661    double jd = 0.0;
    782662
    783 
    784     // Error checks
    785     if(time == NULL) {
    786         psError(__func__, " : Line %d - NULL value not allowed", __LINE__);
    787         return 0.0;
    788     } else if(time->usec >= 1e6) {
    789         psError(__func__, " : Line %d - Input time microseconds too big. Value %u", __LINE__, time->usec);
    790         return 0.0;
    791     }
     663    // Error checks
     664    PS_PTR_CHECK_NULL(time,NAN);
     665    PS_INT_CHECK_RANGE(time->usec,0,1e6-1,NAN);
    792666
    793667    // Julian date conversion
     
    807681
    808682    // Error checks
    809     if(time == NULL) {
    810         psError(__func__, " : Line %d - NULL value not allowed", __LINE__);
    811         return 0.0;
    812     } else if(time->usec >= 1e6) {
    813         psError(__func__, " : Line %d - Input time microseconds too big. Value %u", __LINE__, time->usec);
    814         return 0.0;
    815     }
     683    PS_PTR_CHECK_NULL(time,NAN);
     684    PS_INT_CHECK_RANGE(time->usec,0,1e6-1,NAN);
    816685
    817686    // Modified Julian date conversion
     
    835704
    836705    // Error checks
    837     if(time == NULL) {
    838         psError(__func__, " : Line %d - NULL value not allowed", __LINE__);
    839         return NULL;
    840     } else if(time->usec >= 1e6) {
    841         psError(__func__, " : Line %d - Input time microseconds too big. Value %u", __LINE__, time->usec);
    842         return NULL;
    843     }
     706    PS_PTR_CHECK_NULL(time,NULL);
     707    PS_INT_CHECK_RANGE(time->usec,0,1e6-1,NULL);
    844708
    845709    tempString = psAlloc(MAX_TIME_STRING_LENGTH);
     
    854718    // Converts psTime to YYYY-MM-DDThh:mm:ss.sss in string form
    855719    if (!strftime(tempString, MAX_TIME_STRING_LENGTH, "%Y-%m-%dT%H:%M:%S", tmTime)) {
    856         psError(__func__, " : Line %d - Failed strftime conversion", __LINE__);
     720        psError(PS_ERR_OS_CALL_FAILED, true,
     721                PS_ERRORTEXT_psTime_CONVERT_TIME_TO_STRING_FAILED);
    857722    }
    858723
    859724    if (snprintf(timeString, MAX_TIME_STRING_LENGTH, "%s.%3.3dZ", tempString, ms) < 0) {
    860         psError(__func__, " : Line %d - Failed snprintf conversion", __LINE__);
     725        psError(PS_ERR_OS_CALL_FAILED, true,
     726                PS_ERRORTEXT_psTime_APPEND_MSEC_FAILED);
    861727    }
    862728    psFree(tempString);
     
    869735    struct timeval timevalTime;
    870736
    871 
    872     // Error checks
    873     if(time == NULL)
    874     {
    875         psError(__func__, " : Line %d - NULL value not allowed", __LINE__);
    876         return timevalTime;
    877     } else if(time->usec >= 1e6)
    878     {
    879         psError(__func__, " : Line %d - Input time microseconds too big. Value %u", __LINE__, time->usec);
    880         return timevalTime;
    881     }
     737    timevalTime.tv_sec = 0;
     738    timevalTime.tv_usec = 0;
     739
     740    // Error checks
     741    PS_PTR_CHECK_NULL(time,timevalTime);
     742    PS_INT_CHECK_RANGE(time->usec,0,1e6-1,timevalTime);
    882743
    883744    timevalTime.tv_sec = time->sec;
     
    901762
    902763    // Error checks
    903     if(time == NULL)
    904     {
    905         psError(__func__, " : Line %d - NULL value not allowed", __LINE__);
    906         return NULL;
    907     } else if(time->usec >= 1e6)
    908     {
    909         psError(__func__, " : Line %d - Input time microseconds too big. Value %u", __LINE__, time->usec);
    910         return NULL;
    911     }
     764    PS_PTR_CHECK_NULL(time,NULL);
     765    PS_INT_CHECK_RANGE(time->usec,0,1e6-1,NULL);
    912766
    913767    seconds = time->sec%60;
     
    945799    // Allocate output
    946800    tmTime = (struct tm*)psAlloc(sizeof(struct tm));
    947     if (tmTime == NULL)
    948     {
    949         psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);
    950     }
    951801
    952802    tmTime->tm_year = year - 1900;
     
    982832
    983833    // Error check
    984     if(outTime->usec >= 1e6) {
    985         psError(__func__, " : Line %d - Output time microseconds too big. Value %u", __LINE__, outTime->usec);
    986     }
     834    PS_INT_CHECK_RANGE(outTime->usec,0,1e6-1,outTime);
    987835
    988836    return outTime;
     
    1010858
    1011859    // Error check
    1012     if(outTime->usec >= 1e6) {
    1013         psError(__func__, " : Line %d - Output time microseconds too big. Value %u", __LINE__, outTime->usec);
    1014     }
     860    PS_INT_CHECK_RANGE(outTime->usec,0,1e6-1,outTime);
    1015861
    1016862    return outTime;
     
    1020866{
    1021867    char tempString[MAX_TIME_STRING_LENGTH];
    1022     psS32 month;
    1023     psS32 day;
    1024     psS32 year;
    1025     psS32 hour;
    1026     psS32 minute;
    1027     psS32 second;
    1028868    psS32 millisecond;
    1029869    struct tm tmTime;
    1030870    psTime *outTime = NULL;
    1031871
    1032 
    1033     // Preserve input string by creating duplicate
    1034     strncpy(tempString, time, MAX_TIME_STRING_LENGTH);
    1035 
    1036872    // Convert YYYY-MM-DDThh:mm:ss.sss in string form to tm time
    1037     year = atoi(strtok(tempString, "-"));
    1038     if (year < 0) {
    1039         psError(__func__, "Years less than 0 not allowed. Value: %d", year);
    1040         return outTime;
    1041     }
    1042 
    1043     month = atoi(strtok(NULL, "-"));
    1044     if (month < 1 || month > 12) {
    1045         psError(__func__, "Month must have a value from 1 to 12. Value: %d", month);
    1046         return outTime;
    1047     }
    1048 
    1049     day = atoi(strtok(NULL, "T"));
    1050     if (day < 1 || day > 31) {
    1051         psError(__func__, "Day must have a value from 1 to 31. Value: %d", day);
    1052         return outTime;
    1053     }
    1054 
    1055     hour = atoi(strtok(NULL, ":"));
    1056     if (hour < 0 || hour > 23) {
    1057         psError(__func__, "Hour must have a value from 0 to 23. Value: %d", hour);
    1058         return outTime;
    1059     }
    1060 
    1061     minute = atoi(strtok(NULL, ":"));
    1062     if (minute < 0 || minute > 59) {
    1063         psError(__func__, "Minute must have a value from 0 to 59. Value: %d", minute);
    1064         return outTime;
    1065     }
    1066 
    1067     second = atoi(strtok(NULL, "."));
    1068     if (second < 0 || second > 59) {
    1069         psError(__func__, "Second must have a value from 0 to 59. Value: %d", second);
    1070         return outTime;
    1071     }
    1072 
    1073     millisecond = atoi(strtok(NULL, "Z"));
    1074     if (millisecond < 0 || millisecond > 1000) {
    1075         psError(__func__, "Millisecond must have a value from 0 to 999. Value: %d", millisecond);
    1076         return outTime;
    1077     }
    1078 
    1079     tmTime.tm_year = year - 1900;
    1080     tmTime.tm_mon = month - 1;
    1081     tmTime.tm_mday = day;
    1082     tmTime.tm_hour = hour;
    1083     tmTime.tm_min = minute;
    1084     tmTime.tm_sec = second;
     873    if (sscanf(time, "%d-%d-%dT%d:%d:%d.%d",
     874               &tmTime.tm_year,&tmTime.tm_mon,&tmTime.tm_mday,
     875               &tmTime.tm_hour,&tmTime.tm_min,&tmTime.tm_sec,&millisecond) < 7) {
     876        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     877                PS_ERRORTEXT_psTime_ISOTIME_MALFORMED,
     878                time);
     879        return NULL;
     880    }
     881
     882    PS_INT_CHECK_NON_NEGATIVE(tmTime.tm_year, outTime);
     883    PS_INT_CHECK_RANGE(tmTime.tm_mon,1,12,outTime);
     884    PS_INT_CHECK_RANGE(tmTime.tm_mday,1,31,outTime);
     885    PS_INT_CHECK_RANGE(tmTime.tm_hour,0,23,outTime);
     886    PS_INT_CHECK_RANGE(tmTime.tm_min,0,59,outTime);
     887    PS_INT_CHECK_RANGE(tmTime.tm_sec,0,59,outTime);
     888    PS_INT_CHECK_RANGE(millisecond,0,999,outTime);
     889
     890    tmTime.tm_year -= 1900;
     891    tmTime.tm_mon--;
    1085892    tmTime.tm_isdst = -1;
    1086893
     
    1089896    outTime->usec = millisecond * 1000;
    1090897
     898    return outTime;
     899}
     900
     901psTime* psTimeFromTimeval(const struct timeval *time)
     902{
     903    psTime *outTime = NULL;
     904
     905
    1091906    // Error check
    1092     if(outTime->usec >= 1e6) {
    1093         psError(__func__, " : Line %d - Output time microseconds too big. Value %u", __LINE__, outTime->usec);
    1094     }
    1095 
    1096     return outTime;
    1097 }
    1098 
    1099 psTime* psTimeFromTimeval(const struct timeval *time)
    1100 {
    1101     psTime *outTime = NULL;
    1102 
    1103 
    1104     // Error check
    1105     if(time == NULL)
    1106     {
    1107         psError(__func__, " : Line %d - NULL value not allowed", __LINE__);
    1108         return NULL;
    1109     }
     907    PS_PTR_CHECK_NULL(time,NULL);
    1110908
    1111909    // Allocate psTime struct
     
    1117915
    1118916    // Error check
    1119     if(outTime->usec >= 1e6)
    1120     {
    1121         psError(__func__, " : Line %d - Output time microseconds too big. Value %u", __LINE__, outTime->usec);
    1122     }
     917    PS_INT_CHECK_RANGE(outTime->usec,0,1e6-1,outTime);
    1123918
    1124919    return outTime;
     
    1138933
    1139934    // Error check
    1140     if(time == NULL)
    1141     {
    1142         psError(__func__, " : Line %d - NULL value not allowed", __LINE__);
    1143         return NULL;
    1144     }
     935    PS_PTR_CHECK_NULL(time,NULL);
    1145936
    1146937    // Allocate psTime struct
     
    1183974
    1184975    // Error check
    1185     if(outTime->usec >= 1e6)
    1186     {
    1187         psError(__func__, " : Line %d - Output time microseconds too big. Value %u", __LINE__, outTime->usec);
    1188     }
     976    PS_INT_CHECK_RANGE(outTime->usec,0,1e6-1,outTime);
    1189977
    1190978    return outTime;
     
    1199987
    1200988    // Error checks
     989    PS_PTR_CHECK_NULL(tai1,NULL);
     990    PS_PTR_CHECK_NULL(tai2,NULL);
     991    PS_INT_CHECK_RANGE(tai1->usec,0,1e6-1,NULL);
     992    PS_INT_CHECK_RANGE(tai2->usec,0,1e6-1,NULL);
     993
    1201994    if(tai1->type != tai2->type) {
    1202         psError(__func__, " : Line %d - Argument types inconsistent for time addition", __LINE__);
    1203         return NULL;
    1204     } else if(tai1 == NULL) {
    1205         psError(__func__, " : Line %d - NULL value not allowed for first input", __LINE__);
    1206         return NULL;
    1207     } else if(tai1->usec >= 1e6) {
    1208         psError(__func__, " : Line %d - Argument 1 microseconds too big. Value %u", __LINE__, tai1->usec);
    1209         return NULL;
    1210     } else if(tai2 == NULL) {
    1211         psError(__func__, " : Line %d - NULL value not allowed for second input", __LINE__);
    1212         return NULL;
    1213     } else if(tai2->usec >= 1e6) {
    1214         psError(__func__, " : Line %d - Argument 2 microseconds too big. Value %u", __LINE__, tai2->usec);
     995        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     996                PS_ERRORTEXT_psTime_TYPE_MISMATCH);
    1215997        return NULL;
    1216998    }
     
    12331015
    12341016    // Error check
    1235     if(outTime->usec >= 1e6) {
    1236         psError(__func__, " : Line %d - Output time microseconds too big. Value %u", __LINE__, outTime->usec);
    1237     }
     1017    PS_INT_CHECK_RANGE(outTime->usec,0,1e6-1,outTime);
    12381018
    12391019    return outTime;
     
    12481028
    12491029    // Error checks
     1030    PS_PTR_CHECK_NULL(tai1,NULL);
     1031    PS_PTR_CHECK_NULL(tai2,NULL);
     1032    PS_INT_CHECK_RANGE(tai1->usec,0,1e6-1,NULL);
     1033    PS_INT_CHECK_RANGE(tai2->usec,0,1e6-1,NULL);
    12501034    if(tai1->type != tai2->type) {
    1251         psError(__func__, " : Line %d - Argument types inconsistent for time subtraction", __LINE__);
    1252         return NULL;
    1253     } else if(tai1 == NULL) {
    1254         psError(__func__, " : Line %d - NULL value not allowed for first input", __LINE__);
    1255         return NULL;
    1256     } else if(tai1->usec >= 1e6) {
    1257         psError(__func__, " : Line %d - Argument 1 microseconds too big. Value %u", __LINE__, tai1->usec);
    1258         return NULL;
    1259     } else if(tai2 == NULL) {
    1260         psError(__func__, " : Line %d - NULL value not allowed for second input", __LINE__);
    1261         return NULL;
    1262     } else if(tai2->usec >= 1e6) {
    1263         psError(__func__, " : Line %d - Argument 2 microseconds too big. Value %u", __LINE__, tai2->usec);
     1035        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     1036                PS_ERRORTEXT_psTime_TYPE_MISMATCH);
    12641037        return NULL;
    12651038    }
     
    12941067
    12951068    // Error checks
     1069    // Error checks
     1070    PS_PTR_CHECK_NULL(tai1,NULL);
     1071    PS_PTR_CHECK_NULL(tai2,NULL);
     1072    PS_INT_CHECK_RANGE(tai1->usec,0,1e6-1,NULL);
     1073    PS_INT_CHECK_RANGE(tai2->usec,0,1e6-1,NULL);
    12961074    if(tai1->type != tai2->type) {
    1297         psError(__func__, " : Line %d - Argument types inconsistent for time subtraction", __LINE__);
    1298         return NULL;
    1299     } else if(tai1 == NULL) {
    1300         psError(__func__, " : Line %d - NULL value not allowed for first input", __LINE__);
    1301         return NULL;
    1302     } else if(tai1->usec >= 1e6) {
    1303         psError(__func__, " : Line %d - Argument 1 microseconds too big. Value %u", __LINE__, tai1->usec);
    1304         return NULL;
    1305     } else if(tai2 == NULL) {
    1306         psError(__func__, " : Line %d - NULL value not allowed for second input", __LINE__);
    1307         return NULL;
    1308     } else if(tai2->usec >= 1e6) {
    1309         psError(__func__, " : Line %d - Argument 2 microseconds too big. Value %u", __LINE__, tai2->usec);
     1075        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     1076                PS_ERRORTEXT_psTime_TYPE_MISMATCH);
    13101077        return NULL;
    13111078    }
Note: See TracChangeset for help on using the changeset viewer.