The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ

Update to Swiss Ephemeris 2.04

arabic-lots
Gergely Polonkai 6 years ago
parent ae1ba0a5e9
commit aed102ea11
  1. 1
      data/sweph-data/seleapsec.txt
  2. 5
      data/sweph-data/seorbel.txt
  3. BIN
      swe/doc/swephprg.pdf
  4. BIN
      swe/doc/swisseph.pdf
  5. 83
      swe/src/swecl.c
  6. 18
      swe/src/swedate.c
  7. 6
      swe/src/swedate.h
  8. 286
      swe/src/swedll.h
  9. 40
      swe/src/swehel.c
  10. 12
      swe/src/swehouse.c
  11. 36
      swe/src/swejpl.c
  12. 82
      swe/src/swemmoon.c
  13. 22
      swe/src/swemplan.c
  14. 95
      swe/src/swemptab.h
  15. 8
      swe/src/swenut2000a.h
  16. 17
      swe/src/sweodef.h
  17. 8
      swe/src/swepcalc.c
  18. 189
      swe/src/sweph.c
  19. 4
      swe/src/sweph.h
  20. 18
      swe/src/swephexp.h
  21. 111
      swe/src/swephlib.c
  22. 16
      swe/src/swephlib.h

@ -28,3 +28,4 @@
20081231
20120630
20150630
20161231

@ -25,11 +25,10 @@
# e.g. number of Kronos is ipl = 39 + 4 = 43
#
# Witte/Sieggruen planets, refined by James Neely
#2456200.5, J2000, 143.49291, 1.4579341, 0.2225740, 178.78899, 304.33810, 10.82816, Eros # 1
J1900, J1900, 163.7409, 40.99837, 0.00460, 171.4333, 129.8325, 1.0833, Cupido # 1
J1900, J1900, 27.6496, 50.66744, 0.00245, 148.1796, 161.3339, 1.0500, Hades # 2
J1900, J1900, 165.1232, 59.21436, 0.00120, 299.0440, 0.0000, 0.0000, Zeus # 3
J1900, J1900, 169.0193, 64.81960, 0.00305, 208.8801, 0.0000, 0.0000, Kronos # 4
J1900, J1900, 169.0193, 64.81690, 0.00305, 208.8801, 0.0000, 0.0000, Kronos # 4
J1900, J1900, 138.0533, 70.29949, 0.00000, 0.0000, 0.0000, 0.0000, Apollon # 5
J1900, J1900, 351.3350, 73.62765, 0.00000, 0.0000, 0.0000, 0.0000, Admetos # 6
J1900, J1900, 55.8983, 77.25568, 0.00000, 0.0000, 0.0000, 0.0000, Vulcanus # 7
@ -67,7 +66,7 @@ J1900,JDATE, 170.73, 79.225630, 0, 0, 0, 0, Proserpina #18
# Neither Swisseph nor Solar fire elements agree with Delphine Jay's ephemeris,
# which is obviously wrong.
2414290.95827875,2414290.95827875, 70.3407215 + 109023.2634989 * T, 0.0068400705250028, 0.1587, 8.14049594 + 2393.47417444 * T, 136.24878256 - 1131.71719709 * T, 2.5, Waldemath, geo # 19
##############################################
#
# The following elements are for test only
# (Selena without T)
J2000,JDATE, 242.2205555, 0.05279142865925, 0.0, 0.0, 0.0, 0.0, Selena/White Moon, geo # 17

Binary file not shown.

Binary file not shown.

