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
ocean 88a3caaafe * win32/win32.c (rb_w32_seekdir): should not segfault even if passed
the location which rb_w32_telldir didn't return. (and should change
  `bits' position) [ruby-core:7035]

* win32/dir.h: ditto. (stores `loc' instead of `bitpos')

* test/ruby/test_dir.rb: added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-01-01 05:49:01 +00:00

44 lines
990 B
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[256];
char d_isdir; /* directory */
char d_isrep; /* reparse point */
};
typedef struct {
char *start;
char *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*);
struct direct* rb_w32_readdir(DIR *);
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 */