summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2008-10-26 21:59:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-10-27 05:08:58 (GMT)
commit108bebeab31881654b7b0f1b5b393a6655d74d3f (patch)
tree49568beafbd6e9d84bcd200f6070b45b6ea74c8e /cache.h
parent9fe7a643fcc56ca1c17afec5d5f8adca10cabdd1 (diff)
downloadgit-108bebeab31881654b7b0f1b5b393a6655d74d3f.zip
git-108bebeab31881654b7b0f1b5b393a6655d74d3f.tar.gz
git-108bebeab31881654b7b0f1b5b393a6655d74d3f.tar.bz2
Add mksnpath which allows you to specify the output buffer
This is just vsnprintf's but additionally calls cleanup_path() on the result. To be used as alternatives to mkpath() where the buffer for the created path may not be reused by subsequent calls of the same formatting function. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 884fae8..aea13b0 100644
--- a/cache.h
+++ b/cache.h
@@ -480,6 +480,9 @@ extern int check_repository_format(void);
#define DATA_CHANGED 0x0020
#define TYPE_CHANGED 0x0040
+extern char *mksnpath(char *buf, size_t n, const char *fmt, ...)
+ __attribute__((format (printf, 3, 4)));
+
/* Return a statically allocated filename matching the sha1 signature */
extern char *mkpath(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
extern char *git_path(const char *fmt, ...) __attribute__((format (printf, 1, 2)));