gwendate.h
Go to the documentation of this file.
/***************************************************************************
begin : Tue Jul 07 2009
copyright : (C) 2009 by Martin Preuss
email : martin@libchipcard.de
***************************************************************************
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
* *
***************************************************************************/
#ifndef GWEN_DATE_H
#define GWEN_DATE_H
#include <gwenhywfar/gwenhywfarapi.h>
#include <gwenhywfar/types.h>
#include <gwenhywfar/buffer.h>
typedef struct GWEN_DATE GWEN_DATE;
#include <gwenhywfar/gwentime.h>
#include <time.h>
#ifdef __cplusplus
extern "C" {
#endif
GWENHYWFAR_API GWEN_DATE *GWEN_Date_fromGregorian(int y, int m, int d);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_fromJulian(int julian);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_CurrentDate(void);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_fromString(const char *s);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_dup(const GWEN_DATE *ogd);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_fromTime(const GWEN_TIME *ti);
GWENHYWFAR_API time_t GWEN_Date_toLocalTime(const GWEN_DATE *gd);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_fromLocalTime(time_t t);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_fromGmTime(time_t t);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_fromStringWithTemplate(const char *s, const char *tmpl);
GWENHYWFAR_API int GWEN_Date_toStringWithTemplate(const GWEN_DATE *t,
const char *tmpl,
GWEN_BUFFER *buf);
GWENHYWFAR_API void GWEN_Date_free(GWEN_DATE *gd);
GWENHYWFAR_API const char *GWEN_Date_GetString(const GWEN_DATE *gd);
GWENHYWFAR_API void GWEN_Date_AddDays(GWEN_DATE *gd, int days);
GWENHYWFAR_API void GWEN_Date_SubDays(GWEN_DATE *gd, int days);
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_GetYear(const GWEN_DATE *gd);
GWENHYWFAR_API int GWEN_Date_GetMonth(const GWEN_DATE *gd);
GWENHYWFAR_API int GWEN_Date_GetDay(const GWEN_DATE *gd);
GWENHYWFAR_API int GWEN_Date_WeekDay(const GWEN_DATE *gd);
GWENHYWFAR_API int GWEN_Date_GetJulian(const GWEN_DATE *gd);
GWENHYWFAR_API int GWEN_Date_IsLeapYear(int y);
GWENHYWFAR_API int GWEN_Date_Compare(const GWEN_DATE *gd1, const GWEN_DATE *gd0);
GWENHYWFAR_API int GWEN_Date_Diff(const GWEN_DATE *gd1, const GWEN_DATE *gd0);
GWENHYWFAR_API int GWEN_Date_toDb(const GWEN_DATE *dt, GWEN_DB_NODE *db);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_fromDb(GWEN_DB_NODE *db);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisWeekStartFromMonday(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisWeekStartFromSunday(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisMonthStart(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisMonthEnd(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisQuarterYearStart(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisQuarterYearEnd(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisHalfYearStart(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisHalfYearEnd(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisYearStart(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisYearEnd(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetLastMonthStart(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetLastMonthEnd(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetLastQuarterYearStart(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetLastQuarterYearEnd(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetLastHalfYearStart(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetLastHalfYearEnd(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetLastYearStart(const GWEN_DATE *dt);
GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetLastYearEnd(const GWEN_DATE *dt);
#ifdef __cplusplus
}
#endif
#endif
buffer.h
GWEN_DB_NODE
struct GWEN_DB_NODE GWEN_DB_NODE
Definition db.h:228
GWEN_BUFFER
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
Definition buffer.h:38
GWEN_Date_GetThisWeekStartFromSunday
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisWeekStartFromSunday(const GWEN_DATE *dt)
GWEN_Date_SubDays
GWENHYWFAR_API void GWEN_Date_SubDays(GWEN_DATE *gd, int days)
GWEN_Date_fromDb
GWENHYWFAR_API GWEN_DATE * GWEN_Date_fromDb(GWEN_DB_NODE *db)
GWEN_Date_free
GWENHYWFAR_API void GWEN_Date_free(GWEN_DATE *gd)
GWEN_Date_GetLastQuarterYearEnd
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetLastQuarterYearEnd(const GWEN_DATE *dt)
GWEN_Date_GetLastMonthStart
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetLastMonthStart(const GWEN_DATE *dt)
GWEN_Date_GetThisQuarterYearEnd
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisQuarterYearEnd(const GWEN_DATE *dt)
GWEN_Date_GetLastMonthEnd
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetLastMonthEnd(const GWEN_DATE *dt)
GWEN_Date_GetThisQuarterYearStart
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisQuarterYearStart(const GWEN_DATE *dt)
GWEN_Date_GetJulian
GWENHYWFAR_API int GWEN_Date_GetJulian(const GWEN_DATE *gd)
GWEN_Date_GetThisHalfYearEnd
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisHalfYearEnd(const GWEN_DATE *dt)
GWEN_Date_fromLocalTime
GWENHYWFAR_API GWEN_DATE * GWEN_Date_fromLocalTime(time_t t)
GWEN_Date_Diff
GWENHYWFAR_API int GWEN_Date_Diff(const GWEN_DATE *gd1, const GWEN_DATE *gd0)
GWEN_Date_fromJulian
GWENHYWFAR_API GWEN_DATE * GWEN_Date_fromJulian(int julian)
GWEN_Date_IsLeapYear
GWENHYWFAR_API int GWEN_Date_IsLeapYear(int y)
GWEN_Date_GetThisMonthEnd
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisMonthEnd(const GWEN_DATE *dt)
GWEN_DATE
struct GWEN_DATE GWEN_DATE
Definition gwendate.h:34
GWEN_Date_toStringWithTemplate
GWENHYWFAR_API int GWEN_Date_toStringWithTemplate(const GWEN_DATE *t, const char *tmpl, GWEN_BUFFER *buf)
GWEN_Date_GetLastHalfYearStart
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetLastHalfYearStart(const GWEN_DATE *dt)
GWEN_Date_GetLastHalfYearEnd
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetLastHalfYearEnd(const GWEN_DATE *dt)
GWEN_Date_GetLastYearStart
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetLastYearStart(const GWEN_DATE *dt)
GWEN_Date_GetLastYearEnd
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetLastYearEnd(const GWEN_DATE *dt)
GWEN_Date_fromGmTime
GWENHYWFAR_API GWEN_DATE * GWEN_Date_fromGmTime(time_t t)
GWEN_Date_DaysInMonth
GWENHYWFAR_API int GWEN_Date_DaysInMonth(const GWEN_DATE *gd)
GWEN_Date_Compare
GWENHYWFAR_API int GWEN_Date_Compare(const GWEN_DATE *gd1, const GWEN_DATE *gd0)
GWEN_Date_GetThisYearStart
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisYearStart(const GWEN_DATE *dt)
GWEN_Date_WeekDay
GWENHYWFAR_API int GWEN_Date_WeekDay(const GWEN_DATE *gd)
GWEN_Date_GetThisMonthStart
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisMonthStart(const GWEN_DATE *dt)
GWEN_Date_fromStringWithTemplate
GWENHYWFAR_API GWEN_DATE * GWEN_Date_fromStringWithTemplate(const char *s, const char *tmpl)
GWEN_Date_AddDays
GWENHYWFAR_API void GWEN_Date_AddDays(GWEN_DATE *gd, int days)
GWEN_Date_GetThisWeekStartFromMonday
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisWeekStartFromMonday(const GWEN_DATE *dt)
GWEN_Date_GetYear
GWENHYWFAR_API int GWEN_Date_GetYear(const GWEN_DATE *gd)
GWEN_Date_GetMonth
GWENHYWFAR_API int GWEN_Date_GetMonth(const GWEN_DATE *gd)
GWEN_Date_toLocalTime
GWENHYWFAR_API time_t GWEN_Date_toLocalTime(const GWEN_DATE *gd)
GWEN_Date_GetDay
GWENHYWFAR_API int GWEN_Date_GetDay(const GWEN_DATE *gd)
GWEN_Date_CurrentDate
GWENHYWFAR_API GWEN_DATE * GWEN_Date_CurrentDate(void)
GWEN_Date_DaysInYear
GWENHYWFAR_API int GWEN_Date_DaysInYear(const GWEN_DATE *gd)
GWEN_Date_GetThisHalfYearStart
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisHalfYearStart(const GWEN_DATE *dt)
GWEN_Date_fromTime
GWENHYWFAR_API GWEN_DATE * GWEN_Date_fromTime(const GWEN_TIME *ti)
GWEN_Date_dup
GWENHYWFAR_API GWEN_DATE * GWEN_Date_dup(const GWEN_DATE *ogd)
GWEN_Date_fromGregorian
GWENHYWFAR_API GWEN_DATE * GWEN_Date_fromGregorian(int y, int m, int d)
GWEN_Date_GetLastQuarterYearStart
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetLastQuarterYearStart(const GWEN_DATE *dt)
GWEN_Date_GetString
GWENHYWFAR_API const char * GWEN_Date_GetString(const GWEN_DATE *gd)
GWEN_Date_GetThisYearEnd
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisYearEnd(const GWEN_DATE *dt)
GWEN_Date_toDb
GWENHYWFAR_API int GWEN_Date_toDb(const GWEN_DATE *dt, GWEN_DB_NODE *db)
GWEN_Date_fromString
GWENHYWFAR_API GWEN_DATE * GWEN_Date_fromString(const char *s)
gwenhywfarapi.h
GWENHYWFAR_API
#define GWENHYWFAR_API
Definition gwenhywfarapi.h:67
gwentime.h
GWEN_TIME
struct GWEN_TIME GWEN_TIME
Definition gwentime.h:43
types.h