summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-03-16 14:27:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-16 18:04:34 (GMT)
commit82c9d6614bcd80bc2b6646f3943971fa0ec20135 (patch)
tree084ea5e00931917f4ff77d1965b09cd563f06665 /cache.h
parente7e07d5a4fcc2a203d9873968ad3e6bd4d7419d7 (diff)
downloadgit-82c9d6614bcd80bc2b6646f3943971fa0ec20135.zip
git-82c9d6614bcd80bc2b6646f3943971fa0ec20135.tar.gz
git-82c9d6614bcd80bc2b6646f3943971fa0ec20135.tar.bz2
move odb_* declarations out of git-compat-util.h
These functions were originally conceived as wrapper functions similar to xmkstemp(). They were later moved by 463db9b10 (wrapper: move odb_* to environment.c, 2010-11-06). The more appropriate place for a declaration is in cache.h. While we're at it, let's add some basic docstrings. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 61fc86e..8b7b008 100644
--- a/cache.h
+++ b/cache.h
@@ -1564,6 +1564,18 @@ extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
extern void pack_report(void);
/*
+ * Create a temporary file rooted in the object database directory.
+ */
+extern int odb_mkstemp(char *template, size_t limit, const char *pattern);
+
+/*
+ * Create a pack .keep file in the object database's pack directory, for
+ * a pack with checksum "sha1". The return value is a file descriptor opened
+ * for writing, or -1 on error. The name of the keep file is written to "name".
+ */
+extern int odb_pack_keep(char *name, size_t namesz, const unsigned char *sha1);
+
+/*
* mmap the index file for the specified packfile (if it is not
* already mmapped). Return 0 on success.
*/