summaryrefslogtreecommitdiff
path: root/src/fileops.h
diff options
context:
space:
mode:
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>2009-03-20 19:51:48 +0000
committerShawn O. Pearce <spearce@spearce.org>2009-03-20 14:39:02 -0700
commit79ca2edcd4e7a801400fa33c2c705b8f03a5d7f5 (patch)
treed48d51dea1dd8e90bb8c960e68afe72cabc5f6aa /src/fileops.h
parent7a6cf8153799563464d6f1761e55352c327b4122 (diff)
downloadlibgit2-79ca2edcd4e7a801400fa33c2c705b8f03a5d7f5.tar.gz
win32: Add routines to abstract memory-mapped file functions
In particular, the git__mmap() and git__munmap() routines provide the interface to platform specific memory-mapped file facilities. We provide implementations for unix and win32, which can be found in their own sub-directories. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'src/fileops.h')
-rw-r--r--src/fileops.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/fileops.h b/src/fileops.h
index 3cc1e1683..39e01811c 100644
--- a/src/fileops.h
+++ b/src/fileops.h
@@ -10,6 +10,7 @@
#define _FILE_OFFSET_BITS 64
#include "common.h"
+#include "map.h"
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
@@ -29,11 +30,6 @@ typedef struct { /* file io buffer */
size_t len; /* data length */
} gitfo_buf;
-typedef struct { /* memory mapped buffer */
- void *data; /* data bytes */
- size_t len; /* data length */
-} gitfo_map;
-
extern int gitfo_exists(const char *path);
extern int gitfo_open(const char *path, int flags);
extern int gitfo_creat(const char *path, int mode);
@@ -66,7 +62,7 @@ extern void gitfo_free_buf(gitfo_buf *obj);
* - GIT_EOSERR on an unspecified OS related error.
*/
extern int gitfo_map_ro(
- gitfo_map *out,
+ git_map *out,
git_file fd,
off_t begin,
size_t len);
@@ -75,7 +71,7 @@ extern int gitfo_map_ro(
* Release the memory associated with a previous memory mapping.
* @param map the mapping description previously configured.
*/
-extern void gitfo_free_map(gitfo_map *map);
+extern void gitfo_free_map(git_map *map);
/**
* Walk each directory entry, except '.' and '..', calling fn(state).