Products Support Documentation Download
rdmtimeapi.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * Raima Database Manager
3  *
4  * Copyright (c) 2010 Raima Inc., All rights reserved.
5  *
6  * Use of this software, whether in source code format, or in executable,
7  * binary object code form, is governed by the Raima LICENSE which
8  * is fully described in the LICENSE.TXT file, included within this
9  * distribution of files.
10  * ----------------------------------------------------------------------------
11  */
12 
17 #if !defined(RDMTIMEAPI_H_INCLUDED_)
18 #define RDMTIMEAPI_H_INCLUDED_
19 
20 #if defined(__cplusplus) && !defined(CPP_HEADER_INCLUDED)
21 #error rdmtimeapi.h is only for C applications. Do not include it directly in C++ applications. Use cpp-rdmtimeapi.h instead
22 #endif
23 
24 #include "rdmdatetimetypes.h"
25 #include "rdmretcodetypes.h"
26 
27 #if !defined(RDM_NO_UNICODE)
28 #define rdm_timeFromString RDM_T_FUNC(rdm_timeFromString)
29 #define rdm_timeToString RDM_T_FUNC(rdm_timeToString)
30 #define rdm_timeNowAsString RDM_T_FUNC(rdm_timeNowAsString)
31 #endif
32 
50 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timeFromString (
51  const RDM_TCHAR_T *str,
52  RDM_PACKED_TIME_T *ptm
53  )
54 ;
55 
62 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timeHour (
64  )
65 ;
66 
73 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timeMinute (
75  )
76 ;
77 
84 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timeSecond (
86  )
87 ;
88 
95 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timeFraction (
97  )
98 ;
99 
108 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timeToString (
109  RDM_PACKED_TIME_T timeVal,
110  RDM_TIME_FORMAT time_fmt,
111  RDM_TCHAR_T *buf,
112  size_t bufSize,
113  size_t *puSize
114  )
115 ;
116 
123 RDM_EXPORT RDM_PACKED_TIME_T EXTERNAL_FCN rdm_timeZero (
124  void)
125 ;
126 
134 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timeNow (
135  int16_t time_zone,
136  RDM_PACKED_TIME_T *ptm
137  )
138 ;
139 
148 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timeNowAsString (
149  int16_t time_zone,
150  RDM_TCHAR_T *timebuf,
151  size_t buflen
152  )
153 ;
154 
157 #endif /* RDMTIMEAPI_H_INCLUDED_ */
RDM_RETCODE rdm_timeToString(RDM_PACKED_TIME_T timeVal, RDM_TIME_FORMAT time_fmt, RDM_TCHAR_T *buf, size_t bufSize, size_t *puSize)
Convert a time to a string.
RDM_RETCODE rdm_timeNowAsString(int16_t time_zone, RDM_TCHAR_T *timebuf, size_t buflen)
Get current local time as a string.
uint32_t RDM_PACKED_TIME_T
The RDM packed Time data structure.
RDM Status and Error Return Codes.
RDM_RETCODE rdm_timeNow(int16_t time_zone, RDM_PACKED_TIME_T *ptm)
Get the current local time.
RDM_PACKED_TIME_T rdm_timeZero(void)
Get the local time at the start of a day.
uint16_t rdm_timeSecond(RDM_PACKED_TIME_T tm)
Get the second of the minute.
RDM_RETCODE rdm_timeFromString(const RDM_TCHAR_T *str, RDM_PACKED_TIME_T *ptm)
Convert a string to local time.
RDM_RETCODE
RDM status and error return codes.
uint16_t rdm_timeFraction(RDM_PACKED_TIME_T tm)
Get the fractions of the second.
uint16_t rdm_timeHour(RDM_PACKED_TIME_T tm)
Get the hour of the day.
uint16_t rdm_timeMinute(RDM_PACKED_TIME_T tm)
Get the minute of the hour.
Header for the public Date/Time types.
#define RDM_TCHAR_T
Definition: psptypes.h:134
RDM_TIME_FORMAT
RDM time format codes.