summaryrefslogtreecommitdiff
path: root/ext/recode/recode.c
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2002-09-25 15:46:47 +0000
committerWez Furlong <wez@php.net>2002-09-25 15:46:47 +0000
commit0141e970526bf07dc37d2519c444b6d83fe1863c (patch)
tree045b681cf8a1e00d122b7db8183000bf80f8c622 /ext/recode/recode.c
parent696e0a2301f2641d2ef8c4f94f0287ddbcb6ae10 (diff)
downloadphp-git-0141e970526bf07dc37d2519c444b6d83fe1863c.tar.gz
Make these all work with persistent streams too.
Diffstat (limited to 'ext/recode/recode.c')
-rw-r--r--ext/recode/recode.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/ext/recode/recode.c b/ext/recode/recode.c
index 9c1c837440..cbcc6bf985 100644
--- a/ext/recode/recode.c
+++ b/ext/recode/recode.c
@@ -184,28 +184,18 @@ PHP_FUNCTION(recode_file)
zval **input, **output;
php_stream *instream, *outstream;
FILE *in_fp, *out_fp;
- int in_type, out_type;
if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &req, &input, &output) == FAILURE) {
WRONG_PARAM_COUNT;
}
- instream = zend_fetch_resource(input TSRMLS_CC,-1, "File-Handle", &in_type, 1, php_file_le_stream());
-
- if (!instream) {
- php_error(E_WARNING,"Unable to find input file identifier");
- RETURN_FALSE;
- }
+ php_stream_from_zval(instream, input);
+ php_stream_from_zval(outstream, output);
if (FAILURE == php_stream_cast(instream, PHP_STREAM_AS_STDIO, (void**)&in_fp, REPORT_ERRORS)) {
RETURN_FALSE;
}
- outstream = zend_fetch_resource(output TSRMLS_CC,-1, "File-Handle", &out_type, 1, php_file_le_stream());
- if (!outstream) {
- php_error(E_WARNING,"Unable to find output file identifier");
- RETURN_FALSE;
- }
if (FAILURE == php_stream_cast(outstream, PHP_STREAM_AS_STDIO, (void**)&out_fp, REPORT_ERRORS)) {
RETURN_FALSE;
}