jansson.git
12 years agoUpdate copyright notices for 2012
Petri Lehtinen [Tue, 20 Mar 2012 18:55:55 +0000 (20:55 +0200)]
Update copyright notices for 2012

12 years agoMake sure strtoll() is available when using long long
Petri Lehtinen [Tue, 20 Mar 2012 18:46:17 +0000 (20:46 +0200)]
Make sure strtoll() is available when using long long

12 years agoRemove unused declarations
Petri Lehtinen [Sun, 11 Mar 2012 18:50:58 +0000 (20:50 +0200)]
Remove unused declarations

12 years agoFix tests on shells that don't support the export FOO=bar syntax
Petri Lehtinen [Thu, 8 Mar 2012 13:01:52 +0000 (15:01 +0200)]
Fix tests on shells that don't support the export FOO=bar syntax

12 years agoDisribute the check-exports tests
Petri Lehtinen [Sun, 12 Feb 2012 14:05:27 +0000 (16:05 +0200)]
Disribute the check-exports tests

12 years agodoc: Fix the names of library version constants
Petri Lehtinen [Thu, 2 Feb 2012 15:00:23 +0000 (17:00 +0200)]
doc: Fix the names of library version constants

Fixes #52.

12 years agoMake test_load.c not depend on the C locale
Petri Lehtinen [Mon, 30 Jan 2012 19:23:15 +0000 (21:23 +0200)]
Make test_load.c not depend on the C locale

Fixes #51.

12 years agojansson 2.3
Petri Lehtinen [Fri, 27 Jan 2012 19:02:12 +0000 (21:02 +0200)]
jansson 2.3

12 years agoAdd support for optional object keys for json_unpack() and friends
Petri Lehtinen [Thu, 26 Jan 2012 19:13:07 +0000 (21:13 +0200)]
Add support for optional object keys for json_unpack() and friends

Initial patch by Andrew Thompson.

12 years agoAdd json_object_update_{existing,missing}
Petri Lehtinen [Tue, 24 Jan 2012 19:03:36 +0000 (21:03 +0200)]
Add json_object_update_{existing,missing}

Closes #37.

12 years agoImplement json_object_foreach()
Petri Lehtinen [Tue, 24 Jan 2012 18:37:08 +0000 (20:37 +0200)]
Implement json_object_foreach()

Also change many places to use it internally to replace hand-crafted
iteration.

Closes #45, #46.

12 years agoMake hashtable less generic
Petri Lehtinen [Tue, 24 Jan 2012 18:36:31 +0000 (20:36 +0200)]
Make hashtable less generic

This will make it possible to implement json_object_foreach(). It
should also have some (positive) effect on speed.

12 years agoFix a potential memory leak
Petri Lehtinen [Tue, 24 Jan 2012 18:35:59 +0000 (20:35 +0200)]
Fix a potential memory leak

12 years agoWrite number of bytes read to error position on successful decode
Petri Lehtinen [Mon, 23 Jan 2012 19:18:04 +0000 (21:18 +0200)]
Write number of bytes read to error position on successful decode

Closes #49.

12 years agoMerge branch '2.2'
Petri Lehtinen [Mon, 14 Nov 2011 19:16:42 +0000 (21:16 +0200)]
Merge branch '2.2'

12 years agoRevert "json_dump_file: Open the output file in wb mode"
Petri Lehtinen [Mon, 14 Nov 2011 19:15:17 +0000 (21:15 +0200)]
Revert "json_dump_file: Open the output file in wb mode"

JSON is read as text, so line endings should be preserved.

This reverts commit 32cd82127390b9fd5b5d090bc3c279d3e4d9f3a6.

12 years agoMerge branch '2.2'
Petri Lehtinen [Mon, 14 Nov 2011 19:11:18 +0000 (21:11 +0200)]
Merge branch '2.2'

Closes GH-43.

12 years agoUpdate the documentation of JSON_DECODE_ANY
Petri Lehtinen [Mon, 14 Nov 2011 10:58:37 +0000 (12:58 +0200)]
Update the documentation of JSON_DECODE_ANY

12 years agoJSON_DECODE_ANY
Andrea Marchesini [Fri, 11 Nov 2011 18:17:29 +0000 (19:17 +0100)]
JSON_DECODE_ANY

