/*
 * FreeAdhocUDF - copyright (c) 2004 - 2006 adhoc dataservice GmbH
 * Christoph Theuring / Peter Mandrella / Georg Horn
 * based on FreeUDFLibC - copyright (c) 1999 Gregory Deatz
 * altered 2001 by ADITO Software GmbH Robert Loipfinger
 *
 * File Name:	date_functions.h
 * Description: This header contains the prototype definitions
 *
 * Software distributed under the License is distributed on an
 * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
 * or implied. See the License for the specific language governing
 * rights and limitations under the License.
 *
 *  rl = added by Robert Loipfinger
 *  pm = added by Peter Mandrella
 *  gh = added by Georg Horn
 *
 *  Date and time routines:
 *
 *  pm   addday - add some number of days to a date
 *  pm   addhour - add some number of hours to a date
 *  pm   addminute - add some number of minutes to a date
 *       addmonth - add some number of months to a date
 *  pm   addsecond - add some number of seconds to a date
 *  pm   addweek - add some number of weeks to a date
 *       addyear - add some number of years to a date
 *       ageinmonths - Between "date" and "ref_date", how many months?
 *  pm   ageinmonthsthreshold - age_in_months with min and max
 *  rl   ageinweeks - Between "date" and "ref_date", how many weeks?
 *  pm   ageinweeksthreshold - age_in_weeks with min and max
 *  rl   ageindays - Between "date" and "ref_date", how many days?
 *  pm   ageindaysthreshold - age_in_days with min and max
 *  pm   ageinhours - Between "date" and "ref_date", how many hours?
 *  pm   ageinhoursthreshold - ageinhours with min and max
 *  pm   ageinminutes - Between "date" and "ref_date", how many minutes?
 *  pm   ageinminutesthreshold - ageinminutes with min and max
 *  pm   ageinseconds - Between "date" and "ref_date", how many seconds?
 *  pm   ageinsecondsthreshold - ageinseconds with min and max
 *  pm   ageinyears - Between "date" and "ref_date", how many years?
 *  pm   ageinyearsthreshold - ageinyears with min and max
 *  pm   ***between - returns abs(agein***)
 *       cdowlong - Convert the date to a "long" pretty version
 *       cdowshort - Convert the date to a "short" pretty version
 *  pm   cdowlonglang - cdow_long with langue dependend output
 *  pm   cdowshortlang - cdow_short with language dependend output
 *       cmonthlong - What is the long name of the month?
 *       cmonthshort - What is the short name of the month?
 *  pm   cmonthlonglang - cmonth_long with language dependend output
 *  pm   cmonthshortlang - cmonth_short with language dependend output
 *       dayofmonth - What is the day of the month?
 *       dayofweek - What is the day of the week?
 *       dayofyear - What is the day of the year?
 *  pm   gformatd - date/time formatting function
 *  rl   isleapyear - Is it leap year?
 *  pm   lastday - daysofmonth with parameters swapped
 *       maxdate - Compare two dates and return the maximum.
 *       mindate - Compare two dates and return the minimum.
 *       month - What is the month?
 *       quarter - What is the quarter?
 *       stripdate - Strip the date portion of the date
 *       striptime - Strip the time portion of the date
 *       strtotime - Given a time string (hh:mm:ss AM/PM) return date of it
 *       weekofyear - What is the week of the year?
 *       woy - Return the year and the week concatenated (199901)
 *       year - What is the year?
 *       yearofyear - Given a date, return the year as it would
 *                      be returned from the week_of_year function.
 *       hour, minute, second - Given a date, return the "hour", "minute",
 *                              "second" of the date.
 *  pm   equaldate - compares year, month and day
 *  pm   equaldatetime - compares year, month, day, hours, minutes and seconds
 *  pm   zeitdifferenz - difference between timestamps in days, hours, minutes or seconds
 *  pm   osterdatum - date of easter sunday
 *  pm   encodedate - creates date from integers
 *  pm   encodetime - creates time from integers
 *  pm   encodetimestamp - creates timestamp from integers
 */

ISC_QUAD * addday PROTO_LIST ((ISC_QUAD *, int *));
ISC_QUAD * addhour PROTO_LIST ((ISC_QUAD *, int *));
ISC_QUAD * addminute PROTO_LIST ((ISC_QUAD *, int *));
ISC_QUAD * addmonth PROTO_LIST ((ISC_QUAD *, int *));
ISC_QUAD * addweek PROTO_LIST ((ISC_QUAD *, int *));
ISC_QUAD * addsecond PROTO_LIST ((ISC_QUAD *, int *));
ISC_QUAD * addyear PROTO_LIST ((ISC_QUAD *, int *));
int ageinmonths PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
int ageinmonthsthreshold PROTO_LIST ((ISC_QUAD *, ISC_QUAD *,
        int *min, int *usemin, int *max, int *usemax));
