Fix missing '\n' at end of git-cat-file -t output.
[gitweb.git] / cache.h
diff --git a/cache.h b/cache.h
index e27429eae979f207d3ccdf0c53fea424306ddeb6..940ced03148782c549a309249729c942b6cc9b85 100644 (file)
--- a/cache.h
+++ b/cache.h
 #include SHA1_HEADER
 #include <zlib.h>
 
+#if ZLIB_VERNUM < 0x1200
+#define deflateBound(c,s)  ((s) + (((s) + 7) >> 3) + (((s) + 63) >> 6) + 11)
+#endif
+
+#ifdef DT_UNKNOWN
+#define DTYPE(de)      ((de)->d_type)
+#else
+#define DT_UNKNOWN     0
+#define DT_DIR         1
+#define DT_REG         2
+#define DTYPE(de)      DT_UNKNOWN
+#endif
+
 /*
  * Basic data structures for the directory cache
  *
@@ -133,6 +146,7 @@ extern int write_sha1_from_fd(const unsigned char *sha1, int fd);
 extern int has_sha1_file(const unsigned char *sha1);
 
 /* Convert to/from hex/sha1 representation */
+extern int get_sha1(const char *str, unsigned char *sha1);
 extern int get_sha1_hex(const char *hex, unsigned char *sha1);
 extern char *sha1_to_hex(const unsigned char *sha1);   /* static buffer result! */