summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend
diff options
context:
space:
mode:
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
commitb4fc8d8c387824c9714a3fb71c550544b8a4b72d (patch)
tree914e17ef06070d0a8b8166d07da18da494c10758 /src/frontend
parent6db02810e47b14177ed62374c8b3fa72a654c16f (diff)
luaengine: add emu_file::write, enables the use of sockets and pipes from lua without needing a third party library (nw)
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/mame/luaengine.cpp1
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,