aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2009-12-16Implement JSON_SORT_KEYS encoding flagPetri Lehtinen2-13/+87
With this flag, the objects are sorted by key when encoding.
2009-12-05Implement JSON_ENSURE_ASCII encoding flagPetri Lehtinen5-22/+88
With this flag, all Unicode characters outside the ASCII range are escaped.
2009-12-02Use int32_t instead of plain int with Unicode code pointsPetri Lehtinen3-6/+10
On some architectures, int just isn't big enough to hold all Unicode code points.
2009-11-08Merge branch '1.1'Petri Lehtinen2-2/+1
Conflicts: configure.ac doc/conf.py
2009-11-08jansson 1.1.2v1.1.2Petri Lehtinen1-1/+1
2009-11-07Don't include stdint.h in jansson.hPetri Lehtinen1-1/+0
It's not needed
2009-11-04Merge branch '1.1'Petri Lehtinen1-1/+7
Conflicts: test/.gitignore test/testprogs/Makefile.am
2009-11-04dump: Revise whitespace usagePetri Lehtinen2-16/+25
- 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-10-29load: Parse a badly put - sign correctlyPetri Lehtinen1-1/+5
Thanks to Manolis Delakis for reporting.
2009-10-27json_load_file: Initialize the error struct properlyPetri Lehtinen1-0/+2
Failing to do this has the effect that the error message is not returned when the input file cannot be opened (e.g. if it doesn't exist). Thanks to Martin Vopatek for reporting.
2009-10-20jansson 1.1v1.1Petri Lehtinen1-1/+1
2009-10-19Add C++ guards to jansson.hraoulh1-0/+8
Signed-off-by: Petri Lehtinen <petri@digip.org>
2009-10-16Fix indentationPetri Lehtinen4-13/+14
No functional changes.
2009-10-15Enhance handling of circular referencesPetri Lehtinen3-42/+75
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-15json_dumps: Close the strbuffer if dumping failsPetri Lehtinen1-2/+6
2009-10-14Make integer, real and string mutablePetri Lehtinen2-4/+47
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-13Don't use non-portable asprintf()Petri Lehtinen1-14/+13
Thanks to Adam Strzelecki for reporting.
2009-10-11Merge branch '1.0'Petri Lehtinen3-6/+6
Conflicts: configure.ac doc/conf.py
2009-10-11jansson 1.0.4v1.0.41.0Petri Lehtinen1-1/+1
2009-10-11Extend object APIPetri Lehtinen4-13/+94
Added functions: json_object_size json_object_clear json_object_update
2009-10-10Check json_object_set_new argumentsPetri Lehtinen1-1/+1
A segfault was caused by NULL key.
2009-10-06Fix a few more compilation issuesPetri Lehtinen1-2/+2
These were left out from the previous commit.
2009-10-01Make it compile on platforms where char is unsignedPetri Lehtinen2-3/+3
Linux on powerpc seems to be one such platform.
2009-09-29Extend array APIPetri Lehtinen2-10/+158
Added functions: json_array_insert json_array_insert_new json_array_remove json_array_clear json_array_extend
2009-09-14Merge branch '1.0'Petri Lehtinen1-1/+1
Conflicts: configure.ac doc/conf.py
2009-09-14jansson 1.0.3v1.0.3Petri Lehtinen1-1/+1
2009-09-14load: Check for integer and real overlfows and underflowsPetri Lehtinen1-9/+40
Backported from master, commit 5406c2b3d347505149d382213b6f318f8c35de6a: * deleted test/testdata/invalid-stripped because the stripped tests don't exist in 1.0
2009-09-13load: Check for integer and real overlfows and underflowsPetri Lehtinen1-9/+40
2009-09-13Use unsigned long instead of uint32_tPetri Lehtinen2-8/+8
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-08Merge branch '1.0' into HEADPetri Lehtinen2-6/+3
Conflicts: configure.ac doc/conf.py
2009-09-08jansson 1.0.2v1.0.2Petri Lehtinen1-1/+1
2009-09-08load: Handle EOF correctlyPetri Lehtinen1-5/+2
In stream_get(), EOF never got it to stream->buffer and because of this, stream_unget() failed on some situations. This patch makes stream_get() handle EOF just like any other byte. As a "side effect", lex_scan_string() now needs to unget the EOF, or otherwise it ends up in error message on premature end of input.
2009-09-07Don't perform reference counting on true, false and nullPetri Lehtinen2-8/+8
This makes their constructors thread safe. A special reference count -1 is used to test whether to perform reference counting on a value or not.
2009-09-06Better argument validationPetri Lehtinen1-2/+23
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-06Don't include unistd.hPetri Lehtinen2-2/+0
It's not needed.
2009-09-06Merge branch '1.0'Petri Lehtinen2-2/+2
Conflicts: configure.ac doc/conf.py
2009-09-04jansson 1.0.1v1.0.1Petri Lehtinen1-1/+1
2009-09-04jansson.h: Fix typoPetri Lehtinen1-1/+1
json_is_true was spelled jsin_is_true. Quite fatal.
2009-09-04dump: Optimize indentingPetri Lehtinen1-8/+9
Don't alloca() a whitespace buffer and fill it with spaces in each call to dump_indent. Instead, use a static whitespace buffer. As a bonus, this saves the use of poorly portable alloca().
2009-09-04load: Factor out an unneeded strdupPetri Lehtinen1-1/+12
By "stealing" the string parsed out in lexer, one strdup can be saved.
2009-09-04Don't define -std=c99 in AM_CFLAGSPetri Lehtinen1-1/+1
It is not needed.
2009-09-04Add reference stealing functions for inserting values to objects and arraysPetri Lehtinen2-12/+60
The non-stealing functions are now just simple wrappers around these.
2009-08-24Detect garbage near EOF in json_loadf() and json_load_file()Petri Lehtinen1-0/+10
2009-08-23array: Fix a few checks and a leakPetri Lehtinen1-2/+4
2009-08-04Refuse to dump other types than array and object as the root valuePetri Lehtinen1-0/+6
2009-07-30Remove unimplemented json_clone()Petri Lehtinen1-2/+0
2009-07-30Add macro json_is_booleanPetri Lehtinen1-0/+1
2009-07-30Add LICENSE and a copyright note to all sourcesPetri Lehtinen10-0/+70
2009-07-28Rename json_{load,dump} to json_{load,dump}_filePetri Lehtinen3-35/+35
2009-07-28Fix some memory leaks and invalid memory referencesPetri Lehtinen2-7/+22