int ageinweeks PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
int ageinweeksthreshold PROTO_LIST ((ISC_QUAD *, ISC_QUAD *,
        int *min, int *usemin, int *max, int *usemax));
int ageindays PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
int ageindaysthreshold PROTO_LIST ((ISC_QUAD *, ISC_QUAD *,
        int *min, int *usemin, int *max, int *usemax));
int ageinhours PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
int ageinhoursthreshold PROTO_LIST ((ISC_QUAD *, ISC_QUAD *,
        int *min, int *usemin, int *max, int *usemax));
int ageinminutes PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
int ageinminutesthreshold PROTO_LIST ((ISC_QUAD *, ISC_QUAD *,
        int *min, int *usemin, int *max, int *usemax));
int ageinseconds PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
int ageinsecondsthreshold PROTO_LIST ((ISC_QUAD *, ISC_QUAD *,
        int *min, int *usemin, int *max, int *usemax));
int ageinyears PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
int ageinyearsthreshold PROTO_LIST ((ISC_QUAD *, ISC_QUAD *,
        int *min, int *usemin, int *max, int *usemax));
char * cdowlong PROTO_LIST ((ISC_QUAD *));
char * cdowlonglang PROTO_LIST ((ISC_QUAD *, char *));
char * cdowshort PROTO_LIST ((ISC_QUAD *));
char * cdowshortlang PROTO_LIST ((ISC_QUAD *, char *));
char * cmonthlong PROTO_LIST ((ISC_QUAD *));
char * cmonthlonglang PROTO_LIST ((ISC_QUAD *, char *));
char * cmonthshort PROTO_LIST ((ISC_QUAD *));
char * cmonthshortlang PROTO_LIST ((ISC_QUAD *, char *));
int dayofmonth PROTO_LIST ((ISC_QUAD *));
int dayofweek PROTO_LIST ((ISC_QUAD *));
int dayofyear PROTO_LIST ((ISC_QUAD *));
ISC_DATE * encodedate PROTO_LIST ((int *, int *, int *));
ISC_TIME * encodetime PROTO_LIST ((int *, int *, int *));
ISC_QUAD * encodetimestamp PROTO_LIST ((int *, int *, int *, int *, int *, int *));
char * gformatd PROTO_LIST ((char *, ISC_QUAD *));
int hour PROTO_LIST ((ISC_QUAD *));
int isleapyear PROTO_LIST ((ISC_QUAD *));
int lastday PROTO_LIST ((int *y, int *m));
ISC_QUAD * maxdate PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
ISC_QUAD * mindate PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
int minute PROTO_LIST ((ISC_QUAD *));
int month PROTO_LIST ((ISC_QUAD *));
int quarter PROTO_LIST ((ISC_QUAD *));
int second PROTO_LIST ((ISC_QUAD *));
ISC_QUAD * stripdate PROTO_LIST ((ISC_QUAD *));
ISC_QUAD * striptime PROTO_LIST ((ISC_QUAD *));
ISC_TIME * strtotime PROTO_LIST ((char *));
int week PROTO_LIST((ISC_QUAD *));
int weekofyear PROTO_LIST ((ISC_QUAD *));
char * woy PROTO_LIST ((ISC_QUAD *));
int year PROTO_LIST ((ISC_QUAD *));
int yearofyear PROTO_LIST ((ISC_QUAD *));

int yearsbetween PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
int monthsbetween PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
int weeksbetween PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
int daysbetween PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
int hoursbetween PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
int minutesbetween PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
int secondsbetween PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));

// internal functions
int daysofmonth PROTO_LIST ((int *, int *));
int dtime PROTO_LIST ((ISC_QUAD *));
// gh 2006-10-24
ISC_QUAD *gen_ib_date(struct tm *t);
// new 03.10.05
int equaldate PROTO_LIST ((ISC_QUAD *date1, ISC_QUAD *date2));
int equaldatetime PROTO_LIST ((ISC_QUAD *date1, ISC_QUAD *date2));
double zeitdifferenz PROTO_LIST ((ISC_QUAD *date1, ISC_QUAD *date2, char *sz));
ISC_QUAD * osterdatum PROTO_LIST ((int *year));

// Integer-Parameter sind Zeiger !!!

