From 1b6c4e6e4a16ed49570e1787641e5af79dba23f7 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 19 Jun 2016 18:42:13 +0000 Subject: MirLua: almost work m_json git-svn-id: http://svn.miranda-ng.org/main/trunk@17013 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/Modules/JSON/src/json.cpp | 33 -------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 plugins/MirLua/Modules/JSON/src/json.cpp (limited to 'plugins/MirLua/Modules/JSON/src/json.cpp') diff --git a/plugins/MirLua/Modules/JSON/src/json.cpp b/plugins/MirLua/Modules/JSON/src/json.cpp deleted file mode 100644 index c8680c753c..0000000000 --- a/plugins/MirLua/Modules/JSON/src/json.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "stdafx.h" - -static int lua_decode(lua_State *L) -{ - const char *string = luaL_checkstring(L, 1); - new (L) MT(json_parse(string)); - luaL_setmetatable(L, MT_JSON); - return 1; -} - -int json__call(lua_State *L); -static int lua_encode(lua_State *L) -{ - return json__call(L); -} - -static const luaL_Reg methods[] = -{ - { "decode", lua_decode }, - { "encode", lua_encode }, - { NULL, NULL } -}; - -LUA_LIBRARY_EXPORT(json) -{ - luaL_newlib(L, methods); - - luaL_newmetatable(L, MT_JSON); - luaL_setfuncs(L, jsonApi, 0); - lua_pop(L, 1); - - return 1; -} \ No newline at end of file -- cgit v1.2.3