Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Lua bindings for POSIX APIs
C Shell Lua Makefile

This branch is 54 commits behind luaposix:master

signal: workaround a printf long vs int type coercion issue.

* ext/posix/signal.c (sig_handle): Some architectures use a long
for sig_atomic_t, so we need a %ld specifier to display it without
a warning.  In case sig_atomic_t is narrower than a long, cast it
up before passing to fprintf.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
latest commit 9e8857930a
@gvvaughan gvvaughan authored
Failed to load latest commit information.
build-aux doc: use OpenGroup SUSv3 urls for manual page links.
examples signal: modernize posix.signal.
ext signal: workaround a printf long vs int type coercion issue.
gnulib
lib posix.lua: use error, not die; fixes #201
m4 slingshot: adopt slingshot release mechanism.
slingshot slingshot: sync with upstream for lua 5.3.0 final support.
specs specs: accept '?' as function name in Lua bad argument errors.
.gitignore maint: commit git rockspec to master branch.
.prev-version maint: post-release administrivia.
.slackid slingshot: synch with upstream, for slack integrations.
.travis.yml slingshot: sync with upstream for lua 5.3.0 final support.
.x-update-copyright maint: update copyright notices to include 2014.
AUTHORS Mention where to look for other contributors.
COPYING maint: update copyrights.
ChangeLog.old Update Github URL.
NEWS.md sys.resource: add ifdef guards to RLIM_SAVED_CUR and RLIM_SAVED_MAX.
README.md maint: add Lua 5.3 to README.md.
bootstrap slingshot: sync with upstream.
bootstrap.conf configury: add ansicolors to travis_extra_rocks.
configure.ac configury: distribute posix.curses.html correctly.
local.mk configury: distribute posix.curses.html correctly.
luaposix-git-1.rockspec maint: commit git rockspec to master branch.
rockspec.conf rockspec: Lua 5.4 and higher not yet supported.

README.md

luaposix

By the luaposix project

travis-ci status Stories in Ready

luaposix is a POSIX binding, including curses, for Lua 5.1, 5.2 and 5.3; like most libraries it simply binds to C APIs on the underlying system, so it won't work on non-POSIX systems. 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.

Installation

The simplest way to install luaposix is with LuaRocks. To install the latest release (recommended):

luarocks install luaposix

To install current git master (for testing):

luarocks install https://raw.github.com/luaposix/luaposix/release/luaposix-git-1.rockspec

To install without LuaRocks, check out the sources from the repository and run the following commands:

cd luaposix
./bootstrap
./configure --prefix=INSTALLATION-ROOT-DIRECTORY
make all check install

Dependencies are listed in the dependencies entry of the file rockspec.conf. You will also need Autoconf and Automake.

See INSTALL for configure instructions and configure --help for details of available command-line switches.

Use

The library is split into submodules according to the POSIX header file API declarations.

HTML documentation can be generated with LDoc by running make doc or viewed online at http://luaposix.github.io/luaposix/.

The authoritative online POSIX reference is at http://www.opengroup.org/onlinepubs/007904875/toc.htm.

Example code

See the example program tree.lua, along with the many small examples in the generated documentation and BDD specs/*_spec.yaml.

For a complete application, see the GNU Zile.

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:

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

  2. 8-character indentation using TABs in C sources; 2-character indentation using SPACEs in Lua sources.

  3. 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. If absolutely necessary, use autoconf feature tests.

  4. Thin wrappers: although some existing code contradicts this, wrap POSIX APIs in the simplest way possible. If necessary, more convenient wrappers can be added in Lua (posix.lua).

Something went wrong with that request. Please try again.