1 /* Copyright (C) 2016 by Rainer Gerhards 2 * Released under ASL 2.0 */ 3 #include "config.h" 4 #include "json_object.h" 5 #include "json_tokener.h" 6 #include <stdio.h> 7 int main(void) 8 { 9 json_object *json; 10 11 json = json_object_new_double(1.0); 12 printf("json = %s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); 13 json_object_put(json); 14 15 json = json_object_new_double(-1.0); 16 printf("json = %s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); 17 json_object_put(json); 18 json = json_object_new_double(1.23); 19 printf("json = %s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); 20 json_object_put(json); 21 json = json_object_new_double(123456789.0); 22 printf("json = %s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); 23 json_object_put(json); 24 json = json_object_new_double(123456789.123); 25 printf("json = %s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); 26 json_object_put(json); 27 return 0; 28 } 29
This page was automatically generated by LXR 0.3.1. • OpenWrt