47ccbbfa925ed33b2dda1af50092bf447d440f5d
[m6w6/ext-pq] / src / php_pq_object.h
1 /*
2 +--------------------------------------------------------------------+
3 | PECL :: pq |
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_PQ_OBJECT_H
14 #define PHP_PQ_OBJECT_H
15
16 typedef struct php_pq_object {
17 void *intern;
18 HashTable *prophandler;
19 zend_object zo;
20 } php_pq_object_t;
21
22 static inline void *PHP_PQ_OBJ(zval *zv, zend_object *zo) {
23 if (zv) {
24 zo = Z_OBJ_P(zv);
25 }
26 return (void *) (((char *) zo) - zo->handlers->offset);
27 }
28
29 typedef void (*php_pq_object_prophandler_func_t)(zval *object, void *o, zval *return_value);
30
31 typedef struct php_pq_object_prophandler {
32 php_pq_object_prophandler_func_t read;
33 php_pq_object_prophandler_func_t write;
34 } php_pq_object_prophandler_t;
35
36 extern void php_pq_object_to_zval(void *o, zval *zv);
37 extern void php_pq_object_to_zval_no_addref(void *o, zval *zv);
38 extern void php_pq_object_addref(void *o);
39 extern void php_pq_object_delref(void *o);
40 extern HashTable *php_pq_object_debug_info(zval *object, int *temp);
41 extern HashTable *php_pq_object_properties(zval *object);
42 extern zend_class_entry *ancestor(zend_class_entry *ce);
43 extern zval *php_pq_object_read_prop(zval *object, zval *member, int type, void **cache_slot, zval *tmp);
44 extern void php_pq_object_write_prop(zval *object, zval *member, zval *value, void **cache_slot);
45
46 #endif
47
48 /*
49 * Local variables:
50 * tab-width: 4
51 * c-basic-offset: 4
52 * End:
53 * vim600: noet sw=4 ts=4 fdm=marker
54 * vim<600: noet sw=4 ts=4
55 */