summaryrefslogtreecommitdiff
path: root/ext/imap/php_imap.c
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2001-08-10 20:32:33 +0000
committerfoobar <sniper@php.net>2001-08-10 20:32:33 +0000
commit5019d3d4b9fc3c425fe98dbecd5cee74c71819d7 (patch)
tree32e626ff4d576dad1e2566fe7ba36e208d20b7e5 /ext/imap/php_imap.c
parent6da0268c2ab2f0fb17e8c9b6480e6d7dfc3a6826 (diff)
downloadphp-git-5019d3d4b9fc3c425fe98dbecd5cee74c71819d7.tar.gz
Made use of the resource macros here too. And some beutifying.
Diffstat (limited to 'ext/imap/php_imap.c')
-rw-r--r--ext/imap/php_imap.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index 2d23ff90d6..3d3c30c637 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -132,7 +132,7 @@ function_entry imap_functions[] = {
#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
PHP_FE(imap_get_quota, NULL)
PHP_FE(imap_set_quota, NULL)
- PHP_FE(imap_setacl, NULL)
+ PHP_FE(imap_setacl, NULL)
#endif
#ifndef PHP_WIN32
@@ -1066,30 +1066,22 @@ PHP_FUNCTION(imap_set_quota)
PHP_FUNCTION(imap_setacl)
{
zval **streamind, **mailbox, **id, **rights;
- int ind, ind_type;
pils *imap_le_struct;
-
+
if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &streamind, &mailbox, &id, &rights) == FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
- convert_to_long_ex(streamind);
+ ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
+
convert_to_string_ex(mailbox);
- convert_to_string_ex(id);
convert_to_string_ex(rights);
- ind = Z_LVAL_PP(streamind);
- imap_le_struct = (pils *) zend_list_find(ind, &ind_type);
- if (!imap_le_struct || !IS_STREAM(ind_type)) {
- php_error(E_WARNING, "Unable to find stream pointer");
- RETURN_FALSE;
- }
-
RETURN_LONG(imap_setacl(imap_le_struct->imap_stream, Z_STRVAL_PP(mailbox), Z_STRVAL_PP(id), Z_STRVAL_PP(rights)));
}
/* }}} */
-#endif
+#endif /* HAVE_IMAP2000 || HAVE_IMAP2001 */
/* {{{ proto int imap_expunge(int stream_id)