Tao.Lua SDK Documentation

Lua.lua_pushcclosure Method 

Pushes a new C closure onto the stack.

[Visual Basic]
Public Shared Sub lua_pushcclosure( _
   ByVal L As IntPtr, _
   ByVal fn As lua_CFunction, _
   ByVal n As Integer _
)
[C#]
public static void lua_pushcclosure(
   IntPtr L,
   lua_CFunction fn,
   int n
);

Parameters

L
fn
n

Remarks

When a C function is created, it is possible to associate some values with it, thus creating a C closure (see §3.4); these values are then accessible to the function whenever it is called. To associate values with a C function, first these values should be pushed onto the stack (when there are multiple values, the first value is pushed first). Then lua_pushcclosure is called to create and push the C function onto the stack, with the argument n telling how many values should be associated with the function. lua_pushcclosure also pops these values from the stack.

See Also

Lua Class | Tao.Lua Namespace