gitweb: blobs defined by non-textual hash ids can be cached
[gitweb.git] / cache.h
diff --git a/cache.h b/cache.h
index 08d6a91279c87ad1e4d7ce1be1ac927b52a6113e..1f212d77a4e41009c88c4b599022295b8a12a609 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -123,7 +123,7 @@ extern int cache_errno;
 #define INDEX_ENVIRONMENT "GIT_INDEX_FILE"
 #define GRAFT_ENVIRONMENT "GIT_GRAFT_FILE"
 
-extern char *get_git_dir(void);
+extern const char *get_git_dir(void);
 extern char *get_object_directory(void);
 extern char *get_refs_directory(void);
 extern char *get_index_file(void);
@@ -218,6 +218,14 @@ static inline int hashcmp(const unsigned char *sha1, const unsigned char *sha2)
 {
        return memcmp(sha1, sha2, 20);
 }
+static inline void hashcpy(unsigned char *sha_dst, const unsigned char *sha_src)
+{
+       memcpy(sha_dst, sha_src, 20);
+}
+static inline void hashclr(unsigned char *hash)
+{
+       memset(hash, 0, 20);
+}
 
 int git_mkstemp(char *path, size_t n, const char *template);