Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpx/lua-cjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Pulford <mark@kyne.com.au>2011-04-30 20:41:10 +0400
committerMark Pulford <mark@kyne.com.au>2011-04-30 20:41:10 +0400
commit60fb31cfdd625ea3bc4a12a8440715c8ff0c9242 (patch)
tree58022c23864fde947839cf7ba0eb18749e4e7e07 /strbuf.c
parent058acaa9f2d52a4854650d19964bb7892c99d9af (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.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 @@
#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);
}