1 /*
2  * Copyright (C) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef __LUME_DIR__
16 #define __LUME_DIR__
17 #if _WIN32
18 /*
19  * File types
20  */
21 #define DT_UNKNOWN 0
22 #define DT_FIFO 1
23 #define DT_CHR 2
24 #define DT_DIR 4
25 #define DT_BLK 6
26 #define DT_REG 8
27 #define DT_LNK 10
28 #define DT_SOCK 12
29 
30 struct dirent {
31     unsigned char d_type;
32     char d_name[256];
33 };
34 struct DIR;
35 DIR* opendir(const char* path);
36 struct dirent* readdir(DIR* d);
37 void closedir(DIR* d);
38 #else
39 #include <sys/stat.h>
40 #include <sys/types.h>
41 #include <dirent.h>
42 #include <string>
43 #endif
44 #endif