C# Class WinterSync.CLua

Datei anzeigen Open project: ZeroK-RTS/SpringRTS-Tools Class Usage Examples

Public Methods

Method Description
CBool ( bool b ) : int
CheckError ( IntPtr L, int status ) : void
DoString ( IntPtr L, string s ) : void

loads chunk from string, runs it, pushes results on stack tao's dostring causes segfault, use this instead

DoStringPushReturn ( IntPtr L, string s, IResultCount resultCount ) : void

/// runs a lua chunk loaded from a string, pushes returned values on stack, shows traceback in case of errors

ExpectArgs ( IntPtr L, int n ) : WinterSync.LuaValue[]

/// pops n values from stack, returns them

GetReverseStack ( IntPtr L ) : IEnumerable
GetStack ( IntPtr L ) : IEnumerable
Print ( Action outputFunc, IntPtr L ) : int

/// sends arguments to output function, can be used to make print()-like functions

RegisterGlobalFunction ( IntPtr L, string name, Lua f ) : void
ReturnValues ( IntPtr L ) : int

pushes values on stack, returns number of pushed values

SetGlobal ( IntPtr L, string name, LuaValue value ) : void
TraceCall ( IntPtr L, int resultCount ) : WinterSync.LuaValue[]

expects function on top runs function on top of stack, returns values returned from function, shows traceback in case of errors

TraceCallNoReturn ( IntPtr L ) : void

expects function on top runs function on top of stack, no return values, shows traceback in case of errors

TraceCallPushReturn ( IntPtr L, IResultCount resultCount ) : void

expects function on top runs function on top of stack, pushes return values, shows traceback in case of errors

TraceDoString ( IntPtr L, int resultCount, string s ) : WinterSync.LuaValue[]

runs a lua chunk loaded from a string, returns values returned from function, shows traceback in case of errors

Traceback ( IntPtr L ) : int

calls debug.traceback, pushes result

Method Details

CBool() public static method

public static CBool ( bool b ) : int
b bool
return int

CheckError() public static method

public static CheckError ( IntPtr L, int status ) : void
L System.IntPtr
status int
return void

DoString() public static method

loads chunk from string, runs it, pushes results on stack tao's dostring causes segfault, use this instead
public static DoString ( IntPtr L, string s ) : void
L System.IntPtr
s string
return void

DoStringPushReturn() public static method

/// runs a lua chunk loaded from a string, pushes returned values on stack, shows traceback in case of errors
public static DoStringPushReturn ( IntPtr L, string s, IResultCount resultCount ) : void
L System.IntPtr
s string
resultCount IResultCount
return void

ExpectArgs() public static method

/// pops n values from stack, returns them
public static ExpectArgs ( IntPtr L, int n ) : WinterSync.LuaValue[]
L System.IntPtr
n int
return WinterSync.LuaValue[]

GetReverseStack() public static method

public static GetReverseStack ( IntPtr L ) : IEnumerable
L System.IntPtr
return IEnumerable

GetStack() public static method

public static GetStack ( IntPtr L ) : IEnumerable
L System.IntPtr
return IEnumerable

Print() public static method

/// sends arguments to output function, can be used to make print()-like functions
public static Print ( Action outputFunc, IntPtr L ) : int
outputFunc Action
L System.IntPtr
return int

RegisterGlobalFunction() public static method

public static RegisterGlobalFunction ( IntPtr L, string name, Lua f ) : void
L System.IntPtr
name string
f Tao.Lua.Lua
return void

ReturnValues() public static method

pushes values on stack, returns number of pushed values
public static ReturnValues ( IntPtr L ) : int
L System.IntPtr
return int

SetGlobal() public static method

public static SetGlobal ( IntPtr L, string name, LuaValue value ) : void
L System.IntPtr
name string
value LuaValue
return void

TraceCall() public static method

expects function on top runs function on top of stack, returns values returned from function, shows traceback in case of errors
public static TraceCall ( IntPtr L, int resultCount ) : WinterSync.LuaValue[]
L System.IntPtr
resultCount int
return WinterSync.LuaValue[]

TraceCallNoReturn() public static method

expects function on top runs function on top of stack, no return values, shows traceback in case of errors
public static TraceCallNoReturn ( IntPtr L ) : void
L System.IntPtr
return void

TraceCallPushReturn() public static method

expects function on top runs function on top of stack, pushes return values, shows traceback in case of errors
public static TraceCallPushReturn ( IntPtr L, IResultCount resultCount ) : void
L System.IntPtr
resultCount IResultCount
return void

TraceDoString() public static method

runs a lua chunk loaded from a string, returns values returned from function, shows traceback in case of errors
public static TraceDoString ( IntPtr L, int resultCount, string s ) : WinterSync.LuaValue[]
L System.IntPtr
resultCount int
s string
return WinterSync.LuaValue[]

Traceback() public static method

calls debug.traceback, pushes result
public static Traceback ( IntPtr L ) : int
L System.IntPtr
return int