functionvtansi.vtemu(gpu)-- takes GPU component proxy *gpu* and returns a function to write to it in a manner like an ANSI terminal
functionvtansi.vtemu(gpu)-- table -- function -- takes GPU component proxy *gpu* and returns a function to write to it in a manner like an ANSI terminal
@ -142,7 +142,7 @@ function vtansi.vtemu(gpu) -- takes GPU component proxy *gpu* and returns a func
returntermwrite
end
functionvtansi.vtsession(gpua,scra)-- creates a process to handle the GPU and screen address combination *gpua*/*scra*. Returns read, write and "close" functions.
functionvtansi.vtsession(gpua,scra)-- string string -- table -- creates a process to handle the GPU and screen address combination *gpua*/*scra*. Returns read, write and "close" functions.
functiondevfs.register(fname,fopen)-- Register a new devfs node with the name *fname* that will run the function *fopen* when opened. This function should return a function for read, a function for write, function for close, and optionally, a function for seek, in that order.
functiondevfs.register(fname,fopen)-- string function -- -- Register a new devfs node with the name *fname* that will run the function *fopen* when opened. This function should return a function for read, a function for write, function for close, and optionally, a function for seek, in that order.
functionio.open(path,mode)-- Open file *path* in *mode*. Returns a buffer object.
functionio.open(path,mode)-- string string -- table -- Open file *path* in *mode*. Returns a buffer object.
localf,e=fs.open(path,mode)
ifnotfthenreturnfalse,eend
returnbuffer.new(mode,f)
end
functionio.input(fd)-- Sets the default input stream to *fd* if provided, either as a buffer as a path. Returns the default input stream.
functionio.input(fd)-- table -- table -- Sets the default input stream to *fd* if provided, either as a buffer as a path. Returns the default input stream.
iftype(fd)=="string"then
fd=io.open(fd,"rb")
end
@ -15,7 +15,7 @@ function io.input(fd) -- Sets the default input stream to *fd* if provided, eith
end
returnos.getenv("STDIN")
end
functionio.output(fd)-- Sets the default output stream to *fd* if provided, either as a buffer as a path. Returns the default output stream.
functionio.output(fd)-- table -- table -- Sets the default output stream to *fd* if provided, either as a buffer as a path. Returns the default output stream.
functionrequire(f,force)-- searches for a library with name *f* and returns what the library returns, if possible. if *force* is set, loads the library even if it is cached
functionrequire(f,force)-- string boolean -- table -- searches for a library with name *f* and returns what the library returns, if possible. if *force* is set, loads the library even if it is cached
ifnotpackage.loaded[f]orforcethen
locallib=os.getenv("LIB")or"/boot/lib"
fordinlib:gmatch("[^\n]+")do
@ -29,6 +29,6 @@ function require(f,force) -- searches for a library with name *f* and returns wh
end
error("library not found: "..f)
end
functionreload(f)
functionreload(f)-- string -- table -- Reloads library *f* from disk into memory.
functionos.chdir(p)-- changes the current working directory of the calling process to the directory specified in *p*, returning true or false, error
functionos.chdir(p)-- string -- boolean string -- changes the current working directory of the calling process to the directory specified in *p*, returning true or false, error