split source
[m6w6/ext-pq] / src / php_pq_callback.c
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 #ifdef HAVE_CONFIG_H
14 # include "config.h"
15 #endif
16
17 #include <php.h>
18
19 #include "php_pq_callback.h"
20
21 void php_pq_callback_dtor(php_pq_callback_t *cb)
22 {
23 if (cb->fci.size > 0) {
24 zend_fcall_info_args_clear(&cb->fci, 1);
25 zval_ptr_dtor(&cb->fci.function_name);
26 if (cb->fci.object_ptr) {
27 zval_ptr_dtor(&cb->fci.object_ptr);
28 }
29 }
30 cb->fci.size = 0;
31 }
32
33 void php_pq_callback_addref(php_pq_callback_t *cb)
34 {
35 Z_ADDREF_P(cb->fci.function_name);
36 if (cb->fci.object_ptr) {
37 Z_ADDREF_P(cb->fci.object_ptr);
38 }
39 }
40
41 /*
42 * Local variables:
43 * tab-width: 4
44 * c-basic-offset: 4
45 * End:
46 * vim600: noet sw=4 ts=4 fdm=marker
47 * vim<600: noet sw=4 ts=4
48 */