Closes GH-4.

12 years agodoc: The same JSON values must not be encoded in parallel
Petri Lehtinen [Mon, 14 Nov 2011 17:32:42 +0000 (19:32 +0200)]
doc: The same JSON values must not be encoded in parallel

Closes GH-42.

12 years agoAvoid problems with object's serial number growing too big
Petri Lehtinen [Mon, 14 Nov 2011 17:10:28 +0000 (19:10 +0200)]
Avoid problems with object's serial number growing too big

Transform serial key comparison from substraction to real comparison.
Reset serial to zero in json_object_clear() to avoid it growing out of
bounds when reusing objects.

Closes GH-40.
Closes GH-41.

12 years agojson_load* return NULL if the first argument is NULL
Andrea Marchesini [Fri, 11 Nov 2011 18:17:50 +0000 (19:17 +0100)]
json_load* return NULL if the first argument is NULL

12 years agodoc: The configure script can be used on MinGW
Petri Lehtinen [Wed, 2 Nov 2011 06:01:32 +0000 (08:01 +0200)]
doc: The configure script can be used on MinGW

12 years agoDistribute jansson_config.h.win32
Petri Lehtinen [Wed, 2 Nov 2011 05:56:33 +0000 (07:56 +0200)]
Distribute jansson_config.h.win32

12 years agoRemove '+' and leading zeros from exponents in the encoder
Petri Lehtinen [Tue, 1 Nov 2011 18:49:15 +0000 (20:49 +0200)]
Remove '+' and leading zeros from exponents in the encoder

Fixes GH-39.

12 years agoFix test file comparisons on MinGW
Petri Lehtinen [Tue, 1 Nov 2011 17:52:20 +0000 (19:52 +0200)]
Fix test file comparisons on MinGW

Don't output any DOS line terminators from json_process.

Issue GH-39.

12 years agoUse %I64d format for printing long longs on Windows
Petri Lehtinen [Tue, 1 Nov 2011 17:41:25 +0000 (19:41 +0200)]
Use %I64d format for printing long longs on Windows

Fixes GH-38.

12 years agojson_dump_file: Open the output file in wb mode
Petri Lehtinen [Fri, 7 Oct 2011 17:52:49 +0000 (20:52 +0300)]
json_dump_file: Open the output file in wb mode

For maximum compatibility.

12 years agojansson 2.2.1 origin/2.2 origin/HEAD origin/master v2.2.1
Petri Lehtinen [Thu, 6 Oct 2011 18:16:26 +0000 (21:16 +0300)]
jansson 2.2.1

12 years agoDistribute doc/portability.rst
Petri Lehtinen [Thu, 6 Oct 2011 18:22:59 +0000 (21:22 +0300)]
Distribute doc/portability.rst

12 years agojson_load_file: Open the input file in rb mode
Petri Lehtinen [Tue, 4 Oct 2011 18:11:26 +0000 (21:11 +0300)]
json_load_file: Open the input file in rb mode

For maximum compatibility.

12 years agoDocumentation fixes
Petri Lehtinen [Tue, 4 Oct 2011 18:04:56 +0000 (21:04 +0300)]
Documentation fixes

12 years agodoc: Add project status to introduction, add portability chapter
Petri Lehtinen [Mon, 3 Oct 2011 19:42:39 +0000 (22:42 +0300)]
doc: Add project status to introduction, add portability chapter

Move the multithreading-and-setlocale documentation to the new
portability chapter.

Fixes GH-36.

12 years agoMake identifier decoding work under all locales
Petri Lehtinen [Mon, 3 Oct 2011 18:35:51 +0000 (21:35 +0300)]
Make identifier decoding work under all locales

Replace isxxx() functions from ctype.h with locale-independent macros.

Fixes GH-35.

12 years agoUse strchr() when searching for a single character
Petri Lehtinen [Mon, 3 Oct 2011 05:52:30 +0000 (08:52 +0300)]
Use strchr() when searching for a single character

12 years agoMake real number encoding and decoding work under all locales
Petri Lehtinen [Sun, 2 Oct 2011 18:27:53 +0000 (21:27 +0300)]
Make real number encoding and decoding work under all locales

