diff options
author | daurnimator <quae@daurnimator.com> | 2017-06-09 15:25:05 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-06-09 16:18:09 +1000 |
commit | b01bf7ef940503e373d59c912c9952582a608a77 (patch) | |
tree | 6304d51d53f9b72940fe90d78e8100b86213e3bd /src/lzio.js | |
parent | d47c82caf02bd21d05700c48a52d8be69db9ad7d (diff) | |
download | fengari-b01bf7ef940503e373d59c912c9952582a608a77.tar.gz fengari-b01bf7ef940503e373d59c912c9952582a608a77.tar.bz2 fengari-b01bf7ef940503e373d59c912c9952582a608a77.zip |
src/lzio.js: Introduce luaZ_resetbuffer
Diffstat (limited to 'src/lzio.js')
-rw-r--r-- | src/lzio.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/lzio.js b/src/lzio.js index 919ed44..72969d4 100644 --- a/src/lzio.js +++ b/src/lzio.js @@ -10,6 +10,11 @@ class MBuffer { } } +const luaZ_resetbuffer = function(buff) { + buff.n = 0; + buff.buffer = []; +}; + class ZIO { constructor(L, reader, data) { this.L = L; /* Lua state (for reader) */ @@ -74,8 +79,9 @@ const luaZ_read = function(z, b, b_offset, n) { return 0; }; -module.exports.EOZ = EOZ; -module.exports.luaZ_fill = luaZ_fill; -module.exports.luaZ_read = luaZ_read; -module.exports.MBuffer = MBuffer; -module.exports.ZIO = ZIO; +module.exports.EOZ = EOZ; +module.exports.luaZ_fill = luaZ_fill; +module.exports.luaZ_read = luaZ_read; +module.exports.luaZ_resetbuffer = luaZ_resetbuffer; +module.exports.MBuffer = MBuffer; +module.exports.ZIO = ZIO; |