QOF
0.7.5
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
qoftime.h
Go to the documentation of this file.
1
/***************************************************************************
2
* qoftime.h - QofTime, 64bit UTC time handling (seconds).
3
* Rewritten from scratch for QOF 0.7.0
4
*
5
* Fri May 5 15:05:32 2006
6
* Copyright 2006 Neil Williams
7
* linux@codehelp.co.uk
8
****************************************************************************/
9
/*
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
19
*
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
23
*/
24
25
#ifndef _QOFTIME_H
26
#define _QOFTIME_H
27
90
#include "config.h"
91
#include <time.h>
92
94
#define QOF_MOD_TIME "qof-time"
95
96
#ifndef QOF_DISABLE_DEPRECATED
97
typedef
struct
timespec64
98
{
99
guint64 tv_sec;
100
glong tv_nsec;
101
}
Timespec
;
102
#endif
103
105
#define QOF_NSECS 1000000000
106
120
typedef
struct
QofTime64
QofTime
;
121
129
typedef
gint64
QofTimeSecs
;
130
140
void
141
qof_time_add_secs
(
QofTime
* qt,
QofTimeSecs
secs);
142
152
QofTime
*
153
qof_time_add_secs_copy
(
QofTime
* qt,
QofTimeSecs
secs);
154
160
QofTime
*
161
qof_time_new
(
void
);
162
170
QofTime
*
171
qof_time_copy
(
const
QofTime
*qt);
172
174
void
175
qof_time_free
(
QofTime
* qt);
176
184
void
185
qof_time_set_secs
(
QofTime
* time,
QofTimeSecs
secs);
186
193
void
194
qof_time_set_nanosecs
(
QofTime
* time, glong nano);
195
202
QofTimeSecs
203
qof_time_get_secs
(
const
QofTime
* time);
204
211
glong
212
qof_time_get_nanosecs
(
const
QofTime
* time);
218
gboolean
219
qof_time_equal
(
const
QofTime
* ta,
const
QofTime
* tb);
220
222
gint
223
qof_time_cmp
(
const
QofTime
* ta,
const
QofTime
* tb);
224
234
QofTime
*
235
qof_time_diff
(
const
QofTime
* ta,
const
QofTime
* tb);
236
242
QofTime
*
243
qof_time_abs
(
QofTime
* t);
244
245
gboolean
246
qof_time_is_valid (
const
QofTime
* qt);
247
257
QofTime
*
258
qof_time_from_time_t
(time_t t, glong nanosecs);
259
269
QofTime
*
270
qof_time_set
(
QofTimeSecs
t, glong nanosecs);
271
285
gboolean
286
qof_time_to_time_t
(
QofTime
* ts, time_t * t, glong * nanosecs);
287
300
QofTime
*
301
qof_time_from_tm
(
struct
tm *tm, glong nanosecs);
302
310
gboolean
311
qof_time_to_gtimeval
(
QofTime
* qt, GTimeVal * gtv);
312
319
void
320
qof_time_from_gtimeval
(
QofTime
* qt, GTimeVal * gtv);
321
332
QofTime
*
333
qof_time_dmy_to_time
(guint8 day, guint8 month, guint16 year);
334
348
gboolean
349
qof_time_to_dmy
(
QofTime
* t, guint8 * day, guint8 * month, guint16 * year);
360
GDate *
361
qof_time_to_gdate
(
QofTime
* time);
362
371
QofTime
*
372
qof_time_from_gdate
(GDate * date);
373
385
GTimeVal *
386
qof_time_get_current_start
(
void
);
387
398
QofTime
*
399
qof_time_get_current
(
void
);
400
409
gboolean
410
qof_time_set_day_middle
(
QofTime
* t);
411
420
gboolean
421
qof_time_set_day_start
(
QofTime
* time);
422
431
gboolean
432
qof_time_set_day_end
(
QofTime
* time);
433
442
guint8
443
qof_time_last_mday
(
QofTime
* ts);
444
451
QofTime
*
452
qof_time_get_today_start
(
void
);
453
455
QofTime
*
456
qof_time_get_today_end
(
void
);
457
463
gchar *
464
qof_time_stamp_now
(
void
);
465
469
#endif
/* _QOFTIME_H */
qof
qoftime.h
Generated by
1.8.3.1