| Remi Collet | a01b659 | 2012-12-13 09:47:33 +0100 | [diff] [blame] | 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 | |
| Remi Collet | 32d149c | 2012-12-13 11:46:04 +0100 | [diff] [blame] | 26 | new_obj = json_tokener_parse("[1.2,3.4,123456.78,5.0,2.3e10]"); |
| Remi Collet | a01b659 | 2012-12-13 09:47:33 +0100 | [diff] [blame] | 27 | printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj)); |
| Remi Collet | 32d149c | 2012-12-13 11:46:04 +0100 | [diff] [blame] | 28 | printf("new_obj.to_string()=%s\n", json_object_to_json_string_ext(new_obj,JSON_C_TO_STRING_NOZERO)); |
| Remi Collet | a01b659 | 2012-12-13 09:47:33 +0100 | [diff] [blame] | 29 | json_object_put(new_obj); |
| 30 | } |
| 31 | |