Commit Graph

120 Commits

Author SHA1 Message Date
Petri Lehtinen
bfac1972e2 Add a flags parameter to all decoding functions for future needs
As of now, the parameter is unused, but may be needed in the future.
I'm adding it now so that in the future both API and ABI remain
backwards compatible as long as possible.

This is a backwards incompatible change.
2010-08-14 17:28:09 +03:00
Petri Lehtinen
f8d0e01e46 Change the maximum indentation size to 32 spaces in encoder
This is to free up bits from the flags parameter of json_dump
functions. I'm pretty sure no-one needs 256 spaces of indentation when
pretty-printing JSON values...

This is a backwards incompatible change.
2010-08-13 22:12:36 +03:00
Petri Lehtinen
ffbab6fedd Change the underlying type of JSON integer from long to json_int_t
json_int_t is typedef'd to long long if it's supported, or long
otherwise. There's also some supporting things, like the
JSON_INTEGER_FORMAT macro that expands to the printf() conversion
specifier that corresponds to json_int_t's actual type.

This is a backwards incompatible change.
2010-08-13 22:07:20 +03:00
Petri Lehtinen
014c49c285 Change JSON integer's underlying type from int to long
This is a backwards incompatible change.
2010-08-10 21:45:18 +03:00
Petri Lehtinen
6e3ca5c45c Clarify the documentation
Couple some string and number information from the RFC conformance
chapter in the API reference, and refer to the RFC conformance chapter
from API reference for more information.

Also, state more clearly that a JSON text must have an array or object
as the top-level value, and better document the string comparison
performed by json_equal().
2010-06-16 21:34:10 +03:00
Petri Lehtinen
68f2861e92 Unify unsigned integer usage in the API
Replace all occurences of unsigned int and unsigned long with size_t.

This is a backwards incompatible change, as the signature of many API
functions changes.
2010-06-15 15:38:59 +03:00
Petri Lehtinen
2caac965d4 jansson 1.3 2010-06-13 20:37:33 +03:00
Petri Lehtinen
dec3ad498e Merge branch '1.2' 2010-05-20 18:47:30 +03:00
Petri Lehtinen
978a47e2c5 Clarify the documentation on reference stealing
Provide an example usage pattern for reference stealing functions.
This way the user (hopely) sees more clearly how the reference
stealing functions are meant to be used.
2010-05-20 18:45:24 +03:00
Petri Lehtinen
8857aeadfd Merge branch '1.2'
Conflicts:
	CHANGES
	configure.ac
	doc/conf.py
2010-04-03 14:00:59 +03:00
Petri Lehtinen
047a1417fb jansson 1.2.1 2010-04-03 13:49:56 +03:00
Petri Lehtinen
ce42e30b8c doc: Distribute conformance.rst 2010-04-03 13:49:56 +03:00
Petri Lehtinen
4e63fcd55d Merge branch '1.2'
Conflicts:
	configure.ac
2010-03-28 21:44:41 +03:00
Petri Lehtinen
c7c2edae8a doc: Add chapter on RFC conformance
Thanks to Deron Meranda for providing the initial text.
2010-03-26 22:03:26 +02:00
Petri Lehtinen
35ddd2de20 Update CHANGES, change version to 1.2+ 2010-02-11 20:55:56 +02:00
Petri Lehtinen
f18ef5144a Implement JSON_PRESERVE_ORDER encoding flag
With this encoding flag, the object key-value pairs in output are in
the same order in which they were first inserted into the object.

To make this possible, a key of an object is now a serial number plus
a string. An object keeps an increasing counter which is used to
assign serial number to the keys. Hashing, comparison and public API
functions were changed to act only on the string part, i.e. the serial
number is ignored everywhere else but in the encoder, where it's used
to order object keys if JSON_PRESERVE_ORDER flag is used.
2010-02-11 20:48:56 +02:00
Petri Lehtinen
8d75235ff2 Merge branch '1.2'
Conflicts:
	LICENSE
2010-02-04 21:13:57 +02:00
Petri Lehtinen
08dc8d9baf Add year 2010 to copyright notices 2010-02-02 21:26:11 +02:00
Petri Lehtinen
b495b96547 Add functions json_object_iter_{at,set,set_new} 2010-02-01 21:07:19 +02:00
Petri Lehtinen
aaae37afba doc/Makefile.am: Don't remove changes.rst in clean 2010-01-26 21:19:48 +02:00
Petri Lehtinen
8c2ca3fae6 jansson 1.2 2010-01-21 21:49:10 +02:00
Petri Lehtinen
78594e9bd3 Remove CHANGES preprocessing, as it didn't work with VPATH builds
The problem is that Sphinx can only read input files from a single
directory. In VPATH builds, the source and build trees are separate,
and the changes.rst went into the build tree.

