Ruby: win32/dir.h Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

dir.h
Go to the documentation of this file.
1#ifndef RUBY_WIN32_DIR_H
2#define RUBY_WIN32_DIR_H
3#include <stdint.h> /* for uint8_t */
4#include <esent.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 *);
39void 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
uint8_t
unsigned char uint8_t
Definition: sha2.h:100
DIR
Definition: dir.h:21
DIR::bits
char * bits
Definition: dir.h:28
DIR::nfiles
long nfiles
Definition: dir.h:25
DIR::size
long size
Definition: dir.h:24
DIR::loc
long loc
Definition: dir.h:26
DIR::start
WCHAR * start
Definition: dir.h:22
DIR::curr
WCHAR * curr
Definition: dir.h:23
OnigEncodingTypeST
Definition: onigmo.h:160
direct
Definition: dir.h:13
direct::d_altname
char * d_altname
Definition: dir.h:17
direct::d_namlen
long d_namlen
Definition: dir.h:14
direct::d_ino
ino_t d_ino
Definition: dir.h:15
direct::d_altlen
short d_altlen
Definition: dir.h:18
direct::d_type
uint8_t d_type
Definition: dir.h:19
direct::d_name
char * d_name
Definition: dir.h:16
rb_w32_seekdir
void rb_w32_seekdir(DIR *, long)
Definition: win32.c:2414
rb_w32_opendir
DIR * rb_w32_opendir(const char *)
Definition: win32.c:2203
rb_w32_readdir
struct direct * rb_w32_readdir(DIR *, rb_encoding *)
Definition: win32.c:2374
rb_w32_telldir
long rb_w32_telldir(DIR *)
Definition: win32.c:2403
rb_w32_ureaddir
struct direct * rb_w32_ureaddir(DIR *)
Definition: win32.c:2391
rb_w32_uopendir
DIR * rb_w32_uopendir(const char *)
Definition: win32.c:2216
rb_w32_closedir
void rb_w32_closedir(DIR *)
Definition: win32.c:2441
rb_w32_ugetcwd
char * rb_w32_ugetcwd(char *, int)
Definition: win32.c:4794
rb_w32_rewinddir
void rb_w32_rewinddir(DIR *)
Definition: win32.c:2429