summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Gather all test data into a tableMark Pulford2012-03-041-20/+32
| | | | Move all test data into a single data to tidy the main namespace.
* Add descriptions to all testsMark Pulford2012-03-042-160/+204
| | | | Rewrite test framework and add descriptions for all tests.
* Simplify configuration function codeMark Pulford2012-03-041-60/+47
| | | | | | | Simplify configuration functions by adding an argument position parameter to json_enum_option() and json_integer_option(). Create json_arg_init() to check the number of arguments and return the config data.
* Merge lua_json_decode() into json_decode()Mark Pulford2012-03-041-28/+14
| | | | Also ensure cjson.decode() only receives a single argument.
* Add tests for decode_max_depth()Mark Pulford2012-03-041-5/+13
|
* Use Lua CJSON instead of CJSON in documentationMark Pulford2012-03-041-3/+3
|
* Update copyright date range to include 2012Mark Pulford2012-03-045-6/+30
|
* Change default nesting limits to 1000Mark Pulford2012-03-042-5/+5
| | | | | Increase the default nesting limits to reduce the chance of accidently throwing an error on valid JSON out of the box.
* Improve benchmark stabilityMark Pulford2012-03-041-7/+36
| | | | | | | | | Update benchmark script to average the best half (round up) of the result set. Ensure the initial call rate is calculated from a run of at least 1ms. Remove garbage collection control since any variations due to garbage collection are better handled by averaging multiple results.
* Use static strtod() buffer where possibleMark Pulford2012-03-041-5/+13
| | | | | Use static strtod() buffer where possible to improve performance 5-10% under locales with a comma decimal point.
* Add option to encode invalid numbers as "null"Mark Pulford2012-03-043-111/+180
| | | | | Deprecate and replace refuse_invalid_numbers() with encode_invalid_numbers() and decode_invalid_numbers().
* Add configurable decode nesting limitMark Pulford2012-03-042-35/+89
| | | | | | | | | | | Lua 5.2 is able to extend the Lua stack much further than earlier versions. Recent testing shows it is possible for Lua CJSON to hit the process stack limit and segfault. Add a configurable JSON object/array nesting limit to prevent running out of process stack space. The current limit is 20 (same as encode). Add decode_max_depth() configuration function.
* Update rockspec to install lua2json/json2luaMark Pulford2012-03-041-0/+9
|
* Update RPM to install extra scripts via makeMark Pulford2012-03-041-2/+8
|
* Add make target for cjson.util and scriptsMark Pulford2012-03-041-5/+27
| | | | | | | Add install-extra make target to install cjson.util module, extra scripts and tests. Use "cp" / "chmod" instead of "install" since they are more portable.
* Rename "cjson-misc" module to "cjson.util"Mark Pulford2012-03-045-24/+24
|
* Move cjson-misc and scripts to "lua" directoryMark Pulford2012-03-043-0/+0
|
* Use DISABLE_INVALID_NUMBERS on WIN32 CMake buildsMark Pulford2012-03-041-7/+7
|
* Fix typo in manualMark Pulford2012-03-041-2/+2
|
* Update cjson-misc.lua file descriptionMark Pulford2012-03-041-1/+1
|
* Improve performance by tracking decode ptrMark Pulford2012-03-041-46/+49
| | | | | | | | | Track pointer to the current location in the JSON string, instead of an index to the string array. Improves decode performance 1-10%. json_next_token(): - Clean up white space handling and leave "ch" containing the current non-whitespace character.
* Update bench.lua to support different JSON modulesMark Pulford2012-03-043-41/+62
| | | | | | - Select via JSON_MODULE environment variable (default "cjson") - Custom runtime configuration can be stored in bench-MODNAME.lua - Add run_script() to cjson-misc and update lua2cjson.lua
* Add support to USE_INTERNAL_DTOA to CMake buildMark Pulford2012-03-041-7/+41
| | | | | - Provide build options for USE_INTERNAL_DTOA and MULTIPLE_THREADS - Link module with Lua library under Windows
* Limit significant digits in numbers.json to 14Mark Pulford2012-03-041-6/+6
| | | | | | The dtoa.c strtod() function slows down significantly when the number of digits exceeds the accuracy of a "double". JSON containing excessive digits is an unrepresentative test, limit to 14 digits.
* Add error checking to dtoa locking primitivesMark Pulford2012-03-041-4/+12
|
* Document dtoa build optionsMark Pulford2012-03-041-0/+16
|
* Use internal dtoa/strtod for double conversionMark Pulford2012-03-046-16/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | The internal Lua CJSON dtoa/strtod routines have locale support disabled. This avoids problems under locales with comma decimal separators. Build changes: - CMake: Check for big endian architectures - Makefile: Provide option to build with dtoa.c Modifications to dtoa.c: - Include locale dtoa_config.h configuration - Rename Infinity/NaN to inf/nan to match common C libraries - Rename strtod() -> internal_strtod() to prevent conflict with libc function Modifications to g_fmt.c: - Return output string length (instead of original buffer pointer) - Provide precision as an argument to g_fmt() - Silence compilations warnings from vendor source - while(a = b) - Unused label "done:" - Only swap to scientific notation when once the number of decimal digits required exceeds the precision available. This matches standard printf format %g. - Display a "0" in front of numbers < 1.
* Merge branch 'vendor-netlib-dtoa'Mark Pulford2012-03-042-0/+4460
|\
| * Added Netlib dtoa.c/g_fmt.c routines (20110428)Mark Pulford2011-12-292-0/+4460
| | | | | | | | See "www.netlib.org/fp/changes" for details.
* | Add support for Lua 5.2 environments to lua2jsonMark Pulford2012-01-031-9/+23
| |
* | Rename encode/decode scripts to lua2json/json2luaMark Pulford2012-01-032-6/+6
| |
* | Convert common.lua into cjson-misc moduleMark Pulford2012-01-035-35/+43
| |
* | Tidy Makefile sections and commentsMark Pulford2012-01-021-17/+16
| |
* | Fix Windows TARGET modificationsMark Pulford2012-01-021-3/+3
| |
* | Fix typos (lists, hexadecimal)Mark Pulford2012-01-022-9/+9
| |
* | Update all package descriptions for consistencyMark Pulford2012-01-023-9/+19
| |
* | Add build option to disable invalid numbersMark Pulford2012-01-014-16/+39
| | | | | | | | | | Windows MinGW doesn't convert Infinity/NaN/hexadecimal numbers. Add DISABLE_INVALID_NUMBERS build option option to disable invalid numbers.
* | Sanitise locale code, comments and documentationMark Pulford2012-01-014-41/+71
| |
* | Add Windows MinGW target to MakefileMark Pulford2012-01-011-4/+12
| |
* | Add NDEBUG to performance CFLAGSMark Pulford2011-12-311-1/+1
| |
* | Remove redundant comment from test.luaMark Pulford2011-12-311-7/+0
| |
* | Update NEWS for 1.0.5Mark Pulford2011-12-311-1/+5
| |
* | Minor code cleanupMark Pulford2011-12-311-10/+12
| | | | | | | | | | | | - Sanitised arg ordering to encode functions - Commented json->tmp to explain why decode string processing uses strbuf_*_unsafe() functions.
* | Remove "update_locale" Lua functionMark Pulford2011-12-312-10/+2
| | | | | | | | | | | | | | Only update the locale when the module is initialised. cjson.new() can be used if the locale changes part way through program execution.
* | Add option for private bufferMark Pulford2011-12-311-26/+44
| | | | | | | | | | | | When encode_keep_buffer is false, a private buffer will be used. This will allow multiple encoders to run within a single Lua state.
* | Fix minor warning from Clang analyzerMark Pulford2011-12-311-1/+1
| |
* | Remove shared current_depth var from cfg structMark Pulford2011-12-311-25/+17
| |
* | Remove strbuf:die() from global symbol tableMark Pulford2011-12-301-1/+1
| |
* | Add support for Lua 5.2 and cjson.newMark Pulford2011-12-308-47/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Update all Lua scripts to use new module init style everywhere: local json = require "cjson" Lua CJSON does not register a global table under Lua 5.2. The global table can be disabled under Lua 5.1 with DISABLE_CJSON_GLOBAL. Other changes: - Store CJSON configuration as an upvalue for each function. - Add "cjson.new" function to create another module table with a separate configuration. - Add _NAME and _VERSION variables.
* | Add fpconv to work around comma decimal pointsMark Pulford2011-12-308-20/+206
| | | | | | | | | | | | | | | | Create a separate buffer and translate comma <> dot before calling strtod(), and after calling sprintf() as required. - Add "update_locale" Lua API call and init locale on module load. - Move sprintf format string to fpconv