summaryrefslogtreecommitdiff
path: root/json-glib
Commit message (Collapse)AuthorAgeFilesLines
...
* core: Optimize json_from_string() to avoid copyOle André Vadla Ravnås2017-03-181-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=774688
* Add version macros for 1.4Emmanuele Bassi2017-03-181-0/+16
|
* Drop Autotools build systemEmmanuele Bassi2017-03-183-229/+0
| | | | We use Meson to build JSON-GLib, now.
* Use Unicode in translatable stringsPiotr Drąg2017-03-186-27/+27
| | | | | | See https://developer.gnome.org/hig/stable/typography.html https://bugzilla.gnome.org/show_bug.cgi?id=772753
* doc: Use 'plain' language for JSON snippetsEmmanuele Bassi2017-03-181-3/+4
|
* build: Really require the same pkg-config modulesEmmanuele Bassi2017-03-131-1/+1
|
* build: Require the same modules for Meson and AutotoolsEmmanuele Bassi2017-03-132-2/+2
| | | | We depend on gio-2.0, which strings along glib-2.0 and gobject-2.0.
* Fix the generated pkg-config file with MesonEmmanuele Bassi2017-03-131-1/+1
| | | | We need to specify the sub-directory for the inclusion directive.
* build: Add missing argument to the introspection scannerEmmanuele Bassi2017-03-131-10/+16
| | | | | | The autotools build specifies the include header with the --c-include argument for g-ir-scanner, so we need to do the same when building with Meson.
* Ensure that introspection scans all the headersEmmanuele Bassi2017-03-131-6/+6
| | | | | We have a couple of generated header files, which means we need to list them as sources for the introspection scanner.
* build: Reduce the internal dependenciesEmmanuele Bassi2017-03-131-8/+10
| | | | | | | We don't need to make internal targets depend on generated sources, just on the generated header files. Depending on the generated sources will cause Meson to compile the generated sources once for each internal target.
* Add missing header in the Meson file listingEmmanuele Bassi2017-03-131-0/+1
| | | | The single include 'json-glib.h' header is missing.
* Remove dependency on json-version.hEmmanuele Bassi2017-03-131-11/+11
| | | | The file is generated at configuration time.
* Install testsEmmanuele Bassi2017-03-132-1/+41
| | | | | | We should install our tests in order to get them executed in environments like GNOME Continuous and other continuous delivery systems.
* build: install toolsIgor Gnatenko2017-03-131-1/+1
| | | | Signed-off-by: Igor Gnatenko <ignatenko@src.gnome.org>
* Add various compiler and linker flags to the Meson buildEmmanuele Bassi2017-03-131-3/+16
| | | | | | | We want more warnings to be printed out when build json-glib. We also want to take advantage of linker flags like z,relro and z,now, as well as -Bsymbolic-functions.
* Annotate internal set_error() wrapperEmmanuele Bassi2017-03-131-0/+1
| | | | | | | We need to tell the compiler that the 3rd argument is a format-like string, and that the arguments for that come in the variadic arguments list; this allows compilers like GCC to do validation on the format string itself, and avoid a whole class of bugs.
* Build API reference with MesonEmmanuele Bassi2017-03-131-1/+1
| | | | | | We can use the gnome module to generate the JSON-GLib API reference. https://bugzilla.gnome.org/show_bug.cgi?id=773603
* Update the Meson buildEmmanuele Bassi2017-03-132-65/+70
| | | | | | Clean up the coding style, and make it a bit more idiomatic. https://bugzilla.gnome.org/show_bug.cgi?id=773603
* meson: Add support for building with the meson build systemThibault Saunier2017-03-133-0/+150
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=773603
* Quell a compiler warningEmmanuele Bassi2017-03-131-1/+1
| | | | Original patch by: Thibault Saunier <tsaunier@gnome.org>
* Don't loose decimal in whole-double -> string conversiondjcb2017-03-133-2/+29
| | | | | | | | | | | | | When converting json to its string representation, whole-doubles (such as 1.0) would be converted into strings without decimals ("1"). That can be inconvenient e.g. when converting from/to GVariants. To avoid this, append '.0' to the string representation for doubles if they lost their decimals in the conversion. Also add / update unit tests for this. https://bugzilla.gnome.org/show_bug.cgi?id=753763
* json-glib: Remove unused symbolsThibault Saunier2017-03-131-19/+0
| | | | | | Or compilation fails with -Werror https://bugzilla.gnome.org/show_bug.cgi?id=773604
* Stop providing our own marshaller and use the generic oneThibault Saunier2017-03-134-31/+11
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=773603
* Only seal arrays and objects when a parser is immutableEmmanuele Bassi2017-03-131-2/+4
| | | | | | | We seal nodes conditionally on the :immutable property, but we are sealing their contents unconditionally. https://bugzilla.gnome.org/show_bug.cgi?id=779970
* Allow empty string as object member nameDr. David Alan Gilbert2017-03-116-6/+17
| | | | | | | | | | | Commit 028e540 disallowed empty member names in objects, however they are unfortunately valid JSON. This patch reenables an empty string as a member name. Tests are updated to allow the empty string case, and to test the use of an empty string in generation, iteration etc. https://bugzilla.gnome.org/show_bug.cgi?id=747279
* Add autoptr clean up definition for JsonSerializableEmmanuele Bassi2017-03-111-0/+4
| | | | | This way developers can use G_DECLARE_INTERFACE with Serializable as a pre-condition.
* json-node: Clarify documentation on JsonNode getters for other typesPhilip Withnall2017-03-021-19/+38
| | | | | | | | | | | | | | Clarify in the documentation what each of the JsonNode getters when called on a node which contains a value whose type is not what the caller expects (since this behaviour is well-defined in the code). Add relevant (nullable) annotations too. Inspired by http://stackoverflow.com/q/42081921/2931197. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=779464
* Fix translator commentsPiotr Drąg2017-01-284-7/+7
| | | | They need to be exactly one line above a string to show up in .po files.
* MSVC builds: Improve introspection builds on MSVCChun-wei Fan2016-04-221-2/+24
| | | | | | | This changes the introspection build process on MSVC by moving the source/header list generation from using a Python script to generating the list (and the full command lines for g-ir-scanner and g-ir-compiler) using the common autotools module, to make it more easily maintained.
* build: Clean up MSVC-related items in autotools build filesChun-wei Fan2016-04-221-36/+15
| | | | | | | | | This makes use of the common build/Makefile.msvcproj to create the full Visual Studio 2008/2010 project files from their respective templates, while making the autotools files cleaner. As an added benefit, this also enables the list of headers to "install" to be filled in automatically during 'make dist', so that we will have to worry less about the addition or removal of public headers.
* json-types.h: Add missing JSON_AVAILABLE_IN_1_2Chun-wei Fan2016-04-191-0/+1
| | | | | The json_node_is_immutable() missed an JSON_AVAILABLE_IN_1_2, causing it not to be exported. Fix this.
* node: Turn a g_debug() call into a JSON_NOTEEmmanuele Bassi2016-03-221-1/+8
| | | | | This allows conditional compilation, and it makes the debugging code consistent.
* debug: Add flag for debugging nodesEmmanuele Bassi2016-03-222-2/+4
|
* fixup! docs: Fix the Since tagsEmmanuele Bassi2016-03-011-1/+1
|
* parser: Rename `immutable` bit fieldEmmanuele Bassi2016-03-011-9/+9
|
* docs: Fix the Since tagsEmmanuele Bassi2016-03-016-25/+25
| | | | The newly added API is available since 1.2.
* core: Add JSON node, object, array hashesPhilip Withnall2016-03-017-14/+519
| | | | | | | | | | | | | | | | | | | Now that these objects can be marked as immutable, it is possible to calculate and cache hash values for each of them. This allows efficient hash-based deduplication of large numbers of JSON nodes, as needed by Walbottle for JSON test vector generation. To complement the new hash functions, each of JsonNode, JsonValue, JsonObject and JsonArray also now have an equal() comparison method. This compares them structurally and recursively, using the definition of equality from the JSON Schema specification, which seems as good as any other. http://json-schema.org/latest/json-schema-core.html#anchor9 https://bugzilla.gnome.org/show_bug.cgi?id=756121 Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
* node: Add json_node_ref() and json_node_unref()Philip Withnall2016-03-0112-64/+139
| | | | | | | | | | | | | | 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-0111-5/+802
| | | | | | | | | | | 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
* format: Silence a compiler warningEmmanuele Bassi2016-02-291-1/+2
|
* Add autoptr macrosEmmanuele Bassi2016-02-296-0/+26
| | | | | | | GLib can take advantage of the "cleanup" attribute by using a bunch of macro magic. This has been slowly been used across various libraries in the G* stack, so JSON-GLib should provide symbols for the automatic memory management of its types.
* parser: Detect missing commas in arraysEmmanuele Bassi2016-02-252-1/+45
| | | | | Just like we detect trailing commas, we should also detect missing ones to avoid parsing invalid JSON successfully.
* parser: Correctly increment the array index counterEmmanuele Bassi2016-02-251-1/+2
| | | | | We pass the counter to the JsonParser::array-element signal, but we never really increment it.
* core: Remove atomic operations for reference countingPhilip Withnall2016-01-283-6/+6
| | | | They are not needed — json-glib is not at all thread safe.
* array: Ensure JsonArray is zero-initialisedPhilip Withnall2016-01-281-2/+2
|
* Fix code returning FALSE when it should be NULLRobert Ancell2015-11-241-1/+1
|
* types: Tweak dummy padding in JsonObjectIterPhilip Withnall2015-11-061-2/+4
| | | | | | | | | Use padding which resembles the ABI structure of GHashTableIter so that our struct size is the same as GHashTableIter on all platforms, rather than just on x86_64. This fixes the static assertion failure on i386 and armhf. https://bugzilla.gnome.org/show_bug.cgi?id=757675
* object: Add JsonObjectIter to ease iteration over JsonObject membersPhilip Withnall2015-10-064-0/+134
| | | | | | | | | | This is a stack-allocated iterator object similar to GHashTableIter which allows allocation-free iteration over the members in a JsonObject. It differs from json_object_foreach_member() in the order in which it iterates — for JsonObjectIter the order is undefined. https://bugzilla.gnome.org/show_bug.cgi?id=755509
* tests/builder: Don't duplicate test namesIain Lane2015-10-021-1/+1
| | | | | | GLib 2.46.0 forbids this and so the testsuite fails. https://bugzilla.gnome.org/show_bug.cgi?id=755977