Added tsDefs - R3.13 compatibility tsStamp code

This commit is contained in:
Janet B. Anderson
2000-12-06 16:38:04 +00:00
parent d622dc7d31
commit fd5b26a387
3 changed files with 75 additions and 0 deletions

6
src/libCom/tsDefs/README Normal file
View File

@@ -0,0 +1,6 @@
This directory contains the old R3.13
time stamp definitions and routines
needed by epics extensions. They exist
for compatibility purposes only and
should not be used by new code.

View File

@@ -0,0 +1,27 @@
/*
* $Id$
*/
#define epicsExportSharedSymbols
#include "tsDefs.h"
epicsShareFunc char * epicsShareAPI tsStampToText(const TS_STAMP *pTS,enum tsTextType textType,char *textBuffer)
{
switch (textType) {
case TS_TEXT_MMDDYY:
tsStampToStrftime(textBuffer,28,"%m/%d/%y %H:%M:%S.%09f",pTS);
break;
case TS_TEXT_MONDDYYYY:
tsStampToStrftime(textBuffer,32,"%b %d, %Y %H:%M:%S.%09f",pTS);
break;
default:
return NULL;
}
return textBuffer;
}
epicsShareFunc long epicsShareAPI tsLocalTime(TS_STAMP *pStamp)
{
return tsStampGetCurrent(pStamp);
}

View File

@@ -0,0 +1,42 @@
/*
* $Id$
* This file contains the old R3.13
* time stamp definitions and routines
* needed by epics extensions. They exist
* for compatibility purposes only and
* should not be used by new code.
*
*/
#ifndef tsDefsh
#define tsDefsh
#include "shareLib.h"
#ifdef __cplusplus
extern "C" {
#endif
#define epicsExportSharedSymbols
#include "tsStamp.h"
/*----------------------------------------------------------------------------
* TS_TEXT_xxx text type codes for converting between text and time stamp
*
* TS_TEXT_MONDDYYYY Mon dd, yyyy hh:mm:ss.nano-secs
* TS_TEXT_MMDDYY mm/dd/yy hh:mm:ss.nano-secs
* 123456789012345678901234567890123456789
* 0 1 2 3
*----------------------------------------------------------------------------*/
enum tsTextType{
TS_TEXT_MONDDYYYY,
TS_TEXT_MMDDYY
};
epicsShareFunc char * epicsShareAPI tsStampToText(const TS_STAMP *pTS,enum tsTextType textType,char *textBuffer);
epicsShareFunc long epicsShareAPI tsLocalTime(TS_STAMP *pStamp);
#ifdef __cplusplus
}
#endif