|
gwenhywfar
5.9.0
|
#include "gwendate_p.h"#include "i18n_l.h"#include <gwenhywfar/debug.h>#include <gwenhywfar/misc.h>#include <time.h>#include <ctype.h>
Go to the source code of this file.
Variables | |
| static const uint8_t | daysInMonth [12] |
|
static |
Definition at line 62 of file gwendate.c.
References _writeAsString(), DBG_INFO, GWEN_LOGDOMAIN, GWEN_NEW_OBJECT, and NULL.
Referenced by GWEN_Date_fromGregorian(), and GWEN_Date_fromString().


|
static |
Definition at line 124 of file gwendate.c.
Referenced by _createFromGregorianAndUseGivenString(), and GWEN_Date_setJulian().

| void GWEN_Date__fillTmplChars | ( | const GWEN_DATE * | t, |
| GWEN_DATE_TMPLCHAR_LIST * | ll | ||
| ) |
Definition at line 656 of file gwendate.c.
References DBG_DEBUG, DBG_ERROR, GWEN_Date_WeekDay(), GWEN_LOGDOMAIN, I18N, and NULL.
Referenced by GWEN_Date_toStringWithTemplate().


| GWEN_DATE_TMPLCHAR* GWEN_Date__findTmplChar | ( | GWEN_DATE_TMPLCHAR_LIST * | ll, |
| char | c | ||
| ) |
Definition at line 609 of file gwendate.c.
Referenced by GWEN_Date__sampleTmplChars(), and GWEN_Date_toStringWithTemplate().

| void GWEN_Date__sampleTmplChars | ( | GWEN_UNUSED const GWEN_DATE * | t, |
| const char * | tmpl, | ||
| GWEN_UNUSED GWEN_BUFFER * | buf, | ||
| GWEN_DATE_TMPLCHAR_LIST * | ll | ||
| ) |
Definition at line 626 of file gwendate.c.
References DBG_DEBUG, GWEN_Date__findTmplChar(), GWEN_DateTmplChar_new(), and GWEN_LOGDOMAIN.
Referenced by GWEN_Date_toStringWithTemplate().


| void GWEN_Date_AddDays | ( | GWEN_DATE * | gd, |
| int | days | ||
| ) |
Add days to the given date.
Definition at line 153 of file gwendate.c.
References GWEN_Date_setJulian().

Definition at line 417 of file gwendate.c.
Referenced by test_date().

| GWEN_DATE* GWEN_Date_CurrentDate | ( | void | ) |
Create a date from the current local date.
Definition at line 238 of file gwendate.c.
References GWEN_Date_fromLocalTime().
Referenced by test_date().


| int GWEN_Date_DaysInMonth | ( | const GWEN_DATE * | gd | ) |
Definition at line 340 of file gwendate.c.
References daysInMonth.
| int GWEN_Date_DaysInYear | ( | const GWEN_DATE * | gd | ) |
Returns the distance between the given date and the begin of that year. E.g. if the given date is the 1st of January the result is 0.
Definition at line 353 of file gwendate.c.
References GWEN_Date_free(), and GWEN_Date_fromGregorian().

Definition at line 437 of file gwendate.c.
Definition at line 248 of file gwendate.c.
References GWEN_NEW_OBJECT.
| void GWEN_Date_free | ( | GWEN_DATE * | gd | ) |
Destructor.
Definition at line 323 of file gwendate.c.
References GWEN_FREE_OBJECT.
Referenced by _convertAndSetCharValue(), GWEN_Date_DaysInYear(), GWEN_Date_GetLastHalfYearEnd(), GWEN_Date_GetLastHalfYearStart(), GWEN_Date_GetLastMonthEnd(), GWEN_Date_GetLastMonthStart(), GWEN_Date_GetLastQuarterYearEnd(), GWEN_Date_GetLastQuarterYearStart(), GWEN_Date_GetLastYearEnd(), and GWEN_Date_GetLastYearStart().

