Added tsDefs - R3.13 compatibility tsStamp code
This commit is contained in:
6
src/libCom/tsDefs/README
Normal file
6
src/libCom/tsDefs/README
Normal 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.
|
||||
|
||||
27
src/libCom/tsDefs/tsDefs.c
Normal file
27
src/libCom/tsDefs/tsDefs.c
Normal 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);
|
||||
}
|
||||
|
||||
42
src/libCom/tsDefs/tsDefs.h
Normal file
42
src/libCom/tsDefs/tsDefs.h
Normal 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user