summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2019-07-16 13:47:38 +0200
committerPaweł Redman <pawel.redman@gmail.com>2019-07-16 13:47:38 +0200
commit69a1aa93b81415a082dc4b5cecaad3d0dc0a97a6 (patch)
tree1faf77f269c5c43498b44309140a01de83cb0182 /src/main.c
parent0a25815768786155371db7154da84d9cdfc43b3f (diff)
Basics of MAT exporting
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index 0242172..dcb5d06 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,7 +1,4 @@
-#include <stdlib.h>
-#include <inttypes.h>
-#include <stdio.h>
-#include <errno.h>
+#include "common.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -9,6 +6,7 @@
#include <sys/mman.h>
#include "e2e.h"
+#include "export.h"
int main(int argc, char **argv)
{
@@ -45,8 +43,11 @@ int main(int argc, char **argv)
goto error_mmap;
}
- if (e2e_read(&data, input, input + st.st_size))
+ if (errno = e2e_read(&data, input, input + st.st_size))
perror("e2e_read");
+ else if (errno = export(&data, "testing.mat"))
+ perror("export");
+
e2e_destroy(&data);
munmap(input, st.st_size);