Fix releases link
[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 #define PHP_PQ_OBJ_DECL(_intern_type) \
17 _intern_type intern; \
18 HashTable *prophandler; \
19 HashTable gc; \
20 zend_object zo;
21
22 typedef struct php_pq_object {
23 PHP_PQ_OBJ_DECL(void *)
24 } php_pq_object_t;
25
26 static inline void *PHP_PQ_OBJ(zval *zv, zend_object *zo) {
27 if (zv) {
28 zo = Z_OBJ_P(zv);
29 }
30 return (void *) (((char *) zo) - zo->handlers->offset);
31 }
32
33 typedef void (*php_pq_object_prophandler_func_t)(zval *object, void *o, zval *return_value);
34
35 typedef struct php_pq_object_prophandler {
36 php_pq_object_prophandler_func_t read;
37 php_pq_object_prophandler_func_t write;
38 php_pq_object_prophandler_func_t gc;
39 } php_pq_object_prophandler_t;
40
41 extern void *php_pq_object_create(zend_class_entry *ce, void *intern, size_t obj_size, zend_object_handlers *oh, HashTable *ph);
42 extern void php_pq_object_dtor(zend_object *obj);
43 extern void php_pq_object_to_zval(void *o, zval *zv);
44 extern void php_pq_object_to_zval_no_addref(void *o, zval *zv);
45 extern void php_pq_object_addref(void *o);
46 extern void php_pq_object_delref(void *o);
47 extern HashTable *php_pq_object_debug_info(zval *object, int *temp);
48 extern HashTable *php_pq_object_properties(zval *object);
49 HashTable *php_pq_object_get_gc(zval *object, zval **table, int *n);
50 extern zend_class_entry *ancestor(zend_class_entry *ce);
51 extern zval *php_pq_object_read_prop(zval *object, zval *member, int type, void **cache_slot, zval *tmp);
52 extern void php_pq_object_write_prop(zval *object, zval *member, zval *value, void **cache_slot);
53 extern void php_pq_object_prophandler_dtor(zval *zv);
54
55 #endif
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 */