X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=json.h;h=d7017e0662ce499c8e01e79a761128fe006382f4;hp=2a798ceb4b06d4fc41203096fbb3eb9f4f9749b2;hb=fb9bc6e3ddba81b9455870bbe00e4c60352067a8;hpb=952b05e00103bf45576e1860cde0626bd42ed52a diff --git a/json.h b/json.h index 2a798ceb..d7017e06 100644 --- a/json.h +++ b/json.h @@ -1,5 +1,8 @@ #ifndef __JSON__H #define __JSON__H + +#include "lib/output_buffer.h" + struct json_object; struct json_array; struct json_pair; @@ -14,7 +17,7 @@ struct json_pair; struct json_value { int type; union { - long integer_number; + long long integer_number; double float_number; char *string; struct json_object *object; @@ -52,7 +55,7 @@ void json_free_object(struct json_object *obj); int json_object_add_value_type(struct json_object *obj, const char *name, int type, ...); #define json_object_add_value_int(obj, name, val) \ - json_object_add_value_type((obj), name, JSON_TYPE_INTEGER, (val)) + json_object_add_value_type((obj), name, JSON_TYPE_INTEGER, (long long) (val)) #define json_object_add_value_float(obj, name, val) \ json_object_add_value_type((obj), name, JSON_TYPE_FLOAT, (val)) #define json_object_add_value_string(obj, name, val) \ @@ -76,5 +79,5 @@ int json_array_add_value_type(struct json_array *array, int type, ...); #define json_array_last_value_object(obj) \ (obj->values[obj->value_cnt - 1]->object) -void json_print_object(struct json_object *obj); +void json_print_object(struct json_object *obj, struct buf_output *out); #endif