dir.h 1.01 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 11
#ifndef INCLUDE_dir_h__
#define INCLUDE_dir_h__

#include "common.h"

12
struct git__dirent {
Vicent Marti committed
13
	int d_ino;
14 15 16 17 18
	char d_name[261];
};

typedef struct {
	HANDLE h;
19
	WIN32_FIND_DATAW f;
20
	struct git__dirent entry;
21 22
	char *dir;
	int first;
23 24
} git__DIR;

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

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

#endif /* INCLUDE_dir_h__ */