lua-users home
lua-l archive

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

Hi all,

winapi [1] provides bindings for a fair number of useful Windows API
functions.  You can sleep, get the clipboard, list processes and
drives, access the registry, set up timers and named pipe servers and
do asynchronous I/O (backed by threads).   It's useful for GUI
programs (IUP, wxWindows, etc) that need to silently launch a process;
you can even use winapi timers and async i/o providing you call
winapi.use_gui() initially to route all callbacks through the main GUI

The full documentation [3] (done by ldoc) also links to the readme and
to the examples.

This version has a few renamings and a few nice new features.
winapi.get_console() gives you a File object which you can use to
async console input (say in a server program); open_serial() will open
a serial port using the same device description used by the old mode

There's a new function that expands two-byte Unicode values into UTF-8 strings.

    local U = winapi.utf8_expand

    txt = U '#03BB + #03BC + C'
    print(U '#03BD')
    ---> OUTPUT
    λ + μ + C

winapi.short_path will take an encoded pathname and return a plain
ASCII equivalent which can be used by Lua I/o.

New experiments like open_serial() have not been exhaustively tested,
but this _is_ a beta release ;)

There are _five_ binaries [2], depending on whether you're Lua 5.1 or
5.2, 32 or 64, lfw or gcc runtime.

steve d.