aboutsummaryrefslogtreecommitdiffstats
path: root/util/folder/dirent_win.h
diff options
context:
space:
mode:
authorDevtools Arcadia <arcadia-devtools@yandex-team.ru>2022-02-07 18:08:42 +0300
committerDevtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net>2022-02-07 18:08:42 +0300
commit1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch)
treee26c9fed0de5d9873cce7e00bc214573dc2195b7 /util/folder/dirent_win.h
downloadydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'util/folder/dirent_win.h')
-rw-r--r--util/folder/dirent_win.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/util/folder/dirent_win.h b/util/folder/dirent_win.h
new file mode 100644
index 0000000000..ac11a64c04
--- /dev/null
+++ b/util/folder/dirent_win.h
@@ -0,0 +1,46 @@
+#pragma once
+
+#include <util/system/defaults.h>
+
+#ifdef _win_
+
+ #include <util/system/winint.h>
+
+ #ifdef __cplusplus
+extern "C" {
+ #endif
+
+ struct DIR {
+ HANDLE sh;
+ WIN32_FIND_DATAW wfd;
+ WCHAR* fff_templ;
+ int file_no;
+ struct dirent* readdir_buf;
+ };
+
+ #define MAXNAMLEN (MAX_PATH - 1) * 2
+ #define MAXPATHLEN MAX_PATH
+ #define DT_DIR 4
+ #define DT_REG 8
+ #define DT_LNK 10
+ #define DT_UNKNOWN 0
+
+ struct dirent {
+ ui32 d_fileno; /* file number of entry */
+ ui16 d_reclen; /* length of this record */
+ ui8 d_type; /* file type */
+ ui8 d_namlen; /* length of string in d_name */
+ char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
+ };
+
+ struct DIR* opendir(const char* dirname);
+ int closedir(struct DIR* dir);
+ int readdir_r(struct DIR* dir, struct dirent* entry, struct dirent** result);
+ struct dirent* readdir(struct DIR* dir);
+ void rewinddir(struct DIR* dir);
+
+ #ifdef __cplusplus
+}
+ #endif
+
+#endif //_win_