-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathphp_rnp.h
50 lines (39 loc) · 1.07 KB
/
php_rnp.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
/* rnp extension for PHP */
#ifndef PHP_RNP_H
# define PHP_RNP_H
#include "php.h"
#include <rnp/rnp.h>
#include <rnp/rnp_err.h>
#ifdef PHP_WIN32
# ifdef PHP_RNP_EXPORTS
# define PHP_RNP_API __declspec(dllexport)
# else
# define PHP_RNP_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) && __GNUC__ >= 4
# define PHP_RNP_API __attribute__ ((visibility("default")))
#else
# define PHP_RNP_API
#endif
extern zend_module_entry rnp_module_entry;
# define phpext_rnp_ptr &rnp_module_entry
typedef struct php_rnp_ffi
{
rnp_ffi_t ffi;
zend_fcall_info fci;
zend_fcall_info_cache fci_cache;
bool pass_provider_is_set;
zend_object std;
} php_rnp_ffi_t;
#define Z_FFI_P(zv) \
((php_rnp_ffi_t*)((char*)(Z_OBJ_P(zv)) - XtOffsetOf(php_rnp_ffi_t, std)))
static inline php_rnp_ffi_t *rnp_ffi_t_from_obj(zend_object *obj)
{
return ((php_rnp_ffi_t*)((char*)(obj) - XtOffsetOf(php_rnp_ffi_t, std)));
}
PHP_RNP_API extern zend_class_entry *rnp_ffi_t_ce;
# define PHP_RNP_VERSION "0.2.0"
# if defined(ZTS) && defined(COMPILE_DL_RNP)
ZEND_TSRMLS_CACHE_EXTERN()
# endif
#endif /* PHP_RNP_H */