diff options
author | Mark Pulford <mark@kyne.com.au> | 2011-05-01 02:11:10 +0930 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2011-05-01 02:11:10 +0930 |
commit | 60fb31cfdd625ea3bc4a12a8440715c8ff0c9242 (patch) | |
tree | 58022c23864fde947839cf7ba0eb18749e4e7e07 /strbuf.c | |
parent | 058acaa9f2d52a4854650d19964bb7892c99d9af (diff) | |
download | lua-cjson-60fb31cfdd625ea3bc4a12a8440715c8ff0c9242.tar.gz lua-cjson-60fb31cfdd625ea3bc4a12a8440715c8ff0c9242.tar.bz2 lua-cjson-60fb31cfdd625ea3bc4a12a8440715c8ff0c9242.zip |
Create "cjson" Lua module, support UCS-2 escapes
- Convert lua_json_init() into luaopen_cjson() to support dynamic .so
loading.
- Rename "json" to "cjson" to reduce conflicts with other JSON modules.
- Remove unnecessary *_pcall_* API. Lua calls are fast enough,
even through C.
- Encode empty tables as objects
- Add support for decoding all UCS-2 escape codes.
Diffstat (limited to 'strbuf.c')
-rw-r--r-- | strbuf.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -5,13 +5,14 @@ | |||
5 | 5 | ||
6 | #include "strbuf.h" | 6 | #include "strbuf.h" |
7 | 7 | ||
8 | static void die(const char *format, ...) | 8 | void die(const char *fmt, ...) |
9 | { | 9 | { |
10 | va_list arg; | 10 | va_list arg; |
11 | 11 | ||
12 | va_start(arg, format); | 12 | va_start(arg, fmt); |
13 | vfprintf(stderr, format, arg); | 13 | vfprintf(stderr, fmt, arg); |
14 | va_end(arg); | 14 | va_end(arg); |
15 | fprintf(stderr, "\n"); | ||
15 | 16 | ||
16 | exit(-1); | 17 | exit(-1); |
17 | } | 18 | } |