Lua Core reference

| axe.lua: | Functions | Modinfo | Source |

# Lua Core

"Lua is an extension programming language designed to support general procedural programming with data description facilities. It also offers good support for object-oriented programming, functional programming, and data-driven programming. Lua is intended to be used as a powerful, light-weight scripting language for any program that needs one. " (from "Lua 5.1 Reference Manual" by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes)
This module provides a BlitzMax interface to the Lua main and auxiliary APIs. It is almost complete, the only functions missing are those with variable argument lists (which are not yet supported by BlitzMax).
The axe.lua package also contains the full Lua 5.1.4 distribution. The Lua source code is completely integrated into the module, additional DLLs (or shared libraries, resp.) are no longer required.

## Lua Documentation

The Lua Reference Manual is part of this distribution and may be directly visited from here:

- Lua 5.1 Contents
- Lua 5.1 Reference Manual
- Lua 5.1 ReadMe

Additional information can be found on the Lua web site; the Lua wiki contains further material about this module and related packages.

## Introduction

The following description is not meant as a tutorial, but may still help you to start Lua programming within BlitzMax. More API-related information can be found in the Lua Reference manual

### Setting up a Lua VM

Running Lua scripts always require the instantiation of at least one Lua VM:

     local LuaState:byte ptr = luaL_newstate()

The result of this instantiation is a pointer to a structure which contains the full state of the new VM and has to be passed as the first argument to almost any other Lua API function.
It is now time to "open" the intrinsic Lua libraries (note: these libraries are part of axe.lua now, external DLLs or shared libraries are not necessary):

     luaL_openlibs(LuaState)

Always initialize the Lua VM by opening its libraries unless you really know what you are doing!
Usually, creating a single Lua state is sufficient, even further (Lua) threads share the basic Lua state (and its associated environment).

### Shutting down a Lua VM

At the end, it's always a good idea to shut down the Lua VM

     lua_close(LuaState)

The Lua interpreter has now been terminated and its state variable is no longer valid.

### Accessing Lua Globals

The code

      lua_pushstring(LuaState, "BMXString")
      lua_setglobal (LuaState, "luaglobal")

defines a global Lua variable (called luaglobal) which contains a string (namely "BMXString").

### Registering BlitzMax Functions

In order to access BlitzMax features from within a Lua script, it is necessary to implement suitable BlitzMax functions and register them in the Lua VM.
Such BlitzMax functions typically look as follows:

     function BMXName:int (LuaState:Byte Ptr)
       ...      ' handling of parameters passed from Lua (if required)
         ...    ' actual function body
       ...      ' passing results back to Lua (if required)
       return 0 ' number of values returned to Lua
     end function

Such a function is then registered using

     lua_register(LuaState, "luaname", BMXName)

This command registers a BlitzMax function (called BMXName) with the (global) name luaname under Lua. Both names may be equal, but they do not have to.

### Running Lua Scripts From Within BlitzMax

The code

     local Result:int = luaL_loadString(LuaState,LuaScript)
     if (Result <> 0) then
       ' ERROR!!!
       lua_close(LuaState) ' just to be complete
       end
     end if

loads and compiles a (BlitzMax) string containing a LuaScript. The result (of compilation) is left on the (Lua) stack.

     lua_getfield(LuaState, LUA_GLOBALSINDEX, "debug")' get global "debug"
     lua_getfield(LuaState, -1, "traceback")       ' get "debug.traceback"
     lua_remove (LuaState, -2)           ' remove "debug" table from stack

     Result = lua_pcall(LuaState,1,-1,-1)' use "debug.traceback" as err.hdlr
     if (Result <> 0) then
       ' ERROR
       lua_close(LuaState) ' just to be complete
       end
     end if

actually evaluates the previously loaded script. The initially mentioned Lua commands just prepare for proper error messages should the Lua script fail.

## Functions Summary

