1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #if ZEND_DEBUG
23
24 #define emalloc_rel_orig(size) \
25 ( __php_stream_call_depth == 0 \
26 ? _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_RELAY_CC) \
27 : _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC) )
28
29 #define erealloc_rel_orig(ptr, size) \
30 ( __php_stream_call_depth == 0 \
31 ? _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_RELAY_CC) \
32 : _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC) )
33
34 #define pemalloc_rel_orig(size, persistent) ((persistent) ? malloc((size)) : emalloc_rel_orig((size)))
35 #define perealloc_rel_orig(ptr, size, persistent) ((persistent) ? realloc((ptr), (size)) : erealloc_rel_orig((ptr), (size)))
36 #else
37 # define pemalloc_rel_orig(size, persistent) pemalloc((size), (persistent))
38 # define perealloc_rel_orig(ptr, size, persistent) perealloc((ptr), (size), (persistent))
39 # define emalloc_rel_orig(size) emalloc((size))
40 #endif
41
42 #define STREAM_DEBUG 0
43 #define STREAM_WRAPPER_PLAIN_FILES ((php_stream_wrapper*)-1)
44
45 #ifndef MAP_FAILED
46 #define MAP_FAILED ((void *) -1)
47 #endif
48
49 #define CHUNK_SIZE 8192
50
51 #ifdef PHP_WIN32
52 # ifdef EWOULDBLOCK
53 # undef EWOULDBLOCK
54 # endif
55 # define EWOULDBLOCK WSAEWOULDBLOCK
56 #endif
57
58
59
60
61
62
63 void php_stream_mode_sanitize_fdopen_fopencookie(php_stream *stream, char *result);
64
65 void php_stream_tidy_wrapper_error_log(php_stream_wrapper *wrapper);
66 void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *path, const char *caption);
67