IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 21, 2007, 4:28:48 PM (19 years ago)
Author:
jhoblitt
Message:

change psLibInit() to return a boolean status
change psLibFinalize() to abort on error as psError() may not/should not be working after invoking this function
change psTimeInitialize() to return a bool status
change psTimeInitialize() to deffer the actual loading of the "time tables"
rename psTimeInitialize() -> psTimeInit()
rename p_psTimeConfigFileName() -> p_psTimeConfigFilename()
change p_psTimeConfigFilename() to accept a filename argument
p_psTimeConfigFilename() now either return's the current conf files name when passed NULL or sets it to the "filename" parameter that is passed in
change all psTime* functions to make sure that the "time tables" have been initalized before using them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psConfigure.c

    r12757 r13950  
    1313 *  @author Robert DeSonia, MHPCC
    1414 *
    15  *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
    16  *  @date $Date: 2007-04-06 00:04:15 $
     15 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
     16 *  @date $Date: 2007-06-22 02:28:48 $
    1717 *
    1818 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2626#include <stdlib.h>
    2727#include <string.h>
     28
     29#include "psAbort.h"
    2830#include "psTrace.h"
    2931#include "psString.h"
     
    9496
    9597
    96 void psLibInit(const char* timeConfig)
     98bool psLibInit(const char* timeConfig)
    9799{
    98100    // XXX: Still needs error codes to be set
    99101
    100102    if (timeConfig && strlen(timeConfig) > 0) {
    101         if (!p_psTimeInit(timeConfig)) {
     103        if (!psTimeInit(timeConfig)) {
    102104            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    103105                    _("Failed to initialize %s."), "psTime");
    104             return;
     106            return false;
    105107        }
    106108    }
     
    111113        atexit(&p_psMemoryCheck);
    112114    }
     115
     116    return true;
    113117}
    114118
     
    122126    // Free the time tables
    123127    if (!p_psTimeFinalize()) {
    124         psError(PS_ERR_UNKNOWN, false,
    125                 _("Failed to finalize %s."), "psTime");
    126         return;
     128        psAbort(_("Failed to finalize psTime."));
    127129    }
    128130
    129131    // Free the precession tables
    130132    if (!p_psEOCFinalize()) {
    131         psError(PS_ERR_UNKNOWN, false,
    132                 _("Failed to finalize %s."), "psEOC");
    133         return;
     133        psAbort(_("Failed to finalize psEOC."));
    134134    }
    135135
     
    139139    // Free the error system
    140140    psErrorClear();
    141 
    142141}
Note: See TracChangeset for help on using the changeset viewer.