CoronaLua.h

Type C header
Revision 2017.3060
Keywords iOS, enterprise, C
See also

Overview

CoronaLibrary.h contains C functions that enable you to create instances of the Lua type CoronaLibrary.

Functions

New()

int CoronaLibraryNew( lua_State *L, const char *libName, const char *publisherId, int version, int revision, const luaL_Reg libFuncs[], void *context )

Creates a library object in Lua and leaves it at the top of the stack.

This object is a Lua table that is an instance of CoronaLibrary. It initializes the table with the functions in libFuncs. If context is non-NULL, then each of those functions is registered as a closure with context as the first upvalue. That upvalue is stored as light userdata, so the caller is responsible for the lifetime of this object.

NewWithFactory()

int CoronaLibraryNewWithFactory( lua_State *L, lua_CFunction factory, const luaL_Reg libFuncs[], void *context )

Creates a library object by calling the Lua chunk factory and leaves it at the top of the stack.

The factory should return an instance of CoronaLibrary and should set the following table properties: name (String), publisherId (String), version (Number), and revision (Number). If 'factory' succeeds, then the functions in 'libFuncs' are added in the same manner as CoronaLibraryNew().