| GWEN_DATE* GWEN_Date_fromDb | ( | GWEN_DB_NODE * | db | ) |
Definition at line 796 of file gwendate.c.
References DBG_INFO, DBG_VERBOUS, GWEN_Date_fromString(), GWEN_DB_GetCharValue(), GWEN_LOGDOMAIN, and NULL.

| GWEN_DATE* GWEN_Date_fromGmTime | ( | time_t | t | ) |
Definition at line 220 of file gwendate.c.
References GWEN_Date_fromGregorian(), and NULL.

| GWEN_DATE* GWEN_Date_fromGregorian | ( | int | y, |
| int | m, | ||
| int | d | ||
| ) |
Create a date from the gregorian calender using year, month and day.
| y | year (e.g. 2009) |
| m | month (1-12) |
| d | day of month (1-31) |
Definition at line 53 of file gwendate.c.
References _createFromGregorianAndUseGivenString(), and NULL.
Referenced by GWEN_Date_DaysInYear(), GWEN_Date_fromGmTime(), GWEN_Date_fromLocalTime(), GWEN_Date_fromString(), GWEN_Date_fromStringWithTemplate(), GWEN_Date_GetLastMonthEnd(), GWEN_Date_GetLastMonthStart(), GWEN_Date_GetThisHalfYearEnd(), GWEN_Date_GetThisHalfYearStart(), GWEN_Date_GetThisMonthEnd(), GWEN_Date_GetThisMonthStart(), GWEN_Date_GetThisQuarterYearEnd(), GWEN_Date_GetThisQuarterYearStart(), GWEN_Date_GetThisYearEnd(), and GWEN_Date_GetThisYearStart().


| GWEN_DATE* GWEN_Date_fromJulian | ( | int | julian | ) |
Create a date from the julian calender.
| julian | date in julian calender |
Definition at line 167 of file gwendate.c.
References GWEN_Date_setJulian(), and GWEN_NEW_OBJECT.
Referenced by GWEN_Date_GetLastHalfYearEnd(), GWEN_Date_GetLastMonthEnd(), GWEN_Date_GetLastMonthStart(), GWEN_Date_GetLastQuarterYearEnd(), and GWEN_Date_GetLastYearEnd().


| GWEN_DATE* GWEN_Date_fromLocalTime | ( | time_t | t | ) |
Definition at line 178 of file gwendate.c.
References GWEN_Date_fromGregorian(), and NULL.
Referenced by GWEN_Date_CurrentDate(), and test_date().


| GWEN_DATE* GWEN_Date_fromString | ( | const char * | s | ) |
Definition at line 269 of file gwendate.c.
References _createFromGregorianAndUseGivenString(), DBG_INFO, GWEN_Date_fromGregorian(), GWEN_LOGDOMAIN, and NULL.
Referenced by _convertAndSetCharValue(), GWEN_Date_fromDb(), and GWEN_Date_fromTime().


| GWEN_DATE* GWEN_Date_fromStringWithTemplate | ( | const char * | s, |
| const char * | tmpl | ||
| ) |
Definition at line 463 of file gwendate.c.
References DBG_DEBUG, DBG_ERROR, DBG_INFO, DBG_VERBOUS, GWEN_Date_fromGregorian(), GWEN_LOGDOMAIN, and NULL.
Referenced by _convertAndSetCharValue().


Definition at line 447 of file gwendate.c.
References GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_Date_fromString(), and GWEN_Time_toString().

| int GWEN_Date_GetDay | ( | const GWEN_DATE * | gd | ) |
Definition at line 385 of file gwendate.c.
| int GWEN_Date_GetJulian | ( | const GWEN_DATE * | gd | ) |
Definition at line 393 of file gwendate.c.
Referenced by GWEN_Date_GetLastHalfYearEnd(), GWEN_Date_GetLastMonthEnd(), GWEN_Date_GetLastMonthStart(), GWEN_Date_GetLastQuarterYearEnd(), and GWEN_Date_GetLastYearEnd().

