mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
- MFH Add PHPAPI to stuff needed by streams API for shared exts
- MFH Readonly issue fix to memory streams option handling (still not activated in 5.2.1 though)
This commit is contained in:
parent
74cafe0840
commit
0709a0490f
@ -48,10 +48,10 @@ PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STR
|
||||
PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC TSRMLS_DC);
|
||||
END_EXTERN_C()
|
||||
|
||||
extern php_stream_ops php_stream_memory_ops;
|
||||
extern php_stream_ops php_stream_temp_ops;
|
||||
extern php_stream_ops php_stream_rfc2397_ops;
|
||||
extern php_stream_wrapper php_stream_rfc2397_wrapper;
|
||||
extern PHPAPI php_stream_ops php_stream_memory_ops;
|
||||
extern PHPAPI php_stream_ops php_stream_temp_ops;
|
||||
extern PHPAPI php_stream_ops php_stream_rfc2397_ops;
|
||||
extern PHPAPI php_stream_wrapper php_stream_rfc2397_wrapper;
|
||||
|
||||
#define PHP_STREAM_IS_MEMORY &php_stream_memory_ops
|
||||
#define PHP_STREAM_IS_TEMP &php_stream_temp_ops
|
||||
|
@ -253,6 +253,9 @@ static int php_stream_memory_set_option(php_stream *stream, int option, int valu
|
||||
return PHP_STREAM_OPTION_RETURN_OK;
|
||||
|
||||
case PHP_STREAM_TRUNCATE_SET_SIZE:
|
||||
if (ms->mode & TEMP_STREAM_READONLY) {
|
||||
return PHP_STREAM_OPTION_RETURN_ERR;
|
||||
}
|
||||
newsize = *(size_t*)ptrparam;
|
||||
if (newsize <= ms->fsize) {
|
||||
if (newsize < ms->fpos) {
|
||||
@ -272,7 +275,7 @@ static int php_stream_memory_set_option(php_stream *stream, int option, int valu
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
php_stream_ops php_stream_memory_ops = {
|
||||
PHPAPI php_stream_ops php_stream_memory_ops = {
|
||||
php_stream_memory_write, php_stream_memory_read,
|
||||
php_stream_memory_close, php_stream_memory_flush,
|
||||
"MEMORY",
|
||||
@ -532,7 +535,7 @@ static int php_stream_temp_set_option(php_stream *stream, int option, int value,
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
php_stream_ops php_stream_temp_ops = {
|
||||
PHPAPI php_stream_ops php_stream_temp_ops = {
|
||||
php_stream_temp_write, php_stream_temp_read,
|
||||
php_stream_temp_close, php_stream_temp_flush,
|
||||
"TEMP",
|
||||
@ -585,7 +588,7 @@ PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
php_stream_ops php_stream_rfc2397_ops = {
|
||||
PHPAPI php_stream_ops php_stream_rfc2397_ops = {
|
||||
php_stream_temp_write, php_stream_temp_read,
|
||||
php_stream_temp_close, php_stream_temp_flush,
|
||||
"RFC2397",
|
||||
|
Loading…
Reference in New Issue
Block a user