| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Remove ENABLE_CJSON_GLOBAL option since it is not recommended or
necessary and doesn't need to be discussed in the manual.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Disable registration of cjson module table global variable in the
default build. Automatically creating a variable in the global namespace
can cause issues for other software and is no longer recommended with
Lua.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
Windows MinGW doesn't convert Infinity/NaN/hexadecimal numbers. Add
DISABLE_INVALID_NUMBERS build option option to disable invalid numbers.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
build-packages.sh has several advantages:
- Automatically bumps version numbers
- Builds HTML documentation on the fly
|
|
|
|
|
| |
The external #define complicates compilation but is only used in
lua_cjson.c and Makefile.
|
|
|
|
|
| |
Previously the the RPM build would overwrite CJSON_CFLAGS but didn't
provide the necessary default CFLAGS (-fpic -DVERSION ..).
|
|
|
|
|
|
|
| |
- Rename README to manual.txt and add AsciiDoc markup
- Rewrite some sections of documentation (more outstanding)
- Add "doc" Makefile target
- Update RPM spec file to include HTML output
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove GNU make "override" statements.
- Add OBJS variable since there is no portable way to specify all
targets for linking.
Also:
- Put build defaults at the top to avoid potential confusion.
- Don't assume a Linux platform. Default to USE_POSIX_SETLOCALE.
- Change "install -d" to mkdir/install since the former isn't
available on some platforms (Solaris).
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Add USE_POSIX_SETLOCALE option for platforms missing uselocale().
Document locale options in README, Makefile & rockspec.
Also:
- Rename USE_POSIX_LOCALE define to USE_POSIX_USELOCALE.
- Use uselocale() by default through Makefile (Linux, OSX).
- Use setlocale() by default through rockspec (other platforms).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some locales (cs_CZ, de_DE,..) use a comma as their decimal separator.
This causes CJSON to generate incorrect JSON (Eg, [10,1]), and fail when
parsing some valid JSON (Eg, [10,"test"]).
Added USE_POSIX_LOCALE #define which harnesses the thread-safe
POSIX.1-2008 locale support (newlocale(), uselocale(), freelocale())
to temporarily use the POSIX locale during JSON conversion.
Some older POSIX operating systems with xlocale.h (MacOSX) are also
supported.
|
|
|
|
|
|
|
| |
Some versions of Solaris (Eg, Solaris 11 / GCC 3.4.3) are missing
isinf(). Provide a work around when MISSING_ISINF is defined.
Reported by: Zhang "agentzh" Yichun <agentzh@gmail.com>
|
| |
|
| |
|
|
|
|
| |
Windows has poor support for "tar.gz", but all platforms support "zip".
|
| |
|
|
|
|
|
|
| |
Remove "-lm" from LDFLAGS in Makefile since it breaks the build under
Windows and isn't required under Linux. Math lib fix suggested by:
Steve Donovan <steve.j.donovan@gmail.com>
|
| |
|
| |
|
| |
|
|
- Add Makefile and RPM spec file
- Add cjson.version variable
|