From: Brad Roberts <braddr@gameboy2.puremagic.com>
To: git@vger.kernel.org
Subject: [PATCH 02/19] Add new api's to front the active_cache and active_nr cache internals
Date: Thu, 21 Apr 2005 11:34:57 -0700 [thread overview]
Message-ID: <200504211834.j3LIYvBM027396@gameboy2.puremagic.com> (raw)
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;
reply other threads:[~2005-04-21 18:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200504211834.j3LIYvBM027396@gameboy2.puremagic.com \
--to=braddr@gameboy2.puremagic.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox