]> granicus.if.org Git - php/commitdiff
- Add more unicode stuff
authorMarcus Boerger <helly@php.net>
Tue, 16 Jan 2007 20:36:04 +0000 (20:36 +0000)
committerMarcus Boerger <helly@php.net>
Tue, 16 Jan 2007 20:36:04 +0000 (20:36 +0000)
main/php_streams.h
main/streams/streams.c

index eab472d683438e651d97cc3fda0b0f540a5393be..e377542314fef4469e0a82eec402a30580b1a9f7 100755 (executable)
@@ -360,7 +360,9 @@ PHPAPI int _php_stream_rmdir(char *path, int options, php_stream_context *contex
 #define php_stream_rmdir(path, options, context)       _php_stream_rmdir(path, options, context TSRMLS_CC)
 
 PHPAPI php_stream *_php_stream_opendir(char *path, int options, php_stream_context *context STREAMS_DC TSRMLS_DC);
+PHPAPI php_stream *_php_stream_u_opendir(zend_uchar type, zstr path, int path_len, int options, php_stream_context *context STREAMS_DC TSRMLS_DC);
 #define php_stream_opendir(path, options, context)     _php_stream_opendir((path), (options), (context) STREAMS_CC TSRMLS_CC)
+#define php_stream_u_opendir(path_type, path, path_len, options, context)      _php_stream_u_opendir((path_type), (path), (path_len), (options), (context) STREAMS_CC TSRMLS_CC)
 PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent TSRMLS_DC);
 #define php_stream_readdir(dirstream, dirent)  _php_stream_readdir((dirstream), (dirent) TSRMLS_CC)
 #define php_stream_closedir(dirstream) php_stream_close((dirstream))
index f7ed82cf9dc42d01eb72663c564f1c222c6b5f89..b521dcae8603932b1a05b96464fd9bcbda81643c 100755 (executable)
@@ -2278,6 +2278,27 @@ PHPAPI php_stream *_php_stream_opendir(char *path, int options,
 }
 /* }}} */
 
+PHPAPI php_stream *_php_stream_u_opendir(zend_uchar type, zstr path, int path_len, int options, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
+{
+       char *filename;
+       int filename_len;
+       php_stream *stream;
+
+       if (type == IS_STRING) {
+               return php_stream_opendir(path.s, options, context);
+       }
+
+       /* type == IS_UNICODE */
+       if (FAILURE == php_stream_path_encode(NULL, &filename, &filename_len, path.u, path_len, options, context)) {
+               return NULL;
+       }
+
+       stream = php_stream_opendir(filename, options, context);
+       efree(filename);
+       return stream;
+}
+/* }}} */
+
 /* {{{ _php_stream_readdir */
 PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent TSRMLS_DC)
 {