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/m_json/src/stdafx.h | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 plugins/MirLua/Modules/m_json/src/stdafx.h (limited to 'plugins/MirLua/Modules/m_json/src/stdafx.h') diff --git a/plugins/MirLua/Modules/m_json/src/stdafx.h b/plugins/MirLua/Modules/m_json/src/stdafx.h new file mode 100644 index 0000000000..d8ecdcacb5 --- /dev/null +++ b/plugins/MirLua/Modules/m_json/src/stdafx.h @@ -0,0 +1,37 @@ +#pragma once + +#include +#include +#include +//#include "..\..\..\src\mlua_metatable.h" + +#include +#include +#include + +struct JSON +{ + JSONNode *node; + bool bDelete; + + JSON(JSONNode &refNode, bool bCopy = false) + : node(bCopy ? json_copy(&refNode) : &refNode), bDelete(bCopy) { } + JSON(JSONNode *n, bool bD = true) + : node(n), bDelete(bD) { } + ~JSON() + { + if (bDelete) + json_delete(node); + } + + __inline void* operator new(size_t size, lua_State *L) + { + return lua_newuserdata(L, size); + } +}; + +void lua2json(lua_State *L, JSONNode &node); + +extern const luaL_Reg jsonApi[]; + +#define MT_JSON "JSON" \ No newline at end of file -- cgit v1.2.3