-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmoonlib.dpr
327 lines (307 loc) · 9.94 KB
/
moonlib.dpr
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
library moonlib;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
SysUtils,
Classes,
moon;
{$R *.res}
{ Calendar algorithms }
function julian_date(date:TDateTime):extended; stdcall;
begin
result:=moon.julian_date(date);
end;
function delphi_date(juldat:extended):TDateTime; stdcall;
begin
result:=moon.delphi_date(juldat);
end;
function EasterDate(year:integer):TDateTime; stdcall;
begin
result:=moon.EasterDate(year);
end;
function EasterDateJulian(year:integer):TDateTime; stdcall;
begin
result:=moon.EasterDateJulian(year);
end;
function PesachDate(year:integer):TDateTime; stdcall;
begin
result:=moon.PesachDate(year);
end;
procedure DecodeDateJewish(date: TDateTime; var year,month,day: word); stdcall;
begin
moon.DecodeDateJewish(date,year,month,day);
end;
function EncodeDateJewish(year,month,day: word):TDateTime; stdcall;
begin
result:=moon.EncodeDateJewish(year,month,day);
end;
function WeekNumber(date:TDateTime):integer; stdcall;
begin
result:=moon.WeekNumber(date);
end;
{ Convert date to julian date and back }
function Calc_Julian_date_julian(year,month,day:word):extended; stdcall;
begin
result:=moon.Calc_Julian_date_julian(year,month,day);
end;
function Calc_Julian_date_gregorian(year,month,day:word):extended; stdcall;
begin
result:=moon.Calc_Julian_date_gregorian(year,month,day);
end;
function Calc_Julian_date_switch(year,month,day:word; switch_date:extended):extended; stdcall;
begin
result:=moon.Calc_Julian_date_switch(year,month,day,switch_date);
end;
function Calc_Julian_date(year,month,day:word):extended; stdcall;
begin
result:=moon.Calc_Julian_date(year,month,day);
end;
procedure Calc_Calendar_date_julian(juldat:extended; var year,month,day:word); stdcall;
begin
moon.Calc_Calendar_date_julian(juldat,year,month,day);
end;
procedure Calc_Calendar_date_gregorian(juldat:extended; var year,month,day:word); stdcall;
begin
moon.Calc_Calendar_date_gregorian(juldat,year,month,day);
end;
procedure Calc_Calendar_date_switch(juldat:extended; var year,month,day:word; switch_date:extended); stdcall;
begin
moon.Calc_Calendar_date_switch(juldat,year,month,day,switch_date);
end;
procedure Calc_Calendar_date(juldat:extended; var year,month,day:word); stdcall;
begin
moon.Calc_Calendar_date(juldat,year,month,day);
end;
{ Sun and Moon }
function sun_distance(date:TDateTime): extended; stdcall;
begin
result:=moon.sun_distance(date);
end;
function moon_distance(date:TDateTime): extended; stdcall;
begin
result:=moon.moon_distance(date);
end;
function age_of_moon(date:TDateTime): extended; stdcall;
begin
result:=moon.age_of_moon(date);
end;
function last_phase(date:TDateTime; phase:TMoonPhase):TDateTime; stdcall;
begin
result:=moon.last_phase(date,phase);
end;
function next_phase(date:TDateTime; phase:TMoonPhase):TDateTime; stdcall;
begin
result:=moon.next_phase(date,phase);
end;
function nearest_phase(date: TDateTime):TMoonPhase; stdcall;
begin
result:=moon.nearest_phase(date);
end;
function next_blue_moon(date: TDateTime):TDateTime; stdcall;
begin
result:=moon.next_blue_moon(date);
end;
function is_blue_moon(lunation: integer):boolean; stdcall;
begin
result:=moon.is_blue_moon(lunation);
end;
function moon_phase_angle(date: TDateTime):extended; stdcall;
begin
result:=moon.moon_phase_angle(date);
end;
function current_phase(date:TDateTime):extended; stdcall;
begin
result:=moon.current_phase(date);
end;
function lunation(date:TDateTime):integer; stdcall;
begin
result:=moon.lunation(date);
end;
function sun_diameter(date:TDateTime):extended; stdcall;
begin
result:=moon.sun_diameter(date);
end;
function moon_diameter(date:TDateTime):extended; stdcall;
begin
result:=moon.moon_diameter(date);
end;
function Sun_Rise(date:TDateTime; latitude, longitude:extended):TDateTime; stdcall;
begin
result:=moon.Sun_Rise(date,latitude,longitude);
end;
function Sun_Set(date:TDateTime; latitude, longitude:extended):TDateTime; stdcall;
begin
result:=moon.Sun_Set(date,latitude,longitude);
end;
function Sun_Transit(date:TDateTime; latitude, longitude:extended):TDateTime; stdcall;
begin
result:=moon.Sun_Transit(date,latitude,longitude);
end;
function Morning_Twilight_Civil(date:TDateTime; latitude, longitude:extended):TDateTime; stdcall;
begin
result:=moon.Morning_Twilight_Civil(date,latitude,longitude);
end;
function Evening_Twilight_Civil(date:TDateTime; latitude, longitude:extended):TDateTime; stdcall;
begin
result:=moon.Evening_Twilight_Civil(date,latitude,longitude);
end;
function Morning_Twilight_Nautical(date:TDateTime; latitude, longitude:extended):TDateTime; stdcall;
begin
result:=moon.Morning_Twilight_Nautical(date,latitude,longitude);
end;
function Evening_Twilight_Nautical(date:TDateTime; latitude, longitude:extended):TDateTime; stdcall;
begin
result:=moon.Evening_Twilight_Nautical(date,latitude,longitude);
end;
function Morning_Twilight_Astronomical(date:TDateTime; latitude, longitude:extended):TDateTime; stdcall;
begin
result:=moon.Morning_Twilight_Astronomical(date,latitude,longitude);
end;
function Evening_Twilight_Astronomical(date:TDateTime; latitude, longitude:extended):TDateTime; stdcall;
begin
result:=moon.Evening_Twilight_Astronomical(date,latitude,longitude);
end;
function Moon_Rise(date:TDateTime; latitude, longitude:extended):TDateTime; stdcall;
begin
result:=moon.Moon_Rise(date,latitude,longitude);
end;
function Moon_Set(date:TDateTime; latitude, longitude:extended):TDateTime; stdcall;
begin
result:=moon.Moon_Set(date,latitude,longitude);
end;
function Moon_Transit(date:TDateTime; latitude, longitude:extended):TDateTime; stdcall;
begin
result:=moon.Moon_Transit(date,latitude,longitude);
end;
function nextperigee(date:TDateTime):TDateTime; stdcall;
begin
result:=moon.nextperigee(date);
end;
function nextapogee(date:TDateTime):TDateTime; stdcall;
begin
result:=moon.nextapogee(date);
end;
function nextperihel(date:TDateTime):TDateTime; stdcall;
begin
result:=moon.nextperihel(date);
end;
function nextaphel(date:TDateTime):TDateTime; stdcall;
begin
result:=moon.nextaphel(date);
end;
function NextEclipse(var date:TDateTime; sun:boolean):TEclipse; stdcall;
begin
result:=moon.NextEclipse(date,sun);
end;
procedure Moon_Position_Horizontal(date:TdateTime; refraction:boolean; latitude,longitude: extended; var elevation,azimuth: extended); stdcall;
begin
moon.Moon_Position_Horizontal(date,refraction,latitude,longitude,elevation,azimuth);
end;
procedure Sun_Position_Horizontal(date:TdateTime; refraction:boolean; latitude,longitude: extended; var elevation,azimuth: extended); stdcall;
begin
moon.Sun_Position_Horizontal(date,refraction,latitude,longitude,elevation,azimuth);
end;
procedure Sun_Position_Ecliptic(date:TdateTime; var rektaszension,declination:extended); stdcall;
begin
moon.Sun_Position_Ecliptic(date,rektaszension,declination);
end;
procedure Moon_Position_Ecliptic(date:TdateTime; var rektaszension,declination:extended); stdcall;
begin
moon.Moon_Position_Ecliptic(date,rektaszension,declination);
end;
function Elevation_Real_to_Apparent(elevation:extended; temperature,airpressure:extended):extended; stdcall;
begin
result:=moon.Elevation_Real_to_Apparent(elevation,temperature,airpressure);
end;
function Elevation_Apparent_to_Real(elevation:extended; temperature,airpressure:extended):extended; stdcall;
begin
result:=moon.Elevation_Apparent_to_Real(elevation,temperature,airpressure);
end;
{ Further useful functions }
function star_time(date:TDateTime):extended; stdcall;
begin
result:=moon.star_time(date);
end;
function DynamicTimeDifference(date:TdateTime):extended; stdcall;
begin
result:=moon.DynamicTimeDifference(date);
end;
function StartSeason(year: integer; season:TSeason):TDateTime; stdcall;
begin
result:=moon.StartSeason(year,season);
end;
{ Chinese calendar }
function ChineseNewYear(year: integer): TDateTime; stdcall;
begin
result:=moon.ChineseNewYear(year);
end;
exports
julian_date,
delphi_date,
EasterDate,
EasterDateJulian,
PesachDate,
DecodeDateJewish,
EncodeDateJewish,
WeekNumber,
{ Convert date to julian date and back }
Calc_Julian_date_julian,
Calc_Julian_date_gregorian,
Calc_Julian_date_switch,
Calc_Julian_date,
Calc_Calendar_date_julian,
Calc_Calendar_date_gregorian,
Calc_Calendar_date_switch,
Calc_Calendar_date,
{ Sun and Moon }
sun_distance,
moon_distance,
age_of_moon,
last_phase,
next_phase,
nearest_phase,
next_blue_moon,
is_blue_moon,
moon_phase_angle,
current_phase,
lunation,
sun_diameter,
moon_diameter,
Sun_Rise,
Sun_Set,
Sun_Transit,
Morning_Twilight_Civil,
Evening_Twilight_Civil,
Morning_Twilight_Nautical,
Evening_Twilight_Nautical,
Morning_Twilight_Astronomical,
Evening_Twilight_Astronomical,
Moon_Rise,
Moon_Set,
Moon_Transit,
nextperigee,
nextapogee,
nextperihel,
nextaphel,
NextEclipse,
Moon_Position_Horizontal,
Sun_Position_Horizontal,
Sun_Position_Ecliptic,
Moon_Position_Ecliptic,
Elevation_Real_to_Apparent,
Elevation_Apparent_to_Real,
{ Further useful functions }
star_time,
DynamicTimeDifference,
StartSeason,
{ Chinese calendar }
ChineseNewYear;
begin
end.