[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH V5 15/32] libxl_internal.h: introduce libxl__json_object_get_number



Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libxl/libxl_internal.h |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index b2966d9..97d6b24 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1704,6 +1704,14 @@ const char *libxl__json_object_get_string(const 
libxl__json_object *o)
         return NULL;
 }
 static inline
+const char *libxl__json_object_get_number(const libxl__json_object *o)
+{
+    if (libxl__json_object_is_number(o))
+        return o->u.string;
+    else
+        return NULL;
+}
+static inline
 flexarray_t *libxl__json_object_get_map(const libxl__json_object *o)
 {
     if (libxl__json_object_is_map(o))
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.