X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fphp_pq_callback.c;fp=src%2Fphp_pq_callback.c;h=1f02a450f2eeaf3a7277a726b0e94d0435ce97d0;hb=9f5cecf26bd70a92ed013f31afec59e272623ac1;hp=0000000000000000000000000000000000000000;hpb=c566b350f18fe5d2ac5a28e82948514a8798a2b6;p=m6w6%2Fext-pq diff --git a/src/php_pq_callback.c b/src/php_pq_callback.c new file mode 100644 index 0000000..1f02a45 --- /dev/null +++ b/src/php_pq_callback.c @@ -0,0 +1,48 @@ +/* + +--------------------------------------------------------------------+ + | PECL :: pq | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted provided that the conditions mentioned | + | in the accompanying LICENSE file are met. | + +--------------------------------------------------------------------+ + | Copyright (c) 2013, Michael Wallner | + +--------------------------------------------------------------------+ +*/ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include + +#include "php_pq_callback.h" + +void php_pq_callback_dtor(php_pq_callback_t *cb) +{ + if (cb->fci.size > 0) { + zend_fcall_info_args_clear(&cb->fci, 1); + zval_ptr_dtor(&cb->fci.function_name); + if (cb->fci.object_ptr) { + zval_ptr_dtor(&cb->fci.object_ptr); + } + } + cb->fci.size = 0; +} + +void php_pq_callback_addref(php_pq_callback_t *cb) +{ + Z_ADDREF_P(cb->fci.function_name); + if (cb->fci.object_ptr) { + Z_ADDREF_P(cb->fci.object_ptr); + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */