diff options
author | 2021-02-21 13:16:54 +0200 | |
---|---|---|
committer | 2021-02-21 13:19:06 +0200 | |
commit | 29712a5098842ea3930ec00ddd1c0b9d264ba9b5 (patch) | |
tree | 3744b445acb971342be18fa6d2c9c4c20a470e1d /src/defs.h | |
parent | 26ab990a747ab675bcff32a40734dcb61468f652 (diff) | |
download | algos-ld1-29712a5098842ea3930ec00ddd1c0b9d264ba9b5.tar.gz algos-ld1-29712a5098842ea3930ec00ddd1c0b9d264ba9b5.tar.bz2 algos-ld1-29712a5098842ea3930ec00ddd1c0b9d264ba9b5.zip |
in-memory array sorting: GET!
lists need a bit more work and after that, in-file should shortly
follow.
Signed-off-by: Gediminas Jakutis <gediminas@varciai.lt>
Diffstat (limited to 'src/defs.h')
-rw-r--r-- | src/defs.h | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -45,10 +45,6 @@ #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)) -#define stream_blank .fd = -1, .settings = &settings, .get_next_element_direct = stub_getnext, \ - .get_next_element_cache = stub_getnext, .place_next_element_direct = stub_put, \ - .place_next_element_cache = stub_put, .split = stub_split, .flush = stub_flush - union nextoff { struct entry_l *next; ptrdiff_t offset; @@ -89,15 +85,15 @@ enum dataformat { }; enum streamtype { - stream_invalid = -1, + stream_invalid, stream_in, stream_out, stream_outlite, + stream_cache, stream_randread }; struct stream { - long int parentid; size_t n; int fd; enum streamtype type; @@ -112,7 +108,7 @@ struct stream { 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); int (*split)(struct stream * const, struct stream * const, struct stream * const); - int (*flush)(struct stream * const); + int (*rewind)(struct stream * const); }; struct settings { |