The decimal point '.' is changed to locale's decimal point
before/after JSON conversion to make C standard library's
locale-specific string conversion functions work correctly.

All the tests now call setlocale(LC_ALL, "") on startup to use the
locale set in the environment.

Fixes GH-32.

12 years agoImplement all other encoding functions using json_dump_callback
Petri Lehtinen [Sat, 24 Sep 2011 18:10:23 +0000 (21:10 +0300)]
Implement all other encoding functions using json_dump_callback

This way we can check for JSON_ENCODE_ANY flag in one place only.

12 years agoMerge pull request #33 from bakulf/master
Petri Lehtinen [Tue, 20 Sep 2011 18:11:55 +0000 (11:11 -0700)]
Merge pull request #33 from bakulf/master

Little fixes

12 years agoscope error. result points to a out-of-score variable.
Andrea Marchesini [Tue, 20 Sep 2011 11:10:32 +0000 (13:10 +0200)]
scope error. result points to a out-of-score variable.

12 years agounsed static variable removed
Andrea Marchesini [Tue, 20 Sep 2011 09:46:29 +0000 (11:46 +0200)]
unsed static variable removed

12 years agodoc: Clarify the result of 's' format of json_unpack()
Petri Lehtinen [Mon, 12 Sep 2011 18:22:19 +0000 (21:22 +0300)]
doc: Clarify the result of 's' format of json_unpack()

Fixes GH-31.

12 years agojansson 2.2 v2.2
Petri Lehtinen [Fri, 2 Sep 2011 18:39:32 +0000 (21:39 +0300)]
jansson 2.2

12 years agodoc: json_dump_callback was added in v2.2
Petri Lehtinen [Fri, 2 Sep 2011 18:29:01 +0000 (21:29 +0300)]
doc: json_dump_callback was added in v2.2

12 years agoMerge branch '2.1'
Petri Lehtinen [Mon, 8 Aug 2011 18:00:47 +0000 (21:00 +0300)]
Merge branch '2.1'

12 years agodoc: Explain the non-constness of the first parameter of json_unpack() et al origin/2.1
Petri Lehtinen [Mon, 8 Aug 2011 17:59:10 +0000 (20:59 +0300)]
doc: Explain the non-constness of the first parameter of json_unpack() et al

Fixes GH-30.

12 years agoMerge branch '2.1'
Petri Lehtinen [Thu, 30 Jun 2011 18:48:51 +0000 (21:48 +0300)]
Merge branch '2.1'

12 years agoMerge branch 'issue-29'
Petri Lehtinen [Thu, 30 Jun 2011 18:48:09 +0000 (21:48 +0300)]
Merge branch 'issue-29'

Fixes GH-29.

12 years agodoc: Add documentation for json_dump_callback()
Petri Lehtinen [Thu, 30 Jun 2011 18:45:25 +0000 (21:45 +0300)]
doc: Add documentation for json_dump_callback()

12 years agotest file for new json_dump_callback function
JKL [Fri, 24 Jun 2011 17:40:20 +0000 (10:40 -0700)]
test file for new json_dump_callback function

12 years agonew typedef json_dump_callback_t, function json_dump_callback
JKL [Fri, 24 Jun 2011 17:00:53 +0000 (10:00 -0700)]
new typedef json_dump_callback_t, function json_dump_callback

12 years agodoc: Fix several typos and other little errors
Petri Lehtinen [Thu, 30 Jun 2011 18:04:45 +0000 (21:04 +0300)]
doc: Fix several typos and other little errors

12 years agouse size_t for strbuffer writes, and avoid integer overflow
JKL [Fri, 24 Jun 2011 16:57:20 +0000 (09:57 -0700)]
use size_t for strbuffer writes, and avoid integer overflow

12 years agoCheck that target is string and value is not NULL in json_string_set()
Petri Lehtinen [Fri, 17 Jun 2011 18:42:11 +0000 (21:42 +0300)]
Check that target is string and value is not NULL in json_string_set()

12 years agodoc: Clarify that removing from containers decrements the refcount
Petri Lehtinen [Fri, 17 Jun 2011 17:53:28 +0000 (20:53 +0300)]
doc: Clarify that removing from containers decrements the refcount