Definition at line 1016 of file gwendate.c.
References GWEN_Date_free(), GWEN_Date_fromJulian(), GWEN_Date_GetJulian(), and GWEN_Date_GetThisHalfYearStart().
Referenced by GWEN_Date_GetLastHalfYearStart().


Definition at line 1003 of file gwendate.c.
References GWEN_Date_free(), GWEN_Date_GetLastHalfYearEnd(), and GWEN_Date_GetThisHalfYearStart().

Definition at line 964 of file gwendate.c.
References GWEN_Date_free(), GWEN_Date_fromGregorian(), GWEN_Date_fromJulian(), GWEN_Date_GetJulian(), GWEN_Date_GetMonth(), and GWEN_Date_GetYear().

Definition at line 947 of file gwendate.c.
References GWEN_Date_free(), GWEN_Date_fromGregorian(), GWEN_Date_fromJulian(), GWEN_Date_GetJulian(), GWEN_Date_GetMonth(), and GWEN_Date_GetYear().

Definition at line 990 of file gwendate.c.
References GWEN_Date_free(), GWEN_Date_fromJulian(), GWEN_Date_GetJulian(), and GWEN_Date_GetThisQuarterYearStart().
Referenced by GWEN_Date_GetLastQuarterYearStart().


Definition at line 977 of file gwendate.c.
References GWEN_Date_free(), GWEN_Date_GetLastQuarterYearEnd(), and GWEN_Date_GetThisQuarterYearStart().

Definition at line 1042 of file gwendate.c.
References GWEN_Date_free(), GWEN_Date_fromJulian(), GWEN_Date_GetJulian(), and GWEN_Date_GetThisYearStart().
Referenced by GWEN_Date_GetLastYearStart().


Definition at line 1029 of file gwendate.c.
References GWEN_Date_free(), GWEN_Date_GetLastYearEnd(), and GWEN_Date_GetThisYearStart().

| int GWEN_Date_GetMonth | ( | const GWEN_DATE * | gd | ) |
Definition at line 377 of file gwendate.c.
Referenced by GWEN_Date_GetLastMonthEnd(), GWEN_Date_GetLastMonthStart(), GWEN_Date_GetThisHalfYearEnd(), GWEN_Date_GetThisHalfYearStart(), GWEN_Date_GetThisMonthEnd(), GWEN_Date_GetThisMonthStart(), GWEN_Date_GetThisQuarterYearEnd(), and GWEN_Date_GetThisQuarterYearStart().

| const char* GWEN_Date_GetString | ( | const GWEN_DATE * | gd | ) |
Definition at line 409 of file gwendate.c.
Referenced by _convertAndSetCharValue(), GWEN_Date_toDb(), and test_date().

Definition at line 923 of file gwendate.c.
References GWEN_Date_fromGregorian(), GWEN_Date_GetMonth(), and GWEN_Date_GetYear().

Definition at line 913 of file gwendate.c.
References GWEN_Date_fromGregorian(), GWEN_Date_GetMonth(), and GWEN_Date_GetYear().
Referenced by GWEN_Date_GetLastHalfYearEnd(), and GWEN_Date_GetLastHalfYearStart().


Definition at line 827 of file gwendate.c.
References DBG_ERROR, GWEN_Date_fromGregorian(), GWEN_Date_GetMonth(), GWEN_Date_GetYear(), GWEN_Date_IsLeapYear(), and GWEN_LOGDOMAIN.

Definition at line 820 of file gwendate.c.
References GWEN_Date_fromGregorian(), GWEN_Date_GetMonth(), and GWEN_Date_GetYear().

Definition at line 889 of file gwendate.c.
References DBG_ERROR, GWEN_Date_fromGregorian(), GWEN_Date_GetMonth(), GWEN_Date_GetYear(), GWEN_LOGDOMAIN, and NULL.

