planarbot/json.h

26 lines
438 B
C
Raw Normal View History

#ifndef JSON_HEADER
#define JSON_HEADER
2022-11-08 23:31:00 +01:00
#include <stdio.h>
#include "sortedmap.h"
#include "arraylist.h"
2022-11-08 23:31:00 +01:00
2022-11-04 08:21:05 +01:00
enum jsontype { NIL, BOOLEAN, STRING, NUMBER, LIST, MAP };
typedef struct json {
enum jsontype type;
union {
int boolean;
char * string;
double number;
ArrayList * list;
SortedMap * map;
} value;
} Json;
Json * json_parse(FILE *stream);
void json_print(Json *this, FILE *stream);
void json_free(Json *this);
#endif