From c9b6b04d190c1f9d0c4dfd7c4e66ac0743be18fd Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sat, 2 Sep 2023 16:10:59 +0100 Subject: 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 --- lib.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lib.h (limited to 'lib.h') 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 +#include +#include + +#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 -- cgit v1.2.3-13-gbd6f