make tsStampFromLocal and tsStampToLocal public

This commit is contained in:
Marty Kraimer
2000-06-28 13:56:14 +00:00
parent 335fc3aaee
commit e8a396074c
2 changed files with 40 additions and 26 deletions

View File

@@ -78,6 +78,28 @@ typedef struct TS_STAMP {
epicsUInt32 nsec; /* nanoseconds within second */
} TS_STAMP;
/*---------------------------------------------------------------------------
* tsDetail
* breakdown structure for working with secPastEpoch
*----------------------------------------------------------------------------*/
typedef struct tsDetail {
int year; /* 4 digit year */
int dayYear; /* day number in year; 0 = Jan 1 */
int monthNum; /* month number; 0 = Jan */
int dayMonth; /* day number; 0 = 1st of month */
int hours; /* hours within day */
int minutes; /* minutes within hour */
int seconds; /* seconds within minute */
int dayOfWeek; /* weekday number; 0 = Sun */
int leapYear; /* (0, 1) for year (isn't, is) a leap year */
char dstOverlapChar; /* indicator for distinguishing duplicate
times in the `switch to standard' time period:
':'--time isn't ambiguous;
's'--time is standard time
'd'--time is daylight time */
} TS_DETAIL;
/*----------------------------------------------------------------------------
* TS_TEXT_xxx text type codes for converting between text and time stamp
*
@@ -160,6 +182,16 @@ enum tsTextType{
#if defined(__STDC__) || defined(__cplusplus)
epicsShareFunc void epicsShareAPI tsStampFromLocal(
TS_STAMP *pStamp,
struct tsDetail *pT
);
epicsShareFunc void epicsShareAPI tsStampToLocal(
TS_STAMP stamp,
struct tsDetail *pT
);
epicsShareFunc long epicsShareAPI tsLocalTime (TS_STAMP *pStamp);
epicsShareFunc void epicsShareAPI tsAddDouble(
@@ -201,6 +233,8 @@ char **pText /* IO ptr to ptr to string containing time and date */
#else /* !defined(__STDC__) && !defined(__cplusplus) */
epicsShareFunc void epicsShareAPI tsStampFromLocal();
epicsShareFunc void epicsShareAPI tsStampToLocal();
epicsShareFunc long epicsShareAPI tsLocalTime ();
epicsShareFunc void epicsShareAPI tsAddDouble();
epicsShareFunc int epicsShareAPI tsCmpStamps();

View File

@@ -91,6 +91,8 @@
* long tsLocalTime( >pStamp )
* long tsRoundDownLocal(<>pStamp, intervalUL )
* long tsRoundUpLocal( <>pStamp, intervalUL )
* void tsStampFromLocal( >pStamp, detail )
* void tsStampToLocal( pStamp, >detail )
* char *tsStampToText( pStamp, textType, >textBuffer )
* TS_TEXT_MONDDYYYY buf[32]
* TS_TEXT_MMDDYY buf[28]
@@ -186,29 +188,7 @@
#define TS_MAX_YEAR TS_EPOCH_YEAR+134 /* ULONG can handle 135 years */
#define TS_TRUNC 1000000 /* truncate to milli-second significance */
/*/subhead struct tsDetail----------------------------------------------------
* breakdown structure for working with secPastEpoch
*----------------------------------------------------------------------------*/
struct tsDetail {
int year; /* 4 digit year */
int dayYear; /* day number in year; 0 = Jan 1 */
int monthNum; /* month number; 0 = Jan */
int dayMonth; /* day number; 0 = 1st of month */
int hours; /* hours within day */
int minutes; /* minutes within hour */
int seconds; /* seconds within minute */
int dayOfWeek; /* weekday number; 0 = Sun */
int leapYear; /* (0, 1) for year (isn't, is) a leap year */
char dstOverlapChar; /* indicator for distinguishing duplicate
times in the `switch to standard' time period:
':'--time isn't ambiguous;
's'--time is standard time
'd'--time is daylight time */
};
static void tsStampFromLocal(TS_STAMP *pStamp, struct tsDetail *pT);
static void tsStampToLocal(TS_STAMP stamp,struct tsDetail *pT);
static void tsStampToLocalZone(TS_STAMP *pStamp,struct tsDetail *pT);
static void tsInitMinWest(void);
@@ -846,7 +826,7 @@ long epicsShareAPI tsRoundUpLocal(TS_STAMP *pStamp, unsigned long interval)
return retStat;
}
/*+/internal******************************************************************
/*+/subr**********************************************************************
* NAME tsStampFromLocal - convert time stamp to local time
*
* DESCRIPTION
@@ -860,7 +840,7 @@ long epicsShareAPI tsRoundUpLocal(TS_STAMP *pStamp, unsigned long interval)
* o doesn't handle 0 time stamps for time zones west of Greenwich
*
*-*/
static void tsStampFromLocal(TS_STAMP *pStamp, struct tsDetail *pT)
void epicsShareAPI tsStampFromLocal(TS_STAMP *pStamp, struct tsDetail *pT)
{
long retStat=S_ts_OK;/* return status to caller */
@@ -936,7 +916,7 @@ static void tsStampFromLocal(TS_STAMP *pStamp, struct tsDetail *pT)
*pStamp = stamp;
}
/*+/internal******************************************************************
/*+/subr**********************************************************************
* NAME tsStampToLocal - convert time stamp to local time
*
* DESCRIPTION
@@ -950,7 +930,7 @@ static void tsStampFromLocal(TS_STAMP *pStamp, struct tsDetail *pT)
* o doesn't handle 0 time stamps for time zones west of Greenwich
*
*-*/
static void tsStampToLocal(TS_STAMP stamp,struct tsDetail *pT)
void epicsShareAPI tsStampToLocal(TS_STAMP stamp,struct tsDetail *pT)
{
int dstBegin; /* day DST begins */
int dstEnd; /* day DST ends */