MACSio  0.9
Multi-purpose, Application-Centric, Scalable I/O Proxy App
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
test_locale.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <stddef.h>
4 #include <string.h>
5 #include <assert.h>
6 
7 #include "config.h"
8 #include "json.h"
9 #include "json_tokener.h"
10 
11 #ifdef HAVE_LOCALE_H
12 #include <locale.h>
13 #endif /* HAVE_LOCALE_H */
14 
15 int main(int argc, char **argv)
16 {
17  json_object *new_obj;
18 #ifdef HAVE_SETLOCALE
19  setlocale(LC_NUMERIC, "de_DE");
20 #else
21  printf("No locale\n");
22 #endif
23 
24  MC_SET_DEBUG(1);
25 
26  new_obj = json_tokener_parse("[1.2,3.4,123456.78,5.0,2.3e10]");
27  printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
28  printf("new_obj.to_string()=%s\n", json_object_to_json_string_ext(new_obj,JSON_C_TO_STRING_NOZERO));
29  json_object_put(new_obj);
30 }
31 
#define MC_SET_DEBUG(x)
Definition: debug.h:60
int main(int argc, char **argv)
Definition: test_locale.c:15
#define JSON_C_TO_STRING_NOZERO
Definition: json_object.h:59
int json_object_put(struct json_object *obj)
Definition: json_object.c:155
const char * json_object_to_json_string_ext(struct json_object *obj, int flags)
Definition: json_object.c:277
const char * json_object_to_json_string(struct json_object *obj)
Definition: json_object.c:295
struct json_object * json_tokener_parse(const char *str)
Definition: json_tokener.c:158