Update Swiss Ephemeris to 2.0

pull/16/head
Gergely Polonkai 9 years ago
parent 26dcd74338
commit 45833584b7

@ -3,6 +3,9 @@ m4_define([swe_glib_minor_version], [0])
m4_define([swe_glib_micro_version], [3])
m4_define([swe_glib_version], [swe_glib_major_version.swe_glib_minor_version.swe_glib_micro_version])
m4_define([swe_glib_api_version], [swe_glib_major_version.0])
m4_define([swe_major_version], [2])
m4_define([swe_minor_version], [0])
m4_define([swe_version], [swe_major_version.swe_minor_version])
AC_INIT([SWE-GLib], [swe_glib_version], [gergely@polonkai.eu], [swe-glib])
AM_INIT_AUTOMAKE([-Wall foreign])
@ -26,6 +29,7 @@ AC_SUBST([SWE_GLIB_MICRO_VERSION], [swe_glib_micro_version])
AC_SUBST([SWE_GLIB_VERSION], [swe_glib_version])
AC_SUBST([SWE_GLIB_API_VERSION], [swe_glib_api_version])
AC_SUBST([SWE_GLIB_API_VERSION_U], [AS_TR_SH([swe_glib_api_version])])
AC_SUBST([SWE_VERSION], [swe_version])
AC_PROG_CC
AM_PROG_CC_C_O
@ -68,7 +72,7 @@ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.32.0])
PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.32.0])
AC_CONFIG_MACRO_DIR([m4])
LIBSWE_LIBS='$(top_builddir)/swe/src/libswe-1.76.la'
LIBSWE_LIBS='$(top_builddir)/swe/src/libswe-$(SWE_VERSION).la'
AC_SUBST(LIBSWE_LIBS)
LIBSWE_GLIB_LIBS='$(top_builddir)/src/libswe-glib-$(SWE_GLIB_API_VERSION).la'

