diff options
| author | Vicent Marti <tanoku@gmail.com> | 2011-07-04 11:43:34 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-07-05 02:04:03 +0200 |
| commit | f79026b4912bcd2336667f4c1663c06e233f0b32 (patch) | |
| tree | 645b776032e924b587fad986aa3f3dc08c98d4c5 /src/win32/posix.h | |
| parent | 678e9e045becdc5d75f2ce2259ed01c3531ee181 (diff) | |
| download | libgit2-f79026b4912bcd2336667f4c1663c06e233f0b32.tar.gz | |
fileops: Cleanup
Cleaned up the structure of the whole OS-abstraction layer.
fileops.c now contains a set of utility methods for file management used
by the library. These are abstractions on top of the original POSIX
calls.
There's a new file called `posix.c` that contains
emulations/reimplementations of all the POSIX calls the library uses.
These are prefixed with `p_`. There's a specific posix file for each
platform (win32 and unix).
All the path-related methods have been moved from `utils.c` to `path.c`
and have their own prefix.
Diffstat (limited to 'src/win32/posix.h')
| -rw-r--r-- | src/win32/posix.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/win32/posix.h b/src/win32/posix.h new file mode 100644 index 000000000..31ee7201c --- /dev/null +++ b/src/win32/posix.h @@ -0,0 +1,25 @@ +#ifndef INCLUDE_posix__w32_h__ +#define INCLUDE_posix__w32_h__ + +#include "common.h" + +GIT_INLINE(int) p_link(const char *GIT_UNUSED(old), const char *GIT_UNUSED(new)) +{ + GIT_UNUSED_ARG(old) + GIT_UNUSED_ARG(new) + errno = ENOSYS; + return -1; +} + +GIT_INLINE(int) p_mkdir(const char *path, int GIT_UNUSED(mode)) +{ + GIT_UNUSED_ARG(mode) + return mkdir(path); +} + +extern int p_unlink(const char *path); +extern int p_lstat(const char *file_name, struct stat *buf); +extern int p_readlink(const char *link, char *target, size_t target_len); +extern int p_hide_directory__w32(const char *path); + +#endif |
