aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2010-03-28Merge branch '1.2'Petri Lehtinen4-16/+19
Conflicts: configure.ac
2010-03-28Support compilers that don't have the "inline" keywordPetri Lehtinen3-8/+18
Use AC_C_INLINE autoconf macro, include config.h where needed, and add a define of JSON_INLINE to jansson.h that has the correct "inline" keyword.
2010-03-26Estimate real number underflows with 0.0Petri Lehtinen1-8/+1
Earlier it was a decoding error.
2010-03-23Merge branch '1.2'Petri Lehtinen5-6/+13
2010-03-23Fix reference counting on true, false and nullPetri Lehtinen1-3/+3
Initialize their reference counts to (unsigned int)-1 to disable reference counting on them. It already was meant to work like this, but the reference counts were just initialized to 1 instead of -1. Thanks to Andrew Thompson for reporting this issue.
2010-03-18c++ wrapper: add missing 'inline' statements to various constructorsAndres Freund1-6/+6
the missing 'inline' leads to duplicated symbols if the header is included into two separately compiled files.
2010-03-18Don't include stdint.h anywherePetri Lehtinen1-1/+1
This should have fixed by commit 28682322, but there was one #include left in utf.c. It now includes utf.h instead of stdint.h.
2010-02-11hashtable: Fix typo in commentPetri Lehtinen1-1/+1
2010-02-11Merge branch 'c++-enhance-proxies'Petri Lehtinen2-7/+54
2010-02-11Implement JSON_PRESERVE_ORDER encoding flagPetri Lehtinen4-20/+65
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-09Optimize hashtable_set()Petri Lehtinen1-16/+24
If a key already exists in the hashtable, use the existing pair changing its value instead of removing the old one and allocating a new pair.
2010-02-08C++: Optimize PropertyProxyPetri Lehtinen2-6/+18
When the property already exists in the object, we can store an iterator pointing to that property, instead of duplicating the key. When the property (key) is not present in the object, we still have to duplicate the key.
2010-02-07C++: Make proxies saferPetri Lehtinen2-5/+40
If a user happens to store an ElementProxy or a PropertyProxy instance, we need to take a reference to the JSON value they point to. With PropertyProxy, the key needs to be copied as well.
2010-02-06Make int32_t available on all systemsPetri Lehtinen3-2/+9
Use AC_TYPE_INT32_T and include inttypes.h (if it exists) instead of stdint.h for maximum portability.
2010-02-04Merge branch '1.2'Petri Lehtinen12-12/+12
Conflicts: LICENSE
2010-02-04C++: Add Value::dump_file(), load_file() and loads() that take an std::stringPetri Lehtinen2-0/+16
2010-02-04C++: Rename some functions to better match the C APIPetri Lehtinen2-8/+8
Value::save_file -> Value::dump_file Value::save_string -> Value::dumps load_string -> loads
2010-02-04C++: #include <cstdio> in jansson.hppPetri Lehtinen1-0/+5
This is to avoid standard C functions ending up in namespace json, as jansson.h is #included in there, and jansson.h in turn #includes stdio.h.
2010-02-02Add year 2010 to copyright noticesPetri Lehtinen12-12/+12
2010-02-02Add myself as another copyright holder for jansson.hpp and jansson.ippPetri Lehtinen2-0/+2
2010-02-02C++: Rename jansson-impl.hpp to jansson.ippPetri Lehtinen3-7/+7
The .ipp suffix is for inlined template implementation code. While at it, use #ifdef and #ifndef instead of #if defined().
2010-02-02C++: Rename namespace json::_private to json::detailPetri Lehtinen2-12/+12
2010-02-02C++: Untabify, reindent, delete trailing whitespacePetri Lehtinen2-673/+673
2010-02-01Add functions json_object_iter_{at,set,set_new}Petri Lehtinen4-0/+77
2010-01-21Merge branch 'c++-api'Petri Lehtinen3-1/+773
2010-01-21jansson 1.2v1.2Petri Lehtinen1-1/+1
2010-01-18add meaningful copyright to jansson-impl.hpp tooSean Middleditch1-4/+2
2010-01-18add meaningful copyright to jansson.hppSean Middleditch1-4/+2
2010-01-18integrate jansson.hpp into build and test suiteSean Middleditch1-1/+1
2010-01-18Merge branch 'master' of /home/elanthis/Source/janssonxxSean Middleditch2-0/+776
Conflicts: .gitignore
2010-01-10Fix memory leaks in json_*_deep_copy()Petri Lehtinen1-2/+2
2010-01-10Use _nocheck functions internally for speedPetri Lehtinen1-4/+4
There are some places where we copy a string from an existing JSON value. In these cases the string has already been checked for valid UTF-8.
2009-12-31Add functions for shallow and deep copying JSON valuesPetri Lehtinen2-0/+161
2009-12-31Add equality test for JSON valuesPetri Lehtinen2-0/+98
2009-12-23Add _nocheck functionsPetri Lehtinen3-12/+18
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-21Merge branch '1.1'Petri Lehtinen2-6/+6
2009-12-21Remove const qualifier from the json_t parameter in json_*_set() functions.Petri Lehtinen2-6/+6
It's incorrect as these functions modify the value.
2009-12-21Merge branch '1.1'Petri Lehtinen3-3/+20
Conflicts: configure.ac doc/conf.py
2009-12-18jansson 1.1.3v1.1.3Petri Lehtinen1-1/+1
2009-12-18Encode reals correctlyPetri Lehtinen1-1/+16
This patch changes the sprintf format from "%0.17f" to "%.17g", as the f format specifier doesn't print the exponent at all. This caused losing precision in all but the most simple cases. Because the g specifier doesn't print the decimal fraction or exponent if they're not needed, a ".0" has to be appended by hand in these cases. Otherwise the value's type changes from real to integer when decoding again. Thanks to Philip Grandinetti for reporting this issue.
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-29Only export symbols starting with "json_" in libjansson.laPetri Lehtinen1-1/+3
This way we don't pollute the symbol namespace with internal symbols.
2009-11-29Make parse_json staticPetri Lehtinen1-1/+1
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