Back to index

php5  5.3.10
php_memory_streams.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Author: Marcus Boerger <helly@php.net>                               |
00016    +----------------------------------------------------------------------+
00017  */
00018 
00019 /* $Id: php_memory_streams.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #ifndef PHP_MEMORY_STREAM_H
00022 #define PHP_MEMORY_STREAM_H
00023 
00024 #include "php_streams.h"
00025 
00026 #define PHP_STREAM_MAX_MEM  2 * 1024 * 1024
00027 
00028 #define TEMP_STREAM_DEFAULT  0
00029 #define TEMP_STREAM_READONLY 1
00030 #define TEMP_STREAM_TAKE_BUFFER 2
00031 
00032 #define php_stream_memory_create(mode) _php_stream_memory_create((mode) STREAMS_CC TSRMLS_CC)
00033 #define php_stream_memory_create_rel(mode) _php_stream_memory_create((mode) STREAMS_REL_CC TSRMLS_CC)
00034 #define php_stream_memory_open(mode, buf, length) _php_stream_memory_open((mode), (buf), (length) STREAMS_CC TSRMLS_CC)
00035 #define php_stream_memory_get_buffer(stream, length) _php_stream_memory_get_buffer((stream), (length) STREAMS_CC TSRMLS_CC)
00036 
00037 #define php_stream_temp_new() php_stream_temp_create(TEMP_STREAM_DEFAULT, PHP_STREAM_MAX_MEM)
00038 #define php_stream_temp_create(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_CC TSRMLS_CC)
00039 #define php_stream_temp_create_rel(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_REL_CC TSRMLS_CC)
00040 #define php_stream_temp_open(mode, max_memory_usage, buf, length) _php_stream_temp_open((mode), (max_memory_usage), (buf), (length) STREAMS_CC TSRMLS_CC)
00041 
00042 BEGIN_EXTERN_C()
00043 PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC TSRMLS_DC);
00044 PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length STREAMS_DC TSRMLS_DC);
00045 PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length STREAMS_DC TSRMLS_DC);
00046 
00047 PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC TSRMLS_DC);
00048 PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC TSRMLS_DC);
00049 END_EXTERN_C()
00050 
00051 extern PHPAPI php_stream_ops php_stream_memory_ops;
00052 extern PHPAPI php_stream_ops php_stream_temp_ops;
00053 extern PHPAPI php_stream_ops php_stream_rfc2397_ops;
00054 extern PHPAPI php_stream_wrapper php_stream_rfc2397_wrapper;
00055 
00056 #define PHP_STREAM_IS_MEMORY &php_stream_memory_ops
00057 #define PHP_STREAM_IS_TEMP   &php_stream_temp_ops
00058 
00059 #endif
00060 
00061 /*
00062  * Local variables:
00063  * tab-width: 4
00064  * c-basic-offset: 4
00065  * End:
00066  * vim600: sw=4 ts=4 fdm=marker
00067  * vim<600: sw=4 ts=4
00068  */