summaryrefslogtreecommitdiff
path: root/main/php_streams.h
diff options
context:
space:
mode:
authorSara Golemon <pollita@php.net>2006-03-31 22:51:37 +0000
committerSara Golemon <pollita@php.net>2006-03-31 22:51:37 +0000
commitfd606a8d7817310a72d56589d64c611a09323c83 (patch)
treef8ef76babae0b5e16ad0e8a617ad20d192692125 /main/php_streams.h
parente08784867ce578c377b281ab04a425406970bab9 (diff)
downloadphp-git-fd606a8d7817310a72d56589d64c611a09323c83.tar.gz
Add API hooks and unicode.filesystem_encoding for handling unicode
conversions of filename entries. Normal path conversions will simply use this converter, Certain other protocols (such as http) which specify a required character set (utf8), may override the conversion by defining a path_encode() and/or path_decode() wrapper ops method.
Diffstat (limited to 'main/php_streams.h')
-rwxr-xr-xmain/php_streams.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/main/php_streams.h b/main/php_streams.h
index 47fafc8bbd..7a80ee529e 100755
--- a/main/php_streams.h
+++ b/main/php_streams.h
@@ -154,6 +154,12 @@ typedef struct _php_stream_wrapper_ops {
/* Create/Remove directory */
int (*stream_mkdir)(php_stream_wrapper *wrapper, char *url, int mode, int options, php_stream_context *context TSRMLS_DC);
int (*stream_rmdir)(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC);
+
+ /* Unicode path manipulation -- Leave NULL to use UG(filesystem_encoding_conv) for conversion */
+ int (*path_encode)(php_stream_wrapper *wrapper, char **encpath, int *encpath_len, UChar *path, int path_len,
+ int options, php_stream_context *context TSRMLS_DC);
+ int (*path_decode)(php_stream_wrapper *wrapper, UChar **decpath, int *decpath_len, char *path, int path_len,
+ int options, php_stream_context *context TSRMLS_DC);
} php_stream_wrapper_ops;
struct _php_stream_wrapper {
@@ -367,6 +373,18 @@ PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, voi
#define php_stream_set_chunk_size(stream, size) _php_stream_set_option((stream), PHP_STREAM_OPTION_SET_CHUNK_SIZE, (size), NULL TSRMLS_CC)
+PHPAPI int _php_stream_path_encode(php_stream_wrapper *wrapper,
+ char **pathenc, int *pathenc_len, UChar *path, int path_len,
+ int options, php_stream_context *context TSRMLS_DC);
+#define php_stream_path_encode(wrapper, pathenc, pathenc_len, path, path_len, options, context) \
+ _php_stream_path_encode((wrapper), (pathenc), (pathenc_len), (path), (path_len), (options), (context) TSRMLS_CC)
+
+PHPAPI int _php_stream_path_decode(php_stream_wrapper *wrapper,
+ char **pathdec, int *pathdec_len, UChar *path, int path_len,
+ int options, php_stream_context *context TSRMLS_DC);
+#define php_stream_path_decode(wrapper, pathdec, pathdec_len, path, path_len, options, context) \
+ _php_stream_path_decode((wrapper), (pathdec), (pathdec_len), (path), (path_len), (options), (context) TSRMLS_CC)
+
END_EXTERN_C()