gwenhywfar
4.6.0beta
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
src
os
gwentime.h
Go to the documentation of this file.
1
/***************************************************************************
2
$RCSfile$
3
-------------------
4
cvs : $Id$
5
begin : Wed Mar 24 2004
6
copyright : (C) 2004 by Martin Preuss
7
email : martin@libchipcard.de
8
9
***************************************************************************
10
* *
11
* This library is free software; you can redistribute it and/or *
12
* modify it under the terms of the GNU Lesser General Public *
13
* License as published by the Free Software Foundation; either *
14
* version 2.1 of the License, or (at your option) any later version. *
15
* *
16
* This library is distributed in the hope that it will be useful, *
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
19
* Lesser General Public License for more details. *
20
* *
21
* You should have received a copy of the GNU Lesser General Public *
22
* License along with this library; if not, write to the Free Software *
23
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
24
* MA 02111-1307 USA *
25
* *
26
***************************************************************************/
27
28
29
#ifndef GWEN_TIME_H
30
#define GWEN_TIME_H
31
32
33
#include <gwenhywfar/gwenhywfarapi.h>
34
#include <gwenhywfar/types.h>
35
#include <gwenhywfar/db.h>
36
#include <time.h>
37
38
39
#ifdef __cplusplus
40
extern
"C"
{
41
#endif
42
43
typedef
struct
GWEN_TIME
GWEN_TIME
;
44
45
46
GWENHYWFAR_API
int
GWEN_Time_toDb
(
const
GWEN_TIME
*t,
GWEN_DB_NODE
*db);
47
GWENHYWFAR_API
GWEN_TIME
*
GWEN_Time_fromDb
(
GWEN_DB_NODE
*db);
48
49
50
GWENHYWFAR_API
GWEN_TIME
*
GWEN_CurrentTime
(
void
);
51
52
GWENHYWFAR_API
GWEN_TIME
*
GWEN_Time_new
(
int
year,
53
int
month,
54
int
day,
55
int
hour,
56
int
min,
57
int
sec,
58
int
inUtc);
59
93
GWENHYWFAR_API
GWEN_TIME
*
GWEN_Time_fromString
(
const
char
*s,
94
const
char
*tmpl);
95
96
GWENHYWFAR_API
GWEN_TIME
*
GWEN_Time_fromUtcString
(
const
char
*s,
97
const
char
*tmpl);
98
99
GWENHYWFAR_API
int
GWEN_Time_toString
(
const
GWEN_TIME
*t,
100
const
char
*tmpl,
101
GWEN_BUFFER
*buf);
102
GWENHYWFAR_API
int
GWEN_Time_toUtcString
(
const
GWEN_TIME
*t,
103
const
char
*tmpl,
104
GWEN_BUFFER
*buf);
105
106
110
GWENHYWFAR_API
GWEN_TIME
*
GWEN_Time_fromSeconds
(uint32_t s);
111
GWENHYWFAR_API
void
GWEN_Time_free
(
GWEN_TIME
*t);
112
GWENHYWFAR_API
GWEN_TIME
*
GWEN_Time_dup
(
const
GWEN_TIME
*t);
113
117
GWENHYWFAR_API
uint32_t
GWEN_Time_Seconds
(
const
GWEN_TIME
*t);
118
120
GWENHYWFAR_API
double
GWEN_Time_Milliseconds
(
const
GWEN_TIME
*t);
121
125
GWENHYWFAR_API
double
GWEN_Time_Diff
(
const
GWEN_TIME
*t1,
126
const
GWEN_TIME
*t0);
127
131
GWENHYWFAR_API
double
GWEN_Time_DiffSeconds
(
const
GWEN_TIME
*t1,
132
const
GWEN_TIME
*t0);
133
134
/* Compare t1 and t0. Return 0 if both are equal, -1 if t1<t0 and
135
* 1 if t1>t0
136
*/
137
GWENHYWFAR_API
int
GWEN_Time_Compare
(
const
GWEN_TIME
*t1,
const
GWEN_TIME
*t0);
138
143
GWENHYWFAR_API
int
GWEN_Time_AddSeconds
(
GWEN_TIME
*ti, uint32_t secs);
144
149
GWENHYWFAR_API
int
GWEN_Time_SubSeconds
(
GWEN_TIME
*ti, uint32_t secs);
150
151
155
GWENHYWFAR_API
int
GWEN_Time_GetBrokenDownTime
(
const
GWEN_TIME
*t,
156
int
*hours,
157
int
*mins,
158
int
*secs);
159
163
GWENHYWFAR_API
int
GWEN_Time_GetBrokenDownUtcTime
(
const
GWEN_TIME
*t,
164
int
*hours,
165
int
*mins,
166
int
*secs);
167
171
GWENHYWFAR_API
int
GWEN_Time_GetBrokenDownDate
(
const
GWEN_TIME
*t,
172
int
*days,
173
int
*month,
174
int
*year);
175
179
GWENHYWFAR_API
int
GWEN_Time_GetBrokenDownUtcDate
(
const
GWEN_TIME
*t,
180
int
*days,
181
int
*month,
182
int
*year);
183
188
GWENHYWFAR_API
struct
tm
GWEN_Time_toTm
(const
GWEN_TIME
*t);
189
193
GWENHYWFAR_API
time_t
GWEN_Time_toTime_t
(
const
GWEN_TIME
*t);
194
195
196
197
#ifdef __cplusplus
198
}
199
#endif
200
201
202
203
#endif
204
Generated on Wed May 29 2013 05:31:47 for gwenhywfar by
1.8.3.1