mirror of
https://github.com/php-gnupg/php-gnupg.git
synced 2024-11-22 14:27:09 +00:00
Fix CS in gnupg_gettrustlist
This commit is contained in:
parent
84a3bf6b39
commit
1a94356ce1
1 changed files with 13 additions and 11 deletions
24
gnupg.c
24
gnupg.c
|
@ -1687,31 +1687,33 @@ PHP_FUNCTION(gnupg_gettrustlist)
|
||||||
GNUPG_GETOBJ();
|
GNUPG_GETOBJ();
|
||||||
|
|
||||||
if (this) {
|
if (this) {
|
||||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &pattern, &pattern_len) == FAILURE) {
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
|
||||||
|
&pattern, &pattern_len) == FAILURE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &res, &pattern, &pattern_len) == FAILURE) {
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs",
|
||||||
|
&res, &pattern, &pattern_len) == FAILURE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GNUPG_RES_FETCH();
|
GNUPG_RES_FETCH();
|
||||||
}
|
}
|
||||||
if ((PHPC_THIS->err = gpgme_op_trustlist_start (PHPC_THIS->ctx, pattern, 0)) != GPG_ERR_NO_ERROR) {
|
if (!PHP_GNUPG_DO(gpgme_op_trustlist_start(PHPC_THIS->ctx, pattern, 0))) {
|
||||||
GNUPG_ERR("could not start trustlist");
|
GNUPG_ERR("could not start trustlist");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PHPC_ARRAY_INIT(return_value);
|
PHPC_ARRAY_INIT(return_value);
|
||||||
while (!(PHPC_THIS->err = gpgme_op_trustlist_next (PHPC_THIS->ctx, &item))) {
|
while (PHP_GNUPG_DO(gpgme_op_trustlist_next(PHPC_THIS->ctx, &item))) {
|
||||||
PHPC_VAL_MAKE(sub_arr);
|
PHPC_VAL_MAKE(sub_arr);
|
||||||
PHPC_ARRAY_INIT(PHPC_VAL_CAST_TO_PZVAL(sub_arr));
|
PHPC_ARRAY_INIT(PHPC_VAL_CAST_TO_PZVAL(sub_arr));
|
||||||
|
|
||||||
PHPC_ARRAY_ADD_ASSOC_LONG(PHPC_VAL_CAST_TO_PZVAL(sub_arr), "level", item->level);
|
PHP_GNUPG_ARRAY_ADD_ASSOC_LONG(sub_arr, level, item);
|
||||||
PHPC_ARRAY_ADD_ASSOC_LONG(PHPC_VAL_CAST_TO_PZVAL(sub_arr), "type", item->type);
|
PHP_GNUPG_ARRAY_ADD_ASSOC_LONG(sub_arr, type, item);
|
||||||
PHPC_ARRAY_ADD_ASSOC_CSTR(PHPC_VAL_CAST_TO_PZVAL(sub_arr), "keyid", item->keyid);
|
PHP_GNUPG_ARRAY_ADD_ASSOC_CSTR(sub_arr, keyid, item);
|
||||||
PHPC_ARRAY_ADD_ASSOC_CSTR(PHPC_VAL_CAST_TO_PZVAL(sub_arr), "ownertrust", item->owner_trust);
|
PHP_GNUPG_ARRAY_ADD_ASSOC_CSTR_EX(sub_arr, ownertrust, item, owner_trust);
|
||||||
PHPC_ARRAY_ADD_ASSOC_CSTR(PHPC_VAL_CAST_TO_PZVAL(sub_arr), "validity", item->validity);
|
PHP_GNUPG_ARRAY_ADD_ASSOC_CSTR(sub_arr, validity, item);
|
||||||
PHPC_ARRAY_ADD_ASSOC_CSTR(PHPC_VAL_CAST_TO_PZVAL(sub_arr), "name", item->name);
|
PHP_GNUPG_ARRAY_ADD_ASSOC_CSTR(sub_arr, name, item);
|
||||||
gpgme_trust_item_unref (item);
|
gpgme_trust_item_unref(item);
|
||||||
PHPC_ARRAY_ADD_NEXT_INDEX_ZVAL(return_value, PHPC_VAL_CAST_TO_PZVAL(sub_arr));
|
PHPC_ARRAY_ADD_NEXT_INDEX_ZVAL(return_value, PHPC_VAL_CAST_TO_PZVAL(sub_arr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue