Browse Source

- Add more unicode stuff

migration/RELEASE_1_0_0
Marcus Boerger 20 years ago
parent
commit
1c60406349
  1. 2
      main/php_streams.h
  2. 21
      main/streams/streams.c

2
main/php_streams.h

@ -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))

21
main/streams/streams.c

@ -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)
{

Loading…
Cancel
Save