1234567891011121314151617181920212223242526272829303132333435363738 |
- /*
- * File: json.h
- * Author: Arthur Brandao
- *
- * Created on 28 octobre 2018, 17:53
- */
- #ifndef JSON_H
- #define JSON_H
- /* --- Include --- */
- #include <string.h>
- #include "boolean.h"
- /* --- Constante --- */
- #define JSON_ERROR -1
- #define JSON_OK 0
- #define JSON_STRING 1
- #define JSON_NUMBER 2
- #define JSON_BOOLEAN 3
- #define JSON_ARRAY 4
- #define JSON_OBJECT 5
- /* --- Structure --- */
- typedef struct{
- char* str; //La chaine de carac json
- char** key; //La position des clef dans la chaine
- char** val; //La position de la valeur
- int* key_length; //La taille des clefs
- int* val_length; //La taille des valeurs
- int* type; //Le type des valeurs
- }JsonParser;
- /* --- fonctions ---- */
- int json_parse(JsonParser*, char*);
- void clean_json_parser(JsonParser*);
- #endif /* JSON_H */
|