gwenhywfar
4.3.1
|
#include <gwenhywfar/gwenhywfarapi.h>
#include <gwenhywfar/types.h>
#include <gwenhywfar/db.h>
#include <time.h>
Go to the source code of this file.
Definition at line 43 of file gwentime.h.
GWENHYWFAR_API GWEN_TIME* GWEN_CurrentTime | ( | void | ) |
Definition at line 50 of file gwentime_all.c.
References DBG_ERROR, GWEN_LOGDOMAIN, GWEN_NEW_OBJECT, GWEN_Time__GetCurrentTime(), and GWEN_Time_free().
Referenced by GWEN_CryptMgr_Sign(), and GWEN_DlgProgress_AddLogText().
GWENHYWFAR_API int GWEN_Time_AddSeconds | ( | GWEN_TIME * | ti, |
uint32_t | secs | ||
) |
Adds the given number of seconds to the given GWEN_TIME.
Definition at line 74 of file gwentime_all.c.
References DBG_INFO, GWEN_ERROR_INVALID, and GWEN_LOGDOMAIN.
GWENHYWFAR_API int GWEN_Time_Compare | ( | const GWEN_TIME * | t1, |
const GWEN_TIME * | t0 | ||
) |
Definition at line 474 of file gwentime_all.c.
GWENHYWFAR_API double GWEN_Time_Diff | ( | const GWEN_TIME * | t1, |
const GWEN_TIME * | t0 | ||
) |
Returns the difference between t1 and t2 in milliseconds
Definition at line 446 of file gwentime_all.c.
GWENHYWFAR_API double GWEN_Time_DiffSeconds | ( | const GWEN_TIME * | t1, |
const GWEN_TIME * | t0 | ||
) |
Returns the difference between t1 and t2 in seconds
Definition at line 460 of file gwentime_all.c.
GWENHYWFAR_API GWEN_TIME* GWEN_Time_dup | ( | const GWEN_TIME * | t | ) |
Definition at line 426 of file gwentime_all.c.
References GWEN_NEW_OBJECT.
Referenced by GWEN_SarFileHeader_dup(), GWEN_SigHead_SetDateTime(), GWEN_SslCertDescr_dup(), GWEN_SslCertDescr_SetNotAfter(), and GWEN_SslCertDescr_SetNotBefore().
GWENHYWFAR_API void GWEN_Time_free | ( | GWEN_TIME * | t | ) |
Definition at line 438 of file gwentime_all.c.
References GWEN_FREE_OBJECT.
Referenced by GWEN_CryptMgr_Sign(), GWEN_CurrentTime(), GWEN_SarFileHeader_dup(), GWEN_SarFileHeader_free(), GWEN_SarFileHeader_SetAtime(), GWEN_SarFileHeader_SetCtime(), GWEN_SarFileHeader_SetMtime(), GWEN_SigHead_free(), GWEN_SigHead_SetDateTime(), GWEN_SslCertDescr_free(), GWEN_SslCertDescr_ReadDb(), GWEN_SslCertDescr_SetNotAfter(), GWEN_SslCertDescr_SetNotBefore(), and GWEN_SyncIo_Tls_GetPeerCert().
Definition at line 156 of file gwentime_all.c.
References DBG_INFO, DBG_VERBOUS, GWEN_DB_GetGroup(), GWEN_DB_GetIntValue(), GWEN_LOGDOMAIN, GWEN_PATH_FLAGS_NAMEMUSTEXIST, and GWEN_Time_new().
Referenced by GWEN_SslCertDescr_ReadDb().
GWENHYWFAR_API GWEN_TIME* GWEN_Time_fromSeconds | ( | uint32_t | s | ) |
Creates a GWEN_TIME object from the return value of GWEN_Time_Seconds.
Definition at line 64 of file gwentime_all.c.
References GWEN_NEW_OBJECT.
Referenced by GWEN_Sar_AddFile(), GWEN_SyncIo_Tls_GetPeerCert(), and GWEN_Time_new().
GWENHYWFAR_API GWEN_TIME* GWEN_Time_fromString | ( | const char * | s, |
const char * | tmpl | ||
) |
Parses the data and time from the given string according to the template string (quite similar to sscanf).
The string is expected to contain the date/time in local time. The following characters are accepted in the template string:
Character | Meaning |
Y | digit of the year |
M | digit of the month |
D | digit of the day of month |
h | digit of the hour |
m | digit of the minute |
s | digit of the second |
All other characters are ignored.
Some examples of valid patterns follow:
s | string containing the date/time |
tmpl | template string |
Definition at line 325 of file gwentime_all.c.
References GWEN_Time__fromString().
GWENHYWFAR_API GWEN_TIME* GWEN_Time_fromUtcString | ( | const char * | s, |
const char * | tmpl | ||
) |
Definition at line 331 of file gwentime_all.c.
References GWEN_Time__fromString().
Referenced by GWEN_Sar_TlvToFileHeader(), and GWEN_SigHead_fromBuffer().
GWENHYWFAR_API int GWEN_Time_GetBrokenDownDate | ( | const GWEN_TIME * | t, |
int * | days, | ||
int * | month, | ||
int * | year | ||
) |
Returns the broken down date as local date.
Definition at line 557 of file gwentime_all.c.
References DBG_ERROR, and GWEN_LOGDOMAIN.
Referenced by GWEN_Time__fillTmplChars().
GWENHYWFAR_API int GWEN_Time_GetBrokenDownTime | ( | const GWEN_TIME * | t, |
int * | hours, | ||
int * | mins, | ||
int * | secs | ||
) |
Returns the broken down time as local time.
Definition at line 513 of file gwentime_all.c.
References DBG_ERROR, and GWEN_LOGDOMAIN.
Referenced by GWEN_Time__fillTmplChars().
GWENHYWFAR_API int GWEN_Time_GetBrokenDownUtcDate | ( | const GWEN_TIME * | t, |
int * | days, | ||
int * | month, | ||
int * | year | ||
) |
Returns the broken down time as UTC date (Greenwhich Mean time).
Definition at line 579 of file gwentime_all.c.
References DBG_ERROR, and GWEN_LOGDOMAIN.
Referenced by GWEN_Time__fillTmplChars(), and GWEN_Time_toDb().
GWENHYWFAR_API int GWEN_Time_GetBrokenDownUtcTime | ( | const GWEN_TIME * | t, |
int * | hours, | ||
int * | mins, | ||
int * | secs | ||
) |
Returns the broken down time as UTC time (Greenwhich Mean time).
Definition at line 535 of file gwentime_all.c.
References DBG_ERROR, and GWEN_LOGDOMAIN.
Referenced by GWEN_Time__fillTmplChars(), and GWEN_Time_toDb().
GWENHYWFAR_API double GWEN_Time_Milliseconds | ( | const GWEN_TIME * | t | ) |
returns the time in milliseconds
Definition at line 499 of file gwentime_all.c.
GWENHYWFAR_API GWEN_TIME* GWEN_Time_new | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour, | ||
int | min, | ||
int | sec, | ||
int | inUtc | ||
) |
Definition at line 337 of file gwentime_all.c.
References GWEN_Time__mktimeUtc(), and GWEN_Time_fromSeconds().
Referenced by GWEN_Time__fromString(), and GWEN_Time_fromDb().
GWENHYWFAR_API uint32_t GWEN_Time_Seconds | ( | const GWEN_TIME * | t | ) |
Returns the time in seconds since the epoch (00:00:00 UTC Jan 1, 1970).
Definition at line 506 of file gwentime_all.c.
GWENHYWFAR_API int GWEN_Time_SubSeconds | ( | GWEN_TIME * | ti, |
uint32_t | secs | ||
) |
Subs the given number of seconds from the given GWEN_TIME.
Definition at line 91 of file gwentime_all.c.
References DBG_INFO, GWEN_ERROR_INVALID, and GWEN_LOGDOMAIN.
GWENHYWFAR_API int GWEN_Time_toDb | ( | const GWEN_TIME * | t, |
GWEN_DB_NODE * | db | ||
) |
Definition at line 116 of file gwentime_all.c.
References DBG_INFO, GWEN_DB_FLAGS_DEFAULT, GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_DB_GetGroup(), GWEN_DB_SetIntValue(), GWEN_LOGDOMAIN, GWEN_Time_GetBrokenDownUtcDate(), and GWEN_Time_GetBrokenDownUtcTime().
Referenced by GWEN_SslCertDescr_toDb().
GWENHYWFAR_API int GWEN_Time_toString | ( | const GWEN_TIME * | t, |
const char * | tmpl, | ||
GWEN_BUFFER * | buf | ||
) |
Definition at line 771 of file gwentime_all.c.
References GWEN_Time__toString().
Referenced by GWEN_Date_fromTime(), GWEN_DlgProgress_AddLogText(), and GWEN_Gui_CheckCertBuiltIn().
GWENHYWFAR_API time_t GWEN_Time_toTime_t | ( | const GWEN_TIME * | t | ) |
Returns this date as a time_t value (see time(2)).
Definition at line 612 of file gwentime_all.c.
GWENHYWFAR_API struct tm GWEN_Time_toTm | ( | const GWEN_TIME * | t | ) | [read] |
Returns this date as a struct tm (see ctime(3)) in the local time zone.
Definition at line 602 of file gwentime_all.c.
GWENHYWFAR_API int GWEN_Time_toUtcString | ( | const GWEN_TIME * | t, |
const char * | tmpl, | ||
GWEN_BUFFER * | buf | ||
) |
Definition at line 778 of file gwentime_all.c.
References GWEN_Time__toString().
Referenced by GWEN_Sar_FileHeaderToTlv(), and GWEN_SigHead_toBuffer().