Skip to content

Commit 11b612a

Browse files
authoredDec 7, 2022
Rename PHP_STREAM_TO_ZVAL to PHP_STREAM_FROM_ZVAL (#10065)
1 parent 35a4950 commit 11b612a

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed
 

‎ext/standard/file.c

+20-20
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ php_file_globals file_globals;
114114

115115
/* }}} */
116116

117-
#define PHP_STREAM_TO_ZVAL(stream, arg) \
117+
#define PHP_STREAM_FROM_ZVAL(stream, arg) \
118118
ZEND_ASSERT(Z_TYPE_P(arg) == IS_RESOURCE); \
119119
php_stream_from_res(stream, Z_RES_P(arg));
120120

@@ -238,7 +238,7 @@ PHP_FUNCTION(flock)
238238
Z_PARAM_ZVAL(wouldblock)
239239
ZEND_PARSE_PARAMETERS_END();
240240

241-
PHP_STREAM_TO_ZVAL(stream, res);
241+
PHP_STREAM_FROM_ZVAL(stream, res);
242242

243243
php_flock_common(stream, operation, 2, wouldblock, return_value);
244244
}
@@ -775,7 +775,7 @@ PHPAPI PHP_FUNCTION(fclose)
775775
Z_PARAM_RESOURCE(res)
776776
ZEND_PARSE_PARAMETERS_END();
777777

778-
PHP_STREAM_TO_ZVAL(stream, res);
778+
PHP_STREAM_FROM_ZVAL(stream, res);
779779

