-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathzdir.h
74 lines (58 loc) · 1.6 KB
/
zdir.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
Copyright (C) 1997-2008 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
http://www.zsnes.com
http://sourceforge.net/projects/zsnes
https://zsnes.bountysource.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef ZDIR_H
#define ZDIR_H
struct dirent_info {
char* name;
mode_t mode;
off_t size;
#ifdef __UNIXSDL__
uid_t uid;
gid_t gid;
#endif
};
#ifndef __UNIXSDL__
#include <stdint.h>
#include <io.h>
#include <windows.h>
// Avoid clashing with DJGPP and MinGW extras
struct z_dirent {
char d_name[256];
};
typedef struct
{
intptr_t find_first_handle;
struct _finddata_t fileinfo;
struct z_dirent entry;
} z_DIR;
z_DIR* z_opendir(const char* path);
struct z_dirent* z_readdir(z_DIR* dir);
int z_closedir(z_DIR* dir);
#ifndef NO_ZDIR_TYPEDEF
#define dirent z_dirent
typedef z_DIR DIR;
#define opendir z_opendir
#define readdir z_readdir
#define closedir z_closedir
#endif
#else
#include <dirent.h>
typedef DIR z_DIR;
#endif
struct dirent_info* readdir_info(z_DIR* dir);
int dirent_access(struct dirent_info* entry, int mode);
#endif