-
Notifications
You must be signed in to change notification settings - Fork 105
/
swedll.h
403 lines (312 loc) · 17.4 KB
/
swedll.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
/* SWISSEPH
*
* Windows DLL interface imports for the Astrodienst SWISSEPH package
*
**************************************************************/
/* Copyright (C) 1997 - 2021 Astrodienst AG, Switzerland. All rights reserved.
License conditions
------------------
This file is part of Swiss Ephemeris.
Swiss Ephemeris is distributed with NO WARRANTY OF ANY KIND. No author
or distributor accepts any responsibility for the consequences of using it,
or for whether it serves any particular purpose or works at all, unless he
or she says so in writing.
Swiss Ephemeris is made available by its authors under a dual licensing
system. The software developer, who uses any part of Swiss Ephemeris
in his or her software, must choose between one of the two license models,
which are
a) GNU Affero General Public License (AGPL)
b) Swiss Ephemeris Professional License
The choice must be made before the software developer distributes software
containing parts of Swiss Ephemeris to others, and before any public
service using the developed software is activated.
If the developer choses the AGPL software license, he or she must fulfill
the conditions of that license, which includes the obligation to place his
or her whole software project under the AGPL or a compatible license.
See https://www.gnu.org/licenses/agpl-3.0.html
If the developer choses the Swiss Ephemeris Professional license,
he must follow the instructions as found in http://www.astro.com/swisseph/
and purchase the Swiss Ephemeris Professional Edition from Astrodienst
and sign the corresponding license contract.
The License grants you the right to use, copy, modify and redistribute
Swiss Ephemeris, but only under certain conditions described in the License.
Among other things, the License requires that the copyright notices and
this notice be preserved on all copies.
Authors of the Swiss Ephemeris: Dieter Koch and Alois Treindl
The authors of Swiss Ephemeris have no control or influence over any of
the derived works, i.e. over software or services created by other
programmers which use Swiss Ephemeris functions.
The names of the authors or of the copyright holder (Astrodienst) must not
be used for promoting any software, product or service which uses or contains
the Swiss Ephemeris. This copyright notice is the ONLY place where the
names of the authors can legally appear, except in cases where they have
given special permission in writing.
The trademarks 'Swiss Ephemeris' and 'Swiss Ephemeris inside' may be used
for promoting such software, products or services.
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _SWEDLL_H
#define _SWEDLL_H
#ifndef _SWEPHEXP_INCLUDED
#include "swephexp.h"
#endif
# ifdef __cplusplus
#define DllImport extern "C" __declspec( dllimport )
# else
#define DllImport __declspec( dllimport )
# endif
/* DLL defines
Define UNDECO_DLL for un-decorated dll
verify compiler option __cdecl for un-decorated and __stdcall for decorated */
/*#define UNDECO_DLL */
#if defined (PASCAL) || defined(__stdcall)
#if defined UNDECO_DLL
#define CALL_CONV_IMP __cdecl
#else
#define CALL_CONV_IMP __stdcall
#endif
#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 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 CALL_CONV_IMP swe_degnorm(double deg);
DllImport char * CALL_CONV_IMP swe_version(char *);
DllImport char * CALL_CONV_IMP swe_get_library_path(char *);
DllImport int32 CALL_CONV_IMP swe_calc(
double tjd, int ipl, int32 iflag,
double *xx,
char *serr);
DllImport int32 CALL_CONV_IMP swe_calc_pctr(
double tjd, int32 ipl, int32 iplctr, int32 iflag,
double *xxret,
char *serr);
DllImport int32 CALL_CONV_IMP swe_calc_ut(
double tjd_ut, int32 ipl, int32 iflag,
double *xx,
char *serr);
DllImport double CALL_CONV_IMP swe_solcross(
double x2cross, double jd_et, int32 flag, char *serr);
DllImport double CALL_CONV_IMP swe_solcross_ut(
double x2cross, double jd_ut, int32 flag, char *serr);
DllImport double CALL_CONV_IMP swe_mooncross(
double x2cross, double jd_et, int32 flag, char *serr);
DllImport double CALL_CONV_IMP swe_mooncross_ut(
double x2cross, double jd_ut, int32 flag, char *serr);
DllImport double CALL_CONV_IMP swe_mooncross_node(
double jd_et, int32 flag, double *xlon, double *xlat, char *serr);
DllImport double CALL_CONV_IMP swe_mooncross_node_ut(
double jd_ut, int32 flag, double *xlon, double *xlat, char *serr);
DllImport int32 CALL_CONV_IMP swe_helio_cross(
int ipl, double x2cross, double jd_et, int32 iflag, int32 dir, double *jd_cross, char *serr);
DllImport int32 CALL_CONV_IMP swe_helio_cross_ut(
int ipl, double x2cross, double jd_ut, int32 iflag, int32 dir, double *jd_cross, char *serr);
DllImport int32 CALL_CONV_IMP swe_fixstar(
char *star, double tjd, int32 iflag,
double *xx,
char *serr);
DllImport int32 CALL_CONV_IMP swe_fixstar_ut(
char *star, double tjd_ut, int32 iflag,
double *xx,
char *serr);
DllImport int32 CALL_CONV_IMP swe_fixstar_mag(
char *star, double *xx, char *serr);
DllImport int32 CALL_CONV_IMP swe_fixstar2(
char *star, double tjd, int32 iflag,
double *xx,
char *serr);
DllImport int32 CALL_CONV_IMP swe_fixstar2_ut(
char *star, double tjd_ut, int32 iflag,
double *xx,
char *serr);
DllImport int32 CALL_CONV_IMP swe_fixstar2_mag(
char *star, double *xx, char *serr);
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 CALL_CONV_IMP swe_deltat_ex(double tjd, int32 iflag, char *serr);
DllImport double CALL_CONV_IMP swe_deltat(double tjd);
DllImport int CALL_CONV_IMP swe_houses(
double tjd_ut, double geolat, double geolon, int hsys,
double *hcusps, double *ascmc);
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 CALL_CONV_IMP swe_houses_ex2(
double tjd_ut, int32 iflag, double geolat, double geolon, int hsys,
double *hcusps, double *ascmc, double *cusp_speed, double *ascmc_speed, char *serr);
DllImport int CALL_CONV_IMP swe_houses_armc(
double armc, double geolat, double eps, int hsys,
double *hcusps, double *ascmc);
DllImport int CALL_CONV_IMP swe_houses_armc_ex2(
double armc, double geolat, double eps, int hsys,
double *hcusps, double *ascmc, double *cusp_speed, double *ascmc_speed, char *serr);
DllImport double CALL_CONV_IMP swe_house_pos(
double armc, double geolon, double eps, int hsys, double *xpin, char *serr);
DllImport const char * CALL_CONV_IMP swe_house_name(int hsys);
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 CALL_CONV_IMP swe_set_sid_mode(
int32 sid_mode, double t0, double ayan_t0);
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 CALL_CONV_IMP swe_get_ayanamsa(double tjd_et);
DllImport double CALL_CONV_IMP swe_get_ayanamsa_ut(double tjd_ut);
DllImport char * CALL_CONV_IMP swe_get_ayanamsa_name(int32 isidmode);
DllImport char * CALL_CONV_IMP swe_get_current_file_data(int ifno, double *tfstart, double *tfend, int *denum);
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 CALL_CONV_IMP swe_julday(
int year, int mon, int mday,
double hour,
int gregflag);
DllImport void CALL_CONV_IMP swe_revjul(
double jd, int gregflag,
int *year, int *mon, int *mday,
double *hour);
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 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 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 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 CALL_CONV_IMP swe_time_equ(
double tjd, double *e, 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 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_delta_t_userdef(double dt);
DllImport void CALL_CONV_IMP swe_set_ephe_path(const char *path);
DllImport void CALL_CONV_IMP swe_set_jpl_file(const 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 CALL_CONV_IMP swe_set_topo(double geolon, double geolat, double height);
DllImport void CALL_CONV_IMP swe_set_astro_models(char *samod, int32 iflag);
DllImport void CALL_CONV_IMP swe_get_astro_models(char *samod, char *sdet, int32 iflag);
/****************************
* from swecl.c
****************************/
/* computes geographic location and attributes of solar
* eclipse at a given tjd */
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_where(double tjd, 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 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 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 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 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 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 CALL_CONV_IMP swe_lun_eclipse_how(
double tjd_ut,
int32 ifl,
double *geopos,
double *attr,
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 CALL_CONV_IMP swe_pheno(double tjd, 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 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 CALL_CONV_IMP swe_azalt(
double tjd_ut,
int32 calc_flag,
double *geopos,
double atpress,
double attemp,
double *xin,
double *xaz);
DllImport void CALL_CONV_IMP swe_azalt_rev(
double tjd_ut,
int32 calc_flag,
double *geopos,
double *xin,
double *xout);
DllImport int32 CALL_CONV_IMP swe_rise_trans(
double tjd_ut, int32 ipl, char *starname,
int32 epheflag, int32 rsmi,
double *geopos,
double atpress, double attemp,
double *tret,
char *serr);
DllImport int32 CALL_CONV_IMP swe_rise_trans_true_hor(
double tjd_ut, int32 ipl, char *starname,
int32 epheflag, int32 rsmi,
double *geopos,
double atpress, double attemp,
double horhgt,
double *tret,
char *serr);
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 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 CALL_CONV_IMP swe_get_orbital_elements(double tjd_et, int32 ipl, int32 iflag, double *dret, char *serr);
DllImport int32 CALL_CONV_IMP swe_orbit_max_min_true_distance(double tjd_et, int32 ipl, int32 iflag, double *dmax, double *dmin, double *dtrue, char *serr);
/*******************************************************
* other functions from swephlib.c;
* they are not needed for Swiss Ephemeris,
* but may be useful to former Placalc users.
********************************************************/
/* normalize argument into interval [0..DEG360] */
DllImport centisec CALL_CONV_IMP swe_csnorm(centisec p);
/* distance in centisecs p1 - p2 normalized to [0..360[ */
DllImport centisec CALL_CONV_IMP swe_difcsn (centisec p1, centisec p2);
DllImport double CALL_CONV_IMP swe_difdegn (double p1, double p2);
/* distance in centisecs p1 - p2 normalized to [-180..180[ */
DllImport centisec CALL_CONV_IMP swe_difcs2n(centisec p1, centisec p2);
DllImport double CALL_CONV_IMP swe_difdeg2n(double p1, double p2);
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 CALL_CONV_IMP swe_csroundsec(centisec x);
/* double to int32 with rounding, no overflow check */
DllImport int32 CALL_CONV_IMP swe_d2l(double x);
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 CALL_CONV_IMP swe_day_of_week(double jd);
DllImport char * CALL_CONV_IMP swe_cs2timestr(CSEC t, int sep, AS_BOOL suppressZero, char *a);
DllImport char * CALL_CONV_IMP swe_cs2lonlatstr(CSEC t, char pchar, char mchar, char *s);
DllImport char * CALL_CONV_IMP swe_cs2degstr(CSEC t, char *a);
DllImport void CALL_CONV_IMP swe_set_interpolate_nut(AS_BOOL do_interpolate);
#endif /* !_SWEDLL_H */
#ifdef __cplusplus
} /* extern C */
#endif