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 
61 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timeHour (
63 ;
64 
71 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timeMinute (
73 ;
74 
81 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timeSecond (
83 ;
84 
91 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timeFraction (
93 ;
94 
103 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timeToString (
104  RDM_PACKED_TIME_T timeVal,
105  RDM_TIME_FORMAT time_fmt,
106  RDM_TCHAR_T *buf,
107  size_t bufSize,
108  size_t *puSize)
109 ;
110 
117 RDM_EXPORT RDM_PACKED_TIME_T EXTERNAL_FCN rdm_timeZero (
118  void)
119 ;
120 
128 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timeNow (
129  int16_t time_zone,
130  RDM_PACKED_TIME_T *ptm)
131 ;
132 
141 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timeNowAsString (
142  int16_t time_zone,
143  RDM_TCHAR_T *timebuf,
144  size_t buflen)
145 ;
146 
149 #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.