Supports field width to add "0x" prepended and zero padded hexadecimal.
obj_add_uint_02x() also changed to use the function as field width 2.
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
obj_add_str(o, k, str);
}
-static void obj_add_uint_02x(struct json_object *o, const char *k, __u32 v)
+static void obj_add_uint_0nx(struct json_object *o, const char *k, __u32 v, int width)
{
char str[STR_LEN];
obj_add_str(o, k, str);
}
+static void obj_add_uint_02x(struct json_object *o, const char *k, __u32 v)
+{
+ obj_add_uint_0nx(o, k, v, 2);
+}
+
static void obj_add_uint_nx(struct json_object *o, const char *k, __u32 v)
{
char str[STR_LEN];