]> git.ipfire.org Git - thirdparty/git.git/blobdiff - cache.h
[PATCH] compat: missing dirent.d_type field
[thirdparty/git.git] / cache.h
diff --git a/cache.h b/cache.h
index 3277d48708f885fa1b7cc56c9d16061c65a2eeb9..af6345820f3f8c533868394059b2d3b189e6b422 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
  *
@@ -143,9 +156,13 @@ extern int error(const char *err, ...);
 
 extern int cache_name_compare(const char *name1, int len1, const char *name2, int len2);
 
-extern void *read_tree_with_tree_or_commit_sha1(const unsigned char *sha1,
-                                               unsigned long *size,
-                                               unsigned char *tree_sha1_ret);
+extern void *read_object_with_reference(const unsigned char *sha1,
+                                       const unsigned char *required_type,
+                                       unsigned long *size,
+                                       unsigned char *sha1_ret);
+
+void parse_date(char *date, char *buf, int bufsize);
+void datestamp(char *buf, int bufsize);
 
 static inline void *xmalloc(int size)
 {