From 7e0f021a9aec35fd8e6725e87e3313b101d26f5e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 27 Jan 2008 11:37:44 +0100 Subject: Initial import (2.0.2-6) --- reference/C/CONTRIB/SNIP/scaldate.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 reference/C/CONTRIB/SNIP/scaldate.h (limited to 'reference/C/CONTRIB/SNIP/scaldate.h') diff --git a/reference/C/CONTRIB/SNIP/scaldate.h b/reference/C/CONTRIB/SNIP/scaldate.h new file mode 100755 index 0000000..6fa7dbb --- /dev/null +++ b/reference/C/CONTRIB/SNIP/scaldate.h @@ -0,0 +1,27 @@ +/* +** scalar date routines -- public domain by Ray Gardner +** These will work over the range 1/01/01 thru 14699/12/31 +*/ + +/* +** Define ISO to be 1 for ISO (Mon-Sun) calendars +** +** ISO defines the first week with 4 or more days in it to be week #1. +*/ + +#ifndef ISO + #define ISO 0 +#endif + +#if (ISO != 0 && ISO != 1) + #error ISO must be set to either 0 or 1 +#endif + +int isleap (unsigned yr); +long ymd_to_scalar (unsigned yr, unsigned mo, unsigned day); +void scalar_to_ymd (long scalar, unsigned *yr, unsigned *mo, unsigned *day); +int dow(unsigned yr, unsigned mo, unsigned day); +int valiDate(unsigned yr, unsigned mo, unsigned day); +int dow(unsigned yr, unsigned mo, unsigned day); +int daynum(int year, int month, int day); +int weeknum(int year, int month, int day); -- cgit v1.2.3-54-g00ecf