-
Notifications
You must be signed in to change notification settings - Fork 0
/
php_gmpi.h
70 lines (54 loc) · 1.43 KB
/
php_gmpi.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
#ifndef PHP_GMPI_H
#define PHP_GMPI_H
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "php.h"
#include <gmp.h>
extern zend_class_entry *php_gmpi_ce;
extern zend_class_entry *php_gmpint_ce;
extern zend_class_entry *php_gmpfloat_ce;
typedef struct _php_gmpint_object {
mpz_t num;
zend_object std;
} php_gmpint_object;
static inline php_gmpint_object*
php_gmpint_object_from_zend_object(zend_object *obj) {
return (php_gmpint_object*)(
((char*)obj) - XtOffsetOf(php_gmpint_object, std)
);
}
typedef struct _php_gmpfloat_object {
mpf_t num;
zend_object std;
} php_gmpfloat_object;
static inline php_gmpfloat_object*
php_gmpfloat_object_from_zend_object(zend_object *obj) {
return (php_gmpfloat_object*)(
((char*)obj) - XtOffsetOf(php_gmpfloat_object, std)
);
}
PHP_MINIT_FUNCTION(gmpi_int);
PHP_MINIT_FUNCTION(gmpi_float);
zend_string* gmpint_to_string(const mpz_t m1, int base);
int gmpfloat_do_operation(zend_uchar, zval*, zval*, zval*);
ZEND_BEGIN_MODULE_GLOBALS(gmpi)
zend_long precision;
zend_long padding;
ZEND_END_MODULE_GLOBALS(gmpi)
ZEND_EXTERN_MODULE_GLOBALS(gmpi)
#if defined(ZTS) && defined(COMPILE_DL_GMPI)
ZEND_TSRMLS_CACHE_EXTERN()
#endif
#define GMPIG(v) ZEND_MODULE_GLOBALS_ACCESSOR(gmpi, v)
#ifndef COMPILE_DL_GMPI
extern zend_module_entry gmpi_module_entry;
# define phpext_gmpi_ptr &gmpi_module_entry
#endif
#endif /* PHP_GMPI_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/