mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
libxl_internal.h: introduce libxl__json_object_is_{null, number, double}
... which return true if json object is valid and of type
JSON_{NULL,NUMBER,DOUBLE}.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
1 parent
f68570ac77
commit
7dd6000671
1 file changed
+12
@@ -1647,6 +1647,10 @@ typedef struct {
|
||||
|
||||
typedef struct libxl__yajl_ctx libxl__yajl_ctx;
|
||||
|
||||
static inline bool libxl__json_object_is_null(const libxl__json_object *o)
|
||||
{
|
||||
return o != NULL && o->type == JSON_NULL;
|
||||
}
|
||||
static inline bool libxl__json_object_is_bool(const libxl__json_object *o)
|
||||
{
|
||||
return o != NULL && o->type == JSON_BOOL;
|
||||
@@ -1659,6 +1663,14 @@ static inline bool libxl__json_object_is_integer(const libxl__json_object *o)
|
||||
{
|
||||
return o != NULL && o->type == JSON_INTEGER;
|
||||
}
|
||||
static inline bool libxl__json_object_is_double(const libxl__json_object *o)
|
||||
{
|
||||
return o != NULL && o->type == JSON_DOUBLE;
|
||||
}
|
||||
static inline bool libxl__json_object_is_number(const libxl__json_object *o)
|
||||
{
|
||||
return o != NULL && o->type == JSON_NUMBER;
|
||||
}
|
||||
static inline bool libxl__json_object_is_map(const libxl__json_object *o)
|
||||
{
|
||||
return o != NULL && o->type == JSON_MAP;
|
||||
|
||||