From 794664746dcbe8894255f9615357dd51f7f836c3 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 6 Mar 2014 14:35:49 +0000 Subject: Use compiler annotations to determine symbol visibility Instead of relying on a separate file that requires being update every time we add a new public function we should use compiler annotations to let the linker know which symbols are public and exported. In order to achieve this we have to: * check for the visibility=hidden attribute * add -fvisibility=hidden to the linker flags * add a macro to annotate all public symbols While we're at it, we should copy the versioned symbols macro layout already used by GLib, GTK+, and other G* libraries, including the ability to express the range of allowed versions of JSON-GLib that third party code can compile against. --- json-glib/json-parser.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'json-glib/json-parser.h') diff --git a/json-glib/json-parser.h b/json-glib/json-parser.h index 9988915..8666548 100644 --- a/json-glib/json-parser.h +++ b/json-glib/json-parser.h @@ -28,7 +28,6 @@ #error "Only can be included directly." #endif -#include #include #include @@ -141,34 +140,46 @@ struct _JsonParserClass void (* _json_reserved8) (void); }; +JSON_AVAILABLE_IN_1_0 GQuark json_parser_error_quark (void); +JSON_AVAILABLE_IN_1_0 GType json_parser_get_type (void) G_GNUC_CONST; +JSON_AVAILABLE_IN_1_0 JsonParser *json_parser_new (void); +JSON_AVAILABLE_IN_1_0 gboolean json_parser_load_from_file (JsonParser *parser, const gchar *filename, GError **error); +JSON_AVAILABLE_IN_1_0 gboolean json_parser_load_from_data (JsonParser *parser, const gchar *data, gssize length, GError **error); +JSON_AVAILABLE_IN_1_0 gboolean json_parser_load_from_stream (JsonParser *parser, GInputStream *stream, GCancellable *cancellable, GError **error); +JSON_AVAILABLE_IN_1_0 void json_parser_load_from_stream_async (JsonParser *parser, GInputStream *stream, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +JSON_AVAILABLE_IN_1_0 gboolean json_parser_load_from_stream_finish (JsonParser *parser, GAsyncResult *result, GError **error); +JSON_AVAILABLE_IN_1_0 JsonNode * json_parser_get_root (JsonParser *parser); +JSON_AVAILABLE_IN_1_0 guint json_parser_get_current_line (JsonParser *parser); +JSON_AVAILABLE_IN_1_0 guint json_parser_get_current_pos (JsonParser *parser); +JSON_AVAILABLE_IN_1_0 gboolean json_parser_has_assignment (JsonParser *parser, gchar **variable_name); -- cgit v1.2.1