LUA_DUMP(3) Library Functions Manual LUA_DUMP(3)

lua_dumpdumps a function as a binary chunk, function indicator [-0, +0, m]

#include <lua.h>

int
lua_dump(lua_State *L, lua_Writer writer, void *data);

() dumps a function as a binary chunk. Receives a Lua function on the top of the stack and produces a binary chunk that, if loaded again, results in a function equivalent to the one dumped. As it produces parts of the chunk, lua_dump() calls function writer (see lua_Writer(3)) with the given data to write them.

This function does not pop the Lua function from the stack.

The value returned is the error code returned by the last call to the writer; 0 means no errors.

lua_Writer(3)

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

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

July 14, 2022 Debian