lua_atpanic | see Lua Reference Manual
lua_call | see Lua Reference Manual
lua_checkstack | see Lua Reference Manual
lua_close | see Lua Reference Manual
lua_concat | see Lua Reference Manual
lua_cpcall | see Lua Reference Manual
lua_createtable | see Lua Reference Manual
lua_dump | see Lua Reference Manual
lua_equal | see Lua Reference Manual
lua_error | see Lua Reference Manual
lua_gc | see Lua Reference Manual
lua_getallocf | see Lua Reference Manual
lua_getfenv | see Lua Reference Manual
lua_getfield | see Lua Reference Manual
lua_getglobal | see Lua Reference Manual
lua_gethook | see Lua Reference Manual
lua_gethookcount | see Lua Reference Manual
lua_gethookmask | see Lua Reference Manual
lua_getinfo | see Lua Reference Manual
lua_getlocal | see Lua Reference Manual
lua_getmetatable | see Lua Reference Manual
lua_getstack | see Lua Reference Manual
lua_gettable | see Lua Reference Manual
lua_gettop | see Lua Reference Manual
lua_getupvalue | see Lua Reference Manual
lua_insert | see Lua Reference Manual
lua_isboolean | see Lua Reference Manual
lua_iscfunction | see Lua Reference Manual
lua_isfunction | see Lua Reference Manual
lua_islightuserdata | see Lua Reference Manual
lua_isnil | see Lua Reference Manual
lua_isnone | see Lua Reference Manual
lua_isnoneornil | see Lua Reference Manual
lua_isnumber | see Lua Reference Manual
lua_isstring | see Lua Reference Manual
lua_istable | see Lua Reference Manual
lua_isthread | see Lua Reference Manual
lua_isuserdata | see Lua Reference Manual
lua_lessthan | see Lua Reference Manual
lua_load | see Lua Reference Manual
lua_newstate | see Lua Reference Manual
lua_newtable | see Lua Reference Manual
lua_newthread | see Lua Reference Manual
lua_newuserdata | see Lua Reference Manual
lua_next | see Lua Reference Manual
lua_objlen | see Lua Reference Manual
lua_pcall | see Lua Reference Manual
lua_pop | see Lua Reference Manual
lua_pushboolean | see Lua Reference Manual
lua_pushcclosure | see Lua Reference Manual
lua_pushcfunction | see Lua Reference Manual
lua_pushinteger | see Lua Reference Manual
lua_pushlightuserdata | see Lua Reference Manual
lua_pushlstring | see Lua Reference Manual
lua_pushnil | see Lua Reference Manual
lua_pushnumber | see Lua Reference Manual
lua_pushstring | see Lua Reference Manual
lua_pushthread | see Lua Reference Manual
lua_pushvalue | see Lua Reference Manual
lua_rawequal | see Lua Reference Manual
lua_rawget | see Lua Reference Manual
lua_rawgeti | see Lua Reference Manual
lua_rawset | see Lua Reference Manual
lua_rawseti | see Lua Reference Manual
lua_register | see Lua Reference Manual
lua_remove | see Lua Reference Manual
lua_replace | see Lua Reference Manual
lua_resume | see Lua Reference Manual
lua_setallocf | see Lua Reference Manual
lua_setfenv | see Lua Reference Manual
lua_setfield | see Lua Reference Manual
lua_setglobal | see Lua Reference Manual
lua_sethook | see Lua Reference Manual
lua_setlocal | see Lua Reference Manual
lua_setmetatable | see Lua Reference Manual
lua_settable | see Lua Reference Manual
lua_settop | see Lua Reference Manual
lua_setupvalue | see Lua Reference Manual
lua_status | see Lua Reference Manual
lua_toboolean | see Lua Reference Manual
lua_tocfunction | see Lua Reference Manual
lua_tointeger | see Lua Reference Manual
lua_tolstring | see Lua Reference Manual
lua_tonumber | see Lua Reference Manual
lua_topointer | see Lua Reference Manual
lua_tostring | see Lua Reference Manual
lua_tothread | see Lua Reference Manual
lua_touserdata | see Lua Reference Manual
lua_type | see Lua Reference Manual
lua_typename | see Lua Reference Manual
lua_xmove | see Lua Reference Manual
lua_yield | see Lua Reference Manual
luaL_addchar | see Lua Reference Manual
luaL_addlstring | see Lua Reference Manual
luaL_addsize | see Lua Reference Manual
luaL_addstring | see Lua Reference Manual
luaL_addvalue | see Lua Reference Manual
luaL_argcheck | see Lua Reference Manual
luaL_argerror | see Lua Reference Manual
luaL_buffinit | see Lua Reference Manual
luaL_callmeta | see Lua Reference Manual
luaL_checkany | see Lua Reference Manual
luaL_checkint | see Lua Reference Manual
luaL_checkinteger | see Lua Reference Manual
luaL_checklong | see Lua Reference Manual
luaL_checklstring | see Lua Reference Manual
luaL_checknumber | see Lua Reference Manual
luaL_checkstack | see Lua Reference Manual
luaL_checkstring | see Lua Reference Manual
luaL_checktype | see Lua Reference Manual
luaL_checkudata | see Lua Reference Manual
luaL_dofile | see Lua Reference Manual
luaL_dostring | see Lua Reference Manual
luaL_getmetafield | see Lua Reference Manual
luaL_getmetatable | see Lua Reference Manual
luaL_gsub | see Lua Reference Manual
luaL_loadbuffer | see Lua Reference Manual
luaL_loadfile | see Lua Reference Manual
luaL_loadstring | see Lua Reference Manual
luaL_newmetatable | see Lua Reference Manual
luaL_newstate | see Lua Reference Manual
luaL_openlibs | see Lua Reference Manual
luaL_optint | see Lua Reference Manual
luaL_optinteger | see Lua Reference Manual
luaL_optlong | see Lua Reference Manual
luaL_optlstring | see Lua Reference Manual
luaL_optnumber | see Lua Reference Manual
luaL_optstring | see Lua Reference Manual
luaL_prepbuffer | see Lua Reference Manual
luaL_pushresult | see Lua Reference Manual
luaL_ref | see Lua Reference Manual
luaL_register | see Lua Reference Manual
luaL_typename | see Lua Reference Manual
luaL_typerror | see Lua Reference Manual
luaL_unref | see Lua Reference Manual
luaL_where | see Lua Reference Manual

