2c8745eea581ce9049026814ca63e668c1ed14ce
[m6w6/ext-propro] / php_propro.h
1 /*
2 +--------------------------------------------------------------------+
3 | PECL :: propro |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2013 Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 #ifndef PHP_PROPRO_H
14 #define PHP_PROPRO_H
15
16 extern zend_module_entry propro_module_entry;
17 #define phpext_propro_ptr &propro_module_entry
18
19 #define PHP_PROPRO_VERSION "1.0.0"
20
21 #ifdef PHP_WIN32
22 # define PHP_PROPRO_API __declspec(dllexport)
23 #elif defined(__GNUC__) && __GNUC__ >= 4
24 # define PHP_PROPRO_API __attribute__ ((visibility("default")))
25 #else
26 # define PHP_PROPRO_API
27 #endif
28
29 #ifdef ZTS
30 # include <TSRM/TSRM.h>
31 #endif
32
33 typedef struct php_property_proxy {
34 zval *container;
35 char *member_str;
36 size_t member_len;
37 } php_property_proxy_t;
38
39 typedef struct php_property_proxy_object {
40 zend_object zo;
41 zend_object_value zv;
42 php_property_proxy_t *proxy;
43 struct php_property_proxy_object *parent;
44 } php_property_proxy_object_t;
45
46 PHP_PROPRO_API php_property_proxy_t *php_property_proxy_init(zval *container, const char *member_str, size_t member_len TSRMLS_DC);
47 PHP_PROPRO_API void php_property_proxy_free(php_property_proxy_t **proxy);
48
49 PHP_PROPRO_API zend_class_entry *php_property_proxy_get_class_entry(void);
50
51 PHP_PROPRO_API zend_object_value php_property_proxy_object_new(zend_class_entry *ce TSRMLS_DC);
52 PHP_PROPRO_API zend_object_value php_property_proxy_object_new_ex(zend_class_entry *ce, php_property_proxy_t *proxy, php_property_proxy_object_t **ptr TSRMLS_DC);
53
54 #endif /* PHP_PROPRO_H */
55
56
57 /*
58 * Local variables:
59 * tab-width: 4
60 * c-basic-offset: 4
61 * End:
62 * vim600: noet sw=4 ts=4 fdm=marker
63 * vim<600: noet sw=4 ts=4
64 */