qoftime.h File Reference


Detailed Description

64bit UTC Time handling routines

Author:
Copyright 2006 Neil Williams <linux@codehelp.co.uk>

Definition in file qoftime.h.

#include "config.h"
#include <time.h>

Go to the source code of this file.

Data Structures

struct  timespec64

QofTime functions.

typedef struct QofTime64 QofTime
 Use a 64-bit signed int QofTime.
typedef gint64 QofTimeSecs
 Replacement for time_t.
void qof_time_add_secs (QofTime *qt, QofTimeSecs secs)
 Add (or subtract) seconds from a QofTime.
QofTimeqof_time_add_secs_copy (QofTime *qt, QofTimeSecs secs)
 Create a new QofTime, secs different to an original.
QofTimeqof_time_new (void)
 create an empty QofTime
QofTimeqof_time_copy (const QofTime *qt)
 Create a copy of a QofTime.
void qof_time_free (QofTime *qt)
 Free a QofTime when no longer required.
void qof_time_set_secs (QofTime *time, QofTimeSecs secs)
 Set the number of seconds.
void qof_time_set_nanosecs (QofTime *time, glong nano)
 Set the number of seconds.
QofTimeSecs qof_time_get_secs (const QofTime *time)
 Get the number of seconds.
glong qof_time_get_nanosecs (const QofTime *time)
 Get the number of seconds.

Defines

#define QOF_MOD_TIME   "qof-time"
#define QOF_NSECS   1000000000

Typedefs

typedef struct timespec64 Timespec

Functions

QofTime manipulation
gboolean qof_time_equal (const QofTime *ta, const QofTime *tb)
gint qof_time_cmp (const QofTime *ta, const QofTime *tb)
QofTimeqof_time_diff (const QofTime *ta, const QofTime *tb)
 difference between two QofTimes.
QofTimeqof_time_abs (QofTime *t)
gboolean qof_time_is_valid (const QofTime *qt)
QofTimeqof_time_from_time_t (time_t t, glong nanosecs)
QofTimeqof_time_set (QofTimeSecs t, glong nanosecs)
gboolean qof_time_to_time_t (QofTime *ts, time_t *t, glong *nanosecs)
QofTimeqof_time_from_tm (struct tm *tm, glong nanosecs)
 Convert a broken-down into a QofTime.
gboolean qof_time_to_gtimeval (QofTime *qt, GTimeVal *gtv)
 Convert a QofTime to a GTimeVal.
void qof_time_from_gtimeval (QofTime *qt, GTimeVal *gtv)
 Convert a QofTime to a GTimeVal.
QofTimeqof_time_dmy_to_time (guint8 day, guint8 month, guint16 year)
gboolean qof_time_to_dmy (QofTime *t, guint8 *day, guint8 *month, guint16 *year)
GDate * qof_time_to_gdate (QofTime *time)
 Convert QofTime to GDate.
QofTimeqof_time_from_gdate (GDate *date)
 Convert a GDate to a QofTime.
Time Start/End Adjustment routines
Given a time value, adjust it to be the beginning or end of that day.

GTimeVal * qof_time_get_current_start (void)
QofTimeqof_time_get_current (void)
 Get the current QofTime.
gboolean qof_time_set_day_middle (QofTime *t)
 set the given QofTime to midday on the same day.
gboolean qof_time_set_day_start (QofTime *time)
 set the given QofTime to the first second of that day.
gboolean qof_time_set_day_end (QofTime *time)
 set the given QofTime to the last second of that day.
guint8 qof_time_last_mday (QofTime *ts)
Today's Date
QofTimeqof_time_get_today_start (void)
QofTimeqof_time_get_today_end (void)
gchar * qof_time_stamp_now (void)


Generated on Thu Jan 31 22:50:26 2008 for QOF by  doxygen 1.5.4