Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-04-02 05:14:06 +0400
committerJunio C Hamano <junkio@cox.net>2007-04-23 09:53:54 +0400
commit228e94f93570b580da388069900c56b813c91953 (patch)
tree34bac44f8bb3f08b493c1d8e7d1634b456063d3d /cache.h
parent4280cde95fa4e3fb012eb6d0c239a7777baaf60c (diff)
Move index-related variables into a structure.
This defines a index_state structure and moves index-related global variables into it. Currently there is one instance of it, the_index, and everybody accesses it, so there is no code change. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/cache.h b/cache.h
index 89aaf0022d..4841c9a161 100644
--- a/cache.h
+++ b/cache.h
@@ -143,9 +143,22 @@ static inline unsigned int ce_mode_from_stat(struct cache_entry *ce, unsigned in
#define cache_entry_size(len) ((offsetof(struct cache_entry,name) + (len) + 8) & ~7)
-extern struct cache_entry **active_cache;
-extern unsigned int active_nr, active_alloc, active_cache_changed;
-extern struct cache_tree *active_cache_tree;
+struct index_state {
+ struct cache_entry **cache;
+ unsigned int cache_nr, cache_alloc, cache_changed;
+ struct cache_tree *cache_tree;
+ time_t timestamp;
+ void *mmap;
+ size_t mmap_size;
+};
+
+extern struct index_state the_index;
+
+#define active_cache (the_index.cache)
+#define active_nr (the_index.cache_nr)
+#define active_alloc (the_index.cache_alloc)
+#define active_cache_changed (the_index.cache_changed)
+#define active_cache_tree (the_index.cache_tree)
enum object_type {
OBJ_BAD = -1,