Separate source and header files

This commit is contained in:
Eric Fischer
2014-02-05 21:27:48 -08:00
parent 281b98e3d8
commit 7983c66add
3 changed files with 118 additions and 103 deletions
+33
View File
@@ -0,0 +1,33 @@
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdarg.h>
typedef enum json_type {
JSON_STRING, JSON_NUMBER, JSON_ARRAY, JSON_HASH, JSON_NULL, JSON_TRUE, JSON_FALSE,
} json_type;
typedef struct json_array {
struct json_object *object;
struct json_array *next;
} json_array;
typedef struct json_hash {
struct json_object *key;
struct json_object *value;
struct json_hash *next;
} json_hash;
typedef struct json_object {
json_type type;
struct json_object *parent;
char *string;
double number;
json_array *array;
json_hash *hash;
} json_object;
json_object *json_parse(FILE *f, json_object *current);
json_object *json_hash_get(json_object *o, char *s);