dir.h 1.05 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
#ifndef INCLUDE_win32_dir_h__
#define INCLUDE_win32_dir_h__
9 10

#include "common.h"
11

12
#include "w32_util.h"
13

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

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

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

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

44
#endif