diff --git a/src/libCom/tsDefs/README b/src/libCom/tsDefs/README new file mode 100644 index 000000000..fddac4575 --- /dev/null +++ b/src/libCom/tsDefs/README @@ -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. + diff --git a/src/libCom/tsDefs/tsDefs.c b/src/libCom/tsDefs/tsDefs.c new file mode 100644 index 000000000..5b0b8d24c --- /dev/null +++ b/src/libCom/tsDefs/tsDefs.c @@ -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); +} + diff --git a/src/libCom/tsDefs/tsDefs.h b/src/libCom/tsDefs/tsDefs.h new file mode 100644 index 000000000..586147c67 --- /dev/null +++ b/src/libCom/tsDefs/tsDefs.h @@ -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 + +