Re: cvs: php4 /ext/mime_magic mime_magic.c
| From: | Wez Furlong | Date: | Wed, 04 Jun 2003 16:02:51 +0000 |
| Subject: | Re: cvs: php4 /ext/mime_magic mime_magic.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-21526@lists.php.net to get a copy of this message | ||
php_stream_from_zval will verify the resource and return from the
function if it is not a resource.
If you just want to check and not have it return, use the
php_stream_from_zval_no_verify() macro instead (same parameters).
--Wez.
On Wed, 4 Jun 2003, Hartmut Holzgraefe wrote:
> + switch (Z_TYPE_P(what)) {
> + case IS_STRING:
> + break;
> + case IS_RESOURCE:
> + {
> + php_stream *stream;
> +
> + php_stream_from_zval(stream, &what);
> + if (stream) {
> + break;
> + }
> + }
> + /* fallthru if not a stream resource */
> + default:
> + php_error_docref(NULL TSRMLS_CC, E_WARNING, "can only process string or stream
> arguments");
> + break;
> + }