@ -72,7 +72,7 @@ static int find_zero(double y00, double y11, double y2, double dx,
double *dxret, double *dxret2);
static double calc_dip(double geoalt, double atpress, double attemp, double lapse_rate);
static double calc_astronomical_refr(double geoalt,double atpress, double attemp);
static double const_lapse_rate = SE_LAPSE_RATE; /* for refraction */
static TLS double const_lapse_rate = SE_LAPSE_RATE; /* for refraction */
#if 0
#define DSUN (1391978489.9 / AUNIT) /* this value is consistent with
@ -549,7 +549,7 @@ struct saros_data saros_data_lunar[NSAROS_LUNAR] = {
* attr[7] angular distance of moon from sun in degrees
* declare as attr[20] at least !
*/
int32 FAR PASCAL_CONV swe_sol_eclipse_where(
int32 CALL_CONV swe_sol_eclipse_where(
double tjd_ut,
int32 ifl,
double *geopos,
@ -568,7 +568,7 @@ int32 FAR PASCAL_CONV swe_sol_eclipse_where(
return retflag;
}
int32 FAR PASCAL_CONV swe_lun_occult_where(
int32 CALL_CONV swe_lun_occult_where(
double tjd_ut,
int32 ipl,
char *starname,
@ -896,7 +896,7 @@ static int32 calc_planet_star(double tjd_et, int32 ipl, char *starname, int32 if
* declare as attr[20] at least !
*
*/
int32 FAR PASCAL_CONV swe_sol_eclipse_how(
int32 CALL_CONV swe_sol_eclipse_how(
double tjd_ut,
int32 ifl,
double *geopos,
@ -1148,7 +1148,7 @@ static int32 eclipse_how( double tjd_ut, int32 ipl, char *starname, int32 ifl,
* declare as tret[10] at least!
*
*/
int32 FAR PASCAL_CONV swe_sol_eclipse_when_glob(double tjd_start, int32 ifl, int32 ifltype,
int32 CALL_CONV swe_sol_eclipse_when_glob(double tjd_start, int32 ifl, int32 ifltype,
double *tret, int32 backward, char *serr)
{
int i, j, k, m, n, o, i1 = 0, i2 = 0;
@ -1535,7 +1535,7 @@ end_search_global:
* declare as tret[10] at least!
*
*/
int32 FAR PASCAL_CONV swe_lun_occult_when_glob(
int32 CALL_CONV swe_lun_occult_when_glob(
double tjd_start, int32 ipl, char *starname, int32 ifl, int32 ifltype,
double *tret, int32 backward, char *serr)
{
@ -1982,7 +1982,7 @@ end_search_global:
* attr[10] saros series member number
* declare as attr[20] at least !
*/
int32 FAR PASCAL_CONV swe_sol_eclipse_when_loc(double tjd_start, int32 ifl,
int32 CALL_CONV swe_sol_eclipse_when_loc(double tjd_start, int32 ifl,
double *geopos, double *tret, double *attr, int32 backward, char *serr)
{
int32 retflag = 0, retflag2 = 0;
@ -2034,7 +2034,7 @@ int32 FAR PASCAL_CONV swe_sol_eclipse_when_loc(double tjd_start, int32 ifl,
*
* for all other parameters, see function swe_sol_eclipse_when_loc().
*/
int32 FAR PASCAL_CONV swe_lun_occult_when_loc(double tjd_start, int32 ipl, char *starname, int32 ifl,
int32 CALL_CONV swe_lun_occult_when_loc(double tjd_start, int32 ipl, char *starname, int32 ifl,
double *geopos, double *tret, double *attr, int32 backward, char *serr)
{
int32 retflag = 0, retflag2 = 0;
@ -2748,7 +2748,7 @@ next_try:
* if a non-zero height above sea is given, atpress is estimated.
* geohgt height of observer above sea (optional)
*/
void FAR PASCAL_CONV swe_azalt(
void CALL_CONV swe_azalt(
double tjd_ut,
int32 calc_flag,
double *geopos,
@ -2799,7 +2799,7 @@ void FAR PASCAL_CONV swe_azalt(
* iflag either SE_HOR2ECL or SE_HOR2EQU
* xin[2] azimut and true altitude, in degrees
*/
void FAR PASCAL_CONV swe_azalt_rev(
void CALL_CONV swe_azalt_rev(
double tjd_ut,
int32 calc_flag,
double *geopos,
@ -2847,7 +2847,7 @@ void FAR PASCAL_CONV swe_azalt_rev(
* int32 calc_flag; * either SE_CALC_APP_TO_TRUE or
* * SE_CALC_TRUE_TO_APP
*/
double FAR PASCAL_CONV swe_refrac(double inalt, double atpress, double attemp, int32 calc_flag)
double CALL_CONV swe_refrac(double inalt, double atpress, double attemp, int32 calc_flag)
{
double a, refr;
double pt_factor = atpress / 1010.0 * 283.0 / (273.0 + attemp);
@ -2946,7 +2946,7 @@ double FAR PASCAL_CONV swe_refrac(double inalt, double atpress, double attemp, i
}
}
void FAR PASCAL_CONV swe_set_lapse_rate(double lapse_rate)
void CALL_CONV swe_set_lapse_rate(double lapse_rate)
{
const_lapse_rate = lapse_rate;
}
@ -2993,7 +2993,7 @@ void FAR PASCAL_CONV swe_set_lapse_rate(double lapse_rate)
*
* The body is above the horizon if the dret[0] != dret[1]
*/
double FAR PASCAL_CONV swe_refrac_extended(double inalt, double geoalt, double atpress, double attemp, double lapse_rate, int32 calc_flag, double *dret)
double CALL_CONV swe_refrac_extended(double inalt, double geoalt, double atpress, double attemp, double lapse_rate, int32 calc_flag, double *dret)
{
double refr;
double trualt;
@ -3143,7 +3143,7 @@ static double calc_dip(double geoalt, double atpress, double attemp, double laps
* declare as attr[20] at least !
*
*/
int32 FAR PASCAL_CONV swe_lun_eclipse_how(
int32 CALL_CONV swe_lun_eclipse_how(
double tjd_ut,
int32 ifl,
double *geopos,
@ -3330,7 +3330,7 @@ static int32 lun_eclipse_how(
* tret[6] time of penumbral phase begin
* tret[7] time of penumbral phase end
*/
int32 FAR PASCAL_CONV swe_lun_eclipse_when(double tjd_start, int32 ifl, int32 ifltype,
int32 CALL_CONV swe_lun_eclipse_when(double tjd_start, int32 ifl, int32 ifltype,
double *tret, int32 backward, char *serr)
{
int i, j, m, n, o, i1 = 0, i2 = 0;
@ -3585,7 +3585,7 @@ next_try:
* attr[10] saros series member number
* declare as attr[20] at least !
*/
int32 FAR PASCAL_CONV swe_lun_eclipse_when_loc(double tjd_start, int32 ifl,
int32 CALL_CONV swe_lun_eclipse_when_loc(double tjd_start, int32 ifl,
double *geopos, double *tret, double *attr, int32 backward, char *serr)
{
int32 retflag = 0, retflag2 = 0, retc;
@ -3701,19 +3701,23 @@ next_lun_ecl:
*/
#define EULER 2.718281828459
#define NMAG_ELEM (SE_VESTA + 1)
static double mag_elem[NMAG_ELEM][4] = {
#define MAG_IAU_1986
static const double mag_elem[NMAG_ELEM][4] = {
/* DTV-Atlas Astronomie, p. 32 */
{-26.86, 0, 0, 0},
{-12.55, 0, 0, 0},
{-26.86, 0, 0, 0}, /* Sun */
{-12.55, 0, 0, 0}, /* Moon */
#ifdef MAG_IAU_1986
/* IAU 1986 */
{-0.42, 3.80, -2.73, 2.00},
{-4.40, 0.09, 2.39, -0.65},
{-0.42, 3.80, -2.73, 2.00}, /* Mercury */
{-4.40, 0.09, 2.39, -0.65}, /* Venus */
{- 1.52, 1.60, 0, 0}, /* Mars */
{- 9.40, 0.5, 0, 0}, /* Jupiter */
{- 8.88, -2.60, 1.25, 0.044}, /* Saturn */
{- 7.19, 0.0, 0, 0}, /* Uranus */
{- 6.87, 0.0, 0, 0}, /* Neptune */
{- 1.00, 0.0, 0, 0}, /* Pluto */
#else
#endif
{99, 0, 0, 0}, /* nodes and apogees */
{99, 0, 0, 0},
{99, 0, 0, 0},
@ -3727,7 +3731,7 @@ static double mag_elem[NMAG_ELEM][4] = {
{5.33, 0.32, 0, 0}, /* Juno */
{3.20, 0.32, 0, 0}, /* Vesta */
};
int32 FAR PASCAL_CONV swe_pheno(double tjd, int32 ipl, int32 iflag, double *attr, char *serr)
int32 CALL_CONV swe_pheno(double tjd, int32 ipl, int32 iflag, double *attr, char *serr)
{
int i;
double xx[6], xx2[6], xxs[6], lbr[6], lbr2[6], dt = 0, dd;
@ -3862,11 +3866,14 @@ int32 FAR PASCAL_CONV swe_pheno(double tjd, int32 ipl, int32 iflag, double *attr
+ mag_elem[ipl][3] * du
+ mag_elem[ipl][0];
} else if (ipl < SE_CHIRON) {
#ifdef MAG_IAU_1986
attr[4] = 5 * log10(lbr2[2] * lbr[2])
+ mag_elem[ipl][1] * attr[0] /100.0
+ mag_elem[ipl][2] * attr[0] * attr[0] / 10000.0
+ mag_elem[ipl][3] * attr[0] * attr[0] * attr[0] / 1000000.0
+ mag_elem[ipl][0];
#else
#endif
} else if (ipl < NMAG_ELEM || ipl > SE_AST_OFFSET) { /* asteroids */
ph1 = pow(EULER, -3.33 * pow(tan(attr[0] * DEGTORAD / 2), 0.63));
ph2 = pow(EULER, -1.87 * pow(tan(attr[0] * DEGTORAD / 2), 1.22));
@ -3942,7 +3949,7 @@ int32 FAR PASCAL_CONV swe_pheno(double tjd, int32 ipl, int32 iflag, double *attr
return OK;
}
int32 FAR PASCAL_CONV swe_pheno_ut(double tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr)
int32 CALL_CONV swe_pheno_ut(double tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr)
{
double deltat;
int32 retflag = OK;
@ -4025,7 +4032,7 @@ double rdi_twilight(int32 rsmi)
* serr[256] error string
* function return value -2 means that the body does not rise or set */
#define SEFLG_EPHMASK (SEFLG_JPLEPH|SEFLG_SWIEPH|SEFLG_MOSEPH)
int32 FAR PASCAL_CONV swe_rise_trans(
int32 CALL_CONV swe_rise_trans(
double tjd_ut, int32 ipl, char *starname,
int32 epheflag, int32 rsmi,
double *geopos,
@ -4038,7 +4045,7 @@ int32 FAR PASCAL_CONV swe_rise_trans(
/* same as swe_rise_trans(), but allows to define the height of the horizon
* at the point of the rising or setting (horhgt) */
int32 FAR PASCAL_CONV swe_rise_trans_true_hor(
int32 CALL_CONV swe_rise_trans_true_hor(
double tjd_ut, int32 ipl, char *starname,
int32 epheflag, int32 rsmi,
double *geopos,
@ -4613,7 +4620,7 @@ barycentric position.
* be returned instead of the aphelia.
*/
/* mean elements for Mercury - Neptune from VSOP87 (mean equinox of date) */
static double el_node[8][4] =
static const double el_node[8][4] =
{{ 48.330893, 1.1861890, 0.00017587, 0.000000211,}, /* Mercury */
{ 76.679920, 0.9011190, 0.00040665, -0.000000080,}, /* Venus */
{ 0 , 0 , 0 , 0 ,}, /* Earth */
@ -4623,7 +4630,7 @@ static double el_node[8][4] =
{ 74.005947, 0.5211258, 0.00133982, 0.000018516,}, /* Uranus */
{131.784057, 1.1022057, 0.00026006, -0.000000636,}, /* Neptune */
};
static double el_peri[8][4] =
static const double el_peri[8][4] =
{{ 77.456119, 1.5564775, 0.00029589, 0.000000056,}, /* Mercury */
{131.563707, 1.4022188, -0.00107337, -0.000005315,}, /* Venus */
{102.937348, 1.7195269, 0.00045962, 0.000000499,}, /* Earth */
@ -4633,7 +4640,7 @@ static double el_peri[8][4] =
{173.005159, 1.4863784, 0.00021450, 0.000000433,}, /* Uranus */
{ 48.123691, 1.4262677, 0.00037918, -0.000000003,}, /* Neptune */
};
static double el_incl[8][4] =
static const double el_incl[8][4] =
{{ 7.004986, 0.0018215, -0.00001809, 0.000000053,}, /* Mercury */
{ 3.394662, 0.0010037, -0.00000088, -0.000000007,}, /* Venus */
{ 0, 0, 0, 0 ,}, /* Earth */
@ -4643,7 +4650,7 @@ static double el_incl[8][4] =
{ 0.773196, 0.0007744, 0.00003749, -0.000000092,}, /* Uranus */
{ 1.769952, -0.0093082, -0.00000708, 0.000000028,}, /* Neptune */
};
static double el_ecce[8][4] =
static const double el_ecce[8][4] =
{{ 0.20563175, 0.000020406, -0.0000000284, -0.00000000017,}, /* Mercury */
{ 0.00677188, -0.000047766, 0.0000000975, 0.00000000044,}, /* Venus */
{ 0.01670862, -0.000042037, -0.0000001236, 0.00000000004,}, /* Earth */
@ -4653,7 +4660,7 @@ static double el_ecce[8][4] =
{ 0.04629590, -0.000027337, 0.0000000790, 0.00000000025,}, /* Uranus */
{ 0.00898809, 0.000006408, -0.0000000008, -0.00000000005,}, /* Neptune */
};
static double el_sema[8][4] =
static const double el_sema[8][4] =
{{ 0.387098310, 0.0, 0.0, 0.0,}, /* Mercury */
{ 0.723329820, 0.0, 0.0, 0.0,}, /* Venus */
{ 1.000001018, 0.0, 0.0, 0.0,}, /* Earth */
@ -4664,7 +4671,7 @@ static double el_sema[8][4] =
{ 30.110386869, -0.0000001663, 0.00000000069, 0.0,}, /* Neptune */
};
/* Ratios of mass of Sun to masses of the planets */
static double plmass[9] = {
static const double plmass[9] = {
6023600, /* Mercury */
408523.5, /* Venus */
328900.5, /* Earth and Moon */
@ -4675,8 +4682,8 @@ static double plmass[9] = {
19314, /* Neptune */
130000000, /* Pluto */
};
static int ipl_to_elem[15] = {2, 0, 0, 1, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 2,};
int32 FAR PASCAL_CONV swe_nod_aps(double tjd_et, int32 ipl, int32 iflag,
static const int ipl_to_elem[15] = {2, 0, 0, 1, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 2,};
int32 CALL_CONV swe_nod_aps(double tjd_et, int32 ipl, int32 iflag,
int32 method,
double *xnasc, double *xndsc,
double *xperi, double *xaphe,
@ -4702,7 +4709,7 @@ int32 FAR PASCAL_CONV swe_nod_aps(double tjd_et, int32 ipl, int32 iflag,
struct plan_data pldat;
double *xsun = psbdp->x;
double *xear = pedp->x;
double *ep;
const double *ep;
double Gmsm, dzmin;
double rxy, rxyz, fac, sgn;
double sinnode, cosnode, sinincl, cosincl, sinu, cosu, sinE, cosE, cosE2;
@ -5189,11 +5196,11 @@ int32 FAR PASCAL_CONV swe_nod_aps(double tjd_et, int32 ipl, int32 iflag,
if (iflag & SEFLG_SIDEREAL) {
/* project onto ecliptic t0 */
if (swed.sidd.sid_mode & SE_SIDBIT_ECL_T0) {
if (swi_trop_ra2sid_lon(x2000, pldat.xreturn+6, pldat.xreturn+18, iflag, serr) != OK)
if (swi_trop_ra2sid_lon(x2000, pldat.xreturn+6, pldat.xreturn+18, iflag) != OK)
return ERR;
/* project onto solar system equator */
} else if (swed.sidd.sid_mode & SE_SIDBIT_SSY_PLANE) {
if (swi_trop_ra2sid_lon_sosy(x2000, pldat.xreturn+6, pldat.xreturn+18, iflag, serr) != OK)
if (swi_trop_ra2sid_lon_sosy(x2000, pldat.xreturn+6, iflag) != OK)
return ERR;
} else {
/* traditional algorithm */
@ -5255,7 +5262,7 @@ int32 FAR PASCAL_CONV swe_nod_aps(double tjd_et, int32 ipl, int32 iflag,
return OK;
}
int32 FAR PASCAL_CONV swe_nod_aps_ut(double tjd_ut, int32 ipl, int32 iflag,
int32 CALL_CONV swe_nod_aps_ut(double tjd_ut, int32 ipl, int32 iflag,
int32 method,
double *xnasc, double *xndsc,
double *xperi, double *xaphe,
@ -5285,7 +5292,7 @@ int32 FAR PASCAL_CONV swe_nod_aps_ut(double tjd_ut, int32 ipl, int32 iflag,
* dgsect is return area (pointer to a double)
* serr is pointer to error string, may be NULL
*/
int32 FAR PASCAL_CONV swe_gauquelin_sector(double t_ut, int32 ipl, char *starname, int32 iflag, int32 imeth, double *geopos, double atpress, double attemp, double *dgsect, char *serr)
int32 CALL_CONV swe_gauquelin_sector(double t_ut, int32 ipl, char *starname, int32 iflag, int32 imeth, double *geopos, double atpress, double attemp, double *dgsect, char *serr)
{
AS_BOOL rise_found = TRUE;
AS_BOOL set_found = TRUE;

@ -86,10 +86,10 @@
# include "swephexp.h"
# include "sweph.h"
static AS_BOOL init_leapseconds_done = FALSE;
static TLS AS_BOOL init_leapseconds_done = FALSE;
int FAR PASCAL_CONV swe_date_conversion(int y,
int CALL_CONV swe_date_conversion(int y,
int m,
int d, /* day, month, year */
double uttime, /* UT in hours (decimal) */
@ -161,7 +161,7 @@ int FAR PASCAL_CONV swe_date_conversion(int y,
and notifies errors like 32 January.
****************************************************************/
double FAR PASCAL_CONV swe_julday(int year, int month, int day, double hour, int gregflag)
double CALL_CONV swe_julday(int year, int month, int day, double hour, int gregflag)
{
double jd;
double u,u0,u1,u2;
@ -202,7 +202,7 @@ double FAR PASCAL_CONV swe_julday(int year, int month, int day, double hour, int
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,
void CALL_CONV swe_revjul (double jd, int gregflag,
int *jyear, int *jmon, int *jday, double *jut)
{
double u0,u1,u2,u3,u4;
@ -236,7 +236,7 @@ void FAR PASCAL_CONV swe_revjul (double jd, int gregflag,
* 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(
void CALL_CONV swe_utc_time_zone(
int32 iyear, int32 imonth, int32 iday,
int32 ihour, int32 imin, double dsec,
double d_timezone,
@ -278,7 +278,7 @@ void FAR PASCAL_CONV swe_utc_time_zone(
/* Leap seconds were inserted at the end of the following days:*/
#define NLEAP_SECONDS 26
#define NLEAP_SECONDS_SPACE 100
static int leap_seconds[NLEAP_SECONDS_SPACE] = {
static TLS int leap_seconds[NLEAP_SECONDS_SPACE] = {
19720630,
19721231,
19731231,
@ -376,7 +376,7 @@ static int 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 CALL_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;
@ -487,7 +487,7 @@ int32 FAR PASCAL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32
* 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 CALL_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;
@ -584,7 +584,7 @@ void FAR PASCAL_CONV swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 *iyear
* 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 CALL_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_ex(tjd_ut, -1, NULL);
swe_jdet_to_utc(tjd_et, gregflag, iyear, imonth, iday, ihour, imin, dsec);

@ -62,17 +62,17 @@ extern "C" {
#endif
#ifndef _SWEDLL_H
extern EXP32 int FAR PASCAL_CONV EXP16 swe_date_conversion (
extern EXP32 int 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(
extern EXP32 double *swe_julday(
int year, int month, int day, double hour,
int gregflag);
extern EXP32 void FAR PASCAL_CONV EXP16 swe_revjul (
extern EXP32 void swe_revjul (
double jd,
int gregflag,
int *jyear, int *jmon, int *jday, double *jut);

@ -81,132 +81,138 @@ extern "C" {
# endif
#endif
DllImport int32 FAR PASCAL swe_heliacal_ut(double JDNDaysUTStart, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 iflag, double *dret, char *serr);
DllImport int32 FAR PASCAL swe_heliacal_pheno_ut(double JDNDaysUT, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 helflag, double *darr, char *serr);
DllImport int32 FAR PASCAL swe_vis_limit_mag(double tjdut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 helflag, double *dret, char *serr);
#if defined (PASCAL) || defined(__stdcall)
#define CALL_CONV_IMP __stdcall
#else
#define CALL_CONV_IMP
#endif
DllImport int32 CALL_CONV_IMP swe_heliacal_ut(double JDNDaysUTStart, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 iflag, double *dret, char *serr);
DllImport int32 CALL_CONV_IMP swe_heliacal_pheno_ut(double JDNDaysUT, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 helflag, double *darr, char *serr);
DllImport int32 CALL_CONV_IMP swe_vis_limit_mag(double tjdut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 helflag, double *dret, char *serr);
/* the following are secret, for Victor Reijs' */
DllImport int32 FAR PASCAL swe_heliacal_angle(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr);
DllImport int32 FAR PASCAL swe_topo_arcus_visionis(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double alt_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr);
DllImport int32 CALL_CONV_IMP swe_heliacal_angle(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr);
DllImport int32 CALL_CONV_IMP swe_topo_arcus_visionis(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double alt_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr);
DllImport double FAR PASCAL swe_degnorm(double deg);
DllImport double CALL_CONV_IMP swe_degnorm(double deg);
DllImport char * FAR PASCAL swe_version(char *);
DllImport char * CALL_CONV_IMP swe_version(char *);
DllImport int32 FAR PASCAL swe_calc(
DllImport int32 CALL_CONV_IMP swe_calc(
double tjd, int ipl, int32 iflag,
double *xx,
char *serr);
DllImport int32 FAR PASCAL swe_calc_ut(
DllImport int32 CALL_CONV_IMP swe_calc_ut(
double tjd_ut, int32 ipl, int32 iflag,
double *xx,
char *serr);
DllImport int32 FAR PASCAL swe_fixstar(
DllImport int32 CALL_CONV_IMP swe_fixstar(
char *star, double tjd, int32 iflag,
double *xx,
char *serr);
DllImport int32 FAR PASCAL swe_fixstar_ut(
DllImport int32 CALL_CONV_IMP swe_fixstar_ut(
char *star, double tjd_ut, int32 iflag,
double *xx,
char *serr);
DllImport int32 FAR PASCAL swe_fixstar_mag(
DllImport int32 CALL_CONV_IMP swe_fixstar_mag(
char *star, double *xx, char *serr);
DllImport double FAR PASCAL swe_sidtime0(double tjd_ut, double ecl, double nut);
DllImport double FAR PASCAL swe_sidtime(double tjd_ut);
DllImport double CALL_CONV_IMP swe_sidtime0(double tjd_ut, double ecl, double nut);
DllImport double CALL_CONV_IMP swe_sidtime(double tjd_ut);
DllImport double FAR PASCAL swe_deltat_ex(double tjd, int32 iflag, char *serr);
DllImport double FAR PASCAL swe_deltat(double tjd);
DllImport double CALL_CONV_IMP swe_deltat_ex(double tjd, int32 iflag, char *serr);
DllImport double CALL_CONV_IMP swe_deltat(double tjd);
DllImport int FAR PASCAL swe_houses(
DllImport int CALL_CONV_IMP swe_houses(
double tjd_ut, double geolat, double geolon, int hsys,
double *hcusps, double *ascmc);
DllImport int FAR PASCAL swe_houses_ex(
DllImport int CALL_CONV_IMP swe_houses_ex(
double tjd_ut, int32 iflag, double geolat, double geolon, int hsys,
double *hcusps, double *ascmc);
DllImport int FAR PASCAL swe_houses_armc(
DllImport int CALL_CONV_IMP swe_houses_armc(
double armc, double geolat, double eps, int hsys,
double *hcusps, double *ascmc);
DllImport double FAR PASCAL swe_house_pos(
DllImport double CALL_CONV_IMP swe_house_pos(
double armc, double geolon, double eps, int hsys, double *xpin, char *serr);
DllImport char * FAR PASCAL swe_house_name(int hsys);
DllImport char * CALL_CONV_IMP swe_house_name(int hsys);
DllImport int32 FAR PASCAL swe_gauquelin_sector(
DllImport int32 CALL_CONV_IMP swe_gauquelin_sector(
double t_ut, int32 ipl, char *starname, int32 iflag, int32 imeth, double *geopos, double atpress, double attemp, double *dgsect, char *serr);
DllImport void FAR PASCAL swe_set_sid_mode(
DllImport void CALL_CONV_IMP swe_set_sid_mode(
int32 sid_mode, double t0, double ayan_t0);
DllImport int32 FAR PASCAL swe_get_ayanamsa_ex(double tjd_et, int32 iflag, double *daya, char *serr);
DllImport int32 FAR PASCAL swe_get_ayanamsa_ex_ut(double tjd_ut, int32 iflag, double *daya, char *serr);
DllImport int32 CALL_CONV_IMP swe_get_ayanamsa_ex(double tjd_et, int32 iflag, double *daya, char *serr);
DllImport int32 CALL_CONV_IMP swe_get_ayanamsa_ex_ut(double tjd_ut, int32 iflag, double *daya, char *serr);
DllImport double FAR PASCAL swe_get_ayanamsa(double tjd_et);
DllImport double FAR PASCAL swe_get_ayanamsa_ut(double tjd_ut);
DllImport double CALL_CONV_IMP swe_get_ayanamsa(double tjd_et);
DllImport double CALL_CONV_IMP swe_get_ayanamsa_ut(double tjd_ut);
DllImport char *FAR PASCAL swe_get_ayanamsa_name(int32 isidmode);
DllImport char * CALL_CONV_IMP swe_get_ayanamsa_name(int32 isidmode);
DllImport int FAR PASCAL swe_date_conversion(
DllImport int CALL_CONV_IMP 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 *tjd);
DllImport double FAR PASCAL swe_julday(
DllImport double CALL_CONV_IMP swe_julday(
int year, int mon, int mday,
double hour,
int gregflag);
DllImport void FAR PASCAL swe_revjul(
DllImport void CALL_CONV_IMP swe_revjul(
double jd, int gregflag,
int *year, int *mon, int *mday,
double *hour);
DllImport void FAR PASCAL swe_utc_time_zone(
DllImport void CALL_CONV_IMP 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);
DllImport int32 FAR PASCAL swe_utc_to_jd(
DllImport int32 CALL_CONV_IMP swe_utc_to_jd(
int32 iyear, int32 imonth, int32 iday,
int32 ihour, int32 imin, double dsec,
int32 gregflag, double *dret, char *serr);
DllImport void FAR PASCAL swe_jdet_to_utc(
DllImport void CALL_CONV_IMP swe_jdet_to_utc(
double tjd_et, int32 gregflag,
int32 *iyear, int32 *imonth, int32 *iday,
int32 *ihour, int32 *imin, double *dsec);
DllImport void FAR PASCAL swe_jdut1_to_utc(
DllImport void CALL_CONV_IMP swe_jdut1_to_utc(
double tjd_ut, int32 gregflag,
int32 *iyear, int32 *imonth, int32 *iday,
int32 *ihour, int32 *imin, double *dsec);
DllImport int FAR PASCAL swe_time_equ(
DllImport int CALL_CONV_IMP swe_time_equ(
double tjd, double *e, char *serr);
DllImport int FAR PASCAL swe_lmt_to_lat(double tjd_lmt, double geolon, double *tjd_lat, char *serr);
DllImport int FAR PASCAL swe_lat_to_lmt(double tjd_lat, double geolon, double *tjd_lmt, char *serr);
DllImport int CALL_CONV_IMP swe_lmt_to_lat(double tjd_lmt, double geolon, double *tjd_lat, char *serr);
DllImport int CALL_CONV_IMP swe_lat_to_lmt(double tjd_lat, double geolon, double *tjd_lmt, char *serr);
DllImport double FAR PASCAL swe_get_tid_acc(void);
DllImport void FAR PASCAL swe_set_tid_acc(double tidacc);
DllImport void FAR PASCAL swe_set_ephe_path(char *path);
DllImport void FAR PASCAL swe_set_jpl_file(char *fname);
DllImport void FAR PASCAL swe_close(void);
DllImport char *FAR PASCAL swe_get_planet_name(int ipl, char *spname);
DllImport void FAR PASCAL swe_cotrans(double *xpo, double *xpn, double eps);
DllImport void FAR PASCAL swe_cotrans_sp(double *xpo, double *xpn, double eps);
DllImport double CALL_CONV_IMP swe_get_tid_acc(void);
DllImport void CALL_CONV_IMP swe_set_tid_acc(double tidacc);
DllImport void CALL_CONV_IMP swe_set_ephe_path(char *path);
DllImport void CALL_CONV_IMP swe_set_jpl_file(char *fname);
DllImport void CALL_CONV_IMP swe_close(void);
DllImport char * CALL_CONV_IMP swe_get_planet_name(int ipl, char *spname);
DllImport void CALL_CONV_IMP swe_cotrans(double *xpo, double *xpn, double eps);
DllImport void CALL_CONV_IMP swe_cotrans_sp(double *xpo, double *xpn, double eps);
DllImport void FAR PASCAL swe_set_topo(double geolon, double geolat, double height);
DllImport void CALL_CONV_IMP swe_set_topo(double geolon, double geolat, double height);
DllImport void FAR PASCAL swe_set_astro_models(int32 *imodel);
DllImport void CALL_CONV_IMP swe_set_astro_models(int32 *imodel);
/****************************
* from swecl.c
@ -214,43 +220,43 @@ DllImport void FAR PASCAL swe_set_astro_models(int32 *imodel);
/* computes geographic location and attributes of solar
* eclipse at a given tjd */
DllImport int32 FAR PASCAL swe_sol_eclipse_where(double tjd, int32 ifl, double *geopos, double *attr, char *serr);
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_where(double tjd, int32 ifl, double *geopos, double *attr, char *serr);
DllImport int32 FAR PASCAL swe_lun_occult_where(double tjd, int32 ipl, char *starname, int32 ifl, double *geopos, double *attr, char *serr);
DllImport int32 CALL_CONV_IMP swe_lun_occult_where(double tjd, int32 ipl, char *starname, int32 ifl, double *geopos, double *attr, char *serr);
/* computes attributes of a solar eclipse for given tjd, geolon, geolat */
DllImport int32 FAR PASCAL swe_sol_eclipse_how(double tjd, int32 ifl, double *geopos, double *attr, char *serr);
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_how(double tjd, int32 ifl, double *geopos, double *attr, char *serr);
/* finds time of next local eclipse */
DllImport int32 FAR PASCAL swe_sol_eclipse_when_loc(double tjd_start, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_when_loc(double tjd_start, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
DllImport int32 FAR PASCAL swe_lun_occult_when_loc(double tjd_start, int32 ipl, char *starname, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
DllImport int32 CALL_CONV_IMP swe_lun_occult_when_loc(double tjd_start, int32 ipl, char *starname, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
/* finds time of next eclipse globally */
DllImport int32 FAR PASCAL swe_sol_eclipse_when_glob(double tjd_start, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr);
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_when_glob(double tjd_start, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr);
/* finds time of next occultation globally */
DllImport int32 FAR PASCAL swe_lun_occult_when_glob(double tjd_start, int32 ipl, char *starname, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr);
DllImport int32 CALL_CONV_IMP swe_lun_occult_when_glob(double tjd_start, int32 ipl, char *starname, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr);
/* computes attributes of a lunar eclipse for given tjd */
DllImport int32 FAR PASCAL swe_lun_eclipse_how(
DllImport int32 CALL_CONV_IMP swe_lun_eclipse_how(
double tjd_ut,
int32 ifl,
double *geopos,
double *attr,
char *serr);
DllImport int32 FAR PASCAL swe_lun_eclipse_when(double tjd_start, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr);
DllImport int32 FAR PASCAL swe_lun_eclipse_when_loc(double tjd_start, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
DllImport int32 CALL_CONV_IMP swe_lun_eclipse_when(double tjd_start, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr);
DllImport int32 CALL_CONV_IMP swe_lun_eclipse_when_loc(double tjd_start, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
/* planetary phenomena */
DllImport int32 FAR PASCAL swe_pheno(double tjd, int32 ipl, int32 iflag, double *attr, char *serr);
DllImport int32 CALL_CONV_IMP swe_pheno(double tjd, int32 ipl, int32 iflag, double *attr, char *serr);
DllImport int32 FAR PASCAL swe_pheno_ut(double tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr);
DllImport int32 CALL_CONV_IMP swe_pheno_ut(double tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr);
DllImport double FAR PASCAL swe_refrac(double inalt, double atpress, double attemp, int32 calc_flag);
DllImport double FAR PASCAL swe_refrac_extended(double inalt, double geoalt, double atpress, double attemp, double lapse_rate, int32 calc_flag, double *dret);
DllImport void FAR PASCAL swe_set_lapse_rate(double lapse_rate);
DllImport double CALL_CONV_IMP swe_refrac(double inalt, double atpress, double attemp, int32 calc_flag);
DllImport double CALL_CONV_IMP swe_refrac_extended(double inalt, double geoalt, double atpress, double attemp, double lapse_rate, int32 calc_flag, double *dret);
DllImport void CALL_CONV_IMP swe_set_lapse_rate(double lapse_rate);
DllImport void FAR PASCAL swe_azalt(
DllImport void CALL_CONV_IMP swe_azalt(
double tjd_ut,
int32 calc_flag,
double *geopos,
@ -259,14 +265,14 @@ DllImport void FAR PASCAL swe_azalt(
double *xin,
double *xaz);
DllImport void FAR PASCAL swe_azalt_rev(
DllImport void CALL_CONV_IMP swe_azalt_rev(
double tjd_ut,
int32 calc_flag,
double *geopos,
double *xin,
double *xout);
DllImport int32 FAR PASCAL swe_rise_trans(
DllImport int32 CALL_CONV_IMP swe_rise_trans(
double tjd_ut, int32 ipl, char *starname,
int32 epheflag, int32 rsmi,
double *geopos,
@ -274,7 +280,7 @@ DllImport int32 FAR PASCAL swe_rise_trans(
double *tret,
char *serr);
DllImport int32 FAR PASCAL swe_rise_trans_true_hor(
DllImport int32 CALL_CONV_IMP swe_rise_trans_true_hor(
double tjd_ut, int32 ipl, char *starname,
int32 epheflag, int32 rsmi,
double *geopos,
@ -283,22 +289,18 @@ DllImport int32 FAR PASCAL swe_rise_trans_true_hor(
double *tret,
char *serr);
DllImport int32 FAR PASCAL swe_nod_aps(double tjd_et, int32 ipl, int32 iflag,
DllImport int32 CALL_CONV_IMP swe_nod_aps(double tjd_et, int32 ipl, int32 iflag,
int32 method,
double *xnasc, double *xndsc,
double *xperi, double *xaphe,
char *serr);
DllImport int32 FAR PASCAL swe_nod_aps_ut(double tjd_ut, int32 ipl, int32 iflag,
DllImport int32 CALL_CONV_IMP swe_nod_aps_ut(double tjd_ut, int32 ipl, int32 iflag,
int32 method,
double *xnasc, double *xndsc,
double *xperi, double *xaphe,
char *serr);
/*DllImport int32 FAR PASCAL HeliacalAngle(double Magn, double Age, int SN, double AziO, double AltM, double AziM, double JDNDaysUT, double AziS, double Lat, double HeightEye, double Temperature, double Pressure, double RH, double VR, double *dangret, char *serr);
DllImport int32 FAR PASCAL HeliacalJDut(double JDNDaysUTStart, double Age, int SN, double Lat, double Longitude, double HeightEye, double Temperature, double Pressure, double RH, double VR, char *ObjectName, int TypeEvent, char *AVkind, double *dret, char *serr);*/
/*******************************************************
* other functions from swephlib.c;
* they are not needed for Swiss Ephemeris,
@ -306,39 +308,39 @@ DllImport int32 FAR PASCAL HeliacalJDut(double JDNDaysUTStart, double Age, int S
********************************************************/
/* normalize argument into interval [0..DEG360] */
DllImport centisec FAR PASCAL swe_csnorm(centisec p);
DllImport centisec CALL_CONV_IMP swe_csnorm(centisec p);
/* distance in centisecs p1 - p2 normalized to [0..360[ */
DllImport centisec FAR PASCAL swe_difcsn (centisec p1, centisec p2);
DllImport centisec CALL_CONV_IMP swe_difcsn (centisec p1, centisec p2);
DllImport double FAR PASCAL swe_difdegn (double p1, double p2);
DllImport double CALL_CONV_IMP swe_difdegn (double p1, double p2);
/* distance in centisecs p1 - p2 normalized to [-180..180[ */
DllImport centisec FAR PASCAL swe_difcs2n(centisec p1, centisec p2);
DllImport centisec CALL_CONV_IMP swe_difcs2n(centisec p1, centisec p2);
DllImport double FAR PASCAL swe_difdeg2n(double p1, double p2);
DllImport double CALL_CONV_IMP swe_difdeg2n(double p1, double p2);
DllImport double FAR PASCAL swe_difdeg2n(double p1, double p2);
DllImport double FAR PASCAL swe_difrad2n(double p1, double p2);
DllImport double FAR PASCAL swe_rad_midp(double x1, double x0);
DllImport double FAR PASCAL swe_deg_midp(double x1, double x0);
DllImport double CALL_CONV_IMP swe_difdeg2n(double p1, double p2);
DllImport double CALL_CONV_IMP swe_difrad2n(double p1, double p2);
DllImport double CALL_CONV_IMP swe_rad_midp(double x1, double x0);
DllImport double CALL_CONV_IMP swe_deg_midp(double x1, double x0);
/* round second, but at 29.5959 always down */
DllImport centisec FAR PASCAL swe_csroundsec(centisec x);
DllImport centisec CALL_CONV_IMP swe_csroundsec(centisec x);
/* double to int32 with rounding, no overflow check */
DllImport int32 FAR PASCAL swe_d2l(double x);
DllImport int32 CALL_CONV_IMP swe_d2l(double x);
DllImport void FAR PASCAL swe_split_deg(double ddeg, int32 roundflag, int32 *ideg, int32 *imin, int32 *isec, double *dsecfr, int32 *isgn);
DllImport void CALL_CONV_IMP swe_split_deg(double ddeg, int32 roundflag, int32 *ideg, int32 *imin, int32 *isec, double *dsecfr, int32 *isgn);
/* monday = 0, ... sunday = 6 */
DllImport int FAR PASCAL swe_day_of_week(double jd);
DllImport int CALL_CONV_IMP swe_day_of_week(double jd);
DllImport char *FAR PASCAL swe_cs2timestr(CSEC t, int sep, AS_BOOL suppressZero, char *a);
DllImport char * CALL_CONV_IMP swe_cs2timestr(CSEC t, int sep, AS_BOOL suppressZero, char *a);
DllImport char *FAR PASCAL swe_cs2lonlatstr(CSEC t, char pchar, char mchar, char *s);
DllImport char * CALL_CONV_IMP swe_cs2lonlatstr(CSEC t, char pchar, char mchar, char *s);
DllImport char *FAR PASCAL swe_cs2degstr(CSEC t, char *a);
DllImport char * CALL_CONV_IMP swe_cs2degstr(CSEC t, char *a);
/* additional functions for antiquated GFA basic DLL interface.
@ -347,115 +349,115 @@ DllImport char *FAR PASCAL swe_cs2degstr(CSEC t, char *a);
* void -> int
*/
DllImport int32 FAR PASCAL swe_calc_d(
DllImport int32 CALL_CONV_IMP swe_calc_d(
double *tjd, int ipl, int32 iflag,
double *x,
char *serr);
DllImport int32 FAR PASCAL swe_calc_ut_d(
DllImport int32 CALL_CONV_IMP swe_calc_ut_d(
double *tjd, int16 ipl, int32 iflag,
double *x,
char *serr);
DllImport int32 FAR PASCAL swe_fixstar_d(
DllImport int32 CALL_CONV_IMP swe_fixstar_d(
char *star, double *tjd, int32 iflag,
double *x,
char *serr);
DllImport int32 FAR PASCAL swe_fixstar_ut_d(
DllImport int32 CALL_CONV_IMP swe_fixstar_ut_d(
char *star, double *tjd, int32 iflag,
double *x,
char *serr);
DllImport int FAR PASCAL swe_close_d(int ivoid);
DllImport int CALL_CONV_IMP swe_close_d(int ivoid);
DllImport int FAR PASCAL swe_set_ephe_path_d(char *path);
DllImport int CALL_CONV_IMP swe_set_ephe_path_d(char *path);
DllImport int FAR PASCAL swe_set_jpl_file_d(char *fname);
DllImport int CALL_CONV_IMP swe_set_jpl_file_d(char *fname);
DllImport char *FAR PASCAL swe_get_planet_name_d(int ipl, char *spname);
DllImport char * CALL_CONV_IMP swe_get_planet_name_d(int ipl, char *spname);
DllImport int FAR PASCAL swe_deltat_d(double *tjd, double *deltat);
DllImport int CALL_CONV_IMP swe_deltat_d(double *tjd, double *deltat);
DllImport int FAR PASCAL swe_sidtime0_d(double *tjd_ut, double *eps,
DllImport int CALL_CONV_IMP swe_sidtime0_d(double *tjd_ut, double *eps,
double *nut, double *sidt);
DllImport int FAR PASCAL swe_sidtime_d(double *tjd_ut, double *sidt);
DllImport int CALL_CONV_IMP swe_sidtime_d(double *tjd_ut, double *sidt);
DllImport int FAR PASCAL swe_set_sid_mode_d(
DllImport int CALL_CONV_IMP swe_set_sid_mode_d(
int32 sid_mode, double *t0, double *ayan_t0);
DllImport int FAR PASCAL swe_get_ayanamsa_d(double *tjd_et, double *ayan);
DllImport int FAR PASCAL swe_get_ayanamsa_ut_d(double *tjd_et, double *ayan);
DllImport int CALL_CONV_IMP swe_get_ayanamsa_d(double *tjd_et, double *ayan);
DllImport int CALL_CONV_IMP swe_get_ayanamsa_ut_d(double *tjd_et, double *ayan);
DllImport int FAR PASCAL swe_cotrans_d(double *xpo, double *xpn, double *eps);
DllImport int FAR PASCAL swe_cotrans_sp_d(double *xpo, double *xpn, double *eps);
DllImport int CALL_CONV_IMP swe_cotrans_d(double *xpo, double *xpn, double *eps);
DllImport int CALL_CONV_IMP swe_cotrans_sp_d(double *xpo, double *xpn, double *eps);
DllImport int FAR PASCAL swe_set_topo_d(double *geolon, double *geolat, double *height);
DllImport int CALL_CONV_IMP swe_set_topo_d(double *geolon, double *geolat, double *height);
DllImport int FAR PASCAL swe_get_tid_acc_d(double *t_acc);
DllImport int FAR PASCAL swe_set_tid_acc_d(double *t_acc);
DllImport int CALL_CONV_IMP swe_get_tid_acc_d(double *t_acc);
DllImport int CALL_CONV_IMP swe_set_tid_acc_d(double *t_acc);
DllImport int FAR PASCAL swe_degnorm_d(double *x);
DllImport int CALL_CONV_IMP swe_degnorm_d(double *x);
DllImport int FAR PASCAL swe_date_conversion_d(
DllImport int CALL_CONV_IMP swe_date_conversion_d(
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 *tjd);
DllImport int FAR PASCAL swe_julday_d(
DllImport int CALL_CONV_IMP swe_julday_d(
int year, int month, int day, double *hour,
int gregflag, double *tjd);
DllImport int FAR PASCAL swe_revjul_d(
DllImport int CALL_CONV_IMP swe_revjul_d(
double *tjd,
int gregflag,
int *jyear, int *jmon, int *jday, double *jut);
DllImport int FAR PASCAL swe_houses_d(
DllImport int CALL_CONV_IMP swe_houses_d(
double *tjd, double *geolat, double *geolon, int hsys,
double *hcusps, double *ascmc);
DllImport int FAR PASCAL swe_houses_ex_d(
DllImport int CALL_CONV_IMP swe_houses_ex_d(
double *tjd_ut, int32 iflag, double *geolat, double *geolon, int hsys,
double *hcusps, double *ascmc);
DllImport int FAR PASCAL swe_houses_armc_d(
DllImport int CALL_CONV_IMP swe_houses_armc_d(
double *armc, double *geolat, double *eps, int hsys,
double *hcusps, double *ascmc);
DllImport int FAR PASCAL swe_house_pos_d(
DllImport int CALL_CONV_IMP swe_house_pos_d(
double *armc, double *geolon, double *eps, int hsys, double *xpin, double *hpos, char *serr);
/* normalize argument into interval [0..DEG360] */
DllImport centisec FAR PASCAL swe_csnorm_d(centisec p);
DllImport centisec CALL_CONV_IMP swe_csnorm_d(centisec p);
/* distance in centisecs p1 - p2 normalized to [0..360[ */
DllImport centisec FAR PASCAL swe_difcsn_d(centisec p1, centisec p2);
DllImport centisec CALL_CONV_IMP swe_difcsn_d(centisec p1, centisec p2);
DllImport int FAR PASCAL swe_difdegn_d(double *p1, double *p2, double *diff);
DllImport int CALL_CONV_IMP swe_difdegn_d(double *p1, double *p2, double *diff);
/* distance in centisecs p1 - p2 normalized to [-180..180[ */
DllImport centisec FAR PASCAL swe_difcs2n_d(centisec p1, centisec p2);
DllImport centisec CALL_CONV_IMP swe_difcs2n_d(centisec p1, centisec p2);
DllImport int FAR PASCAL swe_difdeg2n_d(double *p1, double *p2, double *diff);
DllImport int CALL_CONV_IMP swe_difdeg2n_d(double *p1, double *p2, double *diff);
/* round second, but at 29.5959 always down */
DllImport centisec FAR PASCAL swe_csroundsec_d(centisec x);
DllImport centisec CALL_CONV_IMP swe_csroundsec_d(centisec x);
/* double to int32 with rounding, no overflow check */
DllImport int32 FAR PASCAL swe_d2l_d(double *x);
DllImport int32 CALL_CONV_IMP swe_d2l_d(double *x);
DllImport int FAR PASCAL swe_split_deg_d(double *ddeg, int32 roundflag, int32 *ideg, int32 *imin, int32 *isec, double *dsecfr, int32 *isgn);
DllImport int CALL_CONV_IMP swe_split_deg_d(double *ddeg, int32 roundflag, int32 *ideg, int32 *imin, int32 *isec, double *dsecfr, int32 *isgn);
/* monday = 0, ... sunday = 6 */
DllImport int FAR PASCAL swe_day_of_week_d(double *jd);
DllImport int CALL_CONV_IMP swe_day_of_week_d(double *jd);
DllImport char *FAR PASCAL swe_cs2timestr_d(CSEC t, int sep, AS_BOOL suppressZero, char *a);
DllImport char * CALL_CONV_IMP swe_cs2timestr_d(CSEC t, int sep, AS_BOOL suppressZero, char *a);
DllImport char *FAR PASCAL swe_cs2lonlatstr_d(CSEC t, char *pchar, char *mchar, char *s);
DllImport char * CALL_CONV_IMP swe_cs2lonlatstr_d(CSEC t, char *pchar, char *mchar, char *s);
DllImport char *FAR PASCAL swe_cs2degstr_d(CSEC t, char *a);
DllImport char * CALL_CONV_IMP swe_cs2degstr_d(CSEC t, char *a);
/****************************
* from swecl.c
@ -463,35 +465,35 @@ DllImport char *FAR PASCAL swe_cs2degstr_d(CSEC t, char *a);
/* computes geographic location and attributes of solar
* eclipse at a given tjd */
DllImport int32 FAR PASCAL swe_sol_eclipse_where_d(double *tjd_ut, int32 ifl, double *geopos, double *attr, char *serr);
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_where_d(double *tjd_ut, int32 ifl, double *geopos, double *attr, char *serr);
/* computes attributes of a solar eclipse for given tjd, geolon, geolat */
DllImport int32 FAR PASCAL swe_sol_eclipse_how_d(double *tjd_ut, int32 ifl, double geolon, double geolat, double geohgt, double *attr, char *serr);
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_how_d(double *tjd_ut, int32 ifl, double geolon, double geolat, double geohgt, double *attr, char *serr);
/* finds time of next local eclipse */
DllImport int32 FAR PASCAL swe_sol_eclipse_when_loc_d(double *tjd_start, int32 ifl, double *geopos, double *tret, double *attr, AS_BOOL backward, char *serr);
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_when_loc_d(double *tjd_start, int32 ifl, double *geopos, double *tret, double *attr, AS_BOOL backward, char *serr);
/* finds time of next eclipse globally */
DllImport int32 FAR PASCAL swe_sol_eclipse_when_glob_d(double *tjd_start, int32 ifl, int32 ifltype,
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_when_glob_d(double *tjd_start, int32 ifl, int32 ifltype,
double *tret, AS_BOOL backward, char *serr);
/* computes attributes of a lunar eclipse for given tjd */
DllImport int32 FAR PASCAL swe_lun_eclipse_how_d(
DllImport int32 CALL_CONV_IMP swe_lun_eclipse_how_d(
double *tjd_ut,
int32 ifl,
double *attr,
char *serr);
DllImport int32 FAR PASCAL swe_lun_eclipse_when_d(double *tjd_start, int32 ifl, int32 ifltype,
DllImport int32 CALL_CONV_IMP swe_lun_eclipse_when_d(double *tjd_start, int32 ifl, int32 ifltype,
double *tret, AS_BOOL backward, char *serr);
DllImport int32 FAR PASCAL swe_pheno_d(double *tjd, int32 ipl, int32 iflag,
DllImport int32 CALL_CONV_IMP swe_pheno_d(double *tjd, int32 ipl, int32 iflag,
double *attr, char *serr);
DllImport int32 FAR PASCAL swe_pheno_ut_d(double *tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr);
DllImport int32 CALL_CONV_IMP swe_pheno_ut_d(double *tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr);
DllImport int FAR PASCAL swe_refrac_d(double *inalt, double *atpress, double *attemp, int32 calc_flag, double *retalt);
DllImport int CALL_CONV_IMP swe_refrac_d(double *inalt, double *atpress, double *attemp, int32 calc_flag, double *retalt);
DllImport int FAR PASCAL swe_azalt_d(
DllImport int CALL_CONV_IMP swe_azalt_d(
double *tjd_ut,
int32 calc_flag,
double *geopos,
@ -500,14 +502,14 @@ DllImport int FAR PASCAL swe_azalt_d(
double *xin,
double *xaz);
DllImport int FAR PASCAL swe_azalt_rev_d(
DllImport int CALL_CONV_IMP swe_azalt_rev_d(
double *tjd_ut,
int32 calc_flag,
double *geopos,
double *xin,
double *xout);
DllImport int32 FAR PASCAL swe_rise_trans_d(
DllImport int32 CALL_CONV_IMP swe_rise_trans_d(
double *tjd_ut, int32 ipl, char *starname,
int32 epheflag, int32 rsmi,
double *geopos,
@ -515,13 +517,13 @@ DllImport int32 FAR PASCAL swe_rise_trans_d(
double *tret,
char *serr);
DllImport int32 FAR PASCAL swe_nod_aps_d(double *tjd_et, int32 ipl, int32 iflag,
DllImport int32 CALL_CONV_IMP swe_nod_aps_d(double *tjd_et, int32 ipl, int32 iflag,
int32 method,
double *xnasc, double *xndsc,
double *xperi, double *xaphe,
char *serr);
DllImport int32 FAR PASCAL swe_nod_aps_ut_d(double *tjd_ut, int32 ipl, int32 iflag,
DllImport int32 CALL_CONV_IMP swe_nod_aps_ut_d(double *tjd_ut, int32 ipl, int32 iflag,
int32 method,
double *xnasc, double *xndsc,
double *xperi, double *xaphe,

@ -320,9 +320,9 @@ int32 call_swe_calc(double tjd, int32 ipl, int32 iflag, double *x, char *serr)
{
int32 retval = OK, ipli, i;
double dtjd;
static double tjdsv[3];
static double xsv[3][6];
static int32 iflagsv[3];
static TLS double tjdsv[3];
static TLS double xsv[3][6];
static TLS int32 iflagsv[3];
ipli = ipl;
if (ipli > SE_MOON)
ipli = 2;
@ -360,8 +360,8 @@ int32 call_swe_fixstar_mag(char *star, double *mag, char *serr)
{
int32 retval;
char star2[AS_MAXCH];
static double dmag;
static char star_save[AS_MAXCH];
static TLS double dmag;
static TLS char star_save[AS_MAXCH];
if (strcmp(star, star_save) == 0) {
*mag = dmag;
return OK;
@ -530,8 +530,8 @@ static double SunRA(double JDNDaysUT, int32 helflag, char *serr)
{
int imon, iday, iyar, calflag = SE_GREG_CAL;
double dut;
static double tjdlast;
static double ralast;
static TLS double tjdlast;
static TLS double ralast;
if (JDNDaysUT == tjdlast)
return ralast;
#ifndef SIMULATE_VICTORVB
@ -789,7 +789,7 @@ static double kW(double HeightEye, double TempS, double RH)
static double kOZ(double AltS, double sunra, double Lat)
{
double CHANGEKO, OZ, LT, kOZret;
static double koz_last, alts_last, sunra_last;
static TLS double koz_last, alts_last, sunra_last;