## Functions

function lua_atpanic:byte ptr (lua_state:byte ptr, panicf:int(ls:byte ptr))
Description | see Lua Reference Manual

function lua_call (lua_state:byte ptr, nargs:int, nresults:int)
Description | see Lua Reference Manual

function lua_checkstack:int (lua_state:byte ptr, extra:int)
Description | see Lua Reference Manual

function lua_close (lua_state:byte ptr)
Description | see Lua Reference Manual

function lua_concat (lua_state:byte ptr, n:int)
Description | see Lua Reference Manual

function lua_cpcall:int (lua_state:byte ptr, func:int(ls:byte ptr), ud:byte ptr)
Description | see Lua Reference Manual

function lua_createtable (lua_state:byte ptr, narr:int, nrec:int)
Description | see Lua Reference Manual

function lua_dump:int (lua_state:byte ptr, writer:int(ls:byte ptr,p:byte ptr,sz:int,ud:byte ptr), data:byte ptr)
Description | see Lua Reference Manual

function lua_equal:int (lua_state:byte ptr, index1:int, index2:int)
Description | see Lua Reference Manual

function lua_error:int (lua_state:byte ptr)
Description | see Lua Reference Manual

function lua_gc:int (lua_state:byte ptr, what:int, data:int)
Description | see Lua Reference Manual

function lua_getallocf:byte ptr (lua_state:byte ptr, ud:byte ptr ptr)
Description | see Lua Reference Manual

