/*
- * Copyright (c) 2009 Nicira Networks.
+ * Copyright (c) 2009, 2010, 2013 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "shash.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct ds;
+
/* Type of a JSON value. */
enum json_type {
JSON_NULL, /* null */
void json_array_add(struct json *, struct json *element);
void json_array_trim(struct json *);
struct json *json_array_create(struct json **, size_t n);
+struct json *json_array_create_1(struct json *);
struct json *json_array_create_2(struct json *, struct json *);
struct json *json_array_create_3(struct json *, struct json *, struct json *);
struct json *json_from_string(const char *string);
struct json *json_from_file(const char *file_name);
+struct json *json_from_stream(FILE *stream);
\f
/* Serializing JSON. */
JSSF_SORT = 1 << 1 /* Object members in sorted order, if true. */
};
char *json_to_string(const struct json *, int flags);
+void json_to_ds(const struct json *, int flags, struct ds *);
+
+size_t json_serialized_length(const struct json *);
+\f
+/* JSON string formatting operations. */
+
+bool json_string_unescape(const char *in, size_t in_len, char **outp);
+
+#ifdef __cplusplus
+}
+#endif
#endif /* json.h */