summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/m_database.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-01-16 08:43:00 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-01-16 08:43:00 +0000
commitb97c40a7095474115cdeac7a93183353b203886b (patch)
treecd645b8b1cf0b2495f17173cace167b820798706 /plugins/MirLua/src/m_database.cpp
parent405496db2755c557583f4ad95d0279e4a55c4523 (diff)
MirLua: lambda-based metatables wrapper
git-svn-id: http://svn.miranda-ng.org/main/trunk@16096 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/m_database.cpp')
-rw-r--r--plugins/MirLua/src/m_database.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/MirLua/src/m_database.cpp b/plugins/MirLua/src/m_database.cpp
index 57846c99de..d6b7207cfb 100644
--- a/plugins/MirLua/src/m_database.cpp
+++ b/plugins/MirLua/src/m_database.cpp
@@ -665,16 +665,17 @@ LUAMOD_API int luaopen_m_database(lua_State *L)
lua_pop(L, 1);
MT<DBEVENTINFO>(L, MT_DBEVENTINFO)
- .Field(&DBEVENTINFO::szModule, "Module", LUA_TSTRINGA)
- .Field(&DBEVENTINFO::timestamp, "Timestamp", LUA_TINTEGER)
- .Field(&DBEVENTINFO::eventType, "Type", LUA_TINTEGER)
- .Field(&DBEVENTINFO::flags, "Flags", LUA_TINTEGER)
- .Field(&DBEVENTINFO::cbBlob, "Length", LUA_TINTEGER)
- .Field(&DBEVENTINFO::pBlob, "Blob", LUA_TLIGHTUSERDATA);
+ .Field(std::function<void*(DBEVENTINFO*)>([](DBEVENTINFO* p) { return p->szModule; }), "Module", LUA_TSTRINGA)
+ .Field(std::function<void*(DBEVENTINFO*)>([](DBEVENTINFO* p) { return (void*)p->timestamp; }), "Timestamp", LUA_TINTEGER)
+ .Field(std::function<void*(DBEVENTINFO*)>([](DBEVENTINFO* p) { return (void*)p->eventType; }), "Type", LUA_TINTEGER)
+ .Field(std::function<void*(DBEVENTINFO*)>([](DBEVENTINFO* p) { return (void*)p->flags; }), "Flags", LUA_TINTEGER)
+ .Field(std::function<void*(DBEVENTINFO*)>([](DBEVENTINFO* p) { return (void*)p->cbBlob; }), "Length", LUA_TINTEGER)
+ .Field(std::function<void*(DBEVENTINFO*)>([](DBEVENTINFO* p) { return p->pBlob; }), "Blob", LUA_TLIGHTUSERDATA);
+
lua_pop(L, 1);
MT<CONTACTINFO>(L, "CONTACTINFO")
- .Field(&CONTACTINFO::hContact, "hContact", LUA_TINTEGER)
+ .Field(std::function<void*(CONTACTINFO*)>([](CONTACTINFO* p) { return (void*)p->hContact; }), "hContact", LUA_TINTEGER)
.Method(ci__index, "__index");
lua_pop(L, 1);