lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Per request I've cleaned up my minimal S-Lang console i/o binding for Lua, and anyone who is interested can find
it here: http://www.gweep.net/~glitch/lua_slang.zip

That server may dissappear at the end of june (iirc), so get it now if you want it. This is public domain,
unsupported, and may or may not be updated in the future. The feature set is pretty minimal, functions and
documentation are in the header lua_slang.h, with some utility and test code in slang_stub.lua, and a main.cpp
example program & Makefile (edit it to point to your Lua and S-Lang headers & libs).  It has only been tested on
win2k, building with msys/mingw, Lua 5.0.2, and slang 1.4.9.  FYI, the msys shell will not run it, so use a
regular command prompt (and disable the quick 'edit options' properties if you want mouse input).  Don't run the
test program on a remote terminal - the output test displays pages of ascii gibberish (and a nice test pattern
with all the symbols and color combos) as fast as possible.

Included are the functions: init, reset, mousemode, getinput, dimensions, gotorc, getrc, setcolor, writechar,
writestring, refresh, clear, resize, showcursor, and flushinput.

I nice-ified some of the functions (for multiple return values, alternate argument types, etc), and some things to
watch out for include: input & escape handling (there's some simple checking, but you probably want to customize
getinput), row/column ordering for params & return values, and so on.  Init values and the color table (ascii 
attributes) are fixed, but you can do whatever you want with this stuff.

Enjoy,

-Lucas