Refactor
Move json_value and obj_t to same file - Rename json_obj.* -> json_value.* - Move `print_json_value(...)` to json_value.* Move `err_ctx(...)` to util.* parse.h now only exposes `parse_json_value(...)`
This commit is contained in:
@@ -2,31 +2,10 @@
|
||||
#ifndef _PARSE_H
|
||||
#define _PARSE_H
|
||||
|
||||
#include "json_obj.h"
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include "json_value.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;
|
||||
double number;
|
||||
};
|
||||
};
|
||||
#include <stdio.h> // FILE*
|
||||
|
||||
struct json_value parse_json_value(FILE* fp);
|
||||
|
||||
void print_json(struct json_value val, int indent);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user