gwenhywfar  4.8.0beta
Typedefs | Functions
gwendate.h File Reference
#include <gwenhywfar/gwenhywfarapi.h>
#include <gwenhywfar/types.h>
#include <gwenhywfar/buffer.h>
#include <gwenhywfar/gwentime.h>
#include <time.h>

Go to the source code of this file.

Typedefs

typedef struct GWEN_DATE GWEN_DATE
 

Functions

GWENHYWFAR_API int GWEN_Date_Compare (const GWEN_DATE *gd1, const GWEN_DATE *gd0)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_CurrentDate (void)
 
GWENHYWFAR_API int GWEN_Date_DaysInMonth (const GWEN_DATE *gd)
 
GWENHYWFAR_API int GWEN_Date_DaysInYear (const GWEN_DATE *gd)
 
GWENHYWFAR_API int GWEN_Date_Diff (const GWEN_DATE *gd1, const GWEN_DATE *gd0)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_dup (const GWEN_DATE *ogd)
 
GWENHYWFAR_API void GWEN_Date_free (GWEN_DATE *gd)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_fromDb (GWEN_DB_NODE *db)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_fromGmTime (time_t t)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_fromGregorian (int y, int m, int d)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_fromJulian (int julian)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_fromLocalTime (time_t t)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_fromString (const char *s)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_fromStringWithTemplate (const char *s, const char *tmpl)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_fromTime (const GWEN_TIME *ti)
 
GWENHYWFAR_API int GWEN_Date_GetDay (const GWEN_DATE *gd)
 
GWENHYWFAR_API int GWEN_Date_GetJulian (const GWEN_DATE *gd)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_GetLastHalfYearEnd (const GWEN_DATE *dt)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_GetLastHalfYearStart (const GWEN_DATE *dt)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_GetLastMonthEnd (const GWEN_DATE *dt)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_GetLastMonthStart (const GWEN_DATE *dt)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_GetLastQuarterYearEnd (const GWEN_DATE *dt)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_GetLastQuarterYearStart (const GWEN_DATE *dt)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_GetLastYearEnd (const GWEN_DATE *dt)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_GetLastYearStart (const GWEN_DATE *dt)
 
GWENHYWFAR_API int GWEN_Date_GetMonth (const GWEN_DATE *gd)
 
GWENHYWFAR_API const char * GWEN_Date_GetString (const GWEN_DATE *gd)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_GetThisHalfYearEnd (const GWEN_DATE *dt)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_GetThisHalfYearStart (const GWEN_DATE *dt)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_GetThisMonthEnd (const GWEN_DATE *dt)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_GetThisMonthStart (const GWEN_DATE *dt)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_GetThisQuarterYearEnd (const GWEN_DATE *dt)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_GetThisQuarterYearStart (const GWEN_DATE *dt)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_GetThisYearEnd (const GWEN_DATE *dt)
 
GWENHYWFAR_API GWEN_DATEGWEN_Date_GetThisYearStart (const GWEN_DATE *dt)
 
GWENHYWFAR_API int GWEN_Date_GetYear (const GWEN_DATE *gd)
 
GWENHYWFAR_API int GWEN_Date_IsLeapYear (int y)
 
GWENHYWFAR_API int GWEN_Date_toDb (const GWEN_DATE *dt, GWEN_DB_NODE *db)
 
GWENHYWFAR_API int GWEN_Date_toStringWithTemplate (const GWEN_DATE *t, const char *tmpl, GWEN_BUFFER *buf)
 
GWENHYWFAR_API int GWEN_Date_WeekDay (const GWEN_DATE *gd)
 

Typedef Documentation

typedef struct GWEN_DATE GWEN_DATE

Definition at line 34 of file gwendate.h.

Function Documentation

GWENHYWFAR_API int GWEN_Date_Compare ( const GWEN_DATE gd1,
const GWEN_DATE gd0 
)

Definition at line 250 of file gwendate.c.

GWENHYWFAR_API GWEN_DATE* GWEN_Date_CurrentDate ( void  )

Create a date from the current local date.

Definition at line 136 of file gwendate.c.

References GWEN_Date_fromLocalTime().

GWENHYWFAR_API int GWEN_Date_DaysInMonth ( const GWEN_DATE gd)

Definition at line 181 of file gwendate.c.

References daysInMonth.

GWENHYWFAR_API 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 193 of file gwendate.c.

References GWEN_Date_free(), and GWEN_Date_fromGregorian().

GWENHYWFAR_API int GWEN_Date_Diff ( const GWEN_DATE gd1,
const GWEN_DATE gd0 
)

Definition at line 269 of file gwendate.c.

GWENHYWFAR_API GWEN_DATE* GWEN_Date_dup ( const GWEN_DATE ogd)

Definition at line 145 of file gwendate.c.

References GWEN_Date_fromGregorian().

GWENHYWFAR_API void GWEN_Date_free ( GWEN_DATE gd)
GWENHYWFAR_API GWEN_DATE* GWEN_Date_fromDb ( GWEN_DB_NODE db)
GWENHYWFAR_API GWEN_DATE* GWEN_Date_fromGmTime ( time_t  t)

Definition at line 119 of file gwendate.c.

References GWEN_Date_fromGregorian(), and NULL.

GWENHYWFAR_API GWEN_DATE* GWEN_Date_fromGregorian ( int  y,
int  m,
int  d 
)
GWENHYWFAR_API GWEN_DATE* GWEN_Date_fromJulian ( int  julian)

