diff options
author | horchi <vdr@jwendel.de> | 2017-03-05 16:39:28 +0100 |
---|---|---|
committer | horchi <vdr@jwendel.de> | 2017-03-05 16:39:28 +0100 |
commit | e2a48d8701f91b8e24fbe9e99e91eb72a87bb749 (patch) | |
tree | 726f70554b4ca985a09ef6e30a7fdc8df089993c /lib/json.h | |
download | vdr-epg-daemon-e2a48d8701f91b8e24fbe9e99e91eb72a87bb749.tar.gz vdr-epg-daemon-e2a48d8701f91b8e24fbe9e99e91eb72a87bb749.tar.bz2 |
git init1.1.103
Diffstat (limited to 'lib/json.h')
-rw-r--r-- | lib/json.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/json.h b/lib/json.h new file mode 100644 index 0000000..dd66a93 --- /dev/null +++ b/lib/json.h @@ -0,0 +1,36 @@ +/* + * json.h + * + * See the README file for copyright information and how to reach the author. + * + */ + +#ifndef __JSON_H +#define __JSON_H + +//*************************************************************************** +// Include +//*************************************************************************** + +#ifdef USEJSON + +#include <jansson.h> + +#include "db.h" + +//*************************************************************************** +// JSON Helper Functions +//*************************************************************************** + +int json2Data(json_t* obj, MemoryStruct* data, const char* encoding = 0); + +int addFieldToJson(json_t* obj, cDbTable* table, const char* fname, int ignoreEmpty = yes, const char* extName = 0); +int addFieldToJson(json_t* obj, cDbValue* value, int ignoreEmpty = yes, const char* extName = 0); +int getFieldFromJson(json_t* obj, cDbRow* row, const char* fname, const char* extName = 0); + +const char* getStringFromJson(json_t* obj, const char* name, const char* def = 0); +int getIntFromJson(json_t* obj, const char* name, int def = na); + +#endif // USEJSON + +#endif // __JSON_H |