Skip to content
Snippets Groups Projects
Verified Commit baef047b authored by Vladimír Čunát's avatar Vladimír Čunát Committed by Tomas Krizek
Browse files

contrib/ccan/json: KR_EXPORT all functions

parent f5697b2c
1 merge request!771meson build system
......@@ -24,6 +24,7 @@
#ifndef CCAN_JSON_H
#define CCAN_JSON_H
#include <lib/defines.h>
#include <stdbool.h>
#include <stddef.h>
......@@ -68,20 +69,20 @@ struct JsonNode
/*** Encoding, decoding, and validation ***/
JsonNode *json_decode (const char *json);
char *json_encode (const JsonNode *node);
char *json_encode_string (const char *str);
char *json_stringify (const JsonNode *node, const char *space);
void json_delete (JsonNode *node);
KR_EXPORT JsonNode *json_decode (const char *json);
KR_EXPORT char *json_encode (const JsonNode *node);
KR_EXPORT char *json_encode_string (const char *str);
KR_EXPORT char *json_stringify (const JsonNode *node, const char *space);
KR_EXPORT void json_delete (JsonNode *node);
bool json_validate (const char *json);
KR_EXPORT bool json_validate (const char *json);
/*** Lookup and traversal ***/
JsonNode *json_find_element (JsonNode *array, int index);
JsonNode *json_find_member (JsonNode *object, const char *key);
KR_EXPORT JsonNode *json_find_element (JsonNode *array, int index);
KR_EXPORT JsonNode *json_find_member (JsonNode *object, const char *key);
JsonNode *json_first_child (const JsonNode *node);
KR_EXPORT JsonNode *json_first_child (const JsonNode *node);
#define json_foreach(i, object_or_array) \
for ((i) = json_first_child(object_or_array); \
......@@ -90,19 +91,19 @@ JsonNode *json_first_child (const JsonNode *node);
/*** Construction and manipulation ***/
JsonNode *json_mknull(void);
JsonNode *json_mkbool(bool b);
JsonNode *json_mkstring(const char *s);
JsonNode *json_mknumber(double n);
JsonNode *json_mkarray(void);
JsonNode *json_mkobject(void);
KR_EXPORT JsonNode *json_mknull(void);
KR_EXPORT JsonNode *json_mkbool(bool b);
KR_EXPORT JsonNode *json_mkstring(const char *s);
KR_EXPORT JsonNode *json_mknumber(double n);
KR_EXPORT JsonNode *json_mkarray(void);
KR_EXPORT JsonNode *json_mkobject(void);
void json_append_element(JsonNode *array, JsonNode *element);
void json_prepend_element(JsonNode *array, JsonNode *element);
void json_append_member(JsonNode *object, const char *key, JsonNode *value);
void json_prepend_member(JsonNode *object, const char *key, JsonNode *value);
KR_EXPORT void json_append_element(JsonNode *array, JsonNode *element);
KR_EXPORT void json_prepend_element(JsonNode *array, JsonNode *element);
KR_EXPORT void json_append_member(JsonNode *object, const char *key, JsonNode *value);
KR_EXPORT void json_prepend_member(JsonNode *object, const char *key, JsonNode *value);
void json_remove_from_parent(JsonNode *node);
KR_EXPORT void json_remove_from_parent(JsonNode *node);
/*** Debugging ***/
......@@ -112,6 +113,6 @@ void json_remove_from_parent(JsonNode *node);
* If a problem is detected, return false, writing a description of the problem
* to errmsg (unless errmsg is NULL).
*/
bool json_check(const JsonNode *node, char errmsg[256]);
KR_EXPORT bool json_check(const JsonNode *node, char errmsg[256]);
#endif
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment