diff options
author | 2021-03-03 14:57:28 +0200 | |
---|---|---|
committer | 2021-03-03 14:57:28 +0200 | |
commit | 068e3e6c5a74702c3e7db0e37b243f522c433a7f (patch) | |
tree | f786f107ff5759084e3c1f76f5734cad2084fdd2 /src/defs.h | |
parent | b3072e146b4edd4a2422cee758aa341b0638491d (diff) | |
download | algos-ld1-068e3e6c5a74702c3e7db0e37b243f522c433a7f.tar.gz algos-ld1-068e3e6c5a74702c3e7db0e37b243f522c433a7f.tar.bz2 algos-ld1-068e3e6c5a74702c3e7db0e37b243f522c433a7f.zip |
straight up code refactor.
Signed-off-by: Gediminas Jakutis <gediminas@varciai.lt>
Diffstat (limited to 'src/defs.h')
-rw-r--r-- | src/defs.h | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -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 { |