This patch solves the issue by using cfunc as the Sphinx default role.
2010-01-21 20:53:05 +02:00
Petri Lehtinen
b76ee75aad doc: Convert CHANGES to reStructuredText and add it to HTML docs
CHANGES is preprocessed to convert json_*() function names to Sphinx
:cfunc: cross references. This is to keep CHANGES more readable in
both plain text and HTML.
2010-01-14 22:03:48 +02:00
Petri Lehtinen
b077d7988e Update documentation
* Python is no longer required to run the tests
* Mention pkg-config support
* Fix some errors
2010-01-12 21:29:16 +02:00
Petri Lehtinen
9db34dc31a Add functions for shallow and deep copying JSON values 2009-12-31 18:50:39 +02:00
Petri Lehtinen
95a468cebb Add equality test for JSON values 2009-12-31 18:50:36 +02:00
Petri Lehtinen
dd2fe1ebe8 Add _nocheck functions
Added functions are:

* json_string_nocheck()
* json_string_set_nocheck()
* json_object_set_nocheck()
* json_object_set_new_nocheck()

These functions don't check that their string argument is valid UTF-8,
but assume that the user has already performed the check.
2009-12-23 22:28:24 +02:00
Petri Lehtinen
e7a5dc58e6 Merge branch '1.1'
Conflicts:
	configure.ac
	doc/conf.py
2009-12-21 12:52:25 +02:00
Petri Lehtinen
34fb97998c jansson 1.1.3 2009-12-18 21:43:12 +02:00
Petri Lehtinen
19a606d736 Implement JSON_SORT_KEYS encoding flag
With this flag, the objects are sorted by key when encoding.
2009-12-16 23:12:39 +02:00
Petri Lehtinen
50031440a3 Implement JSON_ENSURE_ASCII encoding flag
With this flag, all Unicode characters outside the ASCII range are
escaped.
2009-12-05 22:55:30 +02:00
Petri Lehtinen
d857fd08a5 doc/github_commits.c Add copyright notice 2009-11-28 13:39:06 +02:00
Petri Lehtinen
e0a88d19d1 Merge branch '1.1'
Conflicts:
	configure.ac
	doc/conf.py
2009-11-08 22:01:02 +02:00
Petri Lehtinen
842bc2128b jansson 1.1.2 2009-11-08 14:13:32 +02:00
Petri Lehtinen
f236c14dc5 dump: Revise whitespace usage
- Never append newline to output
- By default, add spaces between array and object items for more
  readable output
- Introduce the flag JSON_COMPACT to not add the aforementioned spaces
2009-11-04 22:09:40 +02:00
Petri Lehtinen
bf01067a8a Build documentation in make html target
To keep the distchecks for the documentation, the documentation has to
be built in the check target instead of distcheck-hook.

While at it, rename doc/.build to doc/_build. This naming is the
default with sphinx 0.6.2.
2009-11-03 23:09:04 +02:00
Petri Lehtinen
d1b07171cc Merge branch '1.1'
Conflicts:
	CHANGES
	configure.ac
	doc/conf.py
2009-10-26 21:33:03 +02:00
Petri Lehtinen
15d992cb6a jansson 1.1.1 2009-10-26 21:27:10 +02:00
Petri Lehtinen
f95bb423a3 Really distribute all the docs
The tutorial example github_commits.c was still left out.
2009-10-25 00:17:16 +03:00
Petri Lehtinen
9448ed3ef7 Distribute all the docs 2009-10-24 14:16:12 +03:00
Petri Lehtinen
8d53f447bf Set the version number to 1.1+ 2009-10-21 08:51:43 +03:00
Petri Lehtinen
325101e525 jansson 1.1 2009-10-20 21:29:16 +03:00
Petri Lehtinen
cd96049d10 Enhance documentation
- Add more information to the documentation front page
- Document how to build the documentation
- Clarify the tutorial a bit and remove some quirks
- Bring README.rst up-to-date
- Small enhancements here and there
2009-10-19 21:56:11 +03:00
Petri Lehtinen
a00988f663 doc: Add tutorial 2009-10-17 14:18:40 +03:00
Petri Lehtinen
b67e130fda json_dumpf: Document the output shortage on error 2009-10-15 21:06:59 +03:00
Petri Lehtinen
4cd777712b Enhance handling of circular references
It's now an error to try to add an object or array to itself. The
encoder checks for circular references and fails with an error status
if one is detected.
2009-10-15 21:02:27 +03:00
Petri Lehtinen
76999799ed doc: Fix a small typo in apiref 2009-10-15 17:39:49 +03:00
Petri Lehtinen
22af193a51 doc/Makefile.am: Remove *.pyc in clean 2009-10-14 22:09:14 +03:00
Petri Lehtinen
951d091f07 Make integer, real and string mutable
Added functions:

  json_string_set
  json_integer_set
  json_real_set

