C# Class Tao.Lua.Lua

Lua bindings for .NET, implementing Lua 5.1.1 (http://www.lua.org).
Lua is a powerful light-weight programming language designed for extending applications. Lua is also frequently used as a general-purpose, stand-alone language.

More information can be found at the official website (http://www.lua.org).

ファイルを表示 Open project: WolfgangSt/axiom Class Usage Examples

Public Methods

Method Description
luaL_addchar ( luaL_Buffer &B, char c ) : void

Adds the character c to the buffer B (see luaL_Buffer).

luaL_addsize ( luaL_Buffer B, int n ) : void

Adds a string of length n previously copied to the buffer area (see luaL_prepbuffer) to the buffer B (see luaL_Buffer).

luaL_argcheck ( lua_State L, int cond, int numarg, string extramsg ) : bool

Checks whether cond is true. If not, raises an error with the following message, where func is retrieved from the call stack: bad argument #[numarg] to [func] ([extramsg])

luaL_checkint ( lua_State L, int n ) : int

Checks whether the function argument narg is a number and returns this number cast to an int.

luaL_checklong ( lua_State L, int n ) : int

Checks whether the function argument narg is a number and returns this number cast to a long.

luaL_checkstring ( lua_State L, int n ) : string

Checks whether the function argument narg is a string and returns this string.

luaL_dofile ( lua_State L, string fn ) : int

Loads and runs the given file.

luaL_dostring ( lua_State L, string s ) : int

Loads and runs the given string.

luaL_getmetatable ( lua_State L, string n ) : void

Pushes onto the stack the metatable associated with name tname in the registry (see luaL_newmetatable).

luaL_opt ( lua_State L, int f, int n, int d ) : void

luaL_optint ( lua_State L, int n, int d ) : int

If the function argument narg is a number, returns this number cast to an int.

luaL_optlong ( lua_State L, int n, int d ) : int

If the function argument narg is a number, returns this number cast to a long. If this argument is absent or is nil, returns d. Otherwise, raises an error.

luaL_optstring ( lua_State L, int n, string d ) : string

If the function argument narg is a string, returns this string. If this argument is absent or is nil, returns d. Otherwise, raises an error.

luaL_putchar ( luaL_Buffer &B, char c ) : void

luaL_typename ( lua_State L, int i ) : string

Returns the name of the type of the value at index idx.

lua_asset ( object x ) : int

lua_getgccount ( lua_State L ) : int

lua_getglobal ( lua_State L, string s ) : void

Pushes onto the stack the value of the global name.

lua_getref ( lua_State L, int reference ) : void

lua_getregistry ( lua_State L ) : void

lua_isboolean ( lua_State L, int n ) : bool

Returns 1 if the value at the given acceptable index has type boolean, and 0 otherwise.

lua_isfunction ( lua_State L, int n ) : bool

Returns 1 if the value at the given acceptable index is a function (either C or Lua), and 0 otherwise.

lua_islightuserdata ( lua_State L, int n ) : bool

Returns 1 if the value at the given acceptable index is a light userdata, and 0 otherwise.

lua_isnil ( lua_State L, int n ) : bool

Returns 1 if the value at the given acceptable index is nil, and 0 otherwise.

lua_isnone ( lua_State L, int n ) : bool

lua_isnoneornil ( lua_State L, int n ) : bool

lua_istable ( lua_State L, int n ) : bool

Returns 1 if the value at the given acceptable index is a table, and 0 otherwise.

lua_isthread ( lua_State L, int n ) : bool

Returns 1 if the value at the given acceptable index is a thread, and 0 otherwise.

lua_newtable ( lua_State L ) : void

Creates a new empty table and pushes it onto the stack.

It is equivalent to lua_createtable(L, 0, 0).

lua_open ( ) : lua_State

lua_pop ( lua_State L, int n ) : void

Pops n elements from the stack.

lua_pushcfunction ( lua_State L, lua_CFunction f ) : void

Pushes a C function onto the stack. This function receives a pointer to a C function and pushes onto the stack a Lua value of type function that, when called, invokes the corresponding C function.

Any function to be registered in Lua must follow the correct protocol to receive its parameters and return its results

lua_pushliteral ( lua_State L, string s ) : void

lua_ref ( lua_State L, bool lockit ) : int

lua_register ( lua_State L, string n, lua_CFunction f ) : void

Sets the C function f as the new value of global name.

lua_setglobal ( lua_State L, string s ) : void

Pops a value from the stack and sets it as the new value of global name.

lua_tostring ( lua_State L, int i ) : string

Equivalent to lua_tolstring with len equal to NULL.

lua_unref ( lua_State L, int reference ) : void

lua_upvalueindex ( int i ) : int

Private Methods

Method Description
luaI_openlib ( lua_State L, string libname, luaL_Reg &l, int nup ) : void
luaL_addlstring ( luaL_Buffer &B, string s, size_t l ) : void
luaL_addstring ( luaL_Buffer &B, string s ) : void
luaL_addvalue ( luaL_Buffer &B ) : void
luaL_argerror ( lua_State L, int numarg, string extramsg ) : int
luaL_buffinit ( lua_State L, luaL_Buffer &B ) : void
luaL_callmeta ( lua_State L, int obj, string e ) : int
luaL_checkany ( lua_State L, int narg ) : void
luaL_checkinteger ( lua_State L, int numArg ) : lua_Integer
luaL_checklstring ( lua_State L, int numArg, size_t &l ) : string
luaL_checknumber ( lua_State L, int numArg ) : lua_Number
luaL_checkoption ( lua_State L, int narg, string def, string lst ) : int
luaL_checkstack ( lua_State L, int sz, string msg ) : void
luaL_checktype ( lua_State L, int narg, int t ) : void
luaL_checkudata ( lua_State L, int ud, string tname ) : IntPtr
luaL_findtable ( lua_State L, int idx, string fname, int szhint ) : string
luaL_getmetafield ( lua_State L, int obj, string e ) : int
luaL_getn ( lua_State L, int t ) : int
luaL_gsub ( lua_State L, string s, string p, string r ) : string
luaL_loadbuffer ( lua_State L, string buff, size_t sz, string name ) : int
luaL_loadfile ( lua_State L, string filename ) : int
luaL_loadstring ( lua_State L, string s ) : int
luaL_newmetatable ( lua_State L, string tname ) : int
luaL_newstate ( ) : lua_State
luaL_openlibs ( lua_State L ) : int
luaL_optinteger ( lua_State L, int nArg, lua_Integer def ) : lua_Integer
luaL_optlstring ( lua_State L, int numArg, string def, size_t &l ) : string
luaL_optnumber ( lua_State L, int nArg, lua_Number def ) : lua_Number
luaL_prepbuffer ( luaL_Buffer &B ) : string
luaL_pushresult ( luaL_Buffer &B ) : void
luaL_ref ( lua_State L, int t ) : int
luaL_register ( lua_State L, string libname, luaL_Reg &l ) : void
luaL_setn ( lua_State L, int t, int n ) : void
luaL_typerror ( lua_State L, int narg, string tname ) : int
luaL_unref ( lua_State L, int t, int rf ) : void
luaL_where ( lua_State L, int lvl ) : void
lua_atpanic ( lua_State L, lua_CFunction panicf ) : lua_CFunction
lua_call ( lua_State L, int nargs, int nresults ) : void
lua_checkstack ( lua_State L, int sz ) : int
lua_close ( lua_State L ) : void
lua_concat ( lua_State L, int n ) : void
lua_cpcall ( lua_State L, lua_CFunction func, IntPtr ud ) : int
lua_createtable ( lua_State L, int narr, int nrec ) : void
lua_dump ( lua_State L, lua_Writer writer, IntPtr data ) : int
lua_equal ( lua_State L, int idx1, int idx2 ) : int
lua_error ( lua_State L ) : int
lua_gc ( lua_State L, int what, int data ) : int
lua_getallocf ( lua_State L, IntPtr ud ) : lua_Alloc
lua_getfenv ( lua_State L, int idx ) : void
lua_getfield ( lua_State L, int idx, string k ) : void
lua_gethook ( lua_State L ) : lua_Hook
lua_gethookcount ( lua_State L ) : int
lua_gethookmask ( lua_State L ) : int
lua_getinfo ( lua_State L, string what, lua_Debug &ar ) : int
lua_getlocal ( lua_State L, lua_Debug &ar, int n ) : string
lua_getmetatable ( lua_State L, int objindex ) : int
lua_getstack ( lua_State L, int level, lua_Debug &ar ) : int
lua_gettable ( lua_State L, int idx ) : void
lua_gettop ( lua_State L ) : int
lua_getupvalue ( lua_State L, int funcindex, int n ) : string
lua_insert ( lua_State L, int idx ) : void
lua_iscfunction ( lua_State L, int idx ) : int
lua_isnumber ( lua_State L, int idx ) : int
lua_isstring ( lua_State L, int idx ) : int
lua_isuserdata ( lua_State L, int idx ) : int
lua_lessthan ( lua_State L, int idx1, int idx2 ) : int
lua_load ( lua_State L, lua_Reader reader, IntPtr data, string chunkname ) : int
lua_newstate ( lua_Alloc f, IntPtr ud ) : lua_State
lua_newthread ( lua_State L ) : lua_State
lua_newuserdata ( lua_State L, size_t sz ) : IntPtr
lua_next ( lua_State L, int idx ) : int
lua_objlen ( lua_State L, int idx ) : size_t
lua_pcall ( lua_State L, int nargs, int nresults, int errfunc ) : int
lua_pushboolean ( lua_State L, int b ) : void
lua_pushcclosure ( lua_State L, lua_CFunction fn, int n ) : void
lua_pushinteger ( lua_State L, lua_Integer n ) : void
lua_pushlightuserdata ( lua_State L, IntPtr p ) : void
lua_pushlstring ( lua_State L, string s, size_t l ) : void
lua_pushnil ( lua_State L ) : void
lua_pushnumber ( lua_State L, lua_Number n ) : void
lua_pushstring ( lua_State L, string s ) : void
lua_pushthread ( lua_State L ) : int
lua_pushvalue ( lua_State L, int idx ) : void
lua_rawequal ( lua_State L, int idx1, int idx2 ) : int
lua_rawget ( lua_State L, int idx ) : void
lua_rawgeti ( lua_State L, int idx, int n ) : void
lua_rawset ( lua_State L, int idx ) : void
lua_rawseti ( lua_State L, int idx, int n ) : void
lua_remove ( lua_State L, int idx ) : void
lua_replace ( lua_State L, int idx ) : void
lua_resume ( lua_State L, int narg ) : int
lua_setallocf ( lua_State L, lua_Alloc f, IntPtr ud ) : lua_Alloc
lua_setfenv ( lua_State L, int idx ) : int
lua_setfield ( lua_State L, int idx, string k ) : void
lua_sethook ( lua_State L, lua_Hook func, int mask, int count ) : int
lua_setlocal ( lua_State L, lua_Debug &ar, int n ) : string
lua_setmetatable ( lua_State L, int objindex ) : int
lua_settable ( lua_State L, int idx ) : void
lua_settop ( lua_State L, int idx ) : void
lua_setupvalue ( lua_State L, int funcindex, int n ) : string
lua_status ( lua_State L ) : int
lua_strlen ( lua_State L, int i ) : size_t
lua_toboolean ( lua_State L, int idx ) : int
lua_tocfunction ( lua_State L, int idx ) : lua_CFunction
lua_tointeger ( lua_State L, int idx ) : lua_Integer
lua_tolstring ( lua_State L, int idx, int &len ) : IntPtr
lua_tonumber ( lua_State L, int idx ) : lua_Number
lua_topointer ( lua_State L, int idx ) : IntPtr
lua_tothread ( lua_State L, int idx ) : lua_State
lua_touserdata ( lua_State L, int idx ) : IntPtr
lua_type ( lua_State L, int idx ) : int
lua_typename ( lua_State L, int tp ) : string
lua_xmove ( lua_State from, lua_State to, int n ) : void
lua_yield ( lua_State L, int nresults ) : int
luaopen_base ( lua_State L ) : int
luaopen_debug ( lua_State L ) : int
luaopen_io ( lua_State L ) : int
luaopen_math ( lua_State L ) : int
luaopen_os ( lua_State L ) : int
luaopen_package ( lua_State L ) : int
luaopen_string ( lua_State L ) : int
luaopen_table ( lua_State L ) : int

Method Details

luaL_addchar() public static method

Adds the character c to the buffer B (see luaL_Buffer).
public static luaL_addchar ( luaL_Buffer &B, char c ) : void
B luaL_Buffer
c char
return void

luaL_addsize() public static method

Adds a string of length n previously copied to the buffer area (see luaL_prepbuffer) to the buffer B (see luaL_Buffer).
public static luaL_addsize ( luaL_Buffer B, int n ) : void
B luaL_Buffer
n int
return void

luaL_argcheck() public static method

Checks whether cond is true. If not, raises an error with the following message, where func is retrieved from the call stack: bad argument #[numarg] to [func] ([extramsg])
public static luaL_argcheck ( lua_State L, int cond, int numarg, string extramsg ) : bool
L lua_State
cond int
numarg int
extramsg string
return bool

luaL_checkint() public static method

Checks whether the function argument narg is a number and returns this number cast to an int.
public static luaL_checkint ( lua_State L, int n ) : int
L lua_State
n int
return int

luaL_checklong() public static method

Checks whether the function argument narg is a number and returns this number cast to a long.
public static luaL_checklong ( lua_State L, int n ) : int
L lua_State
n int
return int

luaL_checkstring() public static method

Checks whether the function argument narg is a string and returns this string.
public static luaL_checkstring ( lua_State L, int n ) : string
L lua_State
n int
return string

luaL_dofile() public static method

Loads and runs the given file.
public static luaL_dofile ( lua_State L, string fn ) : int
L lua_State
fn string
return int

luaL_dostring() public static method

Loads and runs the given string.
public static luaL_dostring ( lua_State L, string s ) : int
L lua_State
s string
return int

luaL_getmetatable() public static method

Pushes onto the stack the metatable associated with name tname in the registry (see luaL_newmetatable).
public static luaL_getmetatable ( lua_State L, string n ) : void
L lua_State
n string
return void

luaL_opt() public static method

public static luaL_opt ( lua_State L, int f, int n, int d ) : void
L lua_State
f int
n int
d int
return void

luaL_optint() public static method

If the function argument narg is a number, returns this number cast to an int.
public static luaL_optint ( lua_State L, int n, int d ) : int
L lua_State
n int
d int
return int

luaL_optlong() public static method

If the function argument narg is a number, returns this number cast to a long. If this argument is absent or is nil, returns d. Otherwise, raises an error.
public static luaL_optlong ( lua_State L, int n, int d ) : int
L lua_State
n int
d int
return int

luaL_optstring() public static method

If the function argument narg is a string, returns this string. If this argument is absent or is nil, returns d. Otherwise, raises an error.
public static luaL_optstring ( lua_State L, int n, string d ) : string
L lua_State
n int
d string
return string

luaL_putchar() public static method

public static luaL_putchar ( luaL_Buffer &B, char c ) : void
B luaL_Buffer
c char
return void

luaL_typename() public static method

Returns the name of the type of the value at index idx.
public static luaL_typename ( lua_State L, int i ) : string
L lua_State
i int
return string

lua_asset() public static method

public static lua_asset ( object x ) : int
x object
return int

lua_getgccount() public static method

public static lua_getgccount ( lua_State L ) : int
L lua_State
return int

lua_getglobal() public static method

Pushes onto the stack the value of the global name.
public static lua_getglobal ( lua_State L, string s ) : void
L lua_State
s string
return void

lua_getref() public static method

public static lua_getref ( lua_State L, int reference ) : void
L lua_State
reference int
return void

lua_getregistry() public static method

public static lua_getregistry ( lua_State L ) : void
L lua_State
return void

lua_isboolean() public static method

Returns 1 if the value at the given acceptable index has type boolean, and 0 otherwise.
public static lua_isboolean ( lua_State L, int n ) : bool
L lua_State
n int
return bool

lua_isfunction() public static method

Returns 1 if the value at the given acceptable index is a function (either C or Lua), and 0 otherwise.
public static lua_isfunction ( lua_State L, int n ) : bool
L lua_State
n int
return bool

lua_islightuserdata() public static method

Returns 1 if the value at the given acceptable index is a light userdata, and 0 otherwise.
public static lua_islightuserdata ( lua_State L, int n ) : bool
L lua_State
n int
return bool

lua_isnil() public static method

Returns 1 if the value at the given acceptable index is nil, and 0 otherwise.
public static lua_isnil ( lua_State L, int n ) : bool
L lua_State
n int
return bool

lua_isnone() public static method

public static lua_isnone ( lua_State L, int n ) : bool
L lua_State
n int
return bool

lua_isnoneornil() public static method

public static lua_isnoneornil ( lua_State L, int n ) : bool
L lua_State
n int
return bool

lua_istable() public static method

Returns 1 if the value at the given acceptable index is a table, and 0 otherwise.
public static lua_istable ( lua_State L, int n ) : bool
L lua_State
n int
return bool

lua_isthread() public static method

Returns 1 if the value at the given acceptable index is a thread, and 0 otherwise.
public static lua_isthread ( lua_State L, int n ) : bool
L lua_State
n int
return bool

lua_newtable() public static method

Creates a new empty table and pushes it onto the stack.
It is equivalent to lua_createtable(L, 0, 0).
public static lua_newtable ( lua_State L ) : void
L lua_State
return void

lua_open() public static method

public static lua_open ( ) : lua_State
return lua_State

lua_pop() public static method

Pops n elements from the stack.
public static lua_pop ( lua_State L, int n ) : void
L lua_State
n int
return void

lua_pushcfunction() public static method

Pushes a C function onto the stack. This function receives a pointer to a C function and pushes onto the stack a Lua value of type function that, when called, invokes the corresponding C function.
Any function to be registered in Lua must follow the correct protocol to receive its parameters and return its results
public static lua_pushcfunction ( lua_State L, lua_CFunction f ) : void
L lua_State
f lua_CFunction
return void

lua_pushliteral() public static method

public static lua_pushliteral ( lua_State L, string s ) : void
L lua_State
s string
return void

lua_ref() public static method

public static lua_ref ( lua_State L, bool lockit ) : int
L lua_State
lockit bool
return int

lua_register() public static method

Sets the C function f as the new value of global name.
public static lua_register ( lua_State L, string n, lua_CFunction f ) : void
L lua_State
n string
f lua_CFunction
return void

lua_setglobal() public static method

Pops a value from the stack and sets it as the new value of global name.
public static lua_setglobal ( lua_State L, string s ) : void
L lua_State
s string
return void

lua_tostring() public static method

Equivalent to lua_tolstring with len equal to NULL.
public static lua_tostring ( lua_State L, int i ) : string
L lua_State
i int
return string

lua_unref() public static method

public static lua_unref ( lua_State L, int reference ) : void
L lua_State
reference int
return void

lua_upvalueindex() public static method

public static lua_upvalueindex ( int i ) : int
i int
return int