function lua_getfenv (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_getfield (lua_state:byte ptr, index:int, k$z) ' no ~0 expected
Description | see Lua Reference Manual

function lua_getglobal (lua_state:byte ptr, name:string)
Description | see Lua Reference Manual

function lua_gethook:byte ptr (lua_state:byte ptr)
Description | see Lua Reference Manual

function lua_gethookcount:int (lua_state:byte ptr)
Description | see Lua Reference Manual

function lua_gethookmask:int (lua_state:byte ptr)
Description | see Lua Reference Manual

function lua_getinfo:int (lua_state:byte ptr, what$z, ar:lua_Debug ptr) ' no ~0 expected
Description | see Lua Reference Manual

function lua_getlocal$z (lua_state:byte ptr, ar:lua_Debug ptr, n:int) ' no ~0 expected
Description | see Lua Reference Manual

function lua_getmetatable:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_getstack:int (lua_state:byte ptr, level:int, ar:lua_Debug ptr) ' no ~0 expected
Description | see Lua Reference Manual

function lua_gettable (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_gettop:int (lua_state:byte ptr)
Description | see Lua Reference Manual

function lua_getupvalue$z (lua_state:byte ptr, funcindex:int, n:int) ' no ~0 expected
Description | see Lua Reference Manual

function lua_insert (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_isboolean:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_iscfunction:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_isfunction:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_islightuserdata:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_isnil:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_isnone:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_isnoneornil:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_isnumber:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_isstring:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_istable:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_isthread:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_isuserdata:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_lessthan:int (lua_state:byte ptr, index1:int, index2:int)
Description | see Lua Reference Manual

function lua_load:int (lua_state:byte ptr, reader:byte ptr(ls:byte ptr,data:byte ptr,sz:int ptr), data:byte ptr, chunkname$z) ' no ~0 expected
Description | see Lua Reference Manual

function lua_newstate:byte ptr (f:byte ptr(ud:byte ptr, p:byte ptr, osize:int, nsize:int), ud:byte ptr)
Description | see Lua Reference Manual

function lua_newtable (lua_state:byte ptr)
Description | see Lua Reference Manual

function lua_newthread:byte ptr (lua_state:byte ptr)
Description | see Lua Reference Manual

function lua_newuserdata:byte ptr (lua_state:byte ptr, size:int)
Description | see Lua Reference Manual

function lua_next:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_objlen:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_pcall:int (lua_state:byte ptr, nargs:int, nresults:int, errfunc:int)
Description | see Lua Reference Manual

function lua_pop (lua_state:byte ptr, n:int)
Description | see Lua Reference Manual

function lua_pushboolean (lua_state:byte ptr, b:int)
Description | see Lua Reference Manual

function lua_pushcclosure (lua_state:byte ptr, fn:int(ls:byte ptr), n:int)
Description | see Lua Reference Manual

function lua_pushcfunction (lua_state:byte ptr, fn:int(ls:byte ptr))
Description | see Lua Reference Manual

function lua_pushinteger (lua_state:byte ptr, n:int)
Description | see Lua Reference Manual

function lua_pushlightuserdata (lua_state:byte ptr, p:byte ptr)
Description | see Lua Reference Manual

function lua_pushlstring (lua_state:byte ptr, s:byte ptr, size:int) ' without any conversion!
Description | see Lua Reference Manual

function lua_pushnil (lua_state:byte ptr)
Description | see Lua Reference Manual

function lua_pushnumber (lua_state:byte ptr, n:double)
Description | see Lua Reference Manual

function lua_pushstring (lua_state:byte ptr, s$z) ' no ~0 expected
Description | see Lua Reference Manual

function lua_pushthread:int (lua_state:byte ptr)
Description | see Lua Reference Manual

function lua_pushvalue (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_rawequal:int (lua_state:byte ptr, index1:int, index2:int)
Description | see Lua Reference Manual

function lua_rawget (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_rawgeti (lua_state:byte ptr, index:int, n:int)
Description | see Lua Reference Manual

function lua_rawset (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_rawseti (lua_state:byte ptr, index:int, n:int)
Description | see Lua Reference Manual

function lua_register (lua_state:byte ptr, name:string, f:int(ls:byte ptr))
Description | see Lua Reference Manual

function lua_remove (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_replace (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_resume:int (lua_state:byte ptr, narg:int)
Description | see Lua Reference Manual

function lua_setallocf (lua_state:byte ptr, f:byte ptr(ud:byte ptr, p:byte ptr, osize:int, nsize:int), ud:byte ptr)
Description | see Lua Reference Manual

function lua_setfenv:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_setfield (lua_state:byte ptr, index:int, k$z) ' no ~0 expected
Description | see Lua Reference Manual

function lua_setglobal (lua_state:byte ptr, name:string)
Description | see Lua Reference Manual

function lua_sethook:int (lua_state:byte ptr, f(ls:byte ptr,ar:lua_Debug ptr), mask:int, count:int)
Description | see Lua Reference Manual

function lua_setlocal$z (lua_state:byte ptr, ar:lua_Debug ptr, n:int) ' no ~0 expected
Description | see Lua Reference Manual

function lua_setmetatable:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_settable (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_settop (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_setupvalue$z (lua_state:byte ptr, funcindex:int, n:int) ' no ~0 expected
Description | see Lua Reference Manual

function lua_status:int (lua_state:byte ptr)
Description | see Lua Reference Manual

function lua_toboolean:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_tocfunction:byte ptr (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_tointeger:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_tolstring:byte ptr (lua_state:byte ptr, index:int, size:int ptr) ' without any conversion!
Description | see Lua Reference Manual

function lua_tonumber:double (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_topointer:byte ptr (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_tostring:string (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_tothread:byte ptr (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_touserdata:byte ptr (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_type:int (lua_state:byte ptr, index:int)
Description | see Lua Reference Manual

function lua_typename$z (lua_state:byte ptr, tp:int) ' no ~0 expected
Description | see Lua Reference Manual

function lua_xmove (fromState:byte ptr, toState:byte ptr, n:int)
Description | see Lua Reference Manual

function lua_yield:int (lua_state:byte ptr, nresults:int)
Description | see Lua Reference Manual

function luaL_addchar (B:byte ptr, c:string)
Description | see Lua Reference Manual

function luaL_addlstring (B:byte ptr, s:byte ptr, l:int)
Description | see Lua Reference Manual

function luaL_addsize (B:byte ptr, size:int)
Description | see Lua Reference Manual

function luaL_addstring (B:byte ptr, s$z) ' no ~0 allowed!
Description | see Lua Reference Manual

function luaL_addvalue (B:byte ptr)
Description | see Lua Reference Manual

function luaL_argcheck (lua_state:byte ptr, cond:int, narg:int, extramsg:string)
Description | see Lua Reference Manual

function luaL_argerror:int (lua_state:byte ptr, narg:int, extramsg$z) ' no ~0 expected
Description | see Lua Reference Manual

function luaL_buffinit (lua_state:byte ptr, B:byte ptr)
Description | see Lua Reference Manual

function luaL_callmeta:int (lua_state:byte ptr, obj:int, e$z) ' no ~0 expected
Description | see Lua Reference Manual

function luaL_checkany (lua_state:byte ptr, narg:int)
Description | see Lua Reference Manual

function luaL_checkint:int (lua_state:byte ptr, narg:int)
Description | see Lua Reference Manual

function luaL_checkinteger:int (lua_state:byte ptr, narg:int)
Description | see Lua Reference Manual

function luaL_checklong:long (lua_state:byte ptr, narg:int)
Description | see Lua Reference Manual

function luaL_checklstring:byte ptr (lua_state:byte ptr, narg:int, size:int ptr)
Description | see Lua Reference Manual

function luaL_checknumber:double (lua_state:byte ptr, narg:int)
Description | see Lua Reference Manual

function luaL_checkstack (lua_state:byte ptr, sz:int, msg$z) ' no ~0 expected
Description | see Lua Reference Manual

function luaL_checkstring:string (lua_state:byte ptr, narg:int)
Description | see Lua Reference Manual

function luaL_checktype (lua_state:byte ptr, narg:int, t:int)
Description | see Lua Reference Manual

function luaL_checkudata:byte ptr (lua_state:byte ptr, narg:int, tname$z) ' no ~0 expected
Description | see Lua Reference Manual

function luaL_dofile:int (lua_state:byte ptr, filename:string)
Description | see Lua Reference Manual

function luaL_dostring:int (lua_state:byte ptr, str:string)
Description | see Lua Reference Manual

function luaL_getmetafield:int (lua_state:byte ptr, obj:int, e$z) ' no ~0 expected
Description | see Lua Reference Manual

function luaL_getmetatable (lua_state:byte ptr, tname:string)
Description | see Lua Reference Manual

function luaL_gsub$z (lua_state:byte ptr, s$z, p$z, r$z) ' no ~0 expected
Description | see Lua Reference Manual

function luaL_loadbuffer:int (lua_state:byte ptr, buff:byte ptr, sz:int, name$z) ' no ~0 expected
Description | see Lua Reference Manual

function luaL_loadfile:int (lua_state:byte ptr, filename$z) ' no ~0 expected
Description | see Lua Reference Manual

function luaL_loadstring:int (lua_state:byte ptr, s$z) ' no ~0 allowed!
Description | see Lua Reference Manual

function luaL_newmetatable:int (lua_state:byte ptr, tname$z) ' no ~0 expected
Description | see Lua Reference Manual

function luaL_newstate:byte ptr ()
Description | see Lua Reference Manual

function luaL_openlibs (lua_state:byte ptr)
Description | see Lua Reference Manual

function luaL_optint:int (lua_state:byte ptr, narg:int, d:int)
Description | see Lua Reference Manual

function luaL_optinteger:int (lua_state:byte ptr, narg:int, d:int)
Description | see Lua Reference Manual

function luaL_optlong:long (lua_state:byte ptr, narg:int, d:long)
Description | see Lua Reference Manual

function luaL_optlstring:byte ptr (lua_state:byte ptr, narg:int, d$z, size:int ptr) ' no ~0 expected in "d"
Description | see Lua Reference Manual

function luaL_optnumber:double (lua_state:byte ptr, narg:int, d:double)
Description | see Lua Reference Manual

function luaL_optstring:string (lua_state:byte ptr, narg:int, d:string)
Description | see Lua Reference Manual

function luaL_prepbuffer:byte ptr (B:byte ptr)
Description | see Lua Reference Manual

function luaL_pushresult (B:byte ptr)
Description | see Lua Reference Manual

function luaL_ref:int (lua_state:byte ptr, t:int)
Description | see Lua Reference Manual

function luaL_register (lua_state:byte ptr, libname$z, l:lua_Reg ptr) ' no ~0 expected
Description | see Lua Reference Manual

function luaL_typename:string (lua_state:byte ptr, idx:int)
Description | see Lua Reference Manual

function luaL_typerror:int (lua_state:byte ptr, narg:int, tname$z) ' no ~0 expected
Description | see Lua Reference Manual

function luaL_unref (lua_state:byte ptr, t:int, ref:int)
Description | see Lua Reference Manual

function luaL_where (lua_state:byte ptr, lvl:int)
Description | see Lua Reference Manual

## Module Information

Version | 1.25
Author | Tecgraf,PUC-Rio
License | MIT License
Modserver | BRL
Credit | Adapted for BlitzMax by Thomas Mayer, Noel Cower, Andreas Rozek and Simon Armstrong
History | 1.25
History | Updated to Lua 5.1.4 - Htbaa
History | 1.24
History | fixed int<->long discrepancies between Lua and BlitzMAX
History | 1.23
History | several bugfixes and extensions
History | support for strings with embedded ~0 (and byte arrays)
History | modifications for Lua 5.1.2
History | source code is now 'superstrict'-compliant
History | added some documentation
History | 1.22
History | added lots of definitions to support most of the official Lua 5.1.1 API
History | 1.21
History | removed luac.c from build list
History | 1.20
History | fixed missing paramters in lua_createtable definition
History | 1.19
History | updated with lua5.1.1 source
History | 1.18
History | added extra Imports and luaL_openlibs decl
History | 1.17
History | added luaL_loadstring fixed missing lua_dostring
History | 1.16
History | Added lua_newtable as a BMax function
History | Changed extern'd lua_newtable to lua_createtable
History | Added lua_load, lua_dostring and lua_dobuffer.
History | 1.15 Release
History | New LUA 5.1 based build
History | Modified constants and added new wrappers for 5.1 compatability
History | 1.14 Release
History | Added luaopen_debug and ldblib.c
History | Replaced byte ptr with $z (CString) where a C string is expected
History | 1.12 Release
History | Removed lua.h import