gwenhywfar  5.14.1
gwendate.h
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Tue Jul 07 2009
3  copyright : (C) 2009 by Martin Preuss
4  email : martin@libchipcard.de
5 
6  ***************************************************************************
7  * *
8  * This library is free software; you can redistribute it and/or *
9  * modify it under the terms of the GNU Lesser General Public *
10  * License as published by the Free Software Foundation; either *
11  * version 2.1 of the License, or (at your option) any later version. *
12  * *
13  * This library is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16  * Lesser General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU Lesser General Public *
19  * License along with this library; if not, write to the Free Software *
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21  * MA 02111-1307 USA *
22  * *
23  ***************************************************************************/
24 
25 #ifndef GWEN_DATE_H
26 #define GWEN_DATE_H
27 
28 
29 #include <gwenhywfar/gwenhywfarapi.h>
30 #include <gwenhywfar/types.h>
31 #include <gwenhywfar/buffer.h>
32 
33 
34 typedef struct GWEN_DATE GWEN_DATE;
35 
36 
37 #include <gwenhywfar/gwentime.h>
38 
39 #include <time.h>
40 
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 
47 
48 
56 
62 
67 
69 
71 
74 
77 
78 
79 GWENHYWFAR_API GWEN_DATE *GWEN_Date_fromStringWithTemplate(const char *s, const char *tmpl);
81  const char *tmpl,
82  GWEN_BUFFER *buf);
83 
84 
89 
90 
91 
92 GWENHYWFAR_API const char *GWEN_Date_GetString(const GWEN_DATE *gd);
93 
94 
98 GWENHYWFAR_API void GWEN_Date_AddDays(GWEN_DATE *gd, int days);
99 
103 GWENHYWFAR_API void GWEN_Date_SubDays(GWEN_DATE *gd, int days);
104 
105 
106 
108 
114 
120 
121 
123 GWENHYWFAR_API int GWEN_Date_Compare(const GWEN_DATE *gd1, const GWEN_DATE *gd0);
124 GWENHYWFAR_API int GWEN_Date_Diff(const GWEN_DATE *gd1, const GWEN_DATE *gd0);
125 
126 
129 
130 
133 
136 
139 
142 
145 
148 
151 
154 
157 
158 
159 
160 #ifdef __cplusplus
161 }
162 #endif
163 
164 
165 
166 #endif
167 
168 
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetLastHalfYearStart(const GWEN_DATE *dt)
Definition: gwendate.c:1044
GWENHYWFAR_API int GWEN_Date_GetYear(const GWEN_DATE *gd)
Definition: gwendate.c:385
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetLastYearStart(const GWEN_DATE *dt)
Definition: gwendate.c:1070
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisMonthStart(const GWEN_DATE *dt)
Definition: gwendate.c:861
struct GWEN_TIME GWEN_TIME
Definition: gwentime.h:43
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetLastHalfYearEnd(const GWEN_DATE *dt)
Definition: gwendate.c:1057
GWENHYWFAR_API GWEN_DATE * GWEN_Date_fromStringWithTemplate(const char *s, const char *tmpl)
Definition: gwendate.c:479
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisWeekStartFromMonday(const GWEN_DATE *dt)
Definition: gwendate.c:836
struct GWEN_DB_NODE GWEN_DB_NODE
Definition: db.h:228
GWENHYWFAR_API int GWEN_Date_WeekDay(const GWEN_DATE *gd)
Definition: gwendate.c:417
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisHalfYearEnd(const GWEN_DATE *dt)
Definition: gwendate.c:964
GWENHYWFAR_API int GWEN_Date_DaysInYear(const GWEN_DATE *gd)
Definition: gwendate.c:369
GWENHYWFAR_API int GWEN_Date_Diff(const GWEN_DATE *gd1, const GWEN_DATE *gd0)
Definition: gwendate.c:453
GWENHYWFAR_API GWEN_DATE * GWEN_Date_fromLocalTime(time_t t)
Definition: gwendate.c:185
GWENHYWFAR_API int GWEN_Date_GetDay(const GWEN_DATE *gd)
Definition: gwendate.c:401
GWENHYWFAR_API time_t GWEN_Date_toLocalTime(const GWEN_DATE *gd)
Definition: gwendate.c:202
GWENHYWFAR_API void GWEN_Date_free(GWEN_DATE *gd)
Definition: gwendate.c:330
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisYearStart(const GWEN_DATE *dt)
Definition: gwendate.c:974
GWENHYWFAR_API int GWEN_Date_toDb(const GWEN_DATE *dt, GWEN_DB_NODE *db)
Definition: gwendate.c:800
GWENHYWFAR_API GWEN_DATE * GWEN_Date_fromTime(const GWEN_TIME *ti)
Definition: gwendate.c:463
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisHalfYearStart(const GWEN_DATE *dt)
Definition: gwendate.c:954
GWENHYWFAR_API GWEN_DATE * GWEN_Date_fromGregorian(int y, int m, int d)
Definition: gwendate.c:54
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetLastQuarterYearStart(const GWEN_DATE *dt)
Definition: gwendate.c:1018
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisWeekStartFromSunday(const GWEN_DATE *dt)
Definition: gwendate.c:852
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetLastMonthEnd(const GWEN_DATE *dt)
Definition: gwendate.c:1005
GWENHYWFAR_API GWEN_DATE * GWEN_Date_CurrentDate(void)
Definition: gwendate.c:245
GWENHYWFAR_API int GWEN_Date_DaysInMonth(const GWEN_DATE *gd)
Definition: gwendate.c:347
GWENHYWFAR_API int GWEN_Date_toStringWithTemplate(const GWEN_DATE *t, const char *tmpl, GWEN_BUFFER *buf)
Definition: gwendate.c:758
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisQuarterYearStart(const GWEN_DATE *dt)
Definition: gwendate.c:906
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisMonthEnd(const GWEN_DATE *dt)
Definition: gwendate.c:868
GWENHYWFAR_API const char * GWEN_Date_GetString(const GWEN_DATE *gd)
Definition: gwendate.c:425
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
Definition: buffer.h:38
GWENHYWFAR_API GWEN_DATE * GWEN_Date_dup(const GWEN_DATE *ogd)
Definition: gwendate.c:255
#define GWENHYWFAR_API
Definition: gwenhywfarapi.h:67
GWENHYWFAR_API void GWEN_Date_SubDays(GWEN_DATE *gd, int days)
Definition: gwendate.c:167
GWENHYWFAR_API int GWEN_Date_GetMonth(const GWEN_DATE *gd)
Definition: gwendate.c:393
GWENHYWFAR_API GWEN_DATE * GWEN_Date_fromDb(GWEN_DB_NODE *db)
Definition: gwendate.c:812
GWENHYWFAR_API int GWEN_Date_GetJulian(const GWEN_DATE *gd)
Definition: gwendate.c:409
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetLastMonthStart(const GWEN_DATE *dt)
Definition: gwendate.c:988
GWENHYWFAR_API GWEN_DATE * GWEN_Date_fromString(const char *s)
Definition: gwendate.c:276
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetLastQuarterYearEnd(const GWEN_DATE *dt)
Definition: gwendate.c:1031
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisQuarterYearEnd(const GWEN_DATE *dt)
Definition: gwendate.c:930
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetThisYearEnd(const GWEN_DATE *dt)
Definition: gwendate.c:981
GWENHYWFAR_API int GWEN_Date_Compare(const GWEN_DATE *gd1, const GWEN_DATE *gd0)
Definition: gwendate.c:433
GWENHYWFAR_API void GWEN_Date_AddDays(GWEN_DATE *gd, int days)
Definition: gwendate.c:160
GWENHYWFAR_API int GWEN_Date_IsLeapYear(int y)
Definition: gwendate.c:339
GWENHYWFAR_API GWEN_DATE * GWEN_Date_GetLastYearEnd(const GWEN_DATE *dt)
Definition: gwendate.c:1083
GWENHYWFAR_API GWEN_DATE * GWEN_Date_fromGmTime(time_t t)
Definition: gwendate.c:227
GWENHYWFAR_API GWEN_DATE * GWEN_Date_fromJulian(int julian)
Definition: gwendate.c:174
struct GWEN_DATE GWEN_DATE
Definition: gwendate.h:34