diff options
author | 2020-02-25 09:57:14 +0200 | |
---|---|---|
committer | 2020-02-25 09:57:14 +0200 | |
commit | ad1bc59382e3cda63ce507cd7f56fc2a201c11e9 (patch) | |
tree | f57c6c7c672eb2e62bc9ba61a9f32265b4abf8a8 /src/io.h | |
parent | 1bcfe887515845678f8f648c6dfecffd01813b0f (diff) | |
download | algos-ld1-ad1bc59382e3cda63ce507cd7f56fc2a201c11e9.tar.gz algos-ld1-ad1bc59382e3cda63ce507cd7f56fc2a201c11e9.tar.bz2 algos-ld1-ad1bc59382e3cda63ce507cd7f56fc2a201c11e9.zip |
implement reading from dev-you-random for datagen.
Signed-off-by: Gediminas Jakutis <gediminas@varciai.lt>
Diffstat (limited to 'src/io.h')
-rw-r--r-- | src/io.h | 29 |
1 files changed, 4 insertions, 25 deletions
@@ -1,32 +1,11 @@ #ifndef ALGOS_IO_H_INCLUDED #define ALGOS_IO_H_INCLUDED -#include <stddef.h> -#include <stdint.h> +#include "defs.h" -struct stream { - size_t n; - size_t stride; - ssize_t last_idx; - int fd; - int out; - char *name; -}; - -/* for array implementation */ -struct entry_a { - uint64_t val; -}; - -/* for linked list implementation */ -struct entry_l { - uint32_t i; /* "pointer" to the next element. */ - uint64_t val; -}; - -int stream_open(struct stream * const in); +int stream_open(struct stream * const in, const struct settings * const s); int stream_close(struct stream * const in); -int stream_get(struct stream *in, size_t idx, void *data); -int stream_put(struct stream *in, size_t idx, void *data); +int stream_get(struct stream *in, size_t idx, struct entry_l *data, int tag); +int stream_put(struct stream *in, size_t idx, struct entry_l *data, int tag); #endif /* ALGOS_IO_H_INCLUDED */ |