While at it, reword the object iteration protocol description a bit.

12 years agoCHANGES: Fix v2.1 release date
Petri Lehtinen [Fri, 10 Jun 2011 18:53:14 +0000 (21:53 +0300)]
CHANGES: Fix v2.1 release date

12 years agojansson 2.1 v2.1
Petri Lehtinen [Fri, 10 Jun 2011 18:30:11 +0000 (21:30 +0300)]
jansson 2.1

12 years agoUse ``literal`` syntax with macro and flag names in CHANGES
Petri Lehtinen [Tue, 7 Jun 2011 18:39:55 +0000 (21:39 +0300)]
Use ``literal`` syntax with macro and flag names in CHANGES

12 years agoPrepare for relase: Add CHANGES entry for v2.1
Petri Lehtinen [Tue, 7 Jun 2011 18:33:59 +0000 (21:33 +0300)]
Prepare for relase: Add CHANGES entry for v2.1

12 years agoAdd JSON_DISABLE_EOF_CHECK decoding flag
Petri Lehtinen [Sun, 29 May 2011 18:19:28 +0000 (21:19 +0300)]
Add JSON_DISABLE_EOF_CHECK decoding flag

With this flag enabled, the decoder stops after a valid JSON input and
thus allows extra data after it.

Fixes GH-25.

12 years agoReduce code duplication in the decoder
Petri Lehtinen [Sun, 29 May 2011 09:53:25 +0000 (12:53 +0300)]
Reduce code duplication in the decoder

12 years agoClear errno before calling strtod()
Petri Lehtinen [Tue, 24 May 2011 06:59:39 +0000 (09:59 +0300)]
Clear errno before calling strtod()

Fixes GH-27.

12 years agoAdd JSON_REJECT_DUPLICATES decoding flag
Petri Lehtinen [Sun, 15 May 2011 10:57:48 +0000 (13:57 +0300)]
Add JSON_REJECT_DUPLICATES decoding flag

With this flag, a decoding error is issued if any JSON object in the
input contains duplicate keys.

Fixes GH-3.

12 years agodoc: Clarify that Unicode normalization or comparison algorithms are not used
Petri Lehtinen [Sat, 14 May 2011 18:08:02 +0000 (21:08 +0300)]
doc: Clarify that Unicode normalization or comparison algorithms are not used

12 years agodoc: Add "New in version 2.1" notes to new features
Petri Lehtinen [Sat, 14 May 2011 17:46:13 +0000 (20:46 +0300)]
doc: Add "New in version 2.1" notes to new features

12 years agodocs: Add a note that object iteration doesn't give any particular order
Petri Lehtinen [Sat, 14 May 2011 10:04:35 +0000 (13:04 +0300)]
docs: Add a note that object iteration doesn't give any particular order

Closes GH-15.

12 years agoAdd JSON_ENCODE_ANY flag to allow encoding any JSON value
Petri Lehtinen [Sat, 14 May 2011 09:56:14 +0000 (12:56 +0300)]
Add JSON_ENCODE_ANY flag to allow encoding any JSON value

Closes GH-19.

13 years agoMerge branch '2.0'
Petri Lehtinen [Thu, 21 Apr 2011 10:15:58 +0000 (13:15 +0300)]
Merge branch '2.0'

13 years agoFix a leak when memory allocation fails in json_object_set() & friends origin/2.0
Petri Lehtinen [Thu, 21 Apr 2011 10:15:01 +0000 (13:15 +0300)]
Fix a leak when memory allocation fails in json_object_set() & friends

13 years agoAdd json_loadb() for decoding possibly non null-terminated strings
Petri Lehtinen [Sun, 10 Apr 2011 17:54:52 +0000 (20:54 +0300)]
Add json_loadb() for decoding possibly non null-terminated strings

Thanks to Jonathan Landis for the initial patch.

13 years agoMerge branch '2.0'
Petri Lehtinen [Tue, 5 Apr 2011 12:38:37 +0000 (15:38 +0300)]
Merge branch '2.0'

13 years agoAvoid set-but-not-used warning/error in a test
Jim Meyering [Tue, 5 Apr 2011 12:04:16 +0000 (14:04 +0200)]
Avoid set-but-not-used warning/error in a test

