summaryrefslogtreecommitdiff
path: root/win32/dir.h
blob: f970745fdf3f3030e23ca0e28257303401f80a08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#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 *);
off_t          rb_w32_telldir(DIR *);
void           rb_w32_seekdir(DIR *, off_t);
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 */