While at it, clarify the documentation and parameter naming of
json_{string,integer,real}_value() a bit.
2009-10-14 08:23:02 +03:00
Petri Lehtinen
ca7703fbd1 Merge branch '1.0'
Conflicts:
	configure.ac
	doc/conf.py
2009-10-11 21:51:54 +03:00
Petri Lehtinen
12cd4e8c09 jansson 1.0.4 2009-10-11 21:38:42 +03:00
Petri Lehtinen
1e00cd58a5 Extend object API
Added functions:

  json_object_size
  json_object_clear
  json_object_update
2009-10-11 20:44:01 +03:00
Petri Lehtinen
cbacac5975 Extend array API
Added functions:

  json_array_insert
  json_array_insert_new
  json_array_remove
  json_array_clear
  json_array_extend
2009-09-29 22:17:58 +03:00
Petri Lehtinen
b3e1fe2ec5 doc: Add getting started guide 2009-09-20 21:56:12 +03:00
Petri Lehtinen
7728716759 Merge branch '1.0'
Conflicts:
	configure.ac
	doc/conf.py
2009-09-14 15:06:06 +03:00
Petri Lehtinen
b7bf96996f jansson 1.0.3 2009-09-14 14:32:41 +03:00
Petri Lehtinen
743af38e7f Use unsigned long instead of uint32_t
Some day we will have ANSI C compatibility... This change doesn't make
the API backwards incompatible because uint32_t was only used in flags
to json_dump*() and the flags are meant to be used only by ORing
constants and macro output, and actually currently only JSON_INDENT
can be used.
2009-09-13 13:16:34 +03:00
Petri Lehtinen
55d2566539 Merge branch '1.0' into HEAD
Conflicts:
	configure.ac
	doc/conf.py
2009-09-08 17:02:39 +03:00
Petri Lehtinen
827a01937f jansson 1.0.2 2009-09-08 16:48:26 +03:00
Petri Lehtinen
057ba29a27 doc apiref: Enhancements
Constructors are described more clearly and return values on error
situations more compehensively. Also add an example of the object
iteration protocol.
2009-09-07 21:09:55 +03:00
Petri Lehtinen
234ee47281 Better argument validation
All pointer arguments are now tested for NULL. json_string() now also
tests that strdup() succeeds. This is to ensure that no NULL values
end up in data structures.

Also desribe the different sources of errors in documentation.
2009-09-06 22:24:55 +03:00
Petri Lehtinen
42e546d065 doc apiref: json_incref() returns its argument 2009-09-06 22:16:38 +03:00
Petri Lehtinen
fd259ff68c Merge branch '1.0'
Conflicts:
	configure.ac
	doc/conf.py
2009-09-06 12:53:38 +03:00
Petri Lehtinen
e4be4a4a28 jansson 1.0.1 2009-09-04 20:58:55 +03:00
Petri Lehtinen
05654bfcba doc: Fix typo 2009-09-04 09:52:40 +03:00
Petri Lehtinen
89d09813c3 Add reference stealing functions for inserting values to objects and arrays
The non-stealing functions are now just simple wrappers around these.
2009-09-04 09:52:37 +03:00
Petri Lehtinen
5ac4914642 Change the version to 1.0+ 2009-09-02 23:10:46 +03:00
Petri Lehtinen
6b70406bf4 jansson 1.0 2009-08-25 21:50:47 +03:00
Petri Lehtinen
390b0ba633 Distribute appropriate files 2009-08-25 21:48:34 +03:00
Petri Lehtinen
251722d499 Add README and API reference 2009-08-13 18:38:03 +03:00