Closes GH-20.

13 years agoMerge branch '2.0'
Petri Lehtinen [Thu, 31 Mar 2011 18:26:19 +0000 (21:26 +0300)]
Merge branch '2.0'

Conflicts:
doc/conf.py
src/jansson.h

13 years agojansson 2.0.1 v2.0.1
Petri Lehtinen [Thu, 31 Mar 2011 13:59:26 +0000 (16:59 +0300)]
jansson 2.0.1

13 years agoMerge branch '2.0'
Petri Lehtinen [Thu, 31 Mar 2011 13:39:33 +0000 (16:39 +0300)]
Merge branch '2.0'

13 years agoFix a few malloc() and free() calls
Petri Lehtinen [Thu, 31 Mar 2011 13:37:41 +0000 (16:37 +0300)]
Fix a few malloc() and free() calls

Replace them with jsonp_malloc() and jsonp_free() to support the
custom memory allocation.

13 years agoFix invalid object key hashing in json_unpack() strict checking mode
Petri Lehtinen [Wed, 30 Mar 2011 09:57:24 +0000 (12:57 +0300)]
Fix invalid object key hashing in json_unpack() strict checking mode

The keys which are stored temporarily to a hashtable to make sure that
all object keys are unpacked, were hashed with the object key hashing
function. It is meant to compute hashes for object_key_t values, and
it works incorrectly for plain strings.

Fixed by introducing suitable functions for hashing and comparing
strings for string-keyed hashtables.

13 years agoMerge branch '2.0'
Petri Lehtinen [Sun, 27 Mar 2011 18:04:29 +0000 (21:04 +0300)]
Merge branch '2.0'

13 years agoSet JANSSON_MICRO_VERSION to 255 (0xFF) for git master
Petri Lehtinen [Sun, 27 Mar 2011 10:40:25 +0000 (13:40 +0300)]
Set JANSSON_MICRO_VERSION to 255 (0xFF) for git master

Also, set documentation release to "2.0+git". This shows up in the
automatically built HTML documentation.

These changes makes it easier for library users to know that this
version is under development.

Closes GH-14.

13 years agoUse the correct number of parens in JANSSON_VERSION_HEX macro
Petri Lehtinen [Wed, 23 Mar 2011 06:25:50 +0000 (08:25 +0200)]
Use the correct number of parens in JANSSON_VERSION_HEX macro

13 years agoTest framework enhancements, fix the check_exports test
Petri Lehtinen [Sun, 27 Mar 2011 10:34:43 +0000 (13:34 +0300)]
Test framework enhancements, fix the check_exports test

* Use "printf" instead of "echo -n" as it's more portable
* Treat a test as skipped if it exits with exit status of 77
* Skip the check_exports test if "nm -D" doesn't work

13 years agoUse the correct number of parens in JANSSON_VERSION_HEX macro
Petri Lehtinen [Wed, 23 Mar 2011 06:25:50 +0000 (08:25 +0200)]
Use the correct number of parens in JANSSON_VERSION_HEX macro

13 years agoANSI C requires struct initializers to be constant expressions
Petri Lehtinen [Mon, 21 Mar 2011 07:27:51 +0000 (09:27 +0200)]
ANSI C requires struct initializers to be constant expressions

Closes GH-17.

13 years agoFix json_object_size() return value
Petri Lehtinen [Mon, 21 Mar 2011 06:22:32 +0000 (08:22 +0200)]
Fix json_object_size() return value

Return 0 as documented if the argument is not a JSON object.

Closes GH-18.

13 years agoEnhance portability of va_copy()
Petri Lehtinen [Sun, 20 Mar 2011 19:15:39 +0000 (21:15 +0200)]
Enhance portability of va_copy()

va_copy() is a C99 feature. In C89 implementations, it's sometimes
available as __va_copy(). If not, memcpy() should do the trick.

13 years agoFix a declaration after statement
Petri Lehtinen [Thu, 10 Mar 2011 19:28:44 +0000 (21:28 +0200)]
Fix a declaration after statement

While at it, add -Wdeclaration-after-statement to AM_CFLAGS to catch
these in the future.

