diff options
author | Mark Pulford <mark@kyne.com.au> | 2011-04-30 20:41:10 +0400 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2011-04-30 20:41:10 +0400 |
commit | 60fb31cfdd625ea3bc4a12a8440715c8ff0c9242 (patch) | |
tree | 58022c23864fde947839cf7ba0eb18749e4e7e07 /strbuf.c | |
parent | 058acaa9f2d52a4854650d19964bb7892c99d9af (diff) |
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 @@ #include "strbuf.h" -static void die(const char *format, ...) +void die(const char *fmt, ...) { va_list arg; - va_start(arg, format); - vfprintf(stderr, format, arg); + va_start(arg, fmt); + vfprintf(stderr, fmt, arg); va_end(arg); + fprintf(stderr, "\n"); exit(-1); } |