mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
tidyup use of STREAMS_DC macros
This commit is contained in:
parent
1222d80860
commit
dd9a3c94a8
2 changed files with 10 additions and 8 deletions
|
@ -232,7 +232,7 @@ PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length ST
|
||||||
php_stream *stream;
|
php_stream *stream;
|
||||||
php_stream_memory_data *ms;
|
php_stream_memory_data *ms;
|
||||||
|
|
||||||
if ((stream = _php_stream_memory_create(TEMP_STREAM_DEFAULT STREAMS_REL_CC)) != NULL) {
|
if ((stream = php_stream_memory_create_rel(TEMP_STREAM_DEFAULT)) != NULL) {
|
||||||
if (length) {
|
if (length) {
|
||||||
assert(buf != NULL);
|
assert(buf != NULL);
|
||||||
php_stream_write(stream, buf, length);
|
php_stream_write(stream, buf, length);
|
||||||
|
@ -273,7 +273,7 @@ static size_t php_stream_temp_write(php_stream *stream, const char *buf, size_t
|
||||||
|
|
||||||
if (php_stream_is(ts->innerstream, PHP_STREAM_IS_MEMORY)) {
|
if (php_stream_is(ts->innerstream, PHP_STREAM_IS_MEMORY)) {
|
||||||
size_t memsize;
|
size_t memsize;
|
||||||
char *membuf = _php_stream_memory_get_buffer(ts->innerstream, &memsize STREAMS_CC);
|
char *membuf = php_stream_memory_get_buffer(ts->innerstream, &memsize);
|
||||||
|
|
||||||
if (memsize + count >= ts->smax) {
|
if (memsize + count >= ts->smax) {
|
||||||
php_stream *file = php_stream_fopen_tmpfile();
|
php_stream *file = php_stream_fopen_tmpfile();
|
||||||
|
@ -375,7 +375,7 @@ PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char
|
||||||
php_stream *stream;
|
php_stream *stream;
|
||||||
php_stream_temp_data *ms;
|
php_stream_temp_data *ms;
|
||||||
|
|
||||||
if ((stream = _php_stream_temp_create(mode & ~TEMP_STREAM_READONLY, max_memory_usage STREAMS_REL_CC)) != NULL) {
|
if ((stream = php_stream_temp_create_rel(mode & ~TEMP_STREAM_READONLY, max_memory_usage)) != NULL) {
|
||||||
if (length) {
|
if (length) {
|
||||||
assert(buf != NULL);
|
assert(buf != NULL);
|
||||||
php_stream_temp_write(stream, buf, length);
|
php_stream_temp_write(stream, buf, length);
|
||||||
|
|
|
@ -21,12 +21,14 @@
|
||||||
|
|
||||||
#include "php_streams.h"
|
#include "php_streams.h"
|
||||||
|
|
||||||
#define php_stream_memory_create(mode) _php_stream_memory_create((mode) STREAMS_REL_CC);
|
#define php_stream_memory_create(mode) _php_stream_memory_create((mode) STREAMS_CC)
|
||||||
#define php_stream_memory_open(mode, buf, length) _php_stream_memory_open((mode), (buf), (length) STREAMS_REL_CC);
|
#define php_stream_memory_create_rel(mode) _php_stream_memory_create((mode) STREAMS_REL_CC)
|
||||||
#define php_stream_memory_get_buffer(stream, length) _php_stream_memory_get_buffer((stream), (length) STREAMS_REL_CC);
|
#define php_stream_memory_open(mode, buf, length) _php_stream_memory_open((mode), (buf), (length) STREAMS_CC)
|
||||||
|
#define php_stream_memory_get_buffer(stream, length) _php_stream_memory_get_buffer((stream), (length) STREAMS_CC)
|
||||||
|
|
||||||
#define php_stream_temp_create(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_REL_CC);
|
#define php_stream_temp_create(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_CC)
|
||||||
#define php_stream_temp_open(mode, max_memory_usage, buf, length) _php_stream_temp_open((mode), (max_memory_usage), (buf), (length) STREAMS_REL_CC);
|
#define php_stream_temp_create_rel(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_REL_CC)
|
||||||
|
#define php_stream_temp_open(mode, max_memory_usage, buf, length) _php_stream_temp_open((mode), (max_memory_usage), (buf), (length) STREAMS_CC)
|
||||||
|
|
||||||
|
|
||||||
PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC);
|
PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue