gwendate.c File Reference

#include "gwendate_p.h"
#include <gwenhywfar/debug.h>
#include <gwenhywfar/misc.h>
#include <time.h>
#include <ctype.h>

Go to the source code of this file.

Functions

void GWEN_Date__fillTmplChars (const GWEN_DATE *t, GWEN_DATE_TMPLCHAR_LIST *ll)
GWEN_DATE_TMPLCHAR * GWEN_Date__findTmplChar (GWEN_DATE_TMPLCHAR_LIST *ll, char c)
void GWEN_Date__sampleTmplChars (GWEN_UNUSED const GWEN_DATE *t, const char *tmpl, GWEN_UNUSED GWEN_BUFFER *buf, GWEN_DATE_TMPLCHAR_LIST *ll)
int GWEN_Date_Compare (const GWEN_DATE *gd1, const GWEN_DATE *gd0)
GWEN_DATEGWEN_Date_CurrentDate ()
int GWEN_Date_DaysInMonth (const GWEN_DATE *gd)
int GWEN_Date_DaysInYear (const GWEN_DATE *gd)
int GWEN_Date_Diff (const GWEN_DATE *gd1, const GWEN_DATE *gd0)
GWEN_DATEGWEN_Date_dup (const GWEN_DATE *ogd)
void GWEN_Date_free (GWEN_DATE *gd)
GWEN_DATEGWEN_Date_fromGregorian (int y, int m, int d)
GWEN_DATEGWEN_Date_fromJulian (int julian)
GWEN_DATEGWEN_Date_fromString (const char *s)
GWEN_DATEGWEN_Date_fromStringWithTemplate (const char *s, const char *tmpl)
int GWEN_Date_GetDay (const GWEN_DATE *gd)
int GWEN_Date_GetJulian (const GWEN_DATE *gd)
int GWEN_Date_GetMonth (const GWEN_DATE *gd)
const char * GWEN_Date_GetString (const GWEN_DATE *gd)
int GWEN_Date_GetYear (const GWEN_DATE *gd)
int GWEN_Date_IsLeapYear (int y)
int GWEN_Date_toStringWithTemplate (const GWEN_DATE *t, const char *tmpl, GWEN_BUFFER *buf)
int GWEN_Date_WeekDay (const GWEN_DATE *gd)
void GWEN_DateTmplChar_free (GWEN_DATE_TMPLCHAR *e)
GWEN_DATE_TMPLCHAR * GWEN_DateTmplChar_new (char c)

Variables

static const uint8_t daysInMonth [12]

Function Documentation

void GWEN_Date__fillTmplChars ( const GWEN_DATE t,
GWEN_DATE_TMPLCHAR_LIST *  ll 
)

Definition at line 417 of file gwendate.c.

References DBG_ERROR, and GWEN_LOGDOMAIN.

Referenced by GWEN_Date_toStringWithTemplate().

GWEN_DATE_TMPLCHAR* GWEN_Date__findTmplChar ( GWEN_DATE_TMPLCHAR_LIST *  ll,
char  c 
)

Definition at line 372 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 
)
int GWEN_Date_Compare ( const GWEN_DATE gd1,
const GWEN_DATE gd0 
)

Definition at line 224 of file gwendate.c.

GWEN_DATE* GWEN_Date_CurrentDate (  ) 

Create a date from the current local date.

Definition at line 101 of file gwendate.c.

References GWEN_Date_fromGregorian(), and NULL.

int GWEN_Date_DaysInMonth ( const GWEN_DATE gd  ) 

Definition at line 155 of file gwendate.c.

References daysInMonth.

int GWEN_Date_DaysInYear ( const GWEN_DATE gd  ) 

Definition at line 167 of file gwendate.c.

References GWEN_Date_free(), and GWEN_Date_fromGregorian().

int GWEN_Date_Diff ( const GWEN_DATE gd1,
const GWEN_DATE gd0 
)

Definition at line 237 of file gwendate.c.

GWEN_DATE* GWEN_Date_dup ( const GWEN_DATE ogd  ) 

Definition at line 119 of file gwendate.c.

References GWEN_Date_fromGregorian().

void GWEN_Date_free ( GWEN_DATE gd  ) 

Destructor.

Definition at line 140 of file gwendate.c.

References GWEN_FREE_OBJECT.

Referenced by GWEN_Date_DaysInYear().

GWEN_DATE* GWEN_Date_fromGregorian ( int  y,
int  m,
int  d 
)

Create a date from the gregorian calender using year, month and day.

Parameters:
y year (e.g. 2009)
m month (1-12)
d day of month (1-31)

Definition at line 48 of file gwendate.c.

References DBG_ERROR, GWEN_LOGDOMAIN, GWEN_NEW_OBJECT, and NULL.

Referenced by GWEN_Date_CurrentDate(), GWEN_Date_DaysInYear(), GWEN_Date_dup(), GWEN_Date_fromString(), and GWEN_Date_fromStringWithTemplate().

GWEN_DATE* GWEN_Date_fromJulian ( int  julian  ) 

Create a date from the julian calender.

Parameters:
julian date in julian calender

Definition at line 75 of file gwendate.c.

References GWEN_NEW_OBJECT.

GWEN_DATE* GWEN_Date_fromString ( const char *  s  ) 

Definition at line 126 of file gwendate.c.

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

GWEN_DATE* GWEN_Date_fromStringWithTemplate ( const char *  s,
const char *  tmpl 
)
int GWEN_Date_GetDay ( const GWEN_DATE gd  ) 

Definition at line 196 of file gwendate.c.

int GWEN_Date_GetJulian ( const GWEN_DATE gd  ) 

Definition at line 203 of file gwendate.c.

int GWEN_Date_GetMonth ( const GWEN_DATE gd  ) 

Definition at line 189 of file gwendate.c.

const char* GWEN_Date_GetString ( const GWEN_DATE gd  ) 

Definition at line 217 of file gwendate.c.

int GWEN_Date_GetYear ( const GWEN_DATE gd  ) 

Definition at line 182 of file gwendate.c.

int GWEN_Date_IsLeapYear ( int  y  ) 

Definition at line 148 of file gwendate.c.

int GWEN_Date_toStringWithTemplate ( const GWEN_DATE t,
const char *  tmpl,
GWEN_BUFFER buf 
)
int GWEN_Date_WeekDay ( const GWEN_DATE gd  ) 

Definition at line 210 of file gwendate.c.

void GWEN_DateTmplChar_free ( GWEN_DATE_TMPLCHAR *  e  ) 

Definition at line 362 of file gwendate.c.

References GWEN_FREE_OBJECT, and GWEN_LIST_FINI.

GWEN_DATE_TMPLCHAR* GWEN_DateTmplChar_new ( char  c  ) 

Definition at line 351 of file gwendate.c.

References GWEN_LIST_INIT, and GWEN_NEW_OBJECT.

Referenced by GWEN_Date__sampleTmplChars().


Variable Documentation

const uint8_t daysInMonth[12] [static]
Initial value:
{
  31,28,31,30,31,30,31,31,30,31,30,31
}

Definition at line 41 of file gwendate.c.

Referenced by GWEN_Date_DaysInMonth().


Generated on Sat Jan 2 09:32:37 2010 for gwenhywfar by  doxygen 1.6.1