                               luaposix
                               --------

                     Reuben Thomas <rrt@sc3d.org>
                 https://github.com/rrthomas/luaposix


luaposix is a POSIX binding, including curses, for Lua 5.1 and 5.2;
like most libraries it simply binds to C APIs on the underlying
system, so it won't work on a non-POSIX system. However, it does try
to detect the level of POSIX conformance of the underlying system and
bind only available APIs.

luaposix is released under the MIT license, like Lua (see COPYING;
it's basically the same as the BSD license). There is no warranty.

Please report bugs and make suggestions by opening an issue on the
github tracker, or to the email address above.


Installation
------------

luaposix uses the GNU build system. For detailed instructions, see
INSTALL. For a quick start:

[If using git sources:

  ./bootstrap
]

  ./configure && make [&& make install]

The following options may be of interest if you have Lua installed on
non-default paths (as you are likely to on any system supporting more
than one version of Lua):

  --libdir=DIR            Install shared library in this directory
  --with-lua-prefix=DIR   Lua files are in DIR
  --with-lua-suffix=ARG   Lua binary and library files are suffixed with ARG

For example, on Debian or Ubuntu:

  CPPFLAGS='-I/usr/include/lua5.1' ./configure --libdir=/usr/local/lib/lua/5.1 --datadir=/usr/local/share/lua/5.1 --with-lua-suffix=5.1

To run some tests:

  make check

lunit is required for some of the tests. For a version of lunit that
works with Lua 5.2, see: https://github.com/dcurrie/lunit.git


Use
---

The library is split into two modules. The basic POSIX APIs are in
"posix"; the curses APIs in "curses".

There is some HTML documentation for the curses module; to obtain it,
run

  make doc

For the posix module, see lposix.c. For detailed documentation on
POSIX APIs, read the POSIX and curses man pages, or an online POSIX
reference such as:

  http://www.opengroup.org/onlinepubs/007904875/toc.htm

To see a summary of which POSIX APIs are available, run

  make show-funcs

Some documentation (possibly not up-to-date) with examples can be
found at http://wiki.alpinelinux.org/wiki/LuaPosix


Example code
------------

See the example program tree.lua, along with the tests in
tests*.lua.

GNU Zile 2.5 and later is written in Lua, using luaposix, so it
contains plenty of example code. See the lua branch of its git
repository at: http://git.savannah.gnu.org/cgit/zile.git/log/?h=lua


Bugs reports & patches
----------------------

Bug reports and patches are most welcome. Please use the github issue
tracker (see URL at top). There is no strict coding style, but please
bear in mind the following points when writing new code:

0. Follow existing code. There are a lot of useful patterns and
   avoided traps there.

1. 8-character indentation using TABs. Not my favourite either, but
   better than reformatting the code and losing much of the ability to
   follow the version control history.

2. No non-POSIX APIs; no platform-specific code. When wrapping APIs
   introduced in POSIX 2001 or later, add an appropriate #if. If your
   platform isn't quite POSIX, you may find a gnulib module to bridge
   the gap.