Definition at line 865 of file gwendate.c.
References DBG_ERROR, GWEN_Date_fromGregorian(), GWEN_Date_GetMonth(), GWEN_Date_GetYear(), GWEN_LOGDOMAIN, and NULL.
Referenced by GWEN_Date_GetLastQuarterYearEnd(), and GWEN_Date_GetLastQuarterYearStart().


Definition at line 940 of file gwendate.c.
References GWEN_Date_fromGregorian(), and GWEN_Date_GetYear().

Definition at line 933 of file gwendate.c.
References GWEN_Date_fromGregorian(), and GWEN_Date_GetYear().
Referenced by GWEN_Date_GetLastYearEnd(), and GWEN_Date_GetLastYearStart().


| int GWEN_Date_GetYear | ( | const GWEN_DATE * | gd | ) |
Definition at line 369 of file gwendate.c.
Referenced by GWEN_Date_GetLastMonthEnd(), GWEN_Date_GetLastMonthStart(), GWEN_Date_GetThisHalfYearEnd(), GWEN_Date_GetThisHalfYearStart(), GWEN_Date_GetThisMonthEnd(), GWEN_Date_GetThisMonthStart(), GWEN_Date_GetThisQuarterYearEnd(), GWEN_Date_GetThisQuarterYearStart(), GWEN_Date_GetThisYearEnd(), and GWEN_Date_GetThisYearStart().

| int GWEN_Date_IsLeapYear | ( | int | y | ) |
Definition at line 332 of file gwendate.c.
Referenced by GWEN_Date_GetThisMonthEnd().

| void GWEN_Date_setJulian | ( | GWEN_DATE * | gd, |
| int | julian | ||
| ) |
Definition at line 92 of file gwendate.c.
References _writeAsString(), DBG_ERROR, and GWEN_LOGDOMAIN.
Referenced by GWEN_Date_AddDays(), GWEN_Date_fromJulian(), and GWEN_Date_SubDays().


| void GWEN_Date_SubDays | ( | GWEN_DATE * | gd, |
| int | days | ||
| ) |
Subtract days from the given date.
Definition at line 160 of file gwendate.c.
References GWEN_Date_setJulian().

| int GWEN_Date_toDb | ( | const GWEN_DATE * | dt, |
| GWEN_DB_NODE * | db | ||
| ) |
Definition at line 784 of file gwendate.c.
References GWEN_Date_GetString(), GWEN_DB_FLAGS_OVERWRITE_VARS, and GWEN_DB_SetCharValue().

| time_t GWEN_Date_toLocalTime | ( | const GWEN_DATE * | gd | ) |
Definition at line 195 of file gwendate.c.
Referenced by test_date().

| int GWEN_Date_toStringWithTemplate | ( | const GWEN_DATE * | t, |
| const char * | tmpl, | ||
| GWEN_BUFFER * | buf | ||
| ) |
Definition at line 742 of file gwendate.c.
References GWEN_Buffer_AppendByte(), GWEN_Buffer_AppendString(), GWEN_Date__fillTmplChars(), GWEN_Date__findTmplChar(), and GWEN_Date__sampleTmplChars().
Referenced by _convertAndSetCharValue().


| int GWEN_Date_WeekDay | ( | const GWEN_DATE * | gd | ) |
Definition at line 401 of file gwendate.c.
Referenced by GWEN_Date__fillTmplChars().

| void GWEN_DateTmplChar_free | ( | GWEN_DATE_TMPLCHAR * | e | ) |
Definition at line 598 of file gwendate.c.
References GWEN_FREE_OBJECT, and GWEN_LIST_FINI.
| GWEN_DATE_TMPLCHAR* GWEN_DateTmplChar_new | ( | char | c | ) |
Definition at line 567 of file gwendate.c.
References GWEN_LIST_INIT, and GWEN_NEW_OBJECT.
Referenced by GWEN_Date__sampleTmplChars().

|
static |
Definition at line 42 of file gwendate.c.
Referenced by GWEN_Date_DaysInMonth().
1.8.14