123456789101112131415161718192021222324252627 |
- #ifndef _PX_JSON_H_
- #define _PX_JSON_H_
- #include <stdio.h>
- #include <sys/file.h>
- #include "cJSON.h"
- typedef struct JSONFILE
- {
- FILE *fd;
- cJSON *body_json;
- }JSONFILE_S;
- JSONFILE_S *JsonFileOpen(char *path,char *file);
- void JsonFileSet(JSONFILE_S * jf,cJSON *obj,char *name, ...);
- void JsonFileClose(JSONFILE_S * jf);
- #define JsonFileWrite(path,file,obj,name...) \
- do{\
- JSONFILE_S *jf=JsonFileOpen(path,file);\
- JsonFileSet(jf,obj,##name);\
- JsonFileClose(jf);\
- }while(0);
- char* JsonGetStr(cJSON* json,char *name);
- void JsonFillStrArry(cJSON* json,char *name,char ***value);
- #endif
|