mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
luaengine: add emu_file::write, enables the use of sockets and pipes from lua without needing a third party library (nw)
This commit is contained in:
parent
6db02810e4
commit
b4fc8d8c38
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user