LUAL_BUFFER(3) Library Functions Manual LUAL_BUFFER(3)

luaL_Buffertype for a string buffer

#include <lauxlib.h>

typedef struct luaL_Buffer luaL_Buffer;

() type for a .

A string buffer allows C code to build Lua strings piecemeal. Its pattern of use is as follows:

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 ). After calling luaL_pushresult(3) the stack is back to its level when the buffer was initialized, plus the final string on its top.

luaL_pushresult(3)

Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes, Lua 5.1 Reference Manual.

The luaL_Buffer() manual page is based on Lua Reference Manual 5.1 and was created by Sergey Bronnikov.

July 26, 2022 Debian