@ -70,7 +70,7 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/locale/hu/LC_MESSAGES/swe-glib.mo
%files
%doc ChangeLog
%{_libdir}/libswe-1.76.so.*
%{_libdir}/libswe-@SWE_VERSION@.so.*
%{_libdir}/libswe-glib-@SWE_GLIB_API_VERSION@.so.*
%{_libdir}/girepository-1.0/SweGlib-@SWE_GLIB_API_VERSION@.typelib
@ -84,7 +84,7 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/locale/hu/LC_MESSAGES/swe-glib.mo
%{_includedir}/*
%{_libdir}/pkgconfig/*
%{_datadir}/gir-1.0/SweGlib-@SWE_GLIB_API_VERSION@.gir
%{_libdir}/libswe-1.76.so
%{_libdir}/libswe-@SWE_VERSION@.so
%{_libdir}/libswe-glib-@SWE_GLIB_API_VERSION@.so
%{_datadir}/vala/vapi/SweGlib-@SWE_GLIB_API_VERSION@.vapi

@ -1,6 +1,5 @@
This directory contains version 1.76 of the Swiss Ephemeris programming
library in a reduced form, so it can be used in an Autotools project like
Astrognome.
This directory contains version 2.0 of the Swiss Ephemeris programming library
in a reduced form, so it can be used in an Autotools project like Astrognome.
If you need the full version, you can download it from
ftp://ftp.astro.com/pub/swisseph/ (as of July, 2013)

Binary file not shown.

Binary file not shown.

@ -1,7 +1,7 @@
lib_LTLIBRARIES = libswe-1.76.la
libswe_1_76_la_SOURCES = swedate.c swehouse.c swejpl.c swemmoon.c swemplan.c swepcalc.c sweph.c swepdate.c swephlib.c swecl.c swehel.c
libswe_1_76_la_CFLAGS = $(CFLAGS) -Wall
libswe_1_76_la_LIBADD = $(LIBS)
lib_LTLIBRARIES = libswe-2.0.la
libswe_2_0_la_SOURCES = swedate.c swehouse.c swejpl.c swemmoon.c swemplan.c swepcalc.c sweph.c swepdate.c swephlib.c swecl.c swehel.c
libswe_2_0_la_CFLAGS = $(CFLAGS) -Wall
libswe_2_0_la_LIBADD = $(LIBS)
EXTRA_DIST = \
LICENSE \

File diff suppressed because it is too large Load Diff

@ -1,4 +1,3 @@
/*********************************************************
$Header: /home/dieter/sweph/RCS/swedate.c,v 1.75 2009/04/08 07:17:29 dieter Exp $
version 15-feb-89 16:30
@ -8,7 +7,6 @@
swe_julday()
************************************************************/
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
License conditions
@ -85,34 +83,34 @@
Return: OK or ERR (for illegal date)
*********************************************************/
#include "swephexp.h"
#include "sweph.h"
# include "swephexp.h"
# include "sweph.h"
static AS_BOOL init_leapseconds_done = FALSE;
int FAR PASCAL_CONV
swe_date_conversion(int y, int m, int d, /* day, month, year */
double uttime, /* UT in hours (decimal) */
char c, /* calendar g[regorian]|j[ulian] */
double *tjd)
int FAR PASCAL_CONV swe_date_conversion(int y,
int m,
int d, /* day, month, year */
double uttime, /* UT in hours (decimal) */
char c, /* calendar g[regorian]|j[ulian] */
double *tjd)
{
int rday, rmon, ryear;
double rut, jd;
int gregflag = SE_JUL_CAL;
if (c == 'g')
gregflag = SE_GREG_CAL;
rut = uttime; /* hours UT */
jd = swe_julday(y, m, d, rut, gregflag);
swe_revjul(jd, gregflag, &ryear, &rmon, &rday, &rut);
*tjd = jd;
if (rmon == m && rday == d && ryear == y) {
return OK;
}
else {
return ERR;
}
} /* end date_conversion */
int rday, rmon, ryear;
double rut, jd;
int gregflag = SE_JUL_CAL;
if (c == 'g')
gregflag = SE_GREG_CAL;
rut = uttime; /* hours UT */
jd = swe_julday(y, m, d, rut, gregflag);
swe_revjul(jd, gregflag, &ryear, &rmon, &rday, &rut);
*tjd = jd;
if (rmon == m && rday == d && ryear == y) {
return OK;
} else {
return ERR;
}
} /* end date_conversion */
/*************** swe_julday ********************************************
* This function returns the absolute Julian day number (JD)
@ -163,31 +161,26 @@ swe_date_conversion(int y, int m, int d, /* day, month, year */
and notifies errors like 32 January.
****************************************************************/
double FAR PASCAL_CONV
swe_julday(int year, int month, int day, double hour, int gregflag)
double FAR PASCAL_CONV swe_julday(int year, int month, int day, double hour, int gregflag)
{
double jd;
double u, u0, u1, u2;
u = year;
if (month < 3)
u -= 1;
u0 = u + 4712.0;
u1 = month + 1.0;
if (u1 < 4)
u1 += 12.0;
jd = floor(u0 * 365.25)
+ floor(30.6 * u1 + 0.000001)
+ day + hour / 24.0 - 63.5;
if (gregflag == SE_GREG_CAL) {
u2 = floor(fabs(u) / 100) - floor(fabs(u) / 400);
if (u < 0.0)
u2 = -u2;
jd = jd - u2 + 2;
if ((u < 0.0) && (u / 100 == floor(u / 100))
&& (u / 400 != floor(u / 400)))
jd -= 1;
}
return jd;
double jd;
double u,u0,u1,u2;
u = year;
if (month < 3) u -=1;
u0 = u + 4712.0;
u1 = month + 1.0;
if (u1 < 4) u1 += 12.0;
jd = floor(u0*365.25)
+ floor(30.6*u1+0.000001)
+ day + hour/24.0 - 63.5;
if (gregflag == SE_GREG_CAL) {
u2 = floor(fabs(u) / 100) - floor(fabs(u) / 400);
if (u < 0.0) u2 = -u2;
jd = jd - u2 + 2;
if ((u < 0.0) && (u/100 == floor(u/100)) && (u/400 != floor(u/400)))
jd -=1;
}
return jd;
}
/*** swe_revjul ******************************************************
@ -209,27 +202,24 @@ swe_julday(int year, int month, int day, double hour, int gregflag)
Original author Mark Pottenger, Los Angeles.
with bug fix for year < -4711 16-aug-88 Alois Treindl
*************************************************************************/
void FAR PASCAL_CONV
swe_revjul(double jd, int gregflag, int *jyear, int *jmon, int *jday,
double *jut)
void FAR PASCAL_CONV swe_revjul (double jd, int gregflag,
int *jyear, int *jmon, int *jday, double *jut)
{
double u0, u1, u2, u3, u4;
u0 = jd + 32082.5;
if (gregflag == SE_GREG_CAL) {
u1 = u0 + floor(u0 / 36525.0) - floor(u0 / 146100.0) - 38.0;
if (jd >= 1830691.5)
u1 += 1;
u0 = u0 + floor(u1 / 36525.0) - floor(u1 / 146100.0) - 38.0;
}
u2 = floor(u0 + 123.0);
u3 = floor((u2 - 122.2) / 365.25);
u4 = floor((u2 - floor(365.25 * u3)) / 30.6001);
*jmon = (int)(u4 - 1.0);
if (*jmon > 12)
*jmon -= 12;
*jday = (int)(u2 - floor(365.25 * u3) - floor(30.6001 * u4));
*jyear = (int)(u3 + floor((u4 - 2.0) / 12.0) - 4800);
*jut = (jd - floor(jd + 0.5) + 0.5) * 24.0;
double u0,u1,u2,u3,u4;
u0 = jd + 32082.5;
if (gregflag == SE_GREG_CAL) {
u1 = u0 + floor (u0/36525.0) - floor (u0/146100.0) - 38.0;
if (jd >= 1830691.5) u1 +=1;
u0 = u0 + floor (u1/36525.0) - floor (u1/146100.0) - 38.0;
}
u2 = floor (u0 + 123.0);
u3 = floor ( (u2 - 122.2) / 365.25);
u4 = floor ( (u2 - floor (365.25 * u3) ) / 30.6001);
*jmon = (int) (u4 - 1.0);
if (*jmon > 12) *jmon -= 12;
*jday = (int) (u2 - floor (365.25 * u3) - floor (30.6001 * u4));
*jyear = (int) (u3 + floor ( (u4 - 2.0) / 12.0) - 4800);
*jut = (jd - floor (jd + 0.5) + 0.5) * 24.0;
}
/* transform local time to UTC or UTC to local time
@ -246,37 +236,39 @@ swe_revjul(double jd, int gregflag, int *jyear, int *jmon, int *jday,
* For conversion from local time to utc, use +d_timezone.
* For conversion from utc to local time, use -d_timezone.
*/
void FAR PASCAL_CONV
swe_utc_time_zone(int32 iyear, int32 imonth, int32 iday, int32 ihour,
int32 imin, double dsec, double d_timezone,
int32 * iyear_out, int32 * imonth_out, int32 * iday_out,
int32 * ihour_out, int32 * imin_out, double *dsec_out)
void FAR PASCAL_CONV swe_utc_time_zone(
int32 iyear, int32 imonth, int32 iday,
int32 ihour, int32 imin, double dsec,
double d_timezone,
int32 *iyear_out, int32 *imonth_out, int32 *iday_out,
int32 *ihour_out, int32 *imin_out, double *dsec_out
)
{
double tjd, d;
AS_BOOL have_leapsec = FALSE;
double dhour;
if (dsec >= 60.0) {
have_leapsec = TRUE;
dsec -= 1.0;
}
dhour = ((double)ihour) + ((double)imin) / 60.0 + dsec / 3600.0;
tjd = swe_julday(iyear, imonth, iday, 0, SE_GREG_CAL);
dhour -= d_timezone;
if (dhour < 0.0) {
tjd -= 1.0;
dhour += 24.0;
}
if (dhour >= 24.0) {
tjd += 1.0;
dhour -= 24.0;
}
swe_revjul(tjd + 0.001, SE_GREG_CAL, iyear_out, imonth_out, iday_out, &d);
*ihour_out = (int)dhour;
d = (dhour - (double)*ihour_out) * 60;
*imin_out = (int)d;
*dsec_out = (d - (double)*imin_out) * 60;
if (have_leapsec)
*dsec_out += 1.0;
double tjd, d;
AS_BOOL have_leapsec = FALSE;
double dhour;
if (dsec >= 60.0) {
have_leapsec = TRUE;
dsec -= 1.0;
}
dhour = ((double) ihour) + ((double) imin) / 60.0 + dsec / 3600.0;
tjd = swe_julday(iyear, imonth, iday, 0, SE_GREG_CAL);
dhour -= d_timezone;
if (dhour < 0.0) {
tjd -= 1.0;
dhour += 24.0;
}
if (dhour >= 24.0) {
tjd += 1.0;
dhour -= 24.0;
}
swe_revjul(tjd + 0.001, SE_GREG_CAL, iyear_out, imonth_out, iday_out, &d);
*ihour_out = (int) dhour;
d = (dhour - (double) *ihour_out) * 60;
*imin_out = (int) d;
*dsec_out = (d - (double) *imin_out) * 60;
if (have_leapsec)
*dsec_out += 1.0;
}
/*
@ -287,85 +279,80 @@ swe_utc_time_zone(int32 iyear, int32 imonth, int32 iday, int32 ihour,
#define NLEAP_SECONDS 24
#define NLEAP_SECONDS_SPACE 100
static int leap_seconds[NLEAP_SECONDS_SPACE] = {
19720630,
19721231,
19731231,
19741231,
19751231,
19761231,
19771231,
19781231,
19791231,
19810630,
19820630,
19830630,
19850630,
19871231,
19891231,
19901231,
19920630,
19930630,
19940630,
19951231,
19970630,
19981231,
20051231,
20081231,
0 /* keep this 0 as end mark */
19720630,
19721231,
19731231,
19741231,
19751231,
19761231,
19771231,
19781231,
19791231,
19810630,
19820630,
19830630,
19850630,
19871231,
19891231,
19901231,
19920630,
19930630,
19940630,
19951231,
19970630,
19981231,
20051231,
20081231,
0 /* keep this 0 as end mark */
};
#define J1972 2441317.5
#define NLEAP_INIT 10
/* Read additional leap second dates from external file, if given.
*/
static int
init_leapsec(void)
static int init_leapsec(void)
{
FILE *fp;
int ndat, ndat_last;
int tabsiz = 0;
int i;
char s[AS_MAXCH];
char *sp;
if (!init_leapseconds_done) {
init_leapseconds_done = TRUE;
tabsiz = NLEAP_SECONDS;
ndat_last = leap_seconds[NLEAP_SECONDS - 1];
/* no error message if file is missing */
if ((fp =
swi_fopen(-1, "seleapsec.txt", swed.ephepath, NULL)) == NULL)
return NLEAP_SECONDS;
while (fgets(s, AS_MAXCH, fp) != NULL) {
sp = s;
while (*sp == ' ' || *sp == '\t')
sp++;
sp++;
if (*sp == '#' || *sp == '\n')
continue;
ndat = atoi(s);
if (ndat <= ndat_last)
continue;
/* table space is limited. no error msg, if exceeded */
if (tabsiz >= NLEAP_SECONDS_SPACE)
return tabsiz;
leap_seconds[tabsiz] = ndat;
tabsiz++;
}
if (tabsiz > NLEAP_SECONDS)
leap_seconds[tabsiz] = 0; /* end mark */
fclose(fp);
FILE *fp;
int ndat, ndat_last;
int tabsiz = 0;
int i;
char s[AS_MAXCH];
char *sp;
if (!init_leapseconds_done) {
init_leapseconds_done = TRUE;
tabsiz = NLEAP_SECONDS;
ndat_last = leap_seconds[NLEAP_SECONDS - 1];
/* no error message if file is missing */
if ((fp = swi_fopen(-1, "seleapsec.txt", swed.ephepath, NULL)) == NULL)
return NLEAP_SECONDS;
while(fgets(s, AS_MAXCH, fp) != NULL) {
sp = s;
while (*sp == ' ' || *sp == '\t') sp++;
sp++;
if (*sp == '#' || *sp == '\n')
continue;
ndat = atoi(s);
if (ndat <= ndat_last)
continue;
/* table space is limited. no error msg, if exceeded */
if (tabsiz >= NLEAP_SECONDS_SPACE)
return tabsiz;
leap_seconds[tabsiz] = ndat;
tabsiz++;
}
/* find table size */
tabsiz = 0;
for (i = 0; i < NLEAP_SECONDS_SPACE; i++) {
if (leap_seconds[i] == 0)
break;
else
tabsiz++;
}
if (tabsiz > NLEAP_SECONDS) leap_seconds[tabsiz] = 0; /* end mark */
fclose(fp);
return tabsiz;
}
/* find table size */
tabsiz = 0;
for (i = 0; i < NLEAP_SECONDS_SPACE; i++) {
if (leap_seconds[i] == 0)
break;
else
tabsiz++;
}
return tabsiz;
}
/*
@ -387,103 +374,100 @@ init_leapsec(void)
* the leap seconds table (or the Swiss Ephemeris version) is not updated
* for a long time.
*/
int32 FAR PASCAL_CONV
swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32 ihour, int32 imin,
double dsec, int32 gregflag, double *dret, char *serr)
int32 FAR PASCAL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32 ihour, int32 imin, double dsec, int32 gregflag, double *dret, char *serr)
{
double tjd_ut1, tjd_et, tjd_et_1972, dhour, d;
int iyear2, imonth2, iday2;
int i, j, ndat, nleap, tabsiz_nleap;
/*
* error handling: invalid iyear etc.
*/
tjd_ut1 = swe_julday(iyear, imonth, iday, 0, gregflag);
swe_revjul(tjd_ut1, gregflag, &iyear2, &imonth2, &iday2, &d);
if (iyear != iyear2 || imonth != imonth2 || iday != iday2) {
if (serr != NULL)
sprintf(serr, "invalid date: year = %d, month = %d, day = %d",
iyear, imonth, iday);
return ERR;
}
if (ihour < 0 || ihour > 23 || imin < 0 || imin > 59 || dsec < 0
|| dsec >= 61 || (dsec >= 60
&& (imin < 59 || ihour < 23 || tjd_ut1 < J1972))) {
if (serr != NULL)
sprintf(serr, "invalid time: %d:%d:%.2f", ihour, imin, dsec);
return ERR;
}
dhour = (double)ihour + ((double)imin) / 60.0 + dsec / 3600.0;
/*
* before 1972, we treat input date as UT1
*/
if (tjd_ut1 < J1972) {
dret[1] = swe_julday(iyear, imonth, iday, dhour, gregflag);
dret[0] = dret[1] + swe_deltat(dret[1]);
return OK;
}
/*
* if gregflag = Julian calendar, convert to gregorian calendar
*/
if (gregflag == SE_JUL_CAL) {
gregflag = SE_GREG_CAL;
swe_revjul(tjd_ut1, gregflag, &iyear, &imonth, &iday, &d);
}
/*
* number of leap seconds since 1972:
*/
tabsiz_nleap = init_leapsec();
nleap = NLEAP_INIT; /* initial difference between UTC and TAI in 1972 */
ndat = iyear * 10000 + imonth * 100 + iday;
double tjd_ut1, tjd_et, tjd_et_1972, dhour, d;
int iyear2, imonth2, iday2;
int i, j, ndat, nleap, tabsiz_nleap;
/*
* error handling: invalid iyear etc.
*/
tjd_ut1 = swe_julday(iyear, imonth, iday, 0, gregflag);
swe_revjul(tjd_ut1, gregflag, &iyear2, &imonth2, &iday2, &d);
if (iyear != iyear2 || imonth != imonth2 || iday != iday2) {
if (serr != NULL)
sprintf(serr, "invalid date: year = %d, month = %d, day = %d", iyear, imonth, iday);
return ERR;
}
if (ihour < 0 || ihour > 23
|| imin < 0 || imin > 59
|| dsec < 0 || dsec >= 61
|| (dsec >= 60 && (imin < 59 || ihour < 23 || tjd_ut1 < J1972))) {
if (serr != NULL)
sprintf(serr, "invalid time: %d:%d:%.2f", ihour, imin, dsec);
return ERR;
}
dhour = (double) ihour + ((double) imin) / 60.0 + dsec / 3600.0;
/*
* before 1972, we treat input date as UT1
*/
if (tjd_ut1 < J1972) {
dret[1] = swe_julday(iyear, imonth, iday, dhour, gregflag);
dret[0] = dret[1] + swe_deltat(dret[1]);
return OK;
}
/*
* if gregflag = Julian calendar, convert to gregorian calendar
*/
if (gregflag == SE_JUL_CAL) {
gregflag = SE_GREG_CAL;
swe_revjul(tjd_ut1, gregflag, &iyear, &imonth, &iday, &d);
}
/*
* number of leap seconds since 1972:
*/
tabsiz_nleap = init_leapsec();
nleap = NLEAP_INIT; /* initial difference between UTC and TAI in 1972 */
ndat = iyear * 10000 + imonth * 100 + iday;
for (i = 0; i < tabsiz_nleap; i++) {
if (ndat <= leap_seconds[i])
break;
nleap++;
}
/*
* For input dates > today:
* If leap seconds table is not up to date, we'd better interpret the
* input time as UT1, not as UTC. How do we find out?
* Check, if delta_t - nleap - 32.184 > 0.9
*/
d = swe_deltat(tjd_ut1) * 86400.0;
if (d - (double) nleap - 32.184 >= 1.0) {
dret[1] = tjd_ut1 + dhour / 24.0;
dret[0] = dret[1] + swe_deltat(dret[1]);
return OK;
}
/*
* if input second is 60: is it a valid leap second ?
*/
if (dsec >= 60) {
j = 0;
for (i = 0; i < tabsiz_nleap; i++) {
if (ndat <= leap_seconds[i])
break;
nleap++;
if (ndat == leap_seconds[i]) {
j = 1;
break;
}
}
/*
* For input dates > today:
* If leap seconds table is not up to date, we'd better interpret the
* input time as UT1, not as UTC. How do we find out?
* Check, if delta_t - nleap - 32.184 > 0.9
*/
d = swe_deltat(tjd_ut1) * 86400.0;
if (d - (double)nleap - 32.184 >= 1.0) {
dret[1] = tjd_ut1 + dhour / 24.0;
dret[0] = dret[1] + swe_deltat(dret[1]);
return OK;
if (j != 1) {
if (serr != NULL)
sprintf(serr, "invalid time (no leap second!): %d:%d:%.2f", ihour, imin, dsec);
return ERR;
}
/*
* if input second is 60: is it a valid leap second ?
*/
if (dsec >= 60) {
j = 0;
for (i = 0; i < tabsiz_nleap; i++) {
if (ndat == leap_seconds[i]) {
j = 1;
break;
}
}
if (j != 1) {
if (serr != NULL)
sprintf(serr, "invalid time (no leap second!): %d:%d:%.2f",
ihour, imin, dsec);
return ERR;
}
}
/*
* convert UTC to ET and UT1
*/
/* the number of days between input date and 1 jan 1972: */
d = tjd_ut1 - J1972;
/* SI time since 1972, ignoring leap seconds: */
d += (double)ihour / 24.0 + (double)imin / 1440.0 + dsec / 86400.0;
/* ET (TT) */
tjd_et_1972 = J1972 + (32.184 + NLEAP_INIT) / 86400.0;
tjd_et = tjd_et_1972 + d + ((double)(nleap - NLEAP_INIT)) / 86400.0;
d = swe_deltat(tjd_et);
tjd_ut1 = tjd_et - swe_deltat(tjd_et - d);
dret[0] = tjd_et;
dret[1] = tjd_ut1;
return OK;
}
/*
* convert UTC to ET and UT1
*/
/* the number of days between input date and 1 jan 1972: */
d = tjd_ut1 - J1972;
/* SI time since 1972, ignoring leap seconds: */
d += (double) ihour / 24.0 + (double) imin / 1440.0 + dsec / 86400.0;
/* ET (TT) */
tjd_et_1972 = J1972 + (32.184 + NLEAP_INIT) / 86400.0;
tjd_et = tjd_et_1972 + d + ((double) (nleap - NLEAP_INIT)) / 86400.0;
d = swe_deltat(tjd_et);
tjd_ut1 = tjd_et - swe_deltat(tjd_et - d);
dret[0] = tjd_et;
dret[1] = tjd_ut1;
return OK;
}
/*
@ -500,92 +484,86 @@ swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32 ihour, int32 imin,
* the leap seconds table (or the Swiss Ephemeris version) has not been
* updated for a long time.
*/
void FAR PASCAL_CONV
swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 * iyear, int32 * imonth,
int32 * iday, int32 * ihour, int32 * imin, double *dsec)
void FAR PASCAL_CONV swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 *iyear, int32 *imonth, int32 *iday, int32 *ihour, int32 *imin, double *dsec)
{
int i;
int second_60 = 0;
int iyear2, imonth2, iday2, nleap, ndat, tabsiz_nleap;
double d, tjd, tjd_et_1972, tjd_ut, dret[10];
/*
* if tjd_et is before 1 jan 1972 UTC, return UT1
*/
tjd_et_1972 = J1972 + (32.184 + NLEAP_INIT) / 86400.0;
d = swe_deltat(tjd_et);
tjd_ut = tjd_et - swe_deltat(tjd_et - d);
if (tjd_et < tjd_et_1972) {
swe_revjul(tjd_ut, gregflag, iyear, imonth, iday, &d);
*ihour = (int32) d;
d -= (double)*ihour;
d *= 60;
*imin = (int32) d;
*dsec = (d - (double)*imin) * 60.0;
return;
}
/*
* minimum number of leap seconds since 1972; we may be missing one leap
* second
*/
tabsiz_nleap = init_leapsec();
swe_revjul(tjd_ut - 1, SE_GREG_CAL, &iyear2, &imonth2, &iday2, &d);
ndat = iyear2 * 10000 + imonth2 * 100 + iday2;
nleap = 0;
for (i = 0; i < tabsiz_nleap; i++) {
if (ndat <= leap_seconds[i])
break;
nleap++;
}
/* date of potentially missing leapsecond */
if (nleap < tabsiz_nleap) {
i = leap_seconds[nleap];
iyear2 = i / 10000;
imonth2 = (i % 10000) / 100;;
iday2 = i % 100;
tjd = swe_julday(iyear2, imonth2, iday2, 0, SE_GREG_CAL);
swe_revjul(tjd + 1, SE_GREG_CAL, &iyear2, &imonth2, &iday2, &d);
swe_utc_to_jd(iyear2, imonth2, iday2, 0, 0, 0, SE_GREG_CAL, dret,
NULL);
d = tjd_et - dret[0];
if (d >= 0) {
nleap++;
}
else if (d < 0 && d > -1.0 / 86400.0) {
second_60 = 1;
}
}
/*
* UTC, still unsure about one leap second
*/
tjd =
J1972 + (tjd_et - tjd_et_1972) - ((double)nleap +
second_60) / 86400.0;
swe_revjul(tjd, SE_GREG_CAL, iyear, imonth, iday, &d);
int i;
int second_60 = 0;
int iyear2, imonth2, iday2, nleap, ndat, tabsiz_nleap;
double d, tjd, tjd_et_1972, tjd_ut, dret[10];
/*
* if tjd_et is before 1 jan 1972 UTC, return UT1
*/
tjd_et_1972 = J1972 + (32.184 + NLEAP_INIT) / 86400.0;
d = swe_deltat(tjd_et);
tjd_ut = tjd_et - swe_deltat(tjd_et - d);
if (tjd_et < tjd_et_1972) {
swe_revjul(tjd_ut, gregflag, iyear, imonth, iday, &d);
*ihour = (int32) d;
d -= (double)*ihour;
d -= (double) *ihour;
d *= 60;
*imin = (int32) d;
*dsec = (d - (double)*imin) * 60.0 + second_60;
/*
* For input dates > today:
* If leap seconds table is not up to date, we'd better interpret the
* input time as UT1, not as UTC. How do we find out?
* Check, if delta_t - nleap - 32.184 > 0.9
*/
d = swe_deltat(tjd_et);
d = swe_deltat(tjd_et - d);
if (d * 86400.0 - (double)(nleap + NLEAP_INIT) - 32.184 >= 1.0) {
swe_revjul(tjd_et - d, SE_GREG_CAL, iyear, imonth, iday, &d);
*ihour = (int32) d;
d -= (double)*ihour;
d *= 60;
*imin = (int32) d;
*dsec = (d - (double)*imin) * 60.0;
}
if (gregflag == SE_JUL_CAL) {
tjd = swe_julday(*iyear, *imonth, *iday, 0, SE_GREG_CAL);
swe_revjul(tjd, gregflag, iyear, imonth, iday, &d);
*dsec = (d - (double) *imin) * 60.0;
return;
}
/*
* minimum number of leap seconds since 1972; we may be missing one leap
* second
*/
tabsiz_nleap = init_leapsec();
swe_revjul(tjd_ut-1, SE_GREG_CAL, &iyear2, &imonth2, &iday2, &d);
ndat = iyear2 * 10000 + imonth2 * 100 + iday2;
nleap = 0;
for (i = 0; i < tabsiz_nleap; i++) {
if (ndat <= leap_seconds[i])
break;
nleap++;
}
/* date of potentially missing leapsecond */
if (nleap < tabsiz_nleap) {
i = leap_seconds[nleap];
iyear2 = i / 10000;
imonth2 = (i % 10000) / 100;;
iday2 = i % 100;
tjd = swe_julday(iyear2, imonth2, iday2, 0, SE_GREG_CAL);
swe_revjul(tjd+1, SE_GREG_CAL, &iyear2, &imonth2, &iday2, &d);
swe_utc_to_jd(iyear2,imonth2,iday2, 0, 0, 0, SE_GREG_CAL, dret, NULL);
d = tjd_et - dret[0];
if (d >= 0) {
nleap++;
} else if (d < 0 && d > -1.0/86400.0) {
second_60 = 1;
}
}
/*
* UTC, still unsure about one leap second
*/
tjd = J1972 + (tjd_et - tjd_et_1972) - ((double) nleap + second_60) / 86400.0;
swe_revjul(tjd, SE_GREG_CAL, iyear, imonth, iday, &d);
*ihour = (int32) d;
d -= (double) *ihour;
d *= 60;
*imin = (int32) d;
*dsec = (d - (double) *imin) * 60.0 + second_60;
/*
* For input dates > today:
* If leap seconds table is not up to date, we'd better interpret the
* input time as UT1, not as UTC. How do we find out?
* Check, if delta_t - nleap - 32.184 > 0.9
*/
d = swe_deltat(tjd_et);
d = swe_deltat(tjd_et - d);
if (d * 86400.0 - (double) (nleap + NLEAP_INIT) - 32.184 >= 1.0) {
swe_revjul(tjd_et - d, SE_GREG_CAL, iyear, imonth, iday, &d);
*ihour = (int32) d;
d -= (double) *ihour;
d *= 60;
*imin = (int32) d;
*dsec = (d - (double) *imin) * 60.0;
}
if (gregflag == SE_JUL_CAL) {
tjd = swe_julday(*iyear, *imonth, *iday, 0, SE_GREG_CAL);
swe_revjul(tjd, gregflag, iyear, imonth, iday, &d);
}
}
/*
@ -602,10 +580,8 @@ swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 * iyear, int32 * imonth,
* the leap seconds table (or the Swiss Ephemeris version) has not been
* updated for a long time.
*/
void FAR PASCAL_CONV
swe_jdut1_to_utc(double tjd_ut, int32 gregflag, int32 * iyear, int32 * imonth,
int32 * iday, int32 * ihour, int32 * imin, double *dsec)
void FAR PASCAL_CONV swe_jdut1_to_utc(double tjd_ut, int32 gregflag, int32 *iyear, int32 *imonth, int32 *iday, int32 *ihour, int32 *imin, double *dsec)
{
double tjd_et = tjd_ut + swe_deltat(tjd_ut);
swe_jdet_to_utc(tjd_et, gregflag, iyear, imonth, iday, ihour, imin, dsec);
double tjd_et = tjd_ut + swe_deltat(tjd_ut);
swe_jdet_to_utc(tjd_et, gregflag, iyear, imonth, iday, ihour, imin, dsec);
}

@ -1,4 +1,3 @@
/*********************************************************
$Header: /home/dieter/sweph/RCS/swedate.h,v 1.74 2008/06/16 10:07:20 dieter Exp $
version 15-feb-89 16:30
@ -59,27 +58,25 @@
*/
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
#ifndef _SWEDLL_H
extern EXP32 int FAR PASCAL_CONV EXP16 swe_date_conversion(int y, int m, int d, /* year, month, day */
double utime, /* universal time in hours (decimal) */
char c, /* calendar g[regorian]|j[ulian]|a[stro = greg] */
double *tgmt);
extern EXP32 double *FAR PASCAL_CONV EXP16 swe_julday(int year, int month,
int day,
double hour,
int gregflag);
extern EXP32 void FAR PASCAL_CONV EXP16 swe_revjul(double jd,
int gregflag,
int *jyear, int *jmon,
int *jday,
double *jut);
extern EXP32 int FAR PASCAL_CONV EXP16 swe_date_conversion (
int y , int m , int d , /* year, month, day */
double utime, /* universal time in hours (decimal) */
char c, /* calendar g[regorian]|j[ulian]|a[stro = greg] */
double *tgmt);
extern EXP32 double *FAR PASCAL_CONV EXP16 swe_julday(
int year, int month, int day, double hour,
int gregflag);
extern EXP32 void FAR PASCAL_CONV EXP16 swe_revjul (
double jd,
int gregflag,
int *jyear, int *jmon, int *jday, double *jut);
#endif
#ifdef __cplusplus
} /* extern C */
} /* extern C */
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,4 +1,3 @@
/*******************************************************
$Header: /home/dieter/sweph/RCS/swehouse.h,v 1.74 2008/06/16 10:07:20 dieter Exp $
module swehouse.h
@ -60,17 +59,16 @@ house and (simple) aspect calculation
for promoting such software, products or services.
*/
struct houses
{
double cusp[37];
double ac;
double mc;
double vertex;
double equasc;
double coasc1;
double coasc2;
double polasc;
};
struct houses {
double cusp[37];
double ac;
double mc;
double vertex;
double equasc;
double coasc1;
double coasc2;
double polasc;
};
#define HOUSES struct houses
#define VERY_SMALL 1E-10

