summaryrefslogtreecommitdiff
path: root/lib.h
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-08-25 19:07:24 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-08-25 19:07:24 +0100
commit64f8df2592c2bf7cbedd2721ffeec39f74269041 (patch)
tree9e1f89698b955c3719a68e2d65216c2eed2ca7ff /lib.h
parent62647556fadb5407a8b144c5b3067772288b458f (diff)
downloadabelian-sandpile-64f8df2592c2bf7cbedd2721ffeec39f74269041.tar.gz
abelian-sandpile-64f8df2592c2bf7cbedd2721ffeec39f74269041.tar.bz2
abelian-sandpile-64f8df2592c2bf7cbedd2721ffeec39f74269041.zip
(main~>lib.h)+header for data structures,~migrate lib.h
+some file handlers for writing and reading (may help with very large renders by doing them piecemeal when I can)
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib.h b/lib.h
new file mode 100644
index 0000000..bebc1df
--- /dev/null
+++ b/lib.h
@@ -0,0 +1,22 @@
+#ifndef LIB_H
+#define LIB_H
+
+#include <stdbool.h>
+#include <stdlib.h>
+
+typedef struct State
+{
+ // Sandpiles
+ unsigned char *data;
+ size_t dwidth;
+
+ size_t window_len;
+ int multiplier;
+
+ bool thread_alive;
+} state_t;
+
+bool load_from_file(state_t *state, const char *filepath);
+bool write_to_file(state_t *state, const char *filepath);
+
+#endif