xref: /PHP-7.4/ext/gmp/php_gmp.h (revision 92ac598a)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 7                                                        |
4    +----------------------------------------------------------------------+
5    | Copyright (c) The PHP Group                                          |
6    +----------------------------------------------------------------------+
7    | This source file is subject to version 3.01 of the PHP license,      |
8    | that is bundled with this package in the file LICENSE, and is        |
9    | available through the world-wide-web at the following url:           |
10    | http://www.php.net/license/3_01.txt                                  |
11    | If you did not receive a copy of the PHP license and are unable to   |
12    | obtain it through the world-wide-web, please send a note to          |
13    | license@php.net so we can mail you a copy immediately.               |
14    +----------------------------------------------------------------------+
15    | Author: Stanislav Malyshev <stas@php.net>                            |
16    +----------------------------------------------------------------------+
17  */
18 
19 #ifndef PHP_GMP_H
20 #define PHP_GMP_H
21 
22 #include <gmp.h>
23 
24 extern zend_module_entry gmp_module_entry;
25 #define phpext_gmp_ptr &gmp_module_entry
26 
27 #include "php_version.h"
28 #define PHP_GMP_VERSION PHP_VERSION
29 
30 ZEND_MODULE_STARTUP_D(gmp);
31 ZEND_MODULE_DEACTIVATE_D(gmp);
32 ZEND_MODULE_INFO_D(gmp);
33 
34 ZEND_FUNCTION(gmp_init);
35 ZEND_FUNCTION(gmp_import);
36 ZEND_FUNCTION(gmp_export);
37 ZEND_FUNCTION(gmp_intval);
38 ZEND_FUNCTION(gmp_strval);
39 ZEND_FUNCTION(gmp_add);
40 ZEND_FUNCTION(gmp_sub);
41 ZEND_FUNCTION(gmp_mul);
42 ZEND_FUNCTION(gmp_div_qr);
43 ZEND_FUNCTION(gmp_div_q);
44 ZEND_FUNCTION(gmp_div_r);
45 ZEND_FUNCTION(gmp_mod);
46 ZEND_FUNCTION(gmp_divexact);
47 ZEND_FUNCTION(gmp_neg);
48 ZEND_FUNCTION(gmp_abs);
49 ZEND_FUNCTION(gmp_fact);
50 ZEND_FUNCTION(gmp_sqrt);
51 ZEND_FUNCTION(gmp_sqrtrem);
52 ZEND_FUNCTION(gmp_root);
53 ZEND_FUNCTION(gmp_rootrem);
54 ZEND_FUNCTION(gmp_pow);
55 ZEND_FUNCTION(gmp_powm);
56 ZEND_FUNCTION(gmp_perfect_square);
57 ZEND_FUNCTION(gmp_perfect_power);
58 ZEND_FUNCTION(gmp_prob_prime);
59 ZEND_FUNCTION(gmp_gcd);
60 ZEND_FUNCTION(gmp_gcdext);
61 ZEND_FUNCTION(gmp_invert);
62 ZEND_FUNCTION(gmp_jacobi);
63 ZEND_FUNCTION(gmp_legendre);
64 ZEND_FUNCTION(gmp_kronecker);
65 ZEND_FUNCTION(gmp_cmp);
66 ZEND_FUNCTION(gmp_sign);
67 ZEND_FUNCTION(gmp_and);
68 ZEND_FUNCTION(gmp_or);
69 ZEND_FUNCTION(gmp_com);
70 ZEND_FUNCTION(gmp_xor);
71 ZEND_FUNCTION(gmp_random);
72 ZEND_FUNCTION(gmp_random_seed);
73 ZEND_FUNCTION(gmp_random_bits);
74 ZEND_FUNCTION(gmp_random_range);
75 ZEND_FUNCTION(gmp_setbit);
76 ZEND_FUNCTION(gmp_clrbit);
77 ZEND_FUNCTION(gmp_scan0);
78 ZEND_FUNCTION(gmp_scan1);
79 ZEND_FUNCTION(gmp_testbit);
80 ZEND_FUNCTION(gmp_popcount);
81 ZEND_FUNCTION(gmp_hamdist);
82 ZEND_FUNCTION(gmp_nextprime);
83 ZEND_FUNCTION(gmp_binomial);
84 ZEND_FUNCTION(gmp_lcm);
85 
86 ZEND_BEGIN_MODULE_GLOBALS(gmp)
87 	zend_bool rand_initialized;
88 	gmp_randstate_t rand_state;
89 ZEND_END_MODULE_GLOBALS(gmp)
90 
91 #define GMPG(v) ZEND_MODULE_GLOBALS_ACCESSOR(gmp, v)
92 
93 #if defined(ZTS) && defined(COMPILE_DL_GMP)
94 ZEND_TSRMLS_CACHE_EXTERN()
95 #endif
96 
97 #endif	/* PHP_GMP_H */
98