summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorGravatar Gediminas Jakutis <gediminas@varciai.lt> 2021-03-14 19:49:07 +0200
committerGravatar Gediminas Jakutis <gediminas@varciai.lt> 2021-03-14 19:49:07 +0200
commit111d08d814720966d12fd57b58331c149df7e6cf (patch)
tree8c838a937767decc16579a3a3550e91c996de276 /src/util.c
parent56f20e30636c16fd14205ba7c29cf8089caa1260 (diff)
downloadalgos-ld1-111d08d814720966d12fd57b58331c149df7e6cf.tar.gz
algos-ld1-111d08d814720966d12fd57b58331c149df7e6cf.tar.bz2
algos-ld1-111d08d814720966d12fd57b58331c149df7e6cf.zip
we can now print out stuff... things.
Signed-off-by: Gediminas Jakutis <gediminas@varciai.lt>
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index b2a3115..c14a848 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1,4 +1,5 @@
#include <errno.h>
+#include <stdio.h>
#include "defs.h"
#include "util.h"
#include "cache.h"
@@ -70,3 +71,19 @@ int split(struct stream * const src, struct stream * const A, struct stream * co
err:
return ret;
}
+
+int print_data(struct stream * const in)
+{
+ int ret = 0;
+ struct entry_l store;
+ size_t i;
+
+ puts( " position | value |\n"
+ " | |");
+
+ for (i = 0; in->get(in, &store); ++i) {
+ printf(" %10lu | " "%20"fieldprint" |\n", in->settings->ss + i, store.val);
+ }
+
+ return ret;
+}