diff options
Diffstat (limited to 'reference/C/CONTRIB/SNIP/scaldate.h')
-rwxr-xr-x | reference/C/CONTRIB/SNIP/scaldate.h | 27 |
1 files changed, 27 insertions, 0 deletions
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);
|