Create a date from the julian calender.

Parameters
juliandate in julian calender

Definition at line 76 of file gwendate.c.

References GWEN_NEW_OBJECT.

Referenced by GWEN_Date_GetLastHalfYearEnd(), GWEN_Date_GetLastMonthEnd(), GWEN_Date_GetLastMonthStart(), GWEN_Date_GetLastQuarterYearEnd(), and GWEN_Date_GetLastYearEnd().

GWENHYWFAR_API GWEN_DATE* GWEN_Date_fromLocalTime ( time_t  t)

Definition at line 103 of file gwendate.c.

References GWEN_Date_fromGregorian(), and NULL.

Referenced by GWEN_Date_CurrentDate().

GWENHYWFAR_API GWEN_DATE* GWEN_Date_fromString ( const char *  s)

Definition at line 152 of file gwendate.c.

References DBG_ERROR, GWEN_Date_fromGregorian(), GWEN_LOGDOMAIN, and NULL.

Referenced by GWEN_Date_fromDb(), and GWEN_Date_fromTime().

GWENHYWFAR_API GWEN_DATE* GWEN_Date_fromStringWithTemplate ( const char *  s,
const char *  tmpl 
)
GWENHYWFAR_API GWEN_DATE* GWEN_Date_fromTime ( const GWEN_TIME ti)
GWENHYWFAR_API int GWEN_Date_GetDay ( const GWEN_DATE gd)

Definition at line 222 of file gwendate.c.

GWENHYWFAR_API int GWEN_Date_GetJulian ( const GWEN_DATE gd)
GWENHYWFAR_API GWEN_DATE* GWEN_Date_GetLastHalfYearEnd ( const GWEN_DATE dt)
GWENHYWFAR_API GWEN_DATE* GWEN_Date_GetLastHalfYearStart ( const GWEN_DATE dt)
GWENHYWFAR_API GWEN_DATE* GWEN_Date_GetLastMonthEnd ( const GWEN_DATE dt)
GWENHYWFAR_API GWEN_DATE* GWEN_Date_GetLastMonthStart ( const GWEN_DATE dt)
GWENHYWFAR_API GWEN_DATE* GWEN_Date_GetLastQuarterYearEnd ( const GWEN_DATE dt)
GWENHYWFAR_API GWEN_DATE* GWEN_Date_GetLastQuarterYearStart ( const GWEN_DATE dt)
GWENHYWFAR_API GWEN_DATE* GWEN_Date_GetLastYearEnd ( const GWEN_DATE dt)
GWENHYWFAR_API GWEN_DATE* GWEN_Date_GetLastYearStart ( const GWEN_DATE dt)
GWENHYWFAR_API int GWEN_Date_GetMonth ( const GWEN_DATE gd)
GWENHYWFAR_API const char* GWEN_Date_GetString ( const GWEN_DATE gd)

Definition at line 243 of file gwendate.c.

Referenced by GWEN_Date_toDb().

GWENHYWFAR_API GWEN_DATE* GWEN_Date_GetThisHalfYearEnd ( const GWEN_DATE dt)

Definition at line 700 of file gwendate.c.

References GWEN_Date_fromGregorian(), GWEN_Date_GetMonth(), and GWEN_Date_GetYear().

GWENHYWFAR_API GWEN_DATE* GWEN_Date_GetThisHalfYearStart ( const GWEN_DATE dt)
GWENHYWFAR_API GWEN_DATE* GWEN_Date_GetThisMonthEnd ( const GWEN_DATE dt)
GWENHYWFAR_API GWEN_DATE* GWEN_Date_GetThisMonthStart ( const GWEN_DATE dt)

Definition at line 613 of file gwendate.c.

References GWEN_Date_fromGregorian(), GWEN_Date_GetMonth(), and GWEN_Date_GetYear().

GWENHYWFAR_API GWEN_DATE* GWEN_Date_GetThisQuarterYearEnd ( const GWEN_DATE dt)

Definition at line 671 of file gwendate.c.

References GWEN_Date_fromGregorian(), GWEN_Date_GetMonth(), GWEN_Date_GetYear(), and NULL.

GWENHYWFAR_API GWEN_DATE* GWEN_Date_GetThisQuarterYearStart ( const GWEN_DATE dt)
GWENHYWFAR_API GWEN_DATE* GWEN_Date_GetThisYearEnd ( const GWEN_DATE dt)

Definition at line 715 of file gwendate.c.

References GWEN_Date_fromGregorian(), and GWEN_Date_GetYear().

GWENHYWFAR_API GWEN_DATE* GWEN_Date_GetThisYearStart ( const GWEN_DATE dt)
GWENHYWFAR_API int GWEN_Date_GetYear ( const GWEN_DATE gd)
GWENHYWFAR_API int GWEN_Date_IsLeapYear ( int  y)

Definition at line 174 of file gwendate.c.

Referenced by GWEN_Date_GetThisMonthEnd().

GWENHYWFAR_API int GWEN_Date_toDb ( const GWEN_DATE dt,
GWEN_DB_NODE db 
)
GWENHYWFAR_API int GWEN_Date_toStringWithTemplate ( const GWEN_DATE t,
const char *  tmpl,
GWEN_BUFFER buf 
)
GWENHYWFAR_API int GWEN_Date_WeekDay ( const GWEN_DATE gd)

Definition at line 236 of file gwendate.c.

Referenced by GWEN_Date__fillTmplChars().