aboutsummaryrefslogtreecommitdiff
path: root/reftable/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'reftable/system.h')
-rw-r--r--reftable/system.h32
1 files changed, 28 insertions, 4 deletions
diff --git a/reftable/system.h b/reftable/system.h
index c54ed4cad6..c0e2cbe0ff 100644
--- a/reftable/system.h
+++ b/reftable/system.h
@@ -9,11 +9,14 @@
#ifndef SYSTEM_H
#define SYSTEM_H
-/* This header glues the reftable library to the rest of Git */
+/*
+ * This header defines the platform-agnostic interface that is to be
+ * implemented by the project to make it work on their respective supported
+ * systems, and to integrate it into the project itself. This header is not
+ * expected to be changed by the individual project.
+ */
-#define MINGW_DONT_HANDLE_IN_USE_ERROR
-#include "compat/posix.h"
-#include "compat/zlib-compat.h"
+#include "reftable-system.h"
/*
* Return a random 32 bit integer. This function is expected to return
@@ -108,4 +111,25 @@ int flock_release(struct reftable_flock *l);
*/
int flock_commit(struct reftable_flock *l);
+/* Report the time in milliseconds. */
+uint64_t reftable_time_ms(void);
+
+struct reftable_mmap {
+ void *data;
+ size_t size;
+ void *priv;
+};
+
+/*
+ * Map the file into memory. Returns 0 on success, a reftable error code on
+ * error.
+ */
+int reftable_mmap(struct reftable_mmap *out, int fd, size_t len);
+
+/*
+ * Unmap the file from memory. Returns 0 on success, a reftable error code on
+ * error.
+ */
+int reftable_munmap(struct reftable_mmap *mmap);
+
#endif