diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2008-12-31 15:35:36 -0800 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2008-12-31 15:35:36 -0800 |
commit | 5690f02e87e4fd31dfa9fd7c9c01aba03603cde8 (patch) | |
tree | 9396ec28d49129250ff79463cf588e1a8512984f /src/git/fileops.h | |
parent | 9eb7976448bf684dfb41993ef6c76098978ff933 (diff) | |
download | libgit2-5690f02e87e4fd31dfa9fd7c9c01aba03603cde8.tar.gz |
Rewrite git_foreach_dirent into gitfo_dirent
Our fileops API is currently private. We aren't planning on supplying
a cross-platform file API to applications that link to us. If we did,
we'd probably whole-sale publish fileops, not just the dirent code.
By moving it to be private we can also change the call signature to
permit the buffer to be passed down through the call chain. This is
very helpful when we are doing a recursive scan as we can reuse just
one buffer in all stack frames, reducing the impact the recursion has
on the stack frames in the data cache.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'src/git/fileops.h')
-rw-r--r-- | src/git/fileops.h | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/git/fileops.h b/src/git/fileops.h deleted file mode 100644 index 657cec148..000000000 --- a/src/git/fileops.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef INCLUDE_git_fileops_h__ -#define INCLUDE_git_fileops_h__ - -#include "common.h" - -/** - * @file git/fileops.h - * @brief Git platform agnostic filesystem operations - * @defgroup git_fileops Git filesystem operations - * @ingroup Git - * @{ - */ -GIT_BEGIN_DECL - -/** - * For each directory entry (except "." and ".."), run the function - * "fn", passing it "arg" as its first argument and the path to - * the entry as the second argument. - * @param dir The directory to walk - * @param fn The callback function to run for each entry in *dir. - * "fn" may return >0 to signal "I'm done. Stop parsing and - * return successfully" or <0 to signal an error. All non-zero - * return codes cause directory traversal to stop. - * @param arg The first argument that will be passed to 'fn' - * @return GIT_SUCCESS if all entries were successfully traversed, - * otherwise the result of fn. - */ -GIT_EXTERN(int) git_foreach_dirent(const char *dir, - int (*fn)(void *, const char *), void *arg); - -/** @} */ -GIT_END_DECL -#endif /* INCLUDE_git_fileops_h__ */ |