helly Tue Jan 16 20:36:04 2007 UTC Modified files: /php-src/main php_streams.h /php-src/main/streams streams.c Log: - Add more unicode stuff http://cvs.php.net/viewvc.cgi/php-src/main/php_streams.h?r1=1.122&r2=1.123&diff_format=u Index: php-src/main/php_streams.h diff -u php-src/main/php_streams.h:1.122 php-src/main/php_streams.h:1.123 --- php-src/main/php_streams.h:1.122 Mon Jan 15 22:19:33 2007 +++ php-src/main/php_streams.h Tue Jan 16 20:36:04 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_streams.h,v 1.122 2007/01/15 22:19:33 helly Exp $ */ +/* $Id: php_streams.h,v 1.123 2007/01/16 20:36:04 helly Exp $ */ #ifndef PHP_STREAMS_H #define PHP_STREAMS_H @@ -360,7 +360,9 @@ #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)) http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.145&r2=1.146&diff_format=u Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.145 php-src/main/streams/streams.c:1.146 --- php-src/main/streams/streams.c:1.145 Mon Jan 15 22:19:33 2007 +++ php-src/main/streams/streams.c Tue Jan 16 20:36:04 2007 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streams.c,v 1.145 2007/01/15 22:19:33 helly Exp $ */ +/* $Id: streams.c,v 1.146 2007/01/16 20:36:04 helly Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -2278,6 +2278,27 @@ } /* }}} */ +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) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php