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
thread.

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
command.

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

    local U = winapi.utf8_expand
    winapi.set_encoding(winapi.UTF8)

    txt = U '#03BB + #03BC + C'
    print(txt)
    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.

1. https://github.com/stevedonovan/winapi
2.
 http://stevedonovan.github.com/files/winapi13-51lfw32.zip
 http://stevedonovan.github.com/files/winapi13-51gcc32.zip
 http://stevedonovan.github.com/files/winapi13-52gcc32.zip
 http://stevedonovan.github.com/files/winapi13-51gcc64.zip
 http://stevedonovan.github.com/files/winapi13-52gcc64.zip

3. http://stevedonovan.github.com/winapi/api.html