File diff suppressed because it is too large Load Diff

@ -1,17 +1,14 @@
/*
| $Header: /home/dieter/sweph/RCS/swejpl.h,v 1.74 2008/06/16 10:07:20 dieter Exp $
|
| Subroutines for reading JPL ephemerides.
| derived from testeph.f as contained in DE403 distribution July 1995.
| works with DE200, DE102, DE403, DE404, DE405, DE406
| (attention, DE102 has 950 reference frame and also DE403 has slightly
| different reference frame from DE200).
| works with DE200, DE102, DE403, DE404, DE405, DE406, DE431
| (attention, these ephemerides do not have exactly the same reference frame)
Authors: Dieter Koch and Alois Treindl, Astrodienst Zurich
**************************************************************/
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
License conditions
@ -69,8 +66,8 @@
#include "sweodef.h"
#define J_MERCURY 0 /* jpl body indices, modified by Alois */
#define J_VENUS 1 /* now they start at 0 and not at 1 */
#define J_MERCURY 0 /* jpl body indices, modified by Alois */
#define J_VENUS 1 /* now they start at 0 and not at 1 */
#define J_EARTH 2
#define J_MARS 3
#define J_JUPITER 4
@ -91,8 +88,7 @@
* ntarg can be all of the above, ncent all except J_NUT and J_LIB.
* Librations and Nutations are not affected by ncent.
*/
extern int swi_pleph(double et, int ntarg, int ncent, double *rrd,
char *serr);
extern int swi_pleph(double et, int ntarg, int ncent, double *rrd, char *serr);
/*
* read the ephemeris constants. ss[0..2] returns start, end and granule size.
@ -100,9 +96,9 @@ extern int swi_pleph(double et, int ntarg, int ncent, double *rrd,
*/
extern void swi_close_jpl_file(void);
extern int swi_open_jpl_file(double *ss, char *fname, char *fpath,
char *serr);
extern int swi_open_jpl_file(double *ss, char *fname, char *fpath, char *serr);
extern int32 swi_get_jpl_denum(void);
extern void swi_IERS_FK5(double *xin, double *xout, int dir);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,4 +1,3 @@
/************************************************************
$Header: /home/dieter/sweph/RCS/sweodef.h,v 1.74 2008/06/16 10:07:20 dieter Exp $
definitions and constants for all Swiss Ephemeris source files,
@ -69,99 +68,99 @@
for promoting such software, products or services.
*/
#ifndef _OURDEF_INCLUDED /* ourdef.h is a superset of sweodef.h */
#ifndef _SWEODEF_INCLUDED /* allow multiple #includes */
#ifndef _OURDEF_INCLUDED /* ourdef.h is a superset of sweodef.h */
#ifndef _SWEODEF_INCLUDED /* allow multiple #includes */
#define _SWEODEF_INCLUDED
#define MY_TRUE 1 /* for use in other defines, before TRUE is defined */
#define MY_FALSE 0 /* for use in other defines, before TRUE is defined */
# define MY_TRUE 1 /* for use in other defines, before TRUE is defined */
# define MY_FALSE 0 /* for use in other defines, before TRUE is defined */
#ifdef _WIN32 /* Microsoft VC 5.0 does not define MSDOS anymore */
#undef MSDOS
#define MSDOS MY_TRUE
#ifdef _WIN32 /* Microsoft VC 5.0 does not define MSDOS anymore */
# undef MSDOS
# define MSDOS MY_TRUE
#include <wtypes.h>
#include <objbase.h>
#include <wincon.h>
#include <winbase.h>
#include <io.h>
#include <windows.h>
#define sleep(x) Sleep((x) * 1000)
# define sleep(x) Sleep((x) * 1000)
#endif
#ifdef _MSC_VER
#define MS_VC
# define MS_VC
#endif
#ifdef WIN32 /* Microsoft VC 5.0 does not define MSDOS anymore */
#define MSDOS MY_TRUE
#ifdef WIN32 /* Microsoft VC 5.0 does not define MSDOS anymore */
# define MSDOS MY_TRUE
#endif
#ifdef MSDOS /* already defined by some DOS compilers */
#undef MSDOS
#define MSDOS MY_TRUE
#ifdef MSDOS /* already defined by some DOS compilers */
# undef MSDOS
# define MSDOS MY_TRUE
#endif
#ifdef __TURBOC__ /* defined by turboc */
#ifndef MSDOS
#define MSDOS MY_TRUE
#endif
#define TURBO_C
#ifdef __TURBOC__ /* defined by turboc */
# ifndef MSDOS
# define MSDOS MY_TRUE
# endif
# define TURBO_C
#endif
#ifdef __SC__ /* defined by Symantec C */
#ifndef MSDOS
#define MSDOS MY_TRUE
#endif
#define SYMANTEC_C
#ifdef __SC__ /* defined by Symantec C */
# ifndef MSDOS
# define MSDOS MY_TRUE
# endif
# define SYMANTEC_C
#endif
#ifdef __WATCOMC__ /* defined by WatcomC */
#ifndef MSDOS
#define MSDOS MY_TRUE
#endif
#define WATCOMC
#ifdef __WATCOMC__ /* defined by WatcomC */
# ifndef MSDOS
# define MSDOS MY_TRUE
# endif
# define WATCOMC
#endif
#ifdef __MWERKS__ /* defined on Macintosh CodeWarrior */
#if macintosh && powerc
#define MACOS MY_TRUE /* let it undefined otherwise */
#define MSDOS MY_FALSE /* in case one above fired falsely */
#endif
#ifdef __MWERKS__ /* defined on Macintosh CodeWarrior */
# if macintosh && powerc
# define MACOS MY_TRUE /* let it undefined otherwise */
# define MSDOS MY_FALSE /* in case one above fired falsely */
# endif
#endif
#ifdef MSDOS
#define HPUNIX MY_FALSE
#define INTEL_BYTE_ORDER 1
#ifndef TURBO_C
#define MS_C /* assume Microsoft C compiler */
#endif
#define MYFAR far
#define UNIX_FS MY_FALSE
#else
#ifdef MACOS
#define HPUNIX MY_FALSE
#define MYFAR
#define UNIX_FS MY_FALSE
# define HPUNIX MY_FALSE
# define INTEL_BYTE_ORDER 1
# ifndef TURBO_C
# define MS_C /* assume Microsoft C compiler */
# endif
# define MYFAR far
# define UNIX_FS MY_FALSE
#else
#define MSDOS MY_FALSE
#define HPUNIX MY_TRUE
#ifndef _HPUX_SOURCE
#define _HPUX_SOURCE
#endif
#define MYFAR
#define UNIX_FS MY_TRUE
#endif
# ifdef MACOS
# define HPUNIX MY_FALSE
# define MYFAR
# define UNIX_FS MY_FALSE
# else
# define MSDOS MY_FALSE
# define HPUNIX MY_TRUE
# ifndef _HPUX_SOURCE
# define _HPUX_SOURCE
# endif
# define MYFAR
# define UNIX_FS MY_TRUE
# endif
#endif
#include <math.h>
#include <stdlib.h>
#ifndef FILE
#include <stdio.h>
# include <stdio.h>
#endif
#if HPUNIX
#include <unistd.h>
# include <unistd.h>
#endif
/*
@ -171,63 +170,63 @@
*/
#include <limits.h>
#if INT_MAX < 40000
#define INT_16
# define INT_16
#else
#if LONG_MAX > INT_MAX
#define LONG_64
#endif
# if LONG_MAX > INT_MAX
# define LONG_64
# endif
#endif
#ifdef BYTE_ORDER
#ifdef LITTLE_ENDIAN
#if BYTE_ORDER == LITTLE_ENDIAN
#define INTEL_BYTE_ORDER
#endif
# if BYTE_ORDER == LITTLE_ENDIAN
# define INTEL_BYTE_ORDER
# endif
#endif
#endif
#ifdef INT_16
typedef long int32;
typedef unsigned long uint32;
typedef int int16;
typedef double REAL8; /* real with at least 64 bit precision */
typedef long INT4; /* signed integer with at least 32 bit precision */
typedef unsigned long UINT4;
typedef long int32;
typedef unsigned long uint32;
typedef int int16;
typedef double REAL8; /* real with at least 64 bit precision */
typedef long INT4; /* signed integer with at least 32 bit precision */
typedef unsigned long UINT4;
/* unsigned integer with at least 32 bit precision */
typedef int AS_BOOL;
typedef unsigned int UINT2; /* unsigned 16 bits */
#define ABS4 labs /* abs function for long */
typedef int AS_BOOL;
typedef unsigned int UINT2; /* unsigned 16 bits */
# define ABS4 labs /* abs function for long */
#else
typedef int int32;
typedef long long int64;
typedef unsigned int uint32;
typedef short int16;
typedef double REAL8; /* real with at least 64 bit precision */
typedef int INT4; /* signed integer with at least 32 bit precision */
typedef unsigned int UINT4;
/* unsigned integer with at least 32 bit precision */
typedef int AS_BOOL;
typedef unsigned short UINT2; /* unsigned 16 bits */
#define ABS4 abs /* abs function for long */
typedef int int32;
typedef long long int64;
typedef unsigned int uint32;
typedef short int16;
typedef double REAL8; /* real with at least 64 bit precision */
typedef int INT4; /* signed integer with at least 32 bit precision */
typedef unsigned int UINT4;
/* unsigned integer with at least 32 bit precision */
typedef int AS_BOOL;
typedef unsigned short UINT2; /* unsigned 16 bits */
# define ABS4 abs /* abs function for long */
#endif
#if MSDOS
#ifdef TURBO_C
#include <alloc.h> /* MSC needs malloc ! */
#else
#include <malloc.h>
#endif
#define SIGALRM SIGINT
#if MSDOS
# ifdef TURBO_C
# include <alloc.h> /* MSC needs malloc ! */
# else
# include <malloc.h>
# endif
# define SIGALRM SIGINT
#endif
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#ifndef TRUE
# define TRUE 1
# define FALSE 0
#endif
#ifndef OK
#define OK (0)
#define ERR (-1)
#ifndef OK
# define OK (0)
# define ERR (-1)
#endif
/* hack because UCHAR is already used by mingw gcc */
@ -241,30 +240,30 @@ typedef unsigned char UCHAR;
#define UCP (UCHAR*)
#define SCP (char*)
#define ODEGREE_STRING "°" /* degree as string, utf8 encoding */
# define ODEGREE_STRING "°" /* degree as string, utf8 encoding */
#ifndef HUGE
#define HUGE 1.7E+308 /* biggest value for REAL8 */
# define HUGE 1.7E+308 /* biggest value for REAL8 */
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
# define M_PI 3.14159265358979323846
#endif
#define forward static
#define AS_MAXCH 256 /* used for string declarations, allowing 255 char+\0 */
#define AS_MAXCH 256 /* used for string declarations, allowing 255 char+\0 */
#define DEGTORAD 0.0174532925199433
#define RADTODEG 57.2957795130823
typedef int32 centisec; /* centiseconds used for angles and times */
#define CS (centisec) /* use for casting */
#define CSEC centisec /* use for typing */
typedef int32 centisec; /* centiseconds used for angles and times */
#define CS (centisec) /* use for casting */
#define CSEC centisec /* use for typing */
#define DEG 360000 /* degree expressed in centiseconds */
#define DEG7_30 (2700000) /* 7.5 degrees */
#define DEG 360000 /* degree expressed in centiseconds */
#define DEG7_30 (2700000) /* 7.5 degrees */
#define DEG15 (15 * DEG)
#define DEG24 (24 * DEG)
#define DEG30 (30 * DEG)
@ -275,49 +274,48 @@ typedef int32 centisec; /* centiseconds used for angles and times */
#define DEG180 (180 * DEG)
#define DEG270 (270 * DEG)
#define DEG360 (360 * DEG)
#define CSTORAD 4.84813681109536E-08 /* centisec to rad: pi / 180 /3600/100 */
#define RADTOCS 2.06264806247096E+07 /* rad to centisec 180*3600*100/pi */
#define CS2DEG (1.0/360000.0) /* centisec to degree */
#define CSTORAD 4.84813681109536E-08 /* centisec to rad: pi / 180 /3600/100 */
#define RADTOCS 2.06264806247096E+07 /* rad to centisec 180*3600*100/pi */
#define CS2DEG (1.0/360000.0) /* centisec to degree */
/* control strings for fopen() */
#if UNIX_FS
#define BFILE_R_ACCESS "r" /* open binary file for reading */
#define BFILE_RW_ACCESS "r+" /* open binary file for writing and reading */
#define BFILE_W_CREATE "w" /* create/open binary file for write */
#define BFILE_A_ACCESS "a+" /* create/open binary file for append */
#define FILE_R_ACCESS "r" /* open text file for reading */
#define FILE_RW_ACCESS "r+" /* open text file for writing and reading */
#define FILE_W_CREATE "w" /* create/open text file for write */
#define FILE_A_ACCESS "a+" /* create/open text file for append */
#define O_BINARY 0 /* for open(), not defined in Unix */
#define OPEN_MODE 0666 /* default file creation mode */
#define DIR_GLUE "/" /* glue string for directory/file */
#define PATH_SEPARATOR ";:" /* semicolon or colon may be used */
#else
#define BFILE_R_ACCESS "rb" /* open binary file for reading */
#define BFILE_RW_ACCESS "r+b" /* open binary file for writing and reading */
#define BFILE_W_CREATE "wb" /* create/open binary file for write */
#define BFILE_A_ACCESS "a+b" /* create/open binary file for append */
#define PATH_SEPARATOR ";" /* semicolon as PATH separator */
#define OPEN_MODE 0666 /* default file creation mode */
#ifdef MACOS
#define FILE_R_ACCESS "r" /* open text file for reading */
#define FILE_RW_ACCESS "r+" /* open text file for writing and reading */
#define FILE_W_CREATE "w" /* create/open text file for write */
#define FILE_A_ACCESS "a+" /* create/open text file for append */
#define DIR_GLUE ":" /* glue string for directory/file */
# define BFILE_R_ACCESS "r" /* open binary file for reading */
# define BFILE_RW_ACCESS "r+" /* open binary file for writing and reading */
# define BFILE_W_CREATE "w" /* create/open binary file for write*/
# define BFILE_A_ACCESS "a+" /* create/open binary file for append*/
# define FILE_R_ACCESS "r" /* open text file for reading */
# define FILE_RW_ACCESS "r+" /* open text file for writing and reading */
# define FILE_W_CREATE "w" /* create/open text file for write*/
# define FILE_A_ACCESS "a+" /* create/open text file for append*/
# define O_BINARY 0 /* for open(), not defined in Unix */
# define OPEN_MODE 0666 /* default file creation mode */
# define DIR_GLUE "/" /* glue string for directory/file */
# define PATH_SEPARATOR ";:" /* semicolon or colon may be used */
#else
#define FILE_R_ACCESS "rt" /* open text file for reading */
#define FILE_RW_ACCESS "r+t" /* open text file for writing and reading */
#define FILE_W_CREATE "wt" /* create/open text file for write */
#define FILE_A_ACCESS "a+t" /* create/open text file for append */
# define BFILE_R_ACCESS "rb" /* open binary file for reading */
# define BFILE_RW_ACCESS "r+b" /* open binary file for writing and reading */
# define BFILE_W_CREATE "wb" /* create/open binary file for write*/
# define BFILE_A_ACCESS "a+b" /* create/open binary file for append*/
# define PATH_SEPARATOR ";" /* semicolon as PATH separator */
# define OPEN_MODE 0666 /* default file creation mode */
# ifdef MACOS
# define FILE_R_ACCESS "r" /* open text file for reading */
# define FILE_RW_ACCESS "r+" /* open text file for writing and reading */
# define FILE_W_CREATE "w" /* create/open text file for write*/
# define FILE_A_ACCESS "a+" /* create/open text file for append*/
# define DIR_GLUE ":" /* glue string for directory/file */
# else
# define FILE_R_ACCESS "rt" /* open text file for reading */
# define FILE_RW_ACCESS "r+t" /* open text file for writing and reading */
# define FILE_W_CREATE "wt" /* create/open text file for write*/
# define FILE_A_ACCESS "a+t" /* create/open text file for append*/
/* attention, all backslashes for msdos directry names must be written as \\,
because it is the C escape character */
#define DIR_GLUE "\\" /* glue string for directory/file */
#endif
# define DIR_GLUE "\\" /* glue string for directory/file */
# endif
#endif
#include <string.h>

File diff suppressed because it is too large Load Diff

@ -1,4 +1,3 @@
/************************************************************
$Header: /home/dieter/sweph/RCS/swepcalc.h,v 1.74 2008/06/16 10:07:20 dieter Exp $
Definitions and constants for Placalc interface to SwissEph
@ -85,15 +84,15 @@
* It is very simple to adapt your code to it.
* If you want to adapt your source code, turn the next TRUE into FALSE