diff options
author | Emmanuele Bassi <ebassi@openedhand.com> | 2007-10-01 18:01:20 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@openedhand.com> | 2007-10-01 18:01:20 +0100 |
commit | 228a5e4efe65995778847f48d2be43f3df988e10 (patch) | |
tree | 165f8b1dd7f0fabb926018b7d849324b938c23b2 | |
parent | bfa60e9ef9da71e3c0d171f81cd08e8eac749061 (diff) | |
download | json-glib-228a5e4efe65995778847f48d2be43f3df988e10.tar.gz |
Move data types ctors and setters into the public headers
Now that we are providing a generator class we need to provide the
constructors and setters for JsonNode, JsonObject and JsonArray. This
also means that the json-private.h header is now useless, so we can
remove it from the build and repository.
-rw-r--r-- | json-glib/Makefile.am | 2 | ||||
-rw-r--r-- | json-glib/json-array.c | 1 | ||||
-rw-r--r-- | json-glib/json-generator.c | 1 | ||||
-rw-r--r-- | json-glib/json-node.c | 1 | ||||
-rw-r--r-- | json-glib/json-object.c | 1 | ||||
-rw-r--r-- | json-glib/json-parser.c | 1 | ||||
-rw-r--r-- | json-glib/json-private.h | 35 | ||||
-rw-r--r-- | json-glib/json-types.h | 38 |
8 files changed, 32 insertions, 48 deletions
diff --git a/json-glib/Makefile.am b/json-glib/Makefile.am index 3712171..26a7623 100644 --- a/json-glib/Makefile.am +++ b/json-glib/Makefile.am @@ -43,7 +43,7 @@ source_h = \ $(srcdir)/json-version.h \ $(NULL) -source_h_private = json-private.h +source_h_private = source_c = \ json-array.c \ diff --git a/json-glib/json-array.c b/json-glib/json-array.c index 7d0973f..3de3244 100644 --- a/json-glib/json-array.c +++ b/json-glib/json-array.c @@ -20,7 +20,6 @@ #include "config.h" #include "json-types.h" -#include "json-private.h" /** * SECTION:json-array diff --git a/json-glib/json-generator.c b/json-glib/json-generator.c index 798e6c1..7bc2b76 100644 --- a/json-glib/json-generator.c +++ b/json-glib/json-generator.c @@ -32,7 +32,6 @@ #include "json-marshal.h" #include "json-generator.h" -#include "json-private.h" #define JSON_GENERATOR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), JSON_TYPE_GENERATOR, JsonGeneratorPrivate)) diff --git a/json-glib/json-node.c b/json-glib/json-node.c index 8be735e..0cf1b83 100644 --- a/json-glib/json-node.c +++ b/json-glib/json-node.c @@ -22,7 +22,6 @@ #include <glib.h> #include "json-types.h" -#include "json-private.h" /** * SECTION:json-node diff --git a/json-glib/json-object.c b/json-glib/json-object.c index df2591a..7423917 100644 --- a/json-glib/json-object.c +++ b/json-glib/json-object.c @@ -22,7 +22,6 @@ #include <glib.h> #include "json-types.h" -#include "json-private.h" /** * SECTION:json-object diff --git a/json-glib/json-parser.c b/json-glib/json-parser.c index 2a4aab6..1e2db17 100644 --- a/json-glib/json-parser.c +++ b/json-glib/json-parser.c @@ -31,7 +31,6 @@ #include "json-marshal.h" #include "json-parser.h" -#include "json-private.h" GQuark json_parser_error_quark (void) diff --git a/json-glib/json-private.h b/json-glib/json-private.h deleted file mode 100644 index 44f5e37..0000000 --- a/json-glib/json-private.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __JSON_PRIVATE_H__ -#define __JSON_PRIVATE_H__ - -#include <glib-object.h> -#include "json-types.h" - -G_BEGIN_DECLS - -JsonNode * json_node_new (JsonNodeType type); -JsonNode * json_node_copy (JsonNode *node); -void json_node_set_object (JsonNode *node, - JsonObject *object); -void json_node_take_object (JsonNode *node, - JsonObject *object); -void json_node_set_array (JsonNode *node, - JsonArray *array); -void json_node_take_array (JsonNode *node, - JsonArray *array); -void json_node_set_value (JsonNode *node, - const GValue *value); -void json_node_free (JsonNode *node); - -JsonObject * json_object_new (void); -void json_object_add_member (JsonObject *object, - const gchar *member_name, - JsonNode *node); - -JsonArray * json_array_new (void); -JsonArray * json_array_sized_new (guint n_elements); -void json_array_add_element (JsonArray *array, - JsonNode *node); - -G_END_DECLS - -#endif /* __JSON_PRIVATE_H__ */ diff --git a/json-glib/json-types.h b/json-glib/json-types.h index 4663967..b92c709 100644 --- a/json-glib/json-types.h +++ b/json-glib/json-types.h @@ -89,15 +89,35 @@ struct _JsonNode JsonNode *parent; }; -JsonObject * json_node_get_object (JsonNode *node); -JsonArray * json_node_get_array (JsonNode *node); -void json_node_get_value (JsonNode *node, - GValue *value); -JsonNode * json_node_get_parent (JsonNode *node); -G_CONST_RETURN gchar *json_node_type_name (JsonNode *node); - +JsonNode * json_node_new (JsonNodeType type); +JsonNode * json_node_copy (JsonNode *node); +void json_node_free (JsonNode *node); + +void json_node_set_object (JsonNode *node, + JsonObject *object); +void json_node_take_object (JsonNode *node, + JsonObject *object); +JsonObject * json_node_get_object (JsonNode *node); +JsonObject * json_node_dup_object (JsonNode *node); +void json_node_set_array (JsonNode *node, + JsonArray *array); +void json_node_take_array (JsonNode *node, + JsonArray *array); +JsonArray * json_node_get_array (JsonNode *node); +JsonArray * json_node_dup_array (JsonNode *node); +void json_node_set_value (JsonNode *node, + const GValue *value); +void json_node_get_value (JsonNode *node, + GValue *value); +JsonNode * json_node_get_parent (JsonNode *node); +G_CONST_RETURN gchar *json_node_type_name (JsonNode *node); + +JsonObject * json_object_new (void); JsonObject * json_object_ref (JsonObject *object); void json_object_unref (JsonObject *object); +void json_object_add_member (JsonObject *object, + const gchar *member_name, + JsonNode *node); GList * json_object_get_members (JsonObject *object); JsonNode * json_object_get_member (JsonObject *object, const gchar *member_name); @@ -105,8 +125,12 @@ gboolean json_object_has_member (JsonObject *object, const gchar *member_name); guint json_object_get_size (JsonObject *object); +JsonArray * json_array_new (void); +JsonArray * json_array_sized_new (guint n_elements); JsonArray * json_array_ref (JsonArray *array); void json_array_unref (JsonArray *array); +void json_array_add_element (JsonArray *array, + JsonNode *node); GList * json_array_get_elements (JsonArray *array); JsonNode * json_array_get_element (JsonArray *array, guint index_); |