github.com/aergoio/aergo@v1.3.1/contract/util.h (about) 1 #include "lua.h" 2 #include "vm.h" 3 #include <stdbool.h> 4 5 #define UTF8_MAX 8 6 7 char *lua_util_get_json (lua_State *L, int idx, bool json_form); 8 int lua_util_json_to_lua (lua_State *L, char *json, bool check); 9 char *lua_util_get_json_from_stack (lua_State *L, int start, int end, bool json_form); 10 void minus_inst_count(lua_State *L, int count); 11 12 int luaopen_json(lua_State *L); 13 int lua_util_utf8_encode(char *s, unsigned ch); 14 15 #define strPushAndRelease(L,s) \ 16 do { \ 17 lua_pushstring((L), (s)); \ 18 free((s)); \ 19 } while(0) 20