git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
BRBrad Roberts <braddr@gameboy2.puremagic.com>
Date
Apr 21, 2005, 18:34 UTC
Message-ID
<200504211834.j3LIYvBM027396@gameboy2.puremagic.com>

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;
Message 1 of 1 in “Add new api's to front the active_cache and active_nr cache internals”
  1. 02/19 Add new api's to front the active_cache and active_nr cache internalsBrad Roberts, Apr 21, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.