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
This commit is contained in:
2023-09-02 16:10:59 +01:00
parent f1891b0c2e
commit c9b6b04d19
4 changed files with 119 additions and 94 deletions

23
lib.h Normal file
View File

@@ -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