1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #ifndef PHP_BCMATH_H
22 #define PHP_BCMATH_H
23
24 #include "libbcmath/src/bcmath.h"
25
26 extern zend_module_entry bcmath_module_entry;
27 #define phpext_bcmath_ptr &bcmath_module_entry
28
29 PHP_MINIT_FUNCTION(bcmath);
30 PHP_MSHUTDOWN_FUNCTION(bcmath);
31 PHP_MINFO_FUNCTION(bcmath);
32
33 PHP_FUNCTION(bcadd);
34 PHP_FUNCTION(bcsub);
35 PHP_FUNCTION(bcmul);
36 PHP_FUNCTION(bcdiv);
37 PHP_FUNCTION(bcmod);
38 PHP_FUNCTION(bcpow);
39 PHP_FUNCTION(bcsqrt);
40 PHP_FUNCTION(bccomp);
41 PHP_FUNCTION(bcscale);
42 PHP_FUNCTION(bcpowmod);
43
44 ZEND_BEGIN_MODULE_GLOBALS(bcmath)
45 bc_num _zero_;
46 bc_num _one_;
47 bc_num _two_;
48 long bc_precision;
49 ZEND_END_MODULE_GLOBALS(bcmath)
50
51 #ifdef ZTS
52 # define BCG(v) TSRMG(bcmath_globals_id, zend_bcmath_globals *, v)
53 #else
54 # define BCG(v) (bcmath_globals.v)
55 #endif
56
57 ZEND_EXTERN_MODULE_GLOBALS(bcmath)
58
59 #endif