diff options
author | Mark Pulford <mark@kyne.com.au> | 2011-04-26 11:45:29 +0930 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2011-04-26 11:45:29 +0930 |
commit | 058acaa9f2d52a4854650d19964bb7892c99d9af (patch) | |
tree | 7fedf546f02fcbc72d2559c1865b64d3d3843d9c | |
parent | f38fe55aa432317357a14b4993c75a784bdc75dc (diff) | |
download | lua-cjson-058acaa9f2d52a4854650d19964bb7892c99d9af.tar.gz lua-cjson-058acaa9f2d52a4854650d19964bb7892c99d9af.tar.bz2 lua-cjson-058acaa9f2d52a4854650d19964bb7892c99d9af.zip |
Update lua_json pcall API naming convention
-rw-r--r-- | lua_json.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -262,9 +262,10 @@ char *lua_json_encode(lua_State *l, int *len) | |||
262 | return json; | 262 | return json; |
263 | } | 263 | } |
264 | 264 | ||
265 | /* lua_c_json_encode(object) must be called via lua_pcall(). | 265 | /* lua_json_pcall_encode(object) must be called via lua_pcall(). |
266 | * It can be used to catch any encoder exceptions */ | 266 | * This allows a C caller to catch any errors without needing |
267 | int lua_c_json_encode(lua_State *l) | 267 | * to register the string with Lua for garbage collection. */ |
268 | int lua_json_pcall_encode(lua_State *l) | ||
268 | { | 269 | { |
269 | char *json; | 270 | char *json; |
270 | int len; | 271 | int len; |
@@ -666,8 +667,10 @@ void lua_json_decode(lua_State *l, const char *json_text) | |||
666 | strbuf_free(json.tmp); | 667 | strbuf_free(json.tmp); |
667 | } | 668 | } |
668 | 669 | ||
669 | /* lua_c_json_decode(string) must be called from C with lua_pcall() */ | 670 | /* lua_json_pcall_decode(string) must be called via lua_pcall(). |
670 | int lua_c_json_decode(lua_State *l) | 671 | * This allows a C caller to catch any errors so the string can |
672 | * be freed before returning to Lua. */ | ||
673 | int lua_json_pcall_decode(lua_State *l) | ||
671 | { | 674 | { |
672 | const char *json; | 675 | const char *json; |
673 | 676 | ||