dir.h 1.06 KB
Newer Older
Vicent Marti committed
1
/*
Edward Thomson committed
2
 * Copyright (C) the libgit2 contributors. All rights reserved.
Vicent Marti committed
3 4 5 6
 *
 * This file is part of libgit2, distributed under the GNU GPL v2 with
 * a Linking Exception. For full terms see the included COPYING file.
 */
7 8 9 10
#ifndef INCLUDE_dir_h__
#define INCLUDE_dir_h__

#include "common.h"
11
#include "w32_util.h"
12

13
struct git__dirent {
Vicent Marti committed
14
	int d_ino;
15
	git_win32_utf8_path d_name;
16 17 18 19
};

typedef struct {
	HANDLE h;
20
	WIN32_FIND_DATAW f;
21
	struct git__dirent entry;
22
	int first;
23
	char dir[GIT_FLEX_ARRAY];
24 25
} git__DIR;

26 27
extern git__DIR *git__opendir(const char *);
extern struct git__dirent *git__readdir(git__DIR *);
28 29
extern int git__readdir_ext(
	git__DIR *, struct git__dirent *, struct git__dirent **, int *);
30 31
extern void git__rewinddir(git__DIR *);
extern int git__closedir(git__DIR *);
32 33

# ifndef GIT__WIN32_NO_WRAP_DIR
Vicent Marti committed
34 35 36 37
#	define dirent git__dirent
#	define DIR git__DIR
#	define opendir	git__opendir
#	define readdir	git__readdir
38
#   define readdir_r(d,e,r) git__readdir_ext((d),(e),(r),NULL)
Vicent Marti committed
39 40
#	define rewinddir git__rewinddir
#	define closedir git__closedir
41
# endif
42 43

#endif /* INCLUDE_dir_h__ */