Termal is a library for developing terminal applications using Termbox. Termbox is an ncurses-like library with a very simple API. Termal aims to enable the easy construction of complex interfaces.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function int(t) | |
return t:byte(1)+t:byte(2)*0x100+t:byte(3)*0x10000+t:byte(4)*0x1000000 | |
end | |
function num_args(func) | |
local ok, dump = pcall(string.dump,func) | |
if (not ok) then return -1 end | |
local cursor = 13 | |
local offset = int(dump:sub(cursor)) | |
cursor = cursor + offset + 13 |