Add support for alternate SHA1 library implementations.
[git.git] / cache.h
diff --git a/cache.h b/cache.h
index 378299a..8b226b6 100644 (file)
--- a/cache.h
+++ b/cache.h
 #include <string.h>
 #include <errno.h>
 #include <sys/mman.h>
+#include <sys/param.h>
 #include <netinet/in.h>
 
-#include <openssl/sha.h>
+#include SHA1_HEADER
 #include <zlib.h>
 
 /*
@@ -84,6 +85,13 @@ unsigned int active_nr, active_alloc;
 #define DB_ENVIRONMENT "SHA1_FILE_DIRECTORY"
 #define DEFAULT_DB_ENVIRONMENT ".git/objects"
 
+#define get_object_directory() (getenv(DB_ENVIRONMENT) ? : DEFAULT_DB_ENVIRONMENT)
+
+#define INDEX_ENVIRONMENT "GIT_INDEX_FILE"
+#define DEFAULT_INDEX_ENVIRONMENT ".git/index"
+
+#define get_index_file() (getenv(INDEX_ENVIRONMENT) ? : DEFAULT_INDEX_ENVIRONMENT)
+
 #define alloc_nr(x) (((x)+16)*3/2)
 
 /* Initialize and use the cache information */