Ruby: win32/dir.h Source File

Ruby 3.4.6p54 (2025-09-16 revision dbd83256b1cec76c69756ecb8758b9e1079833de)

dir.h
1#ifndef RUBY_WIN32_DIR_H
2#define RUBY_WIN32_DIR_H
3#include <stdint.h> /* for uint8_t */
4#include <basetsd.h> /* for WCHAR */
5#include "ruby/encoding.h" /* for rb_encoding */
6
7#define DT_UNKNOWN 0
8#define DT_DIR (S_IFDIR>>12)
9#define DT_REG (S_IFREG>>12)
10#define DT_LNK 10
11
12 struct direct
13{
14 long d_namlen;
15 ino_t d_ino;
16 char *d_name;
17 char *d_altname; /* short name */
18 short d_altlen;
19 uint8_t d_type;
20};
21 typedef struct {
22 WCHAR *start;
23 WCHAR *curr;
24 long size;
25 long nfiles;
26 long loc; /* [0, nfiles) */
27 struct direct dirstr;
28 char *bits; /* used for d_isdir and d_isrep */
29} DIR;
30
31
32 DIR* rb_w32_opendir(const char*);
33 DIR* rb_w32_uopendir(const char*);
34struct direct* rb_w32_readdir(DIR *, rb_encoding *);
35struct direct* rb_w32_ureaddir(DIR *);
36long rb_w32_telldir(DIR *);
37void rb_w32_seekdir(DIR *, long);
38void rb_w32_rewinddir(DIR *);
39int rb_w32_closedir(DIR *);
40char *rb_w32_ugetcwd(char *, int);
41
42#define opendir(s) rb_w32_uopendir((s))
43#define readdir(d) rb_w32_ureaddir((d))
44#define telldir(d) rb_w32_telldir((d))
45#define seekdir(d, l) rb_w32_seekdir((d), (l))
46#define rewinddir(d) rb_w32_rewinddir((d))
47#define closedir(d) rb_w32_closedir((d))
48#define getcwd(b, s) rb_w32_ugetcwd(b, s)
49
50#endif /* RUBY_WIN32_DIR_H */
encoding.h
Encoding relates APIs.
DIR
Definition dir.h:21
direct
Definition dir.h:13