Browse Source

added type annotations and function documentation to liblz16 and pkgfs

master
Izaya 2 years ago
parent
commit
97e559f26f
  1. 4
      lib/liblz16.lua
  2. 2
      lib/pkgfs.lua

4
lib/liblz16.lua

@ -54,14 +54,14 @@ local function writeBuffer(fo)
return buffer.new("wb",stream)
end
function lz16.buffer(stream)
function lz16.buffer(stream) -- table -- table -- Wrap a stream to read or write LZ16.
if stream.mode.w then
return writeBuffer(stream)
end
return readBuffer(stream)
end
function lz16.open(fname, mode)
function lz16.open(fname, mode) -- string string -- table -- Open file *fname* to read or write LZ16-compressed data depending on *mode*
local f = io.open(fname, mode)
if not f then return false end
f.mode.b = true

2
lib/pkgfs.lua

@ -98,7 +98,7 @@ function pkgfs.component.close(handle)
return true
end
function pkgfs.add(fname,comp)
function pkgfs.add(fname,comp) -- string boolean -- -- Add a package as specified in *fname* to the pkgfs component. If *comp* is true, read it as a LZ16-compressed package.
if fname:sub(1,1) ~= "/" then
fname = "/"..fnormalize(os.getenv("PWD").."/"..fname)
end

Loading…
Cancel
Save