From 29f97864e1b0ef142249898b39332b26a5fb4906 Mon Sep 17 00:00:00 2001 From: jvech Date: Mon, 10 Jul 2023 22:40:05 -0500 Subject: add: json file function implemented --- src/json.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/json.c (limited to 'src/json.c') diff --git a/src/json.c b/src/json.c new file mode 100644 index 0000000..8bf3ed7 --- /dev/null +++ b/src/json.c @@ -0,0 +1,21 @@ +#include "json.h" + +static void fill_item(HouseItem *item, char *key_buffer, char *value_buffer); +static void fill_buffer(FILE *fp, char *key_buffer, char *value_buffer); + +void json_read(const char *filepath, HouseItem *out) +{ + FILE *fp; + fp = fopen(filepath, "r"); + if (fp == NULL) { + perror("json_read() Error"); + exit(1); + } + + char c, key_buffer[1024], value_buffer[1024]; + size_t out_size = 0; + while ((c = fgetc(fp)) != EOF) { + switch (c) { + } + } +} -- cgit v1.2.3-70-g09d2