Initial commit

This commit is contained in:
olemorud
2023-04-24 17:13:47 +02:00
commit 4ce1c34838
12 changed files with 653 additions and 0 deletions

32
include/parse.h Normal file
View File

@@ -0,0 +1,32 @@
#ifndef _PARSE_H
#define _PARSE_H
#include "json_obj.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
enum json_type { object,
array,
string,
number,
boolean,
null };
struct json_value {
enum json_type type;
union {
obj_t* object;
struct json_value** array;
char* string;
bool boolean;
int64_t number;
};
};
struct json_value parse_json_value(FILE* fp);
void print_json(struct json_value val, int indent);
#endif