summaryrefslogtreecommitdiff
path: root/json-glib
Commit message (Collapse)AuthorAgeFilesLines
* Reimplement JSON_VERSION_HEX as a macro callEmmanuele Bassi2014-03-181-5/+7
| | | | Add a JSON_ENCODE_VERSION macro and use it in JSON_VERSION_HEX.
* Use compiler annotations to determine symbol visibilityEmmanuele Bassi2014-03-1814-240/+344
| | | | | | | | | | | | | | | | | 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.
* docs: Port to MarkDownEmmanuele Bassi2014-03-1815-248/+181
| | | | | Drop the DocBook documentation, and move everything to the MarkDown format used by modern gtk-doc.
* scanner: Clean up the UTF-16 surrogate pairs decodingEmmanuele Bassi2014-03-181-6/+36
| | | | | | We over-assert() our pre-conditions, and the conversion is a bit obfuscated. We should use a proper function, and de-obfuscate the code so that the intent is clear.
* Add missing annotationsEmmanuele Bassi2014-02-143-9/+9
| | | | | JsonNode, JsonObject, and JsonArray have various constructors, so we need to annotate them.
* tools: Fix build on Visual StudioChun-wei Fan2014-02-072-1/+12
| | | | | | | | | As unistd.h is not universally available, don't include it unconditionally and include the corresponding Windows headers where necessary. Also, use gssize in place of ssize_t and define STDOUT_FILENO on Windows when we don't have unistd.h, which is a constant that is defined in unistd.h. https://bugzilla.gnome.org/show_bug.cgi?id=723813
* reader: When a read() fails, don't track back on end()Bastien Nocera2014-02-031-4/+12
| | | | | | | | | | | | | | When a call to json_reader_read_element() fails if the element doesn't exist, we need to call json_reader_end_element() to clear out any errors. But the _end_element() call will backtrack to the parent node, when the _read_element() call did not set the child node. To fix this, leave early from _end_*() calls when an error has been set. https://bugzilla.gnome.org/show_bug.cgi?id=723428
* tests: Add new test for reader level bugBastien Nocera2014-02-031-0/+43
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=723428
* reader: Fix example code for json_reader_read_member()Bastien Nocera2014-02-031-3/+3
| | | | | | Fix cut'n'paste error. https://bugzilla.gnome.org/show_bug.cgi?id=721137
* Updated FSF's addressDaniel Mustieles2014-01-312-6/+2
|
* Make json-gvariant.h conform to the other headersEmmanuele Bassi2013-12-042-2/+10
| | | | | Only include the necessary headers, and use a single-header inclusion guard to prevent people from including only json-gvariant.h.
* Move the single include guard after multiple inclusion oneEmmanuele Bassi2013-12-048-24/+24
| | | | | | | | | | | | | | GCC (and other compilers) can optimise multiple inclusion of headers if they find the: #ifndef FOO #define FOO #endif pattern as the first thing inside a header. The single-header inclusion guard was preventing that from happening, so we need to move it inside the multiple inclusion guard.
* tests/gvariant: Use G_N_ELEMENTSEmmanuele Bassi2013-12-021-5/+5
| | | | Instead of sizeof(array)/sizeof(type).
* Make JSON to GVariant conversion handle some string to number conversions.Joseph Artsimovich2013-12-022-7/+54
| | | | | | | | | Consider the following JSON: ["123"] Trying to convert it to GVariant with signature "(i)" would previously fail, as string-to-number conversions weren't implemented. This patch implements string-to-number and string-to-boolean conversions. https://bugzilla.gnome.org/show_bug.cgi?id=707382
* Add tests for json paths (2 invalids, 1 valid)bi2013-12-021-0/+24
| | | | | | | Signed-off-by: Emmanuele Bassi <ebassi@gnome.org> Conflicts: json-glib/tests/path.c
* Handle invalid path: invalid first characterbi2013-12-021-1/+9
| | | | | | | Signed-off-by: Emmanuele Bassi <ebassi@gnome.org> Conflicts: json-glib/json-path.c
* path: compile and query path '$' to retrieve root nodebi2013-12-021-2/+5
| | | | Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
* Handle invalid path : missing member name after .bi2013-12-021-0/+8
| | | | Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
* build: Move the pkg-config file under json-glibEmmanuele Bassi2013-12-022-0/+21
| | | | | The pkg-config file for a library is tied to the source, so it should not be in the top-level of the project.
* build: Drop unnecessary linker flagsEmmanuele Bassi2013-12-021-1/+1
| | | | | | | | | The -no-undefined linker flag is needed only when compiling for Windows, and it's added conditionally. Except that we also add it unconditionally in the LDFLAGS used for the libjson-glib-1.0 shared object. Whoopsie. We should also drop the unneeded -rpath: distributions will go out of their way to patch it out in any case.
* build: Clean up unnecessary complicationsEmmanuele Bassi2013-12-021-2/+0
| | | | | | | | We don't need a custom Makefile for quiet rules: AM_V_GEN is pretty much all we use anyway. The Makefile.am.gtest file is not included any longer, since we switched to TAP and GLib's own rules for unit testing.
* Improve consistency in error messagesEmmanuele Bassi2013-10-282-3/+3
| | | | Use the same spacing and formatting rules.
* Add format toolEmmanuele Bassi2013-10-272-1/+215
| | | | | A simple command line utility to format JSON data; it allows prettifying and unprettifying JSON.
* Add validation toolEmmanuele Bassi2013-10-272-0/+178
| | | | | The json-glib-validate tool is a small utility that validates the data found at the URIs passed on its command line.
* parser: Always perform UTF-8 validationEmmanuele Bassi2013-10-272-0/+11
| | | | | | JSON is defined to be encoded using UTF-8, so we should not rely on the documentation saying so when parsing, but validate the input and eventually provide a recoverable parsing error.
* parser: Always use a valid GError internallyEmmanuele Bassi2013-10-261-2/+15
| | | | | Do not just pass the GError through from the public-facing arguments: we may want to perform error checking internally at any later date.
* build: Clean up the main Makefile.amEmmanuele Bassi2013-10-261-16/+28
|
* path: Check if JSONPath expression is NULLJuan A. Suarez Romero2013-09-191-0/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=708318
* Drop some more pointless GET_PRIVATE macrosEmmanuele Bassi2013-08-222-11/+8
| | | | We can use the autogenerated get_instance_private() function.
* parser: Fix all occurances of TESTS_DATA_DIREmmanuele Bassi2013-08-221-6/+1
| | | | And use g_test_build_filename().
* parser: Use the proper GLib API to find test data filesEmmanuele Bassi2013-08-222-7/+1
| | | | | | | Instead of our homegrown solution. This should fix the regression in the installed tests case. Original patch by: Colin Walters <walters@verbum.org>
* parser: Drop a pointless macroEmmanuele Bassi2013-08-221-4/+2
| | | | | The JSON_PARSER_GET_PRIVATE macro is pointless, now that we use the new version of GLib.
* Remove compile time GLib version checkEmmanuele Bassi2013-08-2119-103/+3
| | | | | We depend on a new version of GLib, so we can remove a bunch of old version checks.
* path: Remove unused variableEmmanuele Bassi2013-08-211-1/+1
|
* tests: Use the new TAP support in GTestEmmanuele Bassi2013-08-212-51/+11
| | | | | Instead of using the old GLib test harness, we should use the newly added TAP support and the TAP driver inside autotools.
* Use new macros when compiling against new GLibEmmanuele Bassi2013-07-204-7/+45
| | | | | | | | 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.
* build: Remove INCLUDESEmmanuele Bassi2013-05-161-3/+3
| | | | It has been replaced by AM_CPPFLAGS for a while.
* build: Add --enable-installed-testsEmmanuele Bassi2013-05-162-11/+59
| | | | | | | See https://live.gnome.org/GnomeGoals/InstalledTests for more information. It's still possible to run `make check` with locally uninstalled tests.
* tests: Improve the JsonPath suiteEmmanuele Bassi2013-05-161-61/+121
| | | | | Run each expression as a separate unit, so we can catch errors more quickly and easily.
* debug: Clean up debug flags accessorEmmanuele Bassi2013-05-163-8/+16
| | | | | | Mark json_get_debug_flags() as an internal function, and drop the '_' prefix; also, add a simple macro that we can use everywhere to mask the function call.
* path: Move debug dump of the path into its own functionEmmanuele Bassi2013-05-161-61/+62
| | | | | The path parsing function is already pretty long, so we should isolate the debugging code out of the way.
* Use G_DEFINE_QUARK macroEmmanuele Bassi2013-05-163-20/+8
| | | | Instead of hand-writing the error domain function ourselves.
* tests/path: Start adding negative tests for JsonPathEmmanuele Bassi2013-05-151-0/+14
|
* tests/path: Allow testing for valid queriesEmmanuele Bassi2013-05-151-14/+50
| | | | | | | This will allow adding negative tests to JsonPath. The tests will only be caught when compiling the query; an invalid query won't return a match, so there's no point to check matches.
* variant: Fix documentation and annotations for deserialize()Emmanuele Bassi2013-03-131-4/+11
| | | | | The returned GVariant when deserializing from JSON has a floating reference that needs to be sunk.
* node: add (transfer none) annotations to the new typed initializersEvan Nemerson2013-02-111-7/+7
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=693575
* path: Fix get all object members with wildcardEmmanuele Bassi2013-01-112-6/+24
| | | | | Similar to the fix that went in commit path e348b1fa, we need to fix getting all the members of an object by using the wildcard notation.
* path: Fix get all array elements with wildcardJuan A. Suarez Romero2013-01-112-1/+5
| | | | | | | | | Using the same data as in tests, asking for $['store']['book'][*] JSON path should return all the book objects in an array. But that array is returned inside another array, dupped several times. https://bugzilla.gnome.org/show_bug.cgi?id=691557
* build: Use the symbols file to generate our public ABIEmmanuele Bassi2012-11-071-3/+3
| | | | | | Instead of a regular expression. This allows us to catch ABI issues immediately, without using the ABI check, while building JSON-GLib, even on *nix.
* symbols: Re-sortEmmanuele Bassi2012-11-071-191/+191
|