00001
00004 #ifndef RAZORBACK_JSON_BUFFER_H
00005 #define RAZORBACK_JSON_BUFFER_H
00006
00007 #include <razorback/visibility.h>
00008 #include <razorback/types.h>
00009 #include <razorback/messages.h>
00010 #include <razorback/ntlv.h>
00011
00012 #include <json/json.h>
00013
00014 #ifdef __cplusplus
00015 extern "C" {
00016 #endif
00017
00018 SO_PUBLIC extern bool JsonBuffer_Put_uint8_t (json_object * parent,
00019 const char *name, uint8_t p_iValue);
00020
00021 SO_PUBLIC extern bool JsonBuffer_Put_uint16_t (json_object * parent, const char * name, uint16_t p_iValue);
00022
00023 SO_PUBLIC extern bool JsonBuffer_Put_uint32_t (json_object * parent, const char * name, uint32_t p_iValue);
00024
00025 SO_PUBLIC extern bool JsonBuffer_Put_uint64_t (json_object * parent, const char * name, uint64_t p_iValue);
00026
00027 SO_PUBLIC extern bool JsonBuffer_Put_ByteArray (json_object * parent, const char *name,
00028 uint32_t p_iSize,
00029 const uint8_t * p_pByteArray);
00030
00031 SO_PUBLIC extern bool JsonBuffer_Put_String (json_object * parent, const char * name,
00032 const char * p_sString);
00033
00034 SO_PUBLIC extern bool JsonBuffer_Get_uint8_t (json_object * parent, const char * name, uint8_t * p_pValue);
00035
00036 SO_PUBLIC extern bool JsonBuffer_Get_uint16_t (json_object * parent, const char * name,
00037 uint16_t * p_pValue);
00038
00039 SO_PUBLIC extern bool JsonBuffer_Get_uint32_t (json_object * parent, const char *name,
00040 uint32_t * p_pValue);
00041
00042 SO_PUBLIC extern bool JsonBuffer_Get_uint64_t (json_object * parent, const char *name,
00043 uint64_t * p_pValue);
00044
00045 SO_PUBLIC extern char *JsonBuffer_Get_String (json_object * parent, const char * name);
00046
00047 SO_PUBLIC extern bool JsonBuffer_Get_ByteArray (json_object * parent, const char * name,
00048 uint32_t * p_iSize,
00049 uint8_t ** p_pByteArray);
00050
00051 SO_PUBLIC extern bool JsonBuffer_Get_UUID (json_object * parent, const char *name, uuid_t p_uuid);
00052 SO_PUBLIC extern bool JsonBuffer_Put_UUID (json_object * parent, const char * name, uuid_t p_uuid);
00053
00054 SO_PUBLIC extern bool JsonBuffer_Put_NTLVList (json_object * parent, const char * name,
00055 struct List *p_pList);
00056
00057 SO_PUBLIC extern bool JsonBuffer_Get_NTLVList (json_object * parent, const char * name,
00058 struct List **p_pList);
00059
00060 SO_PUBLIC extern bool JsonBuffer_Put_Hash (json_object * parent, const char * name,
00061 const struct Hash *p_pHash);
00062
00063 SO_PUBLIC extern bool JsonBuffer_Get_Hash (json_object * parent, const char *name, struct Hash **p_pHash);
00064
00065 SO_PUBLIC extern bool JsonBuffer_Put_BlockId (json_object * parent, const char *name,
00066 struct BlockId *p_pId);
00067
00068
00069 SO_PUBLIC extern bool JsonBuffer_Get_BlockId (json_object * parent, const char * name,
00070 struct BlockId **p_pId);
00071
00072 SO_PUBLIC extern bool JsonBuffer_Put_Block (json_object * parent, const char * name,
00073 struct Block *p_pBlock);
00074
00075 SO_PUBLIC extern bool JsonBuffer_Get_Block (json_object * parent, const char * name,
00076 struct Block **p_pBlock);
00077
00078 SO_PUBLIC extern bool JsonBuffer_Put_Event (json_object * parent, const char * name,
00079 struct Event *p_pEvent);
00080
00081 SO_PUBLIC extern bool JsonBuffer_Get_Event (json_object * parent, const char * name,
00082 struct Event **p_pEvent);
00083
00084
00085 SO_PUBLIC extern bool JsonBuffer_Put_EventId (json_object * parent, const char * name,
00086 struct EventId *p_pEventId);
00087
00088 SO_PUBLIC extern bool JsonBuffer_Get_EventId (json_object * parent, const char * name,
00089 struct EventId **p_pEventId);
00090
00091 SO_PUBLIC extern bool JsonBuffer_Put_Judgment (json_object * parent, const char * name,
00092 struct Judgment *p_pJudgment);
00093
00094 SO_PUBLIC extern bool JsonBuffer_Get_Judgment (json_object * parent, const char * name,
00095 struct Judgment **p_pJudgment);
00096
00097 SO_PUBLIC extern bool JsonBuffer_Put_Nugget (json_object * parent, const char * name,
00098 struct Nugget * nugget);
00099
00100 SO_PUBLIC extern bool JsonBuffer_Get_Nugget (json_object * parent, const char * name,
00101 struct Nugget ** r_nugget);
00102
00103 SO_PUBLIC extern bool JsonBuffer_Put_UUIDList (json_object * parent, const char * name,
00104 struct List * list);
00105 SO_PUBLIC extern bool JsonBuffer_Get_UUIDList (json_object * parent, const char * name,
00106 struct List ** r_list);
00107
00108 SO_PUBLIC extern bool JsonBuffer_Put_StringList (json_object * parent, const char * name,
00109 struct List * list);
00110 SO_PUBLIC extern bool JsonBuffer_Get_StringList (json_object * parent, const char * name,
00111 struct List ** r_list);
00112 SO_PUBLIC extern bool
00113 JsonBuffer_Put_uint8List (json_object * parent, const char * name,
00114 uint8_t *list, uint32_t count);
00115 SO_PUBLIC extern bool
00116 JsonBuffer_Get_uint8List (json_object * parent, const char * name,
00117 uint8_t **list, uint32_t *count);
00118 #ifdef __cplusplus
00119 }
00120 #endif
00121 #endif //RAZORBACK_JSON_BUFFER_H