tree ebbf2c037e68116c4ff934f140ca12cdbe13311d
parent 77de9e0b7a81ddc22526c9415f0273171f631d3f
author Brad Roberts <[EMAIL PROTECTED]> 1114073146 -0700
committer Brad Roberts <[EMAIL PROTECTED]> 1114073146 -0700

[PATCH] Add new api's to front the active_cache and active_nr cache internals

Signed-off-by: Brad Roberts <[EMAIL PROTECTED]>
---

 cache.h      |    3 +++
 read-cache.c |   15 +++++++++++++++
 2 files changed, 18 insertions(+)

Index: cache.h
===================================================================
--- 77de9e0b7a81ddc22526c9415f0273171f631d3f:1/cache.h  (mode:100644 
sha1:a101870e4a002a2548d88544a77bedad21668203)
+++ 27fc41dcd4aecafdaf583f3962697a2fa3fb6480:1/cache.h  (mode:100644 
sha1:9ad6e805eafcb213c6bb4b1f8ff4d4e053fa6067)
@@ -93,6 +93,9 @@
 extern int add_cache_entry(struct cache_entry *ce, int ok_to_add);
 extern int remove_file_from_cache(char *path);
 extern int cache_match_stat(struct cache_entry *ce, struct stat *st);
+extern int get_num_cache_entries();
+extern struct cache_entry * get_cache_entry(int pos);
+extern void set_cache_entry(struct cache_entry *ce, int pos);
 
 #define MTIME_CHANGED  0x0001
 #define CTIME_CHANGED  0x0002
Index: read-cache.c
===================================================================
--- 77de9e0b7a81ddc22526c9415f0273171f631d3f:1/read-cache.c  (mode:100644 
sha1:349ebd1f8a0a95bf462bb1dfd3d9dfb50628829c)
+++ 27fc41dcd4aecafdaf583f3962697a2fa3fb6480:1/read-cache.c  (mode:100644 
sha1:6689df59d5a93e0503d7c80c114efbd16de826f3)
@@ -110,6 +110,21 @@
        return ce_namelen(b) == len && !memcmp(a->name, b->name, len);
 }
 
+int get_num_cache_entries()
+{
+       return active_nr;
+}
+
+struct cache_entry * get_cache_entry(int pos)
+{
+       return active_cache[pos];
+}
+
+void set_cache_entry(struct cache_entry *ce, int pos)
+{
+       active_cache[pos] = ce;
+}
+
 int add_cache_entry(struct cache_entry *ce, int ok_to_add)
 {
        int pos;

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to