summaryrefslogtreecommitdiffstats
path: root/src/cache.h
diff options
context:
space:
mode:
authorGravatar Gediminas Jakutis <gediminas@varciai.lt> 2021-02-09 05:43:36 +0200
committerGravatar Gediminas Jakutis <gediminas@varciai.lt> 2021-02-09 05:43:36 +0200
commit41efe7b8f9f67d5956ab677f3631478c48114ac1 (patch)
tree9b2d1cff2bc30b484a9192a498d38344803d83d9 /src/cache.h
parent7754455c48c50764ad7291ea508109c53b60517f (diff)
downloadalgos-ld1-41efe7b8f9f67d5956ab677f3631478c48114ac1.tar.gz
algos-ld1-41efe7b8f9f67d5956ab677f3631478c48114ac1.tar.bz2
algos-ld1-41efe7b8f9f67d5956ab677f3631478c48114ac1.zip
A major overhaul of the whole thing.
It has come to my attention that previously, the project was built on top of some *very* incorrect assumptions. This patch mostly addresses that. And while it does NOT leave the project in otherwise working state, it does weed out most, if not all, of effects of previously incorrect assumptions, so it can be built the right way from here on forth. Signed-off-by: Gediminas Jakutis <gediminas@varciai.lt>
Diffstat (limited to 'src/cache.h')
-rw-r--r--src/cache.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/cache.h b/src/cache.h
index 45215d4..9f333d3 100644
--- a/src/cache.h
+++ b/src/cache.h
@@ -8,16 +8,25 @@
#include <stddef.h>
#include "defs.h"
-int cache_create(struct stream * const restrict in, const struct settings * const restrict s);
-int cache_populate(struct stream * const restrict in);
+/* INIT|DESTROY */
+int cache_create(struct stream * const in, const struct settings * const restrict s);
+int cache_populate(struct stream * const in);
int cache_flush(struct stream * const in);
int cache_destroy(struct stream * const in);
-int cache_transfer(struct stream * const from, struct stream * const to);
-int cached_get_array(struct stream * const in, ssize_t idx, struct entry_l * const data);
-int cached_get_list(struct stream * const restrict in, ssize_t idx, struct entry_l * const data);
+/* BLOCKMANIP */
+int cache_transfer(struct stream * const src, struct stream * const dest);
+int cache_block_copy(struct stream const * const src, struct stream * const dest, const struct settings * const s);
+int cache_list_copy(struct stream const * const src, struct stream * const dest, const struct settings * const s);
+int cache_block_split(struct stream * const src, struct stream * const A, struct stream * const B);
+int cache_list_split(struct stream * const src, struct stream * const A, struct stream * const B);
-int cached_put_array(struct stream * const in, ssize_t idx, const struct entry_l * const data);
-int cached_put_list(struct stream * const restrict in, ssize_t idx, const struct entry_l * const data);
+/* GET */
+struct entry_l *cached_get_array(struct stream * const in);
+struct entry_l *cached_get_list(struct stream * const in);
+
+/* PUT */
+int cached_put_array(struct stream * const in, const struct entry_l * const data);
+int cached_put_list(struct stream * const restrict in, const struct entry_l * const node);
#endif /* ALGOS_CACHE_H_INCLUDED */