mirror of
https://github.com/php-gnupg/php-gnupg.git
synced 2024-11-22 06:27:08 +00:00
Add macros for adding assoc values
This commit is contained in:
parent
8eabb499cf
commit
f1ec9d594f
1 changed files with 18 additions and 0 deletions
18
gnupg.c
18
gnupg.c
|
@ -411,6 +411,24 @@ zend_module_entry gnupg_module_entry = {
|
|||
ZEND_GET_MODULE(gnupg)
|
||||
#endif
|
||||
|
||||
#define PHP_GNUPG_ARRAY_ADD_ASSOC_BOOL_EX(_g_arr, _g_struct, _g_name, _g_key) \
|
||||
PHPC_ARRAY_ADD_ASSOC_BOOL(\
|
||||
PHPC_VAL_CAST_TO_PZVAL(_g_arr), #_g_name, _g_struct->_g_prop);
|
||||
#define PHP_GNUPG_ARRAY_ADD_ASSOC_BOOL(_g_arr, _g_struct, _g_name) \
|
||||
PHP_GNUPG_ARRAY_ADD_ASSOC_BOOL_EX(_g_arr, _g_struct, _g_name, _g_name)
|
||||
|
||||
#define PHP_GNUPG_ARRAY_ADD_ASSOC_LONG_EX(_g_arr, _g_struct, _g_name, _g_key) \
|
||||
PHPC_ARRAY_ADD_ASSOC_LONG(\
|
||||
PHPC_VAL_CAST_TO_PZVAL(_g_arr), #_g_name, _g_struct->_g_prop);
|
||||
#define PHP_GNUPG_ARRAY_ADD_ASSOC_LONG(_g_arr, _g_struct, _g_name) \
|
||||
PHP_GNUPG_ARRAY_ADD_ASSOC_LONG_EX(_g_arr, _g_struct, _g_name, _g_name)
|
||||
|
||||
#define PHP_GNUPG_ARRAY_ADD_ASSOC_CSTR_EX(_g_arr, _g_struct, _g_name, _g_key) \
|
||||
PHPC_ARRAY_ADD_ASSOC_CSTR(\
|
||||
PHPC_VAL_CAST_TO_PZVAL(_g_arr), #_g_name, _g_struct->_g_prop);
|
||||
#define PHP_GNUPG_ARRAY_ADD_ASSOC_CSTR(_g_arr, _g_struct, _g_name) \
|
||||
PHP_GNUPG_ARRAY_ADD_ASSOC_CSTR_EX(_g_arr, _g_struct, _g_name, _g_name)
|
||||
|
||||
#define PHP_GNUPG_SET_CLASS_CONST(_name, _value) \
|
||||
zend_declare_class_constant_long(gnupg_class_entry, \
|
||||
_name, sizeof(_name) - 1, _value TSRMLS_CC)
|
||||
|
|
Loading…
Reference in a new issue