aboutsummaryrefslogtreecommitdiff
path: root/lib.h
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-09-02 16:10:59 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-09-02 16:14:43 +0100
commitc9b6b04d190c1f9d0c4dfd7c4e66ac0743be18fd (patch)
treeb15cb3c1d407bee7b8dfdd330f46b8cb084328de /lib.h
parentf1891b0c2e85262a8f2dc0a0d13eea192fe00c26 (diff)
downloadobf-c9b6b04d190c1f9d0c4dfd7c4e66ac0743be18fd.tar.gz
obf-c9b6b04d190c1f9d0c4dfd7c4e66ac0743be18fd.tar.bz2
obf-c9b6b04d190c1f9d0c4dfd7c4e66ac0743be18fd.zip
New module for functions I no longer need to work on
lib.(h|c) basically has structures and functions I no longer want to stare at in main.c
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