Tao.Lua SDK Documentation

Lua.luaL_Buffer Structure

Type for a string buffer.

For a list of all members of this type, see Lua.luaL_Buffer Members.

System.Object
   System.ValueType
      Tao.Lua.Lua.luaL_Buffer

[Visual Basic]
Public Structure Lua.luaL_Buffer
[C#]
public struct Lua.luaL_Buffer

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

A string buffer allows C code to build Lua strings piecemeal. Its pattern of use is as follows: * First you declare a variable b of type luaL_Buffer. * Then you initialize it with a call luaL_buffinit(L, &b). * Then you add string pieces to the buffer calling any of the luaL_add* functions. * You finish by calling luaL_pushresult(&b). This call leaves the final string on the top of the stack. During its normal operation, a string buffer uses a variable number of stack slots. So, while using a buffer, you cannot assume that you know where the top of the stack is. You can use the stack between successive calls to buffer operations as long as that use is balanced; that is, when you call a buffer operation, the stack is at the same level it was immediately after the previous buffer operation. (The only exception to this rule is luaL_addvalue.) After calling luaL_pushresult the stack is back to its level when the buffer was initialized, plus the final string on its top.

Requirements

Namespace: Tao.Lua

Assembly: Tao.Lua (in Tao.Lua.dll)

See Also

Lua.luaL_Buffer Members | Tao.Lua Namespace