summaryrefslogtreecommitdiff
path: root/json-glib/json-builder.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'coverity-leak' into 'master'Emmanuele Bassi2022-10-111-3/+3
|\ | | | | | | | | builder: Don't leak memory if json_builder_get_root fails sanity check See merge request GNOME/json-glib!46
| * builder,parser: Use g_assert for sanity checksRay Strode2021-10-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity noticed a leak in json_builder_get_root that can't happen in practice. Namely, if internal state gets screwed up and runtime checks are enabled, json_builder_get_root may return NULL without freeing a copy of the builder root it just made. This is because of a g_return_val_if_fail call to bail early if an internal consistency sanity check fails. This commit addresses the coverity complaint by using g_assert instead of g_return_val_if_fail for this sanity check, and other similar sanity checks, in the code.
* | json-glib/json-builder.c:Farzin2022-02-151-1/+1
|/ | | | | | Delete an extra word Line: 55 Word: root
* Update JsonBuilder documentationEmmanuele Bassi2021-06-081-78/+114
| | | | Use gi-docgen links, and drop gtk-doc'isms.
* docs: Initial, rough port away from gtk-docEmmanuele Bassi2021-06-081-28/+33
| | | | | | | | | | Drop `SECTION` blurbs. Use gi-docgen syntax for internal links. Use summary lines for gi-docgen indices. Use Markdown syntax for code fragments.
* Annotate json_builder_new_immutable()Emmanuele Bassi2019-02-281-1/+1
| | | | | We shouldn't rely on g-ir-scanner doing pattern matching on the name of the function to determine if it's a constructor or not.
* introspection: fix nullable annotation for return values in the following ↵Alberto Ruiz2017-03-181-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | methods json_builder_add_boolean_value json_builder_add_double_value json_builder_add_int_value json_builder_add_null_value json_builder_add_string_value json_builder_add_value json_builder_begin_array json_builder_begin_object json_builder_end_array json_builder_end_object json_builder_get_root json_builder_set_member_name json_generator_get_root json_reader_get_error json_reader_get_member_name json_reader_get_value json_serializable_find_property json_serializable_find_property json_boxed_serialize
* docs: Fix the Since tagsEmmanuele Bassi2016-03-011-2/+2
| | | | The newly added API is available since 1.2.
* node: Add json_node_ref() and json_node_unref()Philip Withnall2016-03-011-2/+2
| | | | | | | | | | | | | | Add reference counting semantics to JsonNode, in addition to the existing init/unset and alloc/free semantics. json_node_free() must only be used with nodes allocated using json_node_alloc(). json_node_unref() may be used with all nodes (if correctly paired; it may be paired with json_node_alloc()). It is not valid to call json_node_free() on a node whose reference count is not 1. https://bugzilla.gnome.org/show_bug.cgi?id=756121
* core: Add immutability support to core objectsPhilip Withnall2016-03-011-0/+106
| | | | | | | | | | | Add an immutable mode to JsonNode, JsonObject, JsonArray and JsonValue. This is an optional mode which objects enter by calling json_*_seal(). It is a one-way transition, which means that we can build and manipulate objects as much as desired, before sealing them and enjoying the benefits of immutable objects: no need to take copies when handling them, persistent hash values (still to be implemented). https://bugzilla.gnome.org/show_bug.cgi?id=756121
* builder: Add missing (transfer) annotation to json_builder_add_value()Philip Withnall2015-01-251-1/+3
| | | | | | | Document and annotate the fact that json_builder_add_value() takes ownership of the JsonNode passed in to it. https://bugzilla.gnome.org/show_bug.cgi?id=743475
* Remove conditional inclusion of config.hEmmanuele Bassi2014-03-181-2/+0
| | | | All the platforms and build system we support have a config.h header.
* docs: Port to MarkDownEmmanuele Bassi2014-03-181-1/+1
| | | | | Drop the DocBook documentation, and move everything to the MarkDown format used by modern gtk-doc.
* Drop some more pointless GET_PRIVATE macrosEmmanuele Bassi2013-08-221-5/+3
| | | | We can use the autogenerated get_instance_private() function.
* Remove compile time GLib version checkEmmanuele Bassi2013-08-211-13/+1
| | | | | We depend on a new version of GLib, so we can remove a bunch of old version checks.
* Use new macros when compiling against new GLibEmmanuele Bassi2013-07-201-3/+12
| | | | | | | | If we're being compiled against a newer version of GLib, we should use the new macros that add instance private data. Since this is a stable branch, we cannot bump the GLib requirement; so we use version checks to conditionally compile the new code.
* builder: Conform to the coding styleEmmanuele Bassi2012-10-261-6/+14
| | | | Function arguments should be aligned on different lines.
* builder: Initialize state fieldsEmmanuele Bassi2011-05-281-0/+1
| | | | | | | If we're calling g_free() on a field we better make sure that it's either NULL or contains valid data. https://bugzilla.gnome.org/show_bug.cgi?id=651271
* docs: Add transfer none annotation to JsonBuilder return values.Luca Bruno2010-08-151-11/+11
|
* docs: Add JsonBuilder to the API referenceEmmanuele Bassi2010-06-161-1/+2
| | | | | And silence gtk-doc-scanner by removing an undefined argument from json_builder_add_null_value().
* builder: Add convenience API for building JSON trees.Luca Bruno2010-06-161-0/+682
https://bugzilla.gnome.org/show_bug.cgi?id=621141 Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>