From 068e3e6c5a74702c3e7db0e37b243f522c433a7f Mon Sep 17 00:00:00 2001 From: Gediminas Jakutis Date: Wed, 3 Mar 2021 14:57:28 +0200 Subject: straight up code refactor. Signed-off-by: Gediminas Jakutis --- src/defs.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/defs.h') diff --git a/src/defs.h b/src/defs.h index 5d632c3..0d543d7 100644 --- a/src/defs.h +++ b/src/defs.h @@ -49,9 +49,6 @@ # endif #endif -#define get(in) (in->settings->access == cached ? in->get_next_element_cache(in) : in->get_next_element_direct(in)) -#define put(in, data) (in->settings->access == cached ? in->place_next_element_cache(in, data) : in->place_next_element_direct(in, data)) - union nextoff { struct entry_l *next; void *nextaddr; @@ -96,7 +93,7 @@ enum streamtype { stream_invalid, stream_in, stream_out, - stream_outlite, + stream_lite, stream_cache, stream_randread }; @@ -110,12 +107,11 @@ struct stream { struct entry_l *cnode; /* "current" node */ union cachewrap; struct settings *settings; - struct entry_l *(*get_next_element_direct)(struct stream * const); - struct entry_l *(*get_next_element_cache)(struct stream * const); - int (*place_next_element_direct)(struct stream * const, struct entry_l const * const); - int (*place_next_element_cache)(struct stream * const, struct entry_l const * const); + struct entry_l *(*get)(struct stream * const); + int (*put)(struct stream * const, struct entry_l const * const); int (*split)(struct stream * const, struct stream * const, struct stream * const); - int (*rewind)(struct stream * const); + int (*rewind)(struct stream * restrict const); + int (*copy)(struct stream * restrict const, struct stream * restrict const); }; struct settings { -- cgit v1.2.3