summaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
authorMark Pulford <mark@kyne.com.au>2011-05-01 02:11:10 +0930
committerMark Pulford <mark@kyne.com.au>2011-05-01 02:11:10 +0930
commit60fb31cfdd625ea3bc4a12a8440715c8ff0c9242 (patch)
tree58022c23864fde947839cf7ba0eb18749e4e7e07 /strbuf.c
parent058acaa9f2d52a4854650d19964bb7892c99d9af (diff)
downloadlua-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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/strbuf.c b/strbuf.c
index 44145dd..208a7be 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -5,13 +5,14 @@
5 5
6#include "strbuf.h" 6#include "strbuf.h"
7 7
8static void die(const char *format, ...) 8void 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}