diff options
author | cracyc <cracyc@users.noreply.github.com> | 2017-03-20 13:11:00 -0500 |
---|---|---|
committer | cracyc <cracyc@users.noreply.github.com> | 2017-03-20 13:11:38 -0500 |
commit | b4fc8d8c387824c9714a3fb71c550544b8a4b72d (patch) | |
tree | 914e17ef06070d0a8b8166d07da18da494c10758 | |
parent | 6db02810e47b14177ed62374c8b3fa72a654c16f (diff) |
luaengine: add emu_file::write, enables the use of sockets and pipes from lua without needing a third party library (nw)
-rw-r--r-- | src/frontend/mame/luaengine.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp index 79e65d4e9c9..7e7d5d78572 100644 --- a/src/frontend/mame/luaengine.cpp +++ b/src/frontend/mame/luaengine.cpp @@ -778,6 +778,7 @@ void lua_engine::initialize() emu.new_usertype<emu_file>("file", sol::call_constructor, sol::constructors<sol::types<const char *, uint32_t>>(), "read", [](emu_file &file, sol::buffer *buff) { buff->set_len(file.read(buff->get_ptr(), buff->get_len())); return buff; }, + "write", [](emu_file &file, const std::string &data) { return file.write(data.data(), data.size()); }, "open", static_cast<osd_file::error (emu_file::*)(const std::string &)>(&emu_file::open), "open_next", &emu_file::open_next, "seek", &emu_file::seek, |