mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
5e22f873ed
Saves comitters' daily life by avoid #include-ing everything from internal.h to make each file do so instead. This would significantly speed up incremental builds. We take the following inclusion order in this changeset: 1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very first thing among everything). 2. RUBY_EXTCONF_H if any. 3. Standard C headers, sorted alphabetically. 4. Other system headers, maybe guarded by #ifdef 5. Everything else, sorted alphabetically. Exceptions are those win32-related headers, which tend not be self- containing (headers have inclusion order dependencies).
48 lines
1.3 KiB
C
48 lines
1.3 KiB
C
#ifndef RUBY_WIN32_DIR_H
|
|
#define RUBY_WIN32_DIR_H
|
|
#include <stdint.h> /* for uint8_t */
|
|
#include <esent.h> /* for WCHAR */
|
|
#include "ruby/encoding.h" /* for rb_encoding */
|
|
|
|
#define DT_UNKNOWN 0
|
|
#define DT_DIR (S_IFDIR>>12)
|
|
#define DT_REG (S_IFREG>>12)
|
|
#define DT_LNK 10
|
|
|
|
struct direct
|
|
{
|
|
long d_namlen;
|
|
ino_t d_ino;
|
|
char *d_name;
|
|
char *d_altname; /* short name */
|
|
short d_altlen;
|
|
uint8_t d_type;
|
|
};
|
|
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 *, rb_encoding *);
|
|
long rb_w32_telldir(DIR *);
|
|
void rb_w32_seekdir(DIR *, long);
|
|
void rb_w32_rewinddir(DIR *);
|
|
void rb_w32_closedir(DIR *);
|
|
char *rb_w32_ugetcwd(char *, int);
|
|
|
|
#define opendir(s) rb_w32_opendir((s))
|
|
#define readdir(d) rb_w32_readdir((d), 0)
|
|
#define telldir(d) rb_w32_telldir((d))
|
|
#define seekdir(d, l) rb_w32_seekdir((d), (l))
|
|
#define rewinddir(d) rb_w32_rewinddir((d))
|
|
#define closedir(d) rb_w32_closedir((d))
|
|
|
|
#endif /* RUBY_WIN32_DIR_H */
|