forked from arcpointgroup/php-sweph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
php_sweph.h
184 lines (160 loc) · 5.11 KB
/
php_sweph.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
/*
+----------------------------------------------------------------------+
| PHP Version 7 Swiss Ephemeris extension |
+----------------------------------------------------------------------+
| Copyright (c) 2007-2018 |
+----------------------------------------------------------------------+
| Author: Joel Chen |
+----------------------------------------------------------------------+
*/
#ifndef PHP_SWEPH_H
#define PHP_SWEPH_H
extern zend_module_entry sweph_module_entry;
#define phpext_sweph_ptr &sweph_module_entry
#ifdef PHP_WIN32
#define PHP_SWEPH_API __declspec(dllexport)
#else
#define PHP_SWEPH_API
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
PHP_MINIT_FUNCTION(sweph);
PHP_MSHUTDOWN_FUNCTION(sweph);
PHP_RINIT_FUNCTION(sweph);
PHP_RSHUTDOWN_FUNCTION(sweph);
PHP_MINFO_FUNCTION(sweph);
/* Joel - sweph functions */
/****************************
* exports from sweph.c
****************************/
PHP_FUNCTION(swe_calc);
PHP_FUNCTION(swe_calc_ut);
PHP_FUNCTION(swe_fixstar);
PHP_FUNCTION(swe_fixstar_ut);
PHP_FUNCTION(swe_close);
PHP_FUNCTION(swe_set_ephe_path);
PHP_FUNCTION(swe_set_jpl_file);
PHP_FUNCTION(swe_get_planet_name);
PHP_FUNCTION(swe_set_topo);
PHP_FUNCTION(swe_set_sid_mode);
PHP_FUNCTION(swe_get_ayanamsa);
PHP_FUNCTION(swe_get_ayanamsa_ut);
PHP_FUNCTION(swe_get_ayanamsa_ex);
PHP_FUNCTION(swe_get_ayanamsa_ex_ut);
PHP_FUNCTION(swe_get_ayanamsa_name);
PHP_FUNCTION(swe_version);
PHP_FUNCTION(swe_get_library_path);
/****************************
* exports from swedate.c
****************************/
PHP_FUNCTION(swe_date_conversion);
PHP_FUNCTION(swe_julday);
PHP_FUNCTION(swe_revjul);
PHP_FUNCTION(swe_jdet_to_utc);
PHP_FUNCTION(swe_jdut1_to_utc);
PHP_FUNCTION(swe_utc_to_jd);
PHP_FUNCTION(swe_utc_time_zone);
/****************************
* exports from swehouse.c
****************************/
PHP_FUNCTION(swe_houses);
PHP_FUNCTION(swe_houses_ex);
PHP_FUNCTION(swe_houses_ex2);
PHP_FUNCTION(swe_houses_armc);
PHP_FUNCTION(swe_houses_armc_ex2);
PHP_FUNCTION(swe_house_pos);
PHP_FUNCTION(swe_gauquelin_sector);
PHP_FUNCTION(swe_house_name);
/****************************
* exports from swecl.c
****************************/
PHP_FUNCTION(swe_sol_eclipse_where);
PHP_FUNCTION(swe_lun_occult_where);
PHP_FUNCTION(swe_sol_eclipse_how);
PHP_FUNCTION(swe_sol_eclipse_when_loc);
PHP_FUNCTION(swe_lun_occult_when_loc);
PHP_FUNCTION(swe_sol_eclipse_when_glob);
PHP_FUNCTION(swe_lun_occult_when_glob);
PHP_FUNCTION(swe_lun_eclipse_how);
PHP_FUNCTION(swe_lun_eclipse_when);
PHP_FUNCTION(swe_lun_eclipse_when_loc);
/* planetary phenomena */
PHP_FUNCTION(swe_pheno);
PHP_FUNCTION(swe_pheno_ut);
PHP_FUNCTION(swe_refrac);
PHP_FUNCTION(swe_refrac_extended);
PHP_FUNCTION(swe_set_lapse_rate);
PHP_FUNCTION(swe_azalt);
PHP_FUNCTION(swe_azalt_rev);
PHP_FUNCTION(swe_rise_trans);
PHP_FUNCTION(swe_rise_trans_true_hor);
PHP_FUNCTION(swe_nod_aps);
PHP_FUNCTION(swe_nod_aps_ut);
/****************************
* exports from swephlib.c
****************************/
PHP_FUNCTION(swe_deltat);
PHP_FUNCTION(swe_deltat_ex);
PHP_FUNCTION(swe_time_equ);
PHP_FUNCTION(swe_lmt_to_lat);
PHP_FUNCTION(swe_lat_to_lmt);
PHP_FUNCTION(swe_sidtime0);
PHP_FUNCTION(swe_sidtime);
PHP_FUNCTION(swe_cotrans);
PHP_FUNCTION(swe_cotrans_sp);
PHP_FUNCTION(swe_get_tid_acc);
PHP_FUNCTION(swe_set_tid_acc);
PHP_FUNCTION(swe_degnorm);
PHP_FUNCTION(swe_radnorm);
PHP_FUNCTION(swe_rad_midp);
PHP_FUNCTION(swe_deg_midp);
PHP_FUNCTION(swe_split_deg);
/*******************************************************
* other functions from swephlib.c;
* they are not needed for Swiss Ephemeris,
* but may be useful to former Placalc users.
********************************************************/
PHP_FUNCTION(swe_csnorm);
PHP_FUNCTION(swe_difcsn);
PHP_FUNCTION(swe_difdegn);
PHP_FUNCTION(swe_difcs2n);
PHP_FUNCTION(swe_difdeg2n);
PHP_FUNCTION(swe_difrad2n);
PHP_FUNCTION(swe_csroundsec);
PHP_FUNCTION(swe_d2l);
PHP_FUNCTION(swe_day_of_week);
PHP_FUNCTION(swe_cs2timestr);
PHP_FUNCTION(swe_cs2lonlatstr);
PHP_FUNCTION(swe_cs2degstr);
PHP_FUNCTION(confirm_sweph_compiled); /* For testing, remove later. */
/*
Declare any global variables you may need between the BEGIN
and END macros here:
ZEND_BEGIN_MODULE_GLOBALS(sweph)
long global_value;
char *global_string;
ZEND_END_MODULE_GLOBALS(sweph)
*/
/* In every utility function you add that needs to use variables
in php_sweph_globals, call TSRMLS_FETCH(); after declaring other
variables used by that function, or better yet, pass in TSRMLS_CC
after the last function argument and declare your utility function
with TSRMLS_DC after the last declared argument. Always refer to
the globals in your function as SWEPH_G(variable). You are
encouraged to rename these macros something shorter, see
examples in any other php module directory.
*/
#ifdef ZTS
#define SWEPH_G(v) TSRMG(sweph_globals_id, zend_sweph_globals *, v)
#else
#define SWEPH_G(v) (sweph_globals.v)
#endif
#endif /* PHP_SWEPH_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
*/