/*
 * FreeAdhocUDF - copyright (c) 2004 adhoc dataservice GmbH Peter Mandrella
 * based on FreeUDFLibC - copyright (c) 1999 Gregory Deatz
 * altered 2001 by ADITO Software GmbH Robert Loipfinger
 *
 *   date_functions.h
 *     Date and time routines:
 *
 *  rl = added by Robert Loipfinger
 *  pm = added by Peter Mandrella
 *
 *       addmonth - add some number of months 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
 *       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?
 *       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.
 */

ISC_QUAD * addmonth 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));
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 *));
char * gformatd PROTO_LIST ((char *, ISC_QUAD *));
int isleapyear PROTO_LIST ((ISC_QUAD *));
ISC_QUAD * maxdate PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
ISC_QUAD * mindate PROTO_LIST ((ISC_QUAD *, ISC_QUAD *));
int month PROTO_LIST ((ISC_QUAD *));
int quarter PROTO_LIST ((ISC_QUAD *));
ISC_QUAD * stripdate PROTO_LIST ((ISC_QUAD *));
ISC_QUAD * striptime PROTO_LIST ((ISC_QUAD *));
ISC_QUAD * 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 hour PROTO_LIST ((ISC_QUAD *));
int minute PROTO_LIST ((ISC_QUAD *));
int second PROTO_LIST ((ISC_QUAD *));

// internal functions
int daysofmonth PROTO_LIST ((int *, int *));
int dtime PROTO_LIST ((ISC_QUAD *));