780780
if ((stream->flags & PHP_STREAM_FLAG_NO_FCLOSE) != 0) {
781781
php_error_docref(NULL, E_WARNING, ZEND_LONG_FMT " is not a valid stream resource", stream->res->handle);
@@ -855,7 +855,7 @@ PHP_FUNCTION(pclose)
855855
Z_PARAM_RESOURCE(res)
856856
ZEND_PARSE_PARAMETERS_END();
857857

858-
PHP_STREAM_TO_ZVAL(stream, res);
858+
PHP_STREAM_FROM_ZVAL(stream, res);
859859

860860
FG(pclose_wait) = 1;
861861
zend_list_close(stream->res);
@@ -874,7 +874,7 @@ PHPAPI PHP_FUNCTION(feof)
874874
Z_PARAM_RESOURCE(res)
875875
ZEND_PARSE_PARAMETERS_END();
876876

877-
PHP_STREAM_TO_ZVAL(stream, res);
877+
PHP_STREAM_FROM_ZVAL(stream, res);
878878

879879
if (php_stream_eof(stream)) {
880880
RETURN_TRUE;
@@ -901,7 +901,7 @@ PHPAPI PHP_FUNCTION(fgets)
901901
Z_PARAM_LONG_OR_NULL(len, len_is_null)
902902
ZEND_PARSE_PARAMETERS_END();
903903

904-
PHP_STREAM_TO_ZVAL(stream, res);
904+
PHP_STREAM_FROM_ZVAL(stream, res);
905905

906906
if (len_is_null) {
907907
/* ask streams to give us a buffer of an appropriate size */
@@ -945,7 +945,7 @@ PHPAPI PHP_FUNCTION(fgetc)
945945
Z_PARAM_RESOURCE(res)
946946
ZEND_PARSE_PARAMETERS_END();
947947

948-
PHP_STREAM_TO_ZVAL(stream, res);
948+
PHP_STREAM_FROM_ZVAL(stream, res);
949949

950950
int result = php_stream_getc(stream);
951951

@@ -1029,7 +1029,7 @@ PHPAPI PHP_FUNCTION(fwrite)
10291029
RETURN_LONG(0);
10301030
}
10311031

1032-
PHP_STREAM_TO_ZVAL(stream, res);
1032+
PHP_STREAM_FROM_ZVAL(stream, res);
10331033

10341034
ret = php_stream_write(stream, input, num_bytes);
10351035
if (ret < 0) {
@@ -1051,7 +1051,7 @@ PHPAPI PHP_FUNCTION(fflush)
10511051
Z_PARAM_RESOURCE(res)
10521052
ZEND_PARSE_PARAMETERS_END();
10531053

1054-
PHP_STREAM_TO_ZVAL(stream, res);
1054+
PHP_STREAM_FROM_ZVAL(stream, res);
10551055

10561056
ret = php_stream_flush(stream);
10571057
if (ret) {
@@ -1071,7 +1071,7 @@ PHPAPI PHP_FUNCTION(rewind)
10711071
Z_PARAM_RESOURCE(res)
10721072
ZEND_PARSE_PARAMETERS_END();
10731073

1074-
PHP_STREAM_TO_ZVAL(stream, res);
1074+
PHP_STREAM_FROM_ZVAL(stream, res);
10751075

10761076
if (-1 == php_stream_rewind(stream)) {
10771077
RETURN_FALSE;
@@ -1091,7 +1091,7 @@ PHPAPI PHP_FUNCTION(ftell)
10911091
Z_PARAM_RESOURCE(res)
10921092
ZEND_PARSE_PARAMETERS_END();
10931093

1094-
PHP_STREAM_TO_ZVAL(stream, res);
1094+
PHP_STREAM_FROM_ZVAL(stream, res);
10951095

10961096
ret = php_stream_tell(stream);
10971097
if (ret == -1) {
@@ -1115,7 +1115,7 @@ PHPAPI PHP_FUNCTION(fseek)
11151115
Z_PARAM_LONG(whence)
11161116
ZEND_PARSE_PARAMETERS_END();
11171117

1118-
PHP_STREAM_TO_ZVAL(stream, res);
1118+
PHP_STREAM_FROM_ZVAL(stream, res);
11191119

11201120
RETURN_LONG(php_stream_seek(stream, offset, (int) whence));
11211121
}
@@ -1259,7 +1259,7 @@ PHPAPI PHP_FUNCTION(fpassthru)
12591259
Z_PARAM_RESOURCE(res)
12601260
ZEND_PARSE_PARAMETERS_END();
12611261

1262-
PHP_STREAM_TO_ZVAL(stream, res);
1262+
PHP_STREAM_FROM_ZVAL(stream, res);
12631263

12641264
size = php_stream_passthru(stream);
12651265
RETURN_LONG(size);
@@ -1346,7 +1346,7 @@ PHP_FUNCTION(fsync)
13461346
Z_PARAM_RESOURCE(res)
13471347
ZEND_PARSE_PARAMETERS_END();
13481348

1349-
PHP_STREAM_TO_ZVAL(stream, res);
1349+
PHP_STREAM_FROM_ZVAL(stream, res);
13501350

13511351
if (!php_stream_sync_supported(stream)) {
13521352
php_error_docref(NULL, E_WARNING, "Can't fsync this stream!");
@@ -1365,7 +1365,7 @@ PHP_FUNCTION(fdatasync)
13651365
Z_PARAM_RESOURCE(res)
13661366
ZEND_PARSE_PARAMETERS_END();
13671367

1368-
PHP_STREAM_TO_ZVAL(stream, res);
1368+
PHP_STREAM_FROM_ZVAL(stream, res);
13691369

13701370
if (!php_stream_sync_supported(stream)) {
13711371
php_error_docref(NULL, E_WARNING, "Can't fsync this stream!");
@@ -1392,7 +1392,7 @@ PHP_FUNCTION(ftruncate)
13921392
RETURN_THROWS();
13931393
}
13941394

1395-
PHP_STREAM_TO_ZVAL(stream, fp);
1395+
PHP_STREAM_FROM_ZVAL(stream, fp);
13961396

13971397
if (!php_stream_truncate_supported(stream)) {
13981398
php_error_docref(NULL, E_WARNING, "Can't truncate this stream!");
@@ -1484,7 +1484,7 @@ PHP_FUNCTION(fstat)
14841484
Z_PARAM_RESOURCE(fp)
14851485
ZEND_PARSE_PARAMETERS_END();
14861486

1487-
PHP_STREAM_TO_ZVAL(stream, fp);
1487+
PHP_STREAM_FROM_ZVAL(stream, fp);
14881488

14891489
php_fstat(stream, return_value);
14901490
}
@@ -1639,7 +1639,7 @@ PHPAPI PHP_FUNCTION(fread)
16391639
Z_PARAM_LONG(len)
16401640
ZEND_PARSE_PARAMETERS_END();
16411641

1642-
PHP_STREAM_TO_ZVAL(stream, res);
1642+
PHP_STREAM_FROM_ZVAL(stream, res);
16431643

16441644
if (len <= 0) {
16451645
zend_argument_value_error(2, "must be greater than 0");
@@ -1752,7 +1752,7 @@ PHP_FUNCTION(fputcsv)
17521752
}
17531753
}
17541754

1755-
PHP_STREAM_TO_ZVAL(stream, fp);
1755+
PHP_STREAM_FROM_ZVAL(stream, fp);
17561756

17571757
ret = php_fputcsv(stream, fields, delimiter, enclosure, escape_char, eol_str);
17581758
if (ret < 0) {
@@ -1899,7 +1899,7 @@ PHP_FUNCTION(fgetcsv)
18991899
RETURN_THROWS();
19001900
}
19011901

1902-
PHP_STREAM_TO_ZVAL(stream, fd);
1902+
PHP_STREAM_FROM_ZVAL(stream, fd);
19031903
}
19041904

19051905
if (len < 0) {

0 commit comments

Comments
 (0)
Please sign in to comment.