From: Ben Pfaff Date: Mon, 7 Mar 2005 15:36:28 +0000 (+0000) Subject: Remove julcal. X-Git-Tag: v0.4.0~153 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp-builds.git;a=commitdiff_plain;h=f1696fab032a5ae5c44e3a3dedba343fce9ffd5c Remove julcal. --- diff --git a/AUTHORS b/AUTHORS index 7b7f3d69..18583506 100644 --- a/AUTHORS +++ b/AUTHORS @@ -5,9 +5,5 @@ * John Williams originally wrote the T-TEST procedure, which was subsequently re-written by John Darrington - * Jim Van Zandt translated the `julcal' date calculation package - into C from code written by Michael Covington, which was based on - formulae by Jean Meeus. - * John Darrington wrote the T-TEST and ONEWAY procedures, and made numerous revisions to other modules. diff --git a/lib/julcal/.cvsignore b/lib/julcal/.cvsignore deleted file mode 100644 index 282522db..00000000 --- a/lib/julcal/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/lib/julcal/ChangeLog b/lib/julcal/ChangeLog deleted file mode 100644 index 29810492..00000000 --- a/lib/julcal/ChangeLog +++ /dev/null @@ -1,49 +0,0 @@ -Sun Jan 2 21:32:13 2000 Ben Pfaff - - * julcal.c: Comment fixes. Most of the code was rewritten. - (_juldnj) Renamed calendar_to_julian. Interface changed. - (juldnj) Removed. - (juldnd) Renamed julian_to_calendar. Interface changed. - (julcd) Removed. - (julcdd) Removed. - (julian_to_mday) New function. - (julian_to_wday) New function. - [STANDALONE] (main) New test routines. - - * julcal.h: Replaced. - -Sat Jan 3 17:09:07 1998 Ben Pfaff - - * README: New file. - -Fri Dec 26 15:43:57 1997 Ben Pfaff - - * julcal.c: (julian_offset) Move glob var definition here. - -Sun Jul 6 19:12:18 1997 Ben Pfaff - - * Makefile.am: Fixed INCLUDES to include intl; fixed directories. - -Sun Jun 1 17:27:17 1997 Ben Pfaff - - * julcal.h: Made the declaration of macros with arguments a lot - nicer looking. - -Fri Apr 18 16:48:41 1997 Ben Pfaff - - * Makefile.am: Refers to src/ as include directory instead of - include/. - -Fri Apr 18 15:42:22 1997 Ben Pfaff - - * Makefile.am: Maintainer-clean Makefile.in. - -Thu Oct 24 17:47:14 1996 Ben Pfaff - - * julcal.h: Comment fix. - ----------------------------------------------------------------------- -Local Variables: -mode: change-log -version-control: never -End: diff --git a/lib/julcal/Makefile.am b/lib/julcal/Makefile.am deleted file mode 100644 index 90674584..00000000 --- a/lib/julcal/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -## Process this file with automake to produce Makefile.in -*- makefile -*- - -noinst_LIBRARIES = libjulcal.a - -INCLUDES = -I$(srcdir) -I$(top_srcdir)/src -I$(top_srcdir) \ --I$(top_srcdir)/intl - -libjulcal_a_SOURCES = julcal.c -noinst_HEADERS = julcal.h - -MAINTAINERCLEANFILES = Makefile.in diff --git a/lib/julcal/README b/lib/julcal/README deleted file mode 100644 index 7cc95aa3..00000000 --- a/lib/julcal/README +++ /dev/null @@ -1,5 +0,0 @@ -Please note that julcal is not part of PSPP. Instead, it is a -separate library that is included in the PSPP distribution for -convenience in compiling. - - -blp diff --git a/lib/julcal/julcal.c b/lib/julcal/julcal.c deleted file mode 100644 index 46b07657..00000000 --- a/lib/julcal/julcal.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - Modified BLP 8/28/95, 12/15/99 for PSPP. - - Original sources for julcal.c and julcal.h can be found at - ftp.cdrom.com in /pub/algorithms/c/julcal10/{julcal.c,julcal.h}. - */ - -/* - Translated from Pascal to C by Jim Van Zandt, July 1992. - - Error-free translation based on error-free PL/I source - - Based on Pascal code copyright 1985 by Michael A. Covington, - published in P.C. Tech Journal, December 1985, based on formulae - appearing in Astronomical Formulae for Calculators by Jean Meeus - */ - -/*#include */ -#include -#include -#include "julcal.h" - -#define JUL_OFFSET 2299160L - -/* Takes Y, M, and D, and returns the corresponding Julian date as an - offset in days from the midnight separating 8 Oct 1582 and 9 Oct - 1582. (Y,M,D) = (1999,10,1) corresponds to 1 Oct 1999. */ -long -calendar_to_julian (int y, int m, int d) -{ - m--; - y += m / 12; - m -= m / 12 * 12; - - assert (m > -12 && m < 12); - if (m < 0) - { - m += 12; - y--; - } - - assert (m >= 0 && m < 12); - if (m < 2) - { - m += 13; - y--; - } - else - m++; - - return ((1461 * (y + 4716L) / 4) - + (153 * (m + 1) / 5) - + (d - 1) - - 1524 - + 3 - - y / 100 - + y / 400 - - y / 4000 - - JUL_OFFSET); -} - -/* Takes a Julian date JD and sets *Y0, *M0, and *D0 to the - corresponding year, month, and day, respectively, where - (*Y0,*M0,*D0) = (1999,10,1) would be 1 Oct 1999. */ -void -julian_to_calendar (long jd, int *y0, int *m0, int *d0) -{ - int a, ay, em; - - jd += JUL_OFFSET; - - { - long aa, ab; - - aa = jd - 1721120L; - ab = 31 * (aa / 1460969L); - aa %= 1460969L; - ab += 3 * (aa / 146097L); - aa = aa % 146097L; - if (aa == 146096L) - ab += 3; - else - ab += aa / 36524L; - a = jd + (ab - 2); - } - - { - long ee, b, d; - - b = a + 1524; - ay = (20 * b - 2442) / 7305; - d = 1461L * ay / 4; - ee = b - d; - em = 10000 * ee / 306001; - if (d0 != NULL) - *d0 = ee - 306001L * em / 10000L; - } - - if (y0 != NULL || m0 != NULL) - { - int m = em - 1; - if (m > 12) - m -= 12; - if (m0 != NULL) - *m0 = m; - - if (y0 != NULL) - { - if (m > 2) - *y0 = ay - 4716; - else - *y0 = ay - 4715; - } - - } -} - -/* Takes a julian date JD and returns the corresponding year-relative - Julian date, with 1=Jan 1. */ -int -julian_to_jday (long jd) -{ - int year; - - julian_to_calendar (jd, &year, NULL, NULL); - return jd - calendar_to_julian (year, 1, 1) + 1; -} - - -/* Takes a julian date JD and returns the corresponding weekday 1...7, - with 1=Sunday. */ -int -julian_to_wday (long jd) -{ - return (jd - 3) % 7 + 1; -} - -#if STANDALONE -#include - -int -main (void) -{ - { - long julian[] = - { - 1, 50000, 102, 1157, 14288, 87365, 109623, 153211, 152371, 144623, - }; - size_t j; - - for (j = 0; j < sizeof julian / sizeof *julian; j++) - { - int y, m, d; - long jd; - julian_to_calendar (julian[j], &y, &m, &d); - jd = calendar_to_julian (y, m, d); - printf ("%ld => %d/%d/%d => %ld\n", julian[j], y, m, d, jd); - } - } - - { - int date[][3] = - { - {1582,10,15}, {1719,9,6}, {1583,1,24}, {1585,12,14}, - {1621,11,26}, {1821,12,25}, {1882,12,3}, {2002,4,6}, - {1999,12,19}, {1978,10,1}, - }; - size_t j; - - for (j = 0; j < sizeof date / sizeof *date; j++) - { - int y = date[j][0], m = date[j][1], d = date[j][2]; - long jd = calendar_to_julian (y, m, d); - int y2, m2, d2; - julian_to_calendar (jd, &y2, &m2, &d2); - printf ("%d/%d/%d => %ld => %d/%d/%d\n", - y, m, d, jd, y2, m2, d2); - } - } - - return 0; -} -#endif diff --git a/lib/julcal/julcal.h b/lib/julcal/julcal.h deleted file mode 100644 index e1a4415b..00000000 --- a/lib/julcal/julcal.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - Declarations for Julian date routines. - - Modified BLP 8/28/95, 9/26/95, 12/15/99 for PSPP. - */ - -#if !julcal_h -#define julcal_h 1 - -long calendar_to_julian (int y, int m, int d); -void julian_to_calendar (long jd, int *y, int *m, int *d); -int julian_to_wday (long jd); -int julian_to_jday (long jd); - -#endif /* !julcal_h */