Streaming I/O and support of named pipes (#570)
* added streaming i/o for scripting, and a byteutil.get_size function * added i/o stream class, also added named pipes support on lua side via ffi * added constant file.named_pipes_prefix * added buffered and yield modes for io_stream * added new time function for work with UTC - utc_time, utc_offset, local_time * docs updated * constant pid moved to os.pid * now gmtime_s and localtime_s used only in windows
This commit is contained in:
@@ -197,9 +197,16 @@ static int l_tpack(lua::State* L) {
|
||||
return pack(L, format, true);
|
||||
}
|
||||
|
||||
static int l_get_size(lua::State* L) {
|
||||
return lua::pushinteger(
|
||||
L, static_cast<int>(calc_size(lua::require_string(L, 1)))
|
||||
);
|
||||
}
|
||||
|
||||
const luaL_Reg byteutillib[] = {
|
||||
{"pack", lua::wrap<l_pack>},
|
||||
{"tpack", lua::wrap<l_tpack>},
|
||||
{"unpack", lua::wrap<l_unpack>},
|
||||
{"get_size", lua::wrap<l_get_size>},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user