- Notifications
You must be signed in to change notification settings - Fork 7.8k
/
Copy pathphp_memory_streams.h
63 lines (49 loc) · 3.23 KB
/
php_memory_streams.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
+----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| https://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Marcus Boerger <helly@php.net> |
+----------------------------------------------------------------------+
*/
#ifndefPHP_MEMORY_STREAM_H
#definePHP_MEMORY_STREAM_H
#include"php_streams.h"
#definePHP_STREAM_MAX_MEM 2 * 1024 * 1024
#defineTEMP_STREAM_DEFAULT 0x0
#defineTEMP_STREAM_READONLY 0x1
#defineTEMP_STREAM_TAKE_BUFFER 0x2
#defineTEMP_STREAM_APPEND 0x4
#definephp_stream_memory_create(mode) _php_stream_memory_create((mode) STREAMS_CC)
#definephp_stream_memory_create_rel(mode) _php_stream_memory_create((mode) STREAMS_REL_CC)
#definephp_stream_memory_open(mode, str) _php_stream_memory_open((mode), (str) STREAMS_CC)
#definephp_stream_memory_get_buffer(stream) _php_stream_memory_get_buffer((stream) STREAMS_CC)
#definephp_stream_temp_new() php_stream_temp_create(TEMP_STREAM_DEFAULT, PHP_STREAM_MAX_MEM)
#definephp_stream_temp_create(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_CC)
#definephp_stream_temp_create_ex(mode, max_memory_usage, tmpdir) _php_stream_temp_create_ex((mode), (max_memory_usage), (tmpdir) STREAMS_CC)
#definephp_stream_temp_create_rel(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_REL_CC)
#definephp_stream_temp_open(mode, max_memory_usage, buf, length) _php_stream_temp_open((mode), (max_memory_usage), (buf), (length) STREAMS_CC)
BEGIN_EXTERN_C()
PHPAPIphp_stream*_php_stream_memory_create(intmodeSTREAMS_DC);
PHPAPIphp_stream*_php_stream_memory_open(intmode, zend_string*bufSTREAMS_DC);
PHPAPIzend_string*_php_stream_memory_get_buffer(php_stream*streamSTREAMS_DC);
PHPAPIphp_stream*_php_stream_temp_create(intmode, size_tmax_memory_usageSTREAMS_DC);
PHPAPIphp_stream*_php_stream_temp_create_ex(intmode, size_tmax_memory_usage, constchar*tmpdirSTREAMS_DC);
PHPAPIphp_stream*_php_stream_temp_open(intmode, size_tmax_memory_usage, constchar*buf, size_tlengthSTREAMS_DC);
PHPAPIintphp_stream_mode_from_str(constchar*mode);
PHPAPIconstchar*_php_stream_mode_to_str(intmode);
END_EXTERN_C()
externPHPAPIconstphp_stream_opsphp_stream_memory_ops;
externPHPAPIconstphp_stream_opsphp_stream_temp_ops;
externPHPAPIconstphp_stream_opsphp_stream_rfc2397_ops;
externPHPAPIconstphp_stream_wrapperphp_stream_rfc2397_wrapper;
#definePHP_STREAM_IS_MEMORY &php_stream_memory_ops
#definePHP_STREAM_IS_TEMP &php_stream_temp_ops
#endif