1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/win32/dir.h
usa 22d5cf9226 * win32/{win32.c,dir.h} (rb_w32_uopendir): new API to pass UTF-8 path.
* win32/win32.c (opendir_internal, rb_w32_opendir): extract and merge
  common part of rb_w32_opendir() and rb_w32_uopendir().

* dir.c (do_opendir, glob_helper): encoding.

* dir.c (dir_initialize, do_opendir): convert path to UTF-8 and call
  rb_w32_uopendir() instead of rb_w32_opendir() on Windows.
  fixes #4491, reported by Joey Zhou.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-28 07:22:18 +00:00

46 lines
1.1 KiB
C

#ifndef RUBY_WIN32_DIR_H
#define RUBY_WIN32_DIR_H
#ifdef __BORLANDC__
# ifndef WIN32_DIR_H_
# define WIN32_DIR_H_
# include <sys/types.h>
# endif
#endif
struct direct
{
long d_namlen;
ino_t d_ino;
char *d_name;
char d_isdir; /* directory */
char d_isrep; /* reparse point */
};
typedef struct {
WCHAR *start;
WCHAR *curr;
long size;
long nfiles;
long loc; /* [0, nfiles) */
struct direct dirstr;
char *bits; /* used for d_isdir and d_isrep */
} DIR;
DIR* rb_w32_opendir(const char*);
DIR* rb_w32_uopendir(const char*);
struct direct* rb_w32_readdir(DIR *);
struct direct* rb_w32_readdir_with_enc(DIR *, rb_encoding *);
long rb_w32_telldir(DIR *);
void rb_w32_seekdir(DIR *, long);
void rb_w32_rewinddir(DIR *);
void rb_w32_closedir(DIR *);
#define opendir rb_w32_opendir
#define readdir rb_w32_readdir
#define telldir rb_w32_telldir
#define seekdir rb_w32_seekdir
#define rewinddir rb_w32_rewinddir
#define closedir rb_w32_closedir
#endif /* RUBY_WIN32_DIR_H */