gwenhywfar 4.0.3

gwendate.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     begin       : Tue Jul 07 2009
00003     copyright   : (C) 2009 by Martin Preuss
00004     email       : martin@libchipcard.de
00005 
00006  ***************************************************************************
00007  *                                                                         *
00008  *   This library is free software; you can redistribute it and/or         *
00009  *   modify it under the terms of the GNU Lesser General Public            *
00010  *   License as published by the Free Software Foundation; either          *
00011  *   version 2.1 of the License, or (at your option) any later version.    *
00012  *                                                                         *
00013  *   This library is distributed in the hope that it will be useful,       *
00014  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00015  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00016  *   Lesser General Public License for more details.                       *
00017  *                                                                         *
00018  *   You should have received a copy of the GNU Lesser General Public      *
00019  *   License along with this library; if not, write to the Free Software   *
00020  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00021  *   MA  02111-1307  USA                                                   *
00022  *                                                                         *
00023  ***************************************************************************/
00024 
00025 #ifndef GWEN_DATE_H
00026 #define GWEN_DATE_H
00027 
00028 
00029 #include <gwenhywfar/gwenhywfarapi.h>
00030 #include <gwenhywfar/types.h>
00031 #include <gwenhywfar/buffer.h>
00032 
00033 
00034 typedef struct GWEN_DATE GWEN_DATE;
00035 
00036 
00037 #include <gwenhywfar/gwentime.h>
00038 
00039 
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043 
00044 
00045 
00046 
00053 GWENHYWFAR_API GWEN_DATE *GWEN_Date_fromGregorian(int y, int m, int d);
00054 
00059 GWENHYWFAR_API GWEN_DATE *GWEN_Date_fromJulian(int julian);
00060 
00064 GWENHYWFAR_API GWEN_DATE *GWEN_Date_CurrentDate();
00065 
00066 GWENHYWFAR_API GWEN_DATE *GWEN_Date_fromString(const char *s);
00067 
00068 GWENHYWFAR_API GWEN_DATE *GWEN_Date_dup(const GWEN_DATE *ogd);
00069 
00070 GWENHYWFAR_API GWEN_DATE *GWEN_Date_fromTime(const GWEN_TIME *ti);
00071 
00072 GWENHYWFAR_API GWEN_DATE *GWEN_Date_fromStringWithTemplate(const char *s, const char *tmpl);
00073 GWENHYWFAR_API int GWEN_Date_toStringWithTemplate(const GWEN_DATE *t,
00074                                                   const char *tmpl,
00075                                                   GWEN_BUFFER *buf);
00076 
00077 
00081 GWENHYWFAR_API void GWEN_Date_free(GWEN_DATE *gd);
00082 
00083 
00084 
00085 GWENHYWFAR_API const char *GWEN_Date_GetString(const GWEN_DATE *gd);
00086 
00087 
00088 GWENHYWFAR_API int GWEN_Date_DaysInMonth(const GWEN_DATE *gd);
00089 
00090 GWENHYWFAR_API int GWEN_Date_DaysInYear(const GWEN_DATE *gd);
00091 
00092 GWENHYWFAR_API int GWEN_Date_GetYear(const GWEN_DATE *gd);
00093 GWENHYWFAR_API int GWEN_Date_GetMonth(const GWEN_DATE *gd);
00094 GWENHYWFAR_API int GWEN_Date_GetDay(const GWEN_DATE *gd);
00095 GWENHYWFAR_API int GWEN_Date_WeekDay(const GWEN_DATE *gd);
00096 GWENHYWFAR_API int GWEN_Date_GetJulian(const GWEN_DATE *gd);
00097 
00098 
00099 GWENHYWFAR_API int GWEN_Date_IsLeapYear(int y);
00100 GWENHYWFAR_API int GWEN_Date_Compare(const GWEN_DATE *gd1, const GWEN_DATE *gd0);
00101 GWENHYWFAR_API int GWEN_Date_Diff(const GWEN_DATE *gd1, const GWEN_DATE *gd0);
00102 
00103 
00104 
00105 
00106 #ifdef __cplusplus
00107 }
00108 #endif
00109 
00110 
00111 
00112 #endif
00113 
00114