aboutsummaryrefslogtreecommitdiff
path: root/lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib.h b/lib.h
new file mode 100644
index 0000000..f0fa170
--- /dev/null
+++ b/lib.h
@@ -0,0 +1,23 @@
+#ifndef LIB_H
+#define LIB_H
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#define MAX(a, b) (a > b ? a : b)
+
+bool usable_character(char c);
+char *fread_all(FILE *fp);
+void print_error(const char *handle, size_t row, size_t column,
+ const char *reason);
+
+typedef struct Buffer
+{
+ const char *name;
+ size_t size;
+ char data[];
+} buffer_t;
+
+buffer_t *buffer_init_str(const char *name, const char *str, size_t str_size);
+#endif