]> mj.ucw.cz Git - libucw.git/blobdiff - ucw-json/json.h
Released as 6.5.16.
[libucw.git] / ucw-json / json.h
index 799d88842642e1ac33f5e3d4fac42cd1337cf28c..369598b705f9ab255eaeed90c2c715aa8103559c 100644 (file)
@@ -191,8 +191,8 @@ static inline struct json_node *json_new_null(struct json_context *js UNUSED)
 static inline struct json_node *json_new_bool(struct json_context *js UNUSED, bool value)
 {
   static const struct json_node static_bool[2] = {
-    [0] = { .type = JSON_BOOLEAN, .boolean = 0 },
-    [1] = { .type = JSON_BOOLEAN, .boolean = 1 },
+    [0] = { .type = JSON_BOOLEAN, { .boolean = 0 } },
+    [1] = { .type = JSON_BOOLEAN, { .boolean = 1 } },
   };
   return (struct json_node *) &static_bool[value];
 }
@@ -215,7 +215,13 @@ bool json_number_to_s64(struct json_node *num, s64 *dest);
 /** Same as above, but for `u64`. **/
 bool json_number_to_u64(struct json_node *num, u64 *dest);
 
-/** Creates a new string value. The @value is kept only as a reference. **/
+/**
+ * Creates a new string value. The @value is kept only as a reference.
+ *
+ * String values can contain an arbitrary UTF-8 string with no null
+ * characters. However, it is not recommended to use UTF-8 values outside
+ * the range of UniCode codepoints (0 to 0x10ffff).
+ **/
 static inline struct json_node *json_new_string_ref(struct json_context *js, const char *value)
 {
   struct json_node *n = json_new_node(js, JSON_STRING);