diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2015-09-20 04:27:51 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2015-09-20 04:27:51 +0200 |
commit | 509712c7d9056b4ceb50134bfeea1a1115720744 (patch) | |
tree | 4c4287c6481d01c4e1bc7ab51c9fa5d9672cac5c /ext/standard/file.c | |
parent | c9988a1e698154dbf168792635c77496a29a6cc6 (diff) | |
download | php-git-509712c7d9056b4ceb50134bfeea1a1115720744.tar.gz |
Add FAST_ZPP to various important stream funcs
Diffstat (limited to 'ext/standard/file.c')
-rw-r--r-- | ext/standard/file.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c index 3087144d44..96509040b3 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -976,9 +976,15 @@ PHPAPI PHP_FUNCTION(feof) zval *res; php_stream *stream; +#ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) { RETURN_FALSE; } +#else + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_RESOURCE(res) + ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); +#endif PHP_STREAM_TO_ZVAL(stream, res); @@ -1002,9 +1008,17 @@ PHPAPI PHP_FUNCTION(fgets) zend_string *str; php_stream *stream; +#ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &res, &len) == FAILURE) { RETURN_FALSE; } +#else + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_RESOURCE(res) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(len) + ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); +#endif PHP_STREAM_TO_ZVAL(stream, res); @@ -1166,9 +1180,18 @@ PHPAPI PHP_FUNCTION(fwrite) zend_long maxlen = 0; php_stream *stream; +#ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l", &res, &input, &inputlen, &maxlen) == FAILURE) { RETURN_FALSE; } +#else + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_RESOURCE(res) + Z_PARAM_STRING(input, inputlen) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(maxlen) + ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); +#endif if (ZEND_NUM_ARGS() == 2) { num_bytes = inputlen; @@ -1198,9 +1221,15 @@ PHPAPI PHP_FUNCTION(fflush) int ret; php_stream *stream; +#ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) { RETURN_FALSE; } +#else + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_RESOURCE(res) + ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); +#endif PHP_STREAM_TO_ZVAL(stream, res); @@ -1219,9 +1248,15 @@ PHPAPI PHP_FUNCTION(rewind) zval *res; php_stream *stream; +#ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) { RETURN_FALSE; } +#else + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_RESOURCE(res) + ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); +#endif PHP_STREAM_TO_ZVAL(stream, res); @@ -1240,9 +1275,15 @@ PHPAPI PHP_FUNCTION(ftell) zend_long ret; php_stream *stream; +#ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) { RETURN_FALSE; } +#else + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_RESOURCE(res) + ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); +#endif PHP_STREAM_TO_ZVAL(stream, res); @@ -1262,9 +1303,18 @@ PHPAPI PHP_FUNCTION(fseek) zend_long offset, whence = SEEK_SET; php_stream *stream; +#ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|l", &res, &offset, &whence) == FAILURE) { RETURN_FALSE; } +#else + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_RESOURCE(res) + Z_PARAM_LONG(offset) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(whence) + ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); +#endif PHP_STREAM_TO_ZVAL(stream, res); @@ -1743,9 +1793,16 @@ PHPAPI PHP_FUNCTION(fread) zend_long len; php_stream *stream; +#ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &res, &len) == FAILURE) { RETURN_FALSE; } +#else + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_RESOURCE(res) + Z_PARAM_LONG(len) + ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); +#endif PHP_STREAM_TO_ZVAL(stream, res); |