13 years agoDistribute doc/upgrading.rst
Petri Lehtinen [Thu, 10 Mar 2011 19:25:43 +0000 (21:25 +0200)]
Distribute doc/upgrading.rst

Closes GH-16.

13 years agoCheck documentation in make distcheck
Petri Lehtinen [Thu, 10 Mar 2011 19:24:44 +0000 (21:24 +0200)]
Check documentation in make distcheck

It seems that the only way to do this is to use the dvi make target,
as it's built in make distcheck after running configure.

13 years agojansson 2.0 v2.0
Petri Lehtinen [Mon, 28 Feb 2011 18:46:14 +0000 (20:46 +0200)]
jansson 2.0

13 years agoFix packing of invalid UTF-8 strings
Petri Lehtinen [Sun, 27 Feb 2011 19:34:12 +0000 (21:34 +0200)]
Fix packing of invalid UTF-8 strings

13 years agoUpdate README
Petri Lehtinen [Sun, 27 Feb 2011 19:09:55 +0000 (21:09 +0200)]
Update README

13 years agotests: Add missing json_decref() calls to suites/api/test_unpack.c
Petri Lehtinen [Fri, 25 Feb 2011 20:24:12 +0000 (22:24 +0200)]
tests: Add missing json_decref() calls to suites/api/test_unpack.c

13 years agoRemove invalid subdirs from test/suites/Makefile.am
Petri Lehtinen [Fri, 25 Feb 2011 19:08:49 +0000 (21:08 +0200)]
Remove invalid subdirs from test/suites/Makefile.am

13 years agodoc: Change the title of the upgrading section
Petri Lehtinen [Fri, 25 Feb 2011 19:01:13 +0000 (21:01 +0200)]
doc: Change the title of the upgrading section

13 years agoSmall documentation tweaks
Petri Lehtinen [Thu, 24 Feb 2011 20:30:46 +0000 (22:30 +0200)]
Small documentation tweaks

- Capitalize section titles correctly

- Rename "Building on Windows" to "Building on non-Unix systems" and
  tweak the text accordingly.

- Remove the "Installing Prebuilt Binaries" section. This info is
  better in the web instead, as it may change.

- Mention that Sphinx 1.0 or newer is required.

13 years agoAdd "Upgrading from older releases" to docs, tweak CHANGES a bit
Petri Lehtinen [Thu, 24 Feb 2011 20:15:13 +0000 (22:15 +0200)]
Add "Upgrading from older releases" to docs, tweak CHANGES a bit

13 years agoAdd a CHANGES entry for version 2.0
Petri Lehtinen [Tue, 22 Feb 2011 19:12:45 +0000 (21:12 +0200)]
Add a CHANGES entry for version 2.0

Wow, lots of stuff. And it's been a long while after the last release.

13 years agoAdd lots of tests for pack/unpack code, fix bugs found
Petri Lehtinen [Tue, 22 Feb 2011 17:08:41 +0000 (19:08 +0200)]
Add lots of tests for pack/unpack code, fix bugs found

Closes GH-12.

13 years agoMove json_error_t documentation to its own section
Petri Lehtinen [Tue, 22 Feb 2011 11:53:58 +0000 (13:53 +0200)]
Move json_error_t documentation to its own section

json_error_t is used in the decoder and in the pack and unpack API's,
so it's better to have a separate section for it.

13 years agoTruncate error source from start, not end, if it's too long to fit
Petri Lehtinen [Tue, 22 Feb 2011 11:24:15 +0000 (13:24 +0200)]
Truncate error source from start, not end, if it's too long to fit

It's more helpful to see "...bar/baz.json" instead of "/long/path/to".

13 years agoRefactor decoder input stream
Petri Lehtinen [Tue, 22 Feb 2011 08:47:02 +0000 (10:47 +0200)]
Refactor decoder input stream

- Add a new field position to the json_error_t structure. This is the
  position in bytes from the beginning of the input.

- Keep track of line, column and input position in the stream level.
  Previously, only line was tracked, and it was in the lexer level, so
  this info was not available for UTF-8 decoding errors.

- While at it, refactor tests so that no separate "stripped" tests are
  required. json_process is now able to strip whitespace from its
  input, and the "valid" and "invalid" test suites now use this to
  test both non-stripped and stripped input.

Closes GH-9.