* [PATCH 02/19] Add new api's to front the active_cache and active_nr cache internals
@ 2005-04-21 18:34 Brad Roberts
0 siblings, 0 replies; only message in thread
From: Brad Roberts @ 2005-04-21 18:34 UTC (permalink / raw)
To: git
tree ebbf2c037e68116c4ff934f140ca12cdbe13311d
parent 77de9e0b7a81ddc22526c9415f0273171f631d3f
author Brad Roberts <braddr@puremagic.com> 1114073146 -0700
committer Brad Roberts <braddr@gameboy2.puremagic.com> 1114073146 -0700
[PATCH] Add new api's to front the active_cache and active_nr cache internals
Signed-off-by: Brad Roberts <braddr@puremagic.com>
---
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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-04-21 18:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-21 18:34 [PATCH 02/19] Add new api's to front the active_cache and active_nr cache internals Brad Roberts
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox