Refactor: macro constants -> config.h

This commit is contained in:
olemorud
2023-04-25 00:22:43 +02:00
parent 2eeaa2171f
commit e0857626d6
5 changed files with 43 additions and 9 deletions

View File

@@ -18,7 +18,7 @@ int main(int argc, char* argv[])
struct json_value x = parse_json_value(fp);
// print_json(x, 1);
print_json(x, 1);
json_value_delete(x);

View File

@@ -1,6 +1,7 @@
#include "parse.h"
#include "config.h"
#include "json_value.h"
#include "util.h"
@@ -10,10 +11,6 @@
#include <stdlib.h> // exit, EXIT_SUCCESS, EXIT_FAILURE
#include <string.h> // strcmp
#define EARLY_EOF 202
#define MALLOC_DIE 201
#define UNEXPECTED_CHAR 200
char* read_string(FILE* fp);
obj_t* read_object(FILE* fp);
void discard_whitespace(FILE* fp);

View File

@@ -1,5 +1,6 @@
#include "util.h"
#include "config.h"
#include <err.h> // err
#include <errno.h> // errno
@@ -8,8 +9,6 @@
#include <stdio.h> // fprintf
#include <stdlib.h> // malloc, realloc, calloc
#define ERROR_CONTEXT_LEN 80
void* malloc_or_die(size_t size)
{
void* result = malloc(size);