Home

Awesome

NCLua

The NCLua library adds event handling and 2D graphics to Lua scripts. Programs written in C can use libnclua to run embedded NCLua scripts, i.e., Lua scripts that use the APIs exported by libnclua; Lua scripts can also use libnclua, either through the C API or by requiring the appropriated modules -- e.g., canvas for 2D graphics, event for general event handling, event.stopwatch for stopwatch timers, event.tcp_socket for asynchronous TCP sockets, event.http_soup for asynchronous HTTP requests, etc. The NCLua library comes with a standalone interpreter, called nclua (cf. src/nclua.c), which can be used to run NCLua scripts.

For stable releases and binaries, cf. http://www.telemidia.puc-rio.br/~gflima/nclua.

For the latest sources, cf. https://github.com/telemidia/nclua.

NCLua is the Lua dialect used by the Brazilian digital TV middleware, called Ginga (cf. http://www.ginga.org.br). The reference implementation of Ginga (>= 0.14) uses libnclua to run NCLua scripts.

Building the repository

Dependencies

Required:

Optional:

GIO is used by the tcp event class, Libsoup is used by the http event class, and GTK+ is used by the nclua binary. These libraries are optional, if they are not present the corresponding modules are not built.

Linux

On Ubuntu-based distros, to install the dependencies run:

$ sudo apt-get install -y git gcc g++ autotools-dev dh-autoreconf \
    liblua5.2-dev libglib2.0-dev libpango1.0-dev \
    librsvg2-dev libgtk-3-dev libsoup2.4-dev -qq

To build with autotools run:

$ ./bootstrap
$ ./configure --prefix=/usr/
$ make

Canvas API

For a complete reference, cf. nclua/canvas.c.

Functions:

Internal functions (for debugging):

Dir API

For a complete reference, cf. nclua/dir.c.

Functions:

Event API

For a complete reference, cf. User API section in nclua/event/init.lua.

Event classes:

Functions:

Libnclua API (C code)

The libnclua API is used by C programs to run NCLua scripts.

Core functions (cf. lib/nclua.c):

Wrapper functions (cf. lib/ncluaw.c, Lua-free interface):


Copyright (C) 2013-2018 PUC-Rio/Laboratorio TeleMidia

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the "GNU Free Documentation License" file as part of this distribution.