aboutsummaryrefslogtreecommitdiff
path: root/modules/cpp
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2013-03-29 23:42:11 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2013-03-29 23:42:11 -0400
commitd64a4113ea658d2ed6818d94b4f0ee5b18ddbe19 (patch)
tree3b0a7d4cdcb19962f01164f820464a981a04b47d /modules/cpp
parente4e562d413d14200abc7e01b94756b16606405ce (diff)
downloadtextadept-d64a4113ea658d2ed6818d94b4f0ee5b18ddbe19.tar.gz
textadept-d64a4113ea658d2ed6818d94b4f0ee5b18ddbe19.zip
Updated to Lua 5.2.2 and LPeg 0.11.
Diffstat (limited to 'modules/cpp')
-rw-r--r--modules/cpp/lua_api103
1 files changed, 53 insertions, 50 deletions
diff --git a/modules/cpp/lua_api b/modules/cpp/lua_api
index 3bdc24de..77eca825 100644
--- a/modules/cpp/lua_api
+++ b/modules/cpp/lua_api
@@ -7,37 +7,37 @@ lua_callk lua_callk(lua_State *L, int nargs, int nresults, int ctx, lua_CFunctio
lua_CFunction (*lua_CFunction)(lua_State *L) [int]\nType for C functions.\n\nIn order to communicate properly with Lua, a C function must use the\nfollowing protocol, which defines the way parameters and results are passed:\na C function receives its arguments from Lua in its stack in direct order\n(the first argument is pushed first). So, when the function starts,\n`lua_gettop(L)` returns the number of arguments received by the function.\nThe first argument (if any) is at index 1 and its last argument is at index\n`lua_gettop(L)`. To return values to Lua, a C function just pushes them onto\nthe stack, in direct order (the first result is pushed first), and returns\nthe number of results. Any other value in the stack below the results will\nbe properly discarded by Lua. Like a Lua function, a C function called by\nLua can also return many results.\n\nAs an example, the following function receives a variable number of numerical\narguments and returns their average and sum:\n\n static int foo (lua_State *L) {\n int n = lua_gettop(L); /* number of arguments */\n lua_Number sum = 0;\n int i;\n for (i = 1; i <= n; i++) {\n if (!lua_isnumber(L, i)) {\n lua_pushstring(L, "incorrect argument");\n lua_error(L);\n }\n sum += lua_tonumber(L, i);\n }\n lua_pushnumber(L, sum/n); /* first result */\n lua_pushnumber(L, sum); /* second result */\n return 2; /* number of results */\n }\n
lua_checkstack lua_checkstack(lua_State *L, int extra) [int]\nEnsures that there are at least `extra` free stack slots in the stack.\nIt returns false if it cannot fulfill the request, because it would cause the\nstack to be larger than a fixed maximum size (typically at least a few thousand\nelements) or because it cannot allocate memory for the new stack size. This\nfunction never shrinks the stack; if the stack is already larger than the new\nsize, it is left unchanged.\n
lua_close lua_close(lua_State *L) [void]\nDestroys all objects in the given Lua state (calling the corresponding\ngarbage-collection metamethods, if any) and frees all dynamic memory used by\nthis state. On several platforms, you may not need to call this function,\nbecause all resources are naturally released when the host program ends.\nOn the other hand, long-running programs that create multiple states, such as\ndaemons or web servers, might need to close states as soon as they are not\nneeded.\n
-lua_compare lua_compare(lua_State *L, int index1, int index2, int op) [int]\nCompares two Lua values.\nReturns 1 if the value at acceptable index `index1` satisfies `op` when compared\nwith the value at acceptable index `index2`, following the semantics of the\ncorresponding Lua operator (that is, it may call metamethods). Otherwise\nreturns 0. Also returns 0 if any of the indices is non valid.\n\nThe value of `op` must be one of the following constants:\n * LUA_OPEQ: compares for equality (`==`)\n * LUA_OPLT: compares for less than (`<`)\n * LUA_OPLE: compares for less or equal (`<=`)\n
+lua_compare lua_compare(lua_State *L, int index1, int index2, int op) [int]\nCompares two Lua values.\nReturns 1 if the value at index `index1` satisfies `op` when compared with\nthe value at index `index2`, following the semantics of the corresponding Lua\noperator (that is, it may call metamethods). Otherwise returns 0. Also\nreturns 0 if any of the indices is non valid.\n\nThe value of `op` must be one of the following constants:\n * LUA_OPEQ: compares for equality (`==`)\n * LUA_OPLT: compares for less than (`<`)\n * LUA_OPLE: compares for less or equal (`<=`)\n
lua_concat lua_concat(lua_State *L, int n) [void]\nConcatenates the `n` values at the top of the stack, pops them, and leaves\nthe result at the top. If `n` is 1, the result is the single value on the\nstack (that is, the function does nothing); if `n` is 0, the result is the\nempty string. Concatenation is performed following the usual semantics of\nLua (see §3.4.5).\n
-lua_copy lua_copy(lua_State *L, int fromidx, int toidx) [void]\nMoves the element at the valid index `fromidx` into the valid index `toidx`\nwithout shifting any element (therefore replacing the value at that position).\n
+lua_copy lua_copy(lua_State *L, int fromidx, int toidx) [void]\nMoves the element at index `fromidx` into the valid index `toidx` without\nshifting any element (therefore replacing the value at that position).\n
lua_createtable lua_createtable(lua_State *L, int narr, int nrec) [void]\nCreates a new empty table and pushes it onto the stack. Parameter `narr` is a\nhint for how many elements the table will have as a sequence; parameter `nrec`\nis a hint for how many other elements the table will have. Lua may use these\nhints to preallocate memory for the new table. This pre-allocation is useful for\nperformance when you know in advance how many elements the table will have.\nOtherwise you can use the function `lua_newtable`.\n
lua_dump lua_dump(lua_State *L, lua_Writer writer, void *data) [int]\nDumps a function as a binary chunk. Receives a Lua function on the top of\nthe stack and produces a binary chunk that, if loaded again, results in a\nfunction equivalent to the one dumped. As it produces parts of the chunk,\n`lua_dump` calls function `writer` (see `lua_Writer`) with the given `data`\nto write them.\n\nThe value returned is the error code returned by the last call to the writer;\n0 means no errors.\n\nThis function does not pop the Lua function from the stack.\n
lua_error lua_error(lua_State *L) [int]\nGenerates a Lua error. The error message (which can actually be a Lua value\nof any type) must be on the stack top. This function does a long jump,\nand therefore never returns (see `luaL_error`).\n
lua_gc lua_gc(lua_State *L, int what, int data) [int]\nControls the garbage collector.\n\nThis function performs several tasks, according to the value of the parameter\n`what`:\n * LUA_GCSTOP: stops the garbage collector.\n * LUA_GCRESTART: restarts the garbage collector.\n * LUA_GCCOLLECT: performs a full garbage-collection cycle.\n * LUA_GCCOUNT: returns the current amount of memory (in Kbytes) in use by Lua.\n * LUA_GCCOUNTB: returns the remainder of dividing the current amount of bytes\n of memory in use by Lua by 1024.\n * LUA_GCSTEP: performs an incremental step of garbage collection.\n The step "size" is controlled by `data` (larger values mean more steps)\n in a non-specified way. If you want to control the step size you must\n experimentally tune the value of `data`. The function returns 1 if the\n step finished a garbage-collection cycle.\n * LUA_GCSETPAUSE: sets `data` as the new value for the _pause_ of the\n collector (see §2.5). The function returns the previous value of the\n pause.\n * LUA_GCSETSTEPMUL: sets `data` as the new value for the _step multiplier_ of\n the collector (see §2.5). The function returns the previous value of the\n step multiplier.\n * LUA_GCISRUNNING: returns a boolean that tells whether the collector is\n running (i.e., not stopped).\n * LUA_GCGEN: changes the collector to generational mode (see §2.5).\n * LUA_GCINC: changes the collector to incremental mode. This is the default\n mode.\n\nFor more details about these options, see `collectgarbage`.\n
lua_getallocf lua_getallocf(lua_State *L, void **ud) [lua_Alloc]\nReturns the memory-allocation function of a given state. If `ud` is not\n`NULL`, Lua stores in `*ud` the opaque pointer passed to `lua_newstate`.\n
lua_getctx lua_getctx(lua_State *L, int *ctx) [int]\nThis function is called by a continuation function (see §4.7) to retrieve the\nstatus of the thread and a context information.\n\nWhen called in the original function, `lua_getctx` always returns `LUA_OK` and\ndoes not change the value of its argument `ctx`. When called inside a\ncontinuation function, `lua_getctx` returns `LUA_YIELD` and sets the value of\n`ctx` to be the context information (the value passed as the `ctx` argument to\nthe callee together with the continuation function).\n\nWhen the callee is `lua_pcallk`, Lua may also call its continuation function to\nhandle errors during the call. That is, upon an error in the function called by\n`lua_pcallk`, Lua may not return to the original function but instead may call\nthe continuation function. In that case, a call to `lua_getctx` will return the\nerror code (the value that would be returned by `lua_pcallk`); the value of\n`ctx` will be set to the context information, as in the case of a yield.\n
-lua_getfield lua_getfield(lua_State *L, int index, const char *k) [void]\nPushes onto the stack the value `t[k]`, where `t` is the value at the given\nvalid index. As in Lua, this function may trigger a metamethod for the\n"index" event (see §2.4).\n
+lua_getfield lua_getfield(lua_State *L, int index, const char *k) [void]\nPushes onto the stack the value `t[k]`, where `t` is the value at the given\nindex. As in Lua, this function may trigger a metamethod for the "index"\nevent (see §2.4).\n
lua_getglobal lua_getglobal(lua_State *L, const char *name) [void]\n\nPushes onto the stack the value of the global `name`.\n
-lua_getmetatable lua_getmetatable(lua_State *L, int index) [int]\nPushes onto the stack the metatable of the value at the given acceptable index.\nIf the value does not have a metatable, the function returns 0 and pushes\nnothing on the stack.\n
-lua_gettable lua_gettable(lua_State *L, int index) [void]\nPushes onto the stack the value `t[k]`, where `t` is the value at the given\nvalid index and `k` is the value at the top of the stack.\n\nThis function pops the key from the stack (putting the resulting value\nin its place). As in Lua, this function may trigger a metamethod for the\n"index" event (see §2.4).\n
+lua_getmetatable lua_getmetatable(lua_State *L, int index) [int]\nPushes onto the stack the metatable of the value at the given index. If the\nvalue does not have a metatable, the function returns 0 and pushes nothing on\nthe stack.\n
+lua_gettable lua_gettable(lua_State *L, int index) [void]\nPushes onto the stack the value `t[k]`, where `t` is the value at the given\nindex and `k` is the value at the top of the stack.\n\nThis function pops the key from the stack (putting the resulting value\nin its place). As in Lua, this function may trigger a metamethod for the\n"index" event (see §2.4).\n
lua_gettop lua_gettop(lua_State *L) [int]\nReturns the index of the top element in the stack. Because indices start\nat 1, this result is equal to the number of elements in the stack (and so\n0 means an empty stack).\n
lua_getuservalue lua_getuservalue(lua_State *L, int index) [void]\nPushes onto the stack the Lua value associated with the userdata at the given\nindex. This Lua value must be a table or nil.\n
-lua_insert lua_insert(lua_State *L, int index) [void]\nMoves the top element into the given valid index, shifting up the elements\nabove this index to open space. Cannot be called with a pseudo-index,\nbecause a pseudo-index is not an actual stack position.\n
+lua_insert lua_insert(lua_State *L, int index) [void]\nMoves the top element into the given valid index, shifting up the elements\nabove this index to open space. This function cannot be called with a\npseudo-index, because a pseudo-index is not an actual stack position.\n
lua_Integer lua_Integer [ptrdiff_t]\nThe type used by the Lua API to represent signed integral values.\n\nBy default it is a `ptrdiff_t`, which is usually the largest signed integral\ntype the machine handles "comfortably".\n
-lua_isboolean lua_isboolean(lua_State *L, int index) [int]\nReturns 1 if the value at the given acceptable index is a boolean, and 0\notherwise.\n
-lua_iscfunction lua_iscfunction(lua_State *L, int index) [int]\nReturns 1 if the value at the given acceptable index is a C function,\nand 0 otherwise.\n
-lua_isfunction lua_isfunction(lua_State *L, int index) [int]\nReturns 1 if the value at the given acceptable index is a function (either\nC or Lua), and 0 otherwise.\n
-lua_islightuserdata lua_islightuserdata(lua_State *L, int index) [int]\n\nReturns 1 if the value at the given acceptable index is a light userdata,\nand 0 otherwise.\n
-lua_isnil lua_isnil(lua_State *L, int index) [int]\nReturns 1 if the value at the given acceptable index is nil, and 0 otherwise.\n
-lua_isnone lua_isnone(lua_State *L, int index) [int]\nReturns 1 if the given acceptable index is not valid (that is, it refers to\nan element outside the current stack), and 0 otherwise.\n
-lua_isnoneornil lua_isnoneornil(lua_State *L, int index) [int]\nReturns 1 if the given acceptable index is not valid (that is, it refers to\nan element outside the current stack) or if the value at this index is nil,\nand 0 otherwise.\n
-lua_isnumber lua_isnumber(lua_State *L, int index) [int]\nReturns 1 if the value at the given acceptable index is a number or a string\nconvertible to a number, and 0 otherwise.\n
-lua_isstring lua_isstring (lua_State *L, int index) [int]\nReturns 1 if the value at the given acceptable index is a string or a number\n(which is always convertible to a string), and 0 otherwise.\n
-lua_istable lua_istable(lua_State *L, int index) [int]\nReturns 1 if the value at the given acceptable index is a table, and 0\notherwise.\n
-lua_isthread lua_isthread(lua_State *L, int index) [int]\nReturns 1 if the value at the given acceptable index is a thread, and\n0 otherwise.\n
-lua_isuserdata lua_isuserdata(lua_State *L, int index) [int]\nReturns 1 if the value at the given acceptable index is a userdata (either\nfull or light), and 0 otherwise.\n
-lua_len lua_len(lua_State *L, int index) [void]\nReturns the "length" of the value at the given acceptable index; it is\nequivalent to the '`#`' operator in Lua (see §3.4.6). The result is pushed on\nthe stack.\n
-lua_load lua_load(lua_State *L, lua_Reader reader, void *data, const char *source, const char *mode) [int]\nLoads a Lua chunk (without running it). If there are no errors, `lua_load`\npushes the compiled chunk as a Lua function on top of the stack. Otherwise, it\npushes an error message.\n\nThe return values of `lua_load` are:\n * LUA_OK: no errors;\n * LUA_ERRSYNTAX: syntax error during pre-compilation;\n * LUA_ERRMEM: memory allocation error.\n * LUA_ERRGCMM: error while running a `__gc` metamethod. (This error has no\n relation with the chunk being loaded. It is generated by the garbage\n collector.)\n\nThe `lua_load` function uses a user-supplied `reader` function to read the chunk\n(see `lua_Reader`). The `data` argument is an opaque value passed to the reader\nfunction.\n\nThe `source` argument gives a name to the chunk, which is used for error\nmessages and in debug information (see §4.9).\n\n`lua_load` automatically detects whether the chunk is text or binary and loads\nit accordingly (see program `luac`). The string `mode` works as in function\n`load`, with the addition that a `NULL` value is equivalent to the string\n"`bt`".\n\nIf the resulting function has one upvalue, this upvalue is set to the value of\nthe global environment stored at index `LUA_RIDX_GLOBALS` in the registry\n(see §4.5). When loading main chunks, this upvalue will be the `_ENV` variable\n(see §2.2).\n
+lua_isboolean lua_isboolean(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is a boolean, and 0 otherwise.\n
+lua_iscfunction lua_iscfunction(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is a C function, and 0 otherwise.\n
+lua_isfunction lua_isfunction(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is a function (either C or Lua),\nand 0 otherwise.\n
+lua_islightuserdata lua_islightuserdata(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is a light userdata, and 0 otherwise.\n
+lua_isnil lua_isnil(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is nil, and 0 otherwise.\n
+lua_isnone lua_isnone(lua_State *L, int index) [int]\nReturns 1 if the given index is not valid, and 0 otherwise.\n
+lua_isnoneornil lua_isnoneornil(lua_State *L, int index) [int]\nReturns 1 if the given index is not valid or if the value at this index is\nnil, and 0 otherwise.\n
+lua_isnumber lua_isnumber(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is a number or a string\nconvertible to a number, and 0 otherwise.\n
+lua_isstring lua_isstring (lua_State *L, int index) [int]\nReturns 1 if the value at the given index is a string or a number (which is\nalways convertible to a string), and 0 otherwise.\n
+lua_istable lua_istable(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is a table, and 0 otherwise.\n
+lua_isthread lua_isthread(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is a thread, and 0 otherwise.\n
+lua_isuserdata lua_isuserdata(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is a userdata (either full or\nlight), and 0 otherwise.\n
+lua_len lua_len(lua_State *L, int index) [void]\nReturns the "length" of the value at the given index; it is equivalent to\nthe '`#`' operator in Lua (see §3.4.6). The result is pushed on the stack.\n
+lua_load lua_load(lua_State *L, lua_Reader reader, void *data, const char *source, const char *mode) [int]\nLoads a Lua chunk (without running it). If there are no errors, `lua_load`\npushes the compiled chunk as a Lua function on top of the stack. Otherwise, it\npushes an error message.\n\nThe return values of `lua_load` are:\n * LUA_OK: no errors;\n * LUA_ERRSYNTAX: syntax error during pre-compilation;\n * LUA_ERRMEM: memory allocation error.\n * LUA_ERRGCMM: error while running a `__gc` metamethod. (This error has no\n relation with the chunk being loaded. It is generated by the garbage\n collector.)\n\nThe `lua_load` function uses a user-supplied `reader` function to read the chunk\n(see `lua_Reader`). The `data` argument is an opaque value passed to the reader\nfunction.\n\nThe `source` argument gives a name to the chunk, which is used for error\nmessages and in debug information (see §4.9).\n\n`lua_load` automatically detects whether the chunk is text or binary and loads\nit accordingly (see program `luac`). The string `mode` works as in function\n`load`, with the addition that a `NULL` value is equivalent to the string\n"`bt`".\n\n`lua_load` uses the stack internally, so the reader function should always\nleave the stack unmodified when returning.\n\nIf the resulting function has one upvalue, this upvalue is set to the value of\nthe global environment stored at index `LUA_RIDX_GLOBALS` in the registry\n(see §4.5). When loading main chunks, this upvalue will be the `_ENV` variable\n(see §2.2).\n
lua_newstate lua_newstate(lua_Alloc f, void *ud) [lua_State*]\nCreates a new thread running in a new, independent state. Returns `NULL` if\ncannot create the thread or the state (due to lack of memory). The argument `f`\nis the allocator function; Lua does all memory allocation for this state through\nthis function. The second argument, `ud`, is an opaque pointer that Lua passes\nto the allocator in every call.\n
lua_newtable lua_newtable(lua_State *L) [void]\nCreates a new empty table and pushes it onto the stack. It is equivalent to\n`lua_createtable(L, 0, 0)`.\n
lua_newthread lua_newthread(lua_State *L) [lua_State*]\nCreates a new thread, pushes it on the stack, and returns a pointer to a\n`lua_State` that represents this new thread. The new thread returned by this\nfunction shares with the original thread its global environment, but has an\nindependent execution stack.\n\nThere is no explicit function to close or to destroy a thread. Threads are\nsubject to garbage collection, like any Lua object.\n
@@ -50,7 +50,8 @@ lua_pop lua_pop(lua_State *L, int n) [void]\nPops `n` elements from the stack.\n
lua_pushboolean lua_pushboolean(lua_State *L, int b) [void]\nPushes a boolean value with value `b` onto the stack.\n
lua_pushcclosure lua_pushcclosure(lua_State *L, lua_CFunction fn, int n) [void]\nPushes a new C closure onto the stack.\n\nWhen a C function is created, it is possible to associate some values with it,\nthus creating a C closure (see §4.4); these values are then accessible to\nthe function whenever it is called. To associate values with a C function,\nfirst these values should be pushed onto the stack (when there are multiple\nvalues, the first value is pushed first). Then `lua_pushcclosure` is called to\ncreate and push the C function onto the stack, with the argument `n` telling\nhow many values should be associated with the function. `lua_pushcclosure`\nalso pops these values from the stack.\n\nThe maximum value for `n` is 255.\n\nWhen `n` is zero, this function creates a _light C function_, which is just a\npointer to the C function. In that case, it never throws a memory error.\n
lua_pushcfunction lua_pushcfunction(lua_State *L, lua_CFunction f) [void]\nPushes a C function onto the stack. This function receives a pointer to a\nC function and pushes onto the stack a Lua value of type `function` that,\nwhen called, invokes the corresponding C function.\n\nAny function to be registered in Lua must follow the correct protocol to\nreceive its parameters and return its results (see `lua_CFunction`).\n\n`lua_pushcfunction` is defined as a macro:\n\n #define lua_pushcfunction(L,f) lua_pushcclosure(L,f,0)\nNote that `f` is used twice.\n
-lua_pushfstring lua_pushfstring(lua_State *L, const char *fmt, ...) [const char*]\nPushes onto the stack a formatted string and returns a pointer to this string.\nIt is similar to the C function `sprintf`, but has some important differences:\n * You do not have to allocate space for the result: the result is a\n Lua string and Lua takes care of memory allocation (and deallocation,\n through garbage collection).\n * The conversion specifiers are quite restricted. There are no flags,\n widths, or precisions. The conversion specifiers can only be '%%'\n (inserts a '%' in the string), '%s' (inserts a zero-terminated string,\n with no size restrictions), '%f' (inserts a `lua_Number`), '%p' (inserts\n a pointer as a hexadecimal numeral), '%d' (inserts an `int`), and '%c'\n (inserts an `int` as a byte).\n
+lua_pushfstring lua_pushfstring(lua_State *L, const char *fmt, ...) [const char*]\nPushes onto the stack a formatted string and returns a pointer to this string.\nIt is similar to the ANSI C function `sprintf`, but has some important\ndifferences:\n * You do not have to allocate space for the result: the result is a\n Lua string and Lua takes care of memory allocation (and deallocation,\n through garbage collection).\n * The conversion specifiers are quite restricted. There are no flags,\n widths, or precisions. The conversion specifiers can only be '%%'\n (inserts a '%' in the string), '%s' (inserts a zero-terminated string,\n with no size restrictions), '%f' (inserts a `lua_Number`), '%p' (inserts\n a pointer as a hexadecimal numeral), '%d' (inserts an `int`), and '%c'\n (inserts an `int` as a byte).\n
+lua_pushglobaltable lua_pushglobaltable(lua_State *L) [void]\nPushes the global environment onto the stack.\n
lua_pushinteger lua_pushinteger(lua_State *L, lua_Integer n) [void]\nPushes a number with value `n` onto the stack.\n
lua_pushlightuserdata lua_pushlightuserdata(lua_State *L, void *p) [void]\nPushes a light userdata onto the stack.\n\nUserdata represent C values in Lua. A _light userdata_ represents a pointer, a\n`void*`. It is a value (like a number): you do not create it, it has no\nindividual metatable, and it is not collected (as it was never created). A\nlight userdata is equal to "any" light userdata with the same C address.\n
lua_pushliteral lua_pushliteral(lua_State *L, const char *s) [const char*]\nThis macro is equivalent to `lua_pushlstring`, but can be used only when `s` is\na literal string. It automatically provides the string length.\n
@@ -59,46 +60,48 @@ lua_pushnil lua_pushnil(lua_State *L) [void]\nPushes a nil value onto the stack.
lua_pushnumber lua_pushnumber(lua_State *L, lua_Number n) [void]\nPushes a number with value `n` onto the stack.\n
lua_pushstring lua_pushstring(lua_State *L, const char *s) [const char*]\nPushes the zero-terminated string pointed to by `s` onto the stack. Lua makes\n(or reuses) an internal copy of the given string, so the memory at `s`\ncan be freed or reused immediately after the function returns. The string\ncannot contain embedded zeros; it is assumed to end at the first zero.\n\nReturns a pointer to the internal copy of the string.\n\nIf `s` is `NULL`, pushes nil and returns `NULL`.\n
lua_pushthread lua_pushthread(lua_State *L) [int]\nPushes the thread represented by `L` onto the stack. Returns 1 if this\nthread is the main thread of its state.\n
-lua_pushvalue lua_pushvalue(lua_State *L, int index) [void]\nPushes a copy of the element at the given valid index onto the stack.\n
+lua_pushunsigned lua_pushunsigned(lua_State *L, lua_Unsigned n) [void]\nPushes a number with value `n` onto the stack.\n
+lua_pushvalue lua_pushvalue(lua_State *L, int index) [void]\nPushes a copy of the element at the given index onto the stack.\n
lua_pushvfstring lua_pushvfstring(lua_State *L, const char *fmt, va_list argp) [const char*]\nEquivalent to `lua_pushfstring`, except that it receives a `va_list` instead\nof a variable number of arguments.\n
-lua_rawequal lua_rawequal(lua_State *L, int index1, int index2) [int]\nReturns 1 if the two values in acceptable indices `index1` and `index2` are\nprimitively equal (that is, without calling metamethods). Otherwise returns 0.\nAlso returns 0 if any of the indices are non valid.\n
+lua_rawequal lua_rawequal(lua_State *L, int index1, int index2) [int]\nReturns 1 if the two values in indices `index1` and `index2` are primitively\nequal (that is, without calling metamethods). Otherwise returns 0. Also\nreturns 0 if any of the indices are non valid.\n
lua_rawget lua_rawget(lua_State *L, int index) [void]\nSimilar to `lua_gettable`, but does a raw access (i.e., without metamethods).\n
-lua_rawgeti lua_rawgeti(lua_State *L, int index, int n) [void]\nPushes onto the stack the value `t[n]`, where `t` is the table at the given\nvalid index. The access is raw; that is, it does not invoke metamethods.\n
-lua_rawgetp lua_rawgetp(lua_State *L, int index, const void *p) [void]\nPushes onto the stack the value `t[k]`, where `t` is the table at the given\nvalid index and `k` is the pointer `p` represented as a light userdata. The\naccess is raw; that is, it does not invoke metamethods.\n
-lua_rawlen lua_rawlen(lua_State *L, int index) [size_t]\nReturns the raw "length" of the value at the given acceptable index: for\nstrings, this is the string length; for tables, this is the result of the length\noperator ('`#`') with no metamethods; for userdata, this is the size of the\nblock of memory allocated for the userdata; for other values, it is 0.\n
+lua_rawgeti lua_rawgeti(lua_State *L, int index, int n) [void]\nPushes onto the stack the value `t[n]`, where `t` is the table at the given\nindex. The access is raw; that is, it does not invoke metamethods.\n
+lua_rawgetp lua_rawgetp(lua_State *L, int index, const void *p) [void]\nPushes onto the stack the value `t[k]`, where `t` is the table at the given\nindex and `k` is the pointer `p` represented as a light userdata. The access\nis raw; that is, it does not invoke metamethods.\n
+lua_rawlen lua_rawlen(lua_State *L, int index) [size_t]\nReturns the raw "length" of the value at the given index: for strings, this\nis the string length; for tables, this is the result of the length operator\n('`#`') with no metamethods; for userdata, this is the size of the block of\nmemory allocated for the userdata; for other values, it is 0.\n
lua_rawset lua_rawset(lua_State *L, int index) [void]\nSimilar to `lua_settable`, but does a raw assignment (i.e., without\nmetamethods).\n
-lua_rawseti lua_rawseti(lua_State *L, int index, int n) [void]\nDoes the equivalent of `t[n] = v`, where `t` is the table at the given valid\nindex and `v` is the value at the top of the stack.\n\nThis function pops the value from the stack. The assignment is raw; that is, it\ndoes not invoke metamethods.\n
-lua_rawsetp lua_rawsetp(lua_State *L, int index, const void *p) [void]\nDoes the equivalent of `t[k] = v`, where `t` is the table at the given valid\nindex, `k` is the pointer `p` represented as a light userdata, and `v` is the\nvalue at the top of the stack.\n\nThis function pops the value from the stack. The assignment is raw; that is, it\ndoes not invoke metamethods.\n
+lua_rawseti lua_rawseti(lua_State *L, int index, int n) [void]\nDoes the equivalent of `t[n] = v`, where `t` is the table at the given index\nand `v` is the value at the top of the stack.\n\nThis function pops the value from the stack. The assignment is raw; that is, it\ndoes not invoke metamethods.\n
+lua_rawsetp lua_rawsetp(lua_State *L, int index, const void *p) [void]\nDoes the equivalent of `t[k] = v`, where `t` is the table at the given index,\n`k` is the pointer `p` represented as a light userdata, and `v` is the value at\nthe top of the stack.\n\nThis function pops the value from the stack. The assignment is raw; that is, it\ndoes not invoke metamethods.\n
lua_Reader (*lua_Reader)(lua_State *L, void *data, size_t *size) [const char*]\nThe reader function used by `lua_load`. Every time it needs another piece of\nthe chunk, `lua_load` calls the reader, passing along its `data` parameter.\nThe reader must return a pointer to a block of memory with a new piece of\nthe chunk and set `size` to the block size. The block must exist until the\nreader function is called again. To signal the end of the chunk, the reader\nmust return `NULL` or set `size` to zero. The reader function may return\npieces of any size greater than zero.\n
lua_register lua_register(lua_State *L, const char *name, lua_CFunction f) [void]\nSets the C function `f` as the new value of global `name`. It is defined\nas a macro:\n\n #define lua_register(L,n,f) (lua_pushcfunction(L, f), lua_setglobal(L, n))\n
-lua_remove lua_remove(lua_State *L, int index) [void]\nRemoves the element at the given valid index, shifting down the elements\nabove this index to fill the gap. Cannot be called with a pseudo-index,\nbecause a pseudo-index is not an actual stack position.\n
-lua_replace lua_replace(lua_State *L, int index) [void]\nMoves the top element into the given position, without shifting any element\n(therefore replacing the value at the given position), and then pops the top\nelement.\n
-lua_resume lua_resume(lua_State *L, lua_State *from, int nargs) [int]\nStarts and resumes a coroutine in a given thread.\n\nTo start a coroutine, you push onto the thread stack the main function plus any\narguments; then you call `lua_resume`, with `nargs` being the number of\narguments. This call returns when the coroutine suspends or finishes its\nexecution. When it returns, the stack contains all values passed to\n`lua_yield`, or all values returned by the body function. `lua_resume` returns\n`LUA_YIELD` if the coroutine yields, `LUA_OK` if the coroutine finishes its\nexecution without errors, or an error code in case of errors (see `lua_pcall`).\n\nIn case of errors, the stack is not unwound, so you can use the debug API over\nit. The error message is on the top of the stack.\n\nTo resume a coroutine, you put on its stack only the values to be passed as\nresults from `yield`, and then call `lua_resume`.\n
+lua_remove lua_remove(lua_State *L, int index) [void]\nRemoves the element at the given valid index, shifting down the elements\nabove this index to fill the gap. This function cannot be called with a\npseudo-index, because a pseudo-index is not an actual stack position.\n
+lua_replace lua_replace(lua_State *L, int index) [void]\nMoves the top element into the given valid index, without shifting any element\n(therefore replacing the value at the given index), and then pops the top\nelement.\n
+lua_resume lua_resume(lua_State *L, lua_State *from, int nargs) [int]\nStarts and resumes a coroutine in a given thread.\n\nTo start a coroutine, you push onto the thread stack the main function plus any\narguments; then you call `lua_resume`, with `nargs` being the number of\narguments. This call returns when the coroutine suspends or finishes its\nexecution. When it returns, the stack contains all values passed to\n`lua_yield`, or all values returned by the body function. `lua_resume` returns\n`LUA_YIELD` if the coroutine yields, `LUA_OK` if the coroutine finishes its\nexecution without errors, or an error code in case of errors (see `lua_pcall`).\n\nIn case of errors, the stack is not unwound, so you can use the debug API over\nit. The error message is on the top of the stack.\n\nTo resume a coroutine, you remove any results from the last `lua_yield`, put on\nits stack only the values to be passed as results from `yield`, and then call\n`lua_resume`.\n\nThe parameter `from` represents the coroutine that is resuming `L`. If there\nis no such coroutine, this parameter can be `NULL`.\n
lua_setallocf lua_setallocf(lua_State *L, lua_Alloc f, void *ud) [void]\nChanges the allocator function of a given state to `f` with user data `ud`.\n
-lua_setfield lua_setfield(lua_State *L, int index, const char *k) [void]\nDoes the equivalent to `t[k] = v`, where `t` is the value at the given valid\nindex and `v` is the value at the top of the stack.\n\nThis function pops the value from the stack. As in Lua, this function may\ntrigger a metamethod for the "newindex" event (see §2.4).\n
+lua_setfield lua_setfield(lua_State *L, int index, const char *k) [void]\nDoes the equivalent to `t[k] = v`, where `t` is the value at the given index\nand `v` is the value at the top of the stack.\n\nThis function pops the value from the stack. As in Lua, this function may\ntrigger a metamethod for the "newindex" event (see §2.4).\n
lua_setglobal lua_setglobal(lua_State *L, const char *name) [void]\nPops a value from the stack and sets it as the new value of global `name`.\n
-lua_setmetatable lua_setmetatable(lua_State *L, int index) [void]\nPops a table from the stack and sets it as the new metatable for the value\nat the given acceptable index.\n
-lua_settable lua_settable(lua_State *L, int index) [void]\nDoes the equivalent to `t[k] = v`, where `t` is the value at the given\nvalid index,\n\n`v` is the value at the top of the stack, and `k` is the value just below\nthe top.\n\nThis function pops both the key and the value from the stack. As in Lua,\nthis function may trigger a metamethod for the "newindex" event (see §2.4).\n
-lua_settop lua_settop(lua_State *L, int index) [void]\nAccepts any acceptable index, or 0, and sets the stack top to this index.\nIf the new top is larger than the old one, then the new elements are filled\nwith <b>nil</b>. If `index` is 0, then all stack elements are removed.\n
+lua_setmetatable lua_setmetatable(lua_State *L, int index) [void]\nPops a table from the stack and sets it as the new metatable for the value\nat the given index.\n
+lua_settable lua_settable(lua_State *L, int index) [void]\nDoes the equivalent to `t[k] = v`, where `t` is the value at the given index,\n`v` is the value at the top of the stack, and `k` is the value just below the\ntop.\n\nThis function pops both the key and the value from the stack. As in Lua,\nthis function may trigger a metamethod for the "newindex" event (see §2.4).\n
+lua_settop lua_settop(lua_State *L, int index) [void]\nAccepts any index, or 0, and sets the stack top to this index. If the new\ntop is larger than the old one, then the new elements are filled with\n**nil**. If `index` is 0, then all stack elements are removed.\n
lua_setuservalue lua_setuservalue(lua_State *L, int index) [void]\nPops a table or nil from the stack and sets it as the new value associated to\nthe userdata at the given index.\n
lua_State lua_State [struct lua_State]\nAn opaque structure that points to a thread and indirectly (through the thread)\nto the whole state of a Lua interpreter. The Lua library is fully reentrant: it\nhas no global variables. All information about a state is accessible through\nthis structure.\n\nA pointer to this structure must be passed as the first argument to every\nfunction in the library, except to `lua_newstate`, which creates a Lua state\nfrom scratch.\n
lua_status lua_status(lua_State *L) [int]\nReturns the status of the thread `L`.\n\nThe status can be 0 (`LUA_OK`) for a normal thread, an error code if the thread\nfinished the execution of a `lua_resume` with an error, or `LUA_YIELD` if the\nthread is suspended.\n\nYou can only call functions in threads with status `LUA_OK`. You can resume\nthreads with status `LUA_OK` (to start a new coroutine) or `LUA_YIELD` (to\nresume a coroutine).\n
-lua_toboolean lua_toboolean(lua_State *L, int index) [int]\nConverts the Lua value at the given acceptable index to a C boolean value\n(0 or 1). Like all tests in Lua, `lua_toboolean` returns true for any Lua value\ndifferent from false and nil; otherwise it returns false. It also returns false\nwhen called with a non-valid index. (If you want to accept only actual boolean\nvalues, use `lua_isboolean` to test the value's type.)\n
-lua_tocfunction lua_tocfunction(lua_State *L, int index) [lua_CFunction]\nConverts a value at the given acceptable index to a C function. That value\nmust be a C function; otherwise, returns `NULL`.\n
+lua_toboolean lua_toboolean(lua_State *L, int index) [int]\nConverts the Lua value at the given index to a C boolean value (0 or 1).\nLike all tests in Lua, `lua_toboolean` returns true for any Lua value different\nfrom false and nil; otherwise it returns false. (If you want to accept only\nactual boolean values, use `lua_isboolean` to test the value's type.)\n
+lua_tocfunction lua_tocfunction(lua_State *L, int index) [lua_CFunction]\nConverts a value at the given index to a C function. That value must be a\nC function; otherwise, returns `NULL`.\n
lua_tointeger lua_tointeger(lua_State *L, int index) [lua_Integer]\nEquivalent to `lua_tointegerx` with `isnum` equal to `NULL`.\n
-lua_tointegerx lua_tointegerx(lua_State *L, int index, int *isnum) [lua_Integer]\nConverts the Lua value at the given acceptable index to the signed integral\ntype `lua_Integer`. The Lua value must be a number or a string convertible\nto a number (see §3.4.2); otherwise, `lua_tointegerx` returns 0.\n\nIf the number is not an integer, it is truncated in some non-specified way.\n\nIf `isnum` is not `NULL`, its referent is assigned a boolean value that\nindicates whether the operation succeeded.\n
-lua_tolstring lua_tolstring(lua_State *L, int index, size_t *len) [const char*]\nConverts the Lua value at the given acceptable index to a C string. If `len`\nis not `NULL`, it also sets `*len` with the string length. The Lua value\nmust be a string or a number; otherwise, the function returns `NULL`.\nIf the value is a number, then `lua_tolstring` also _changes the actual\nvalue in the stack to a string_. (This change confuses `lua_next` when\n`lua_tolstring` is applied to keys during a table traversal.)\n\n`lua_tolstring` returns a fully aligned pointer to a string inside the\nLua state. This string always has a zero ('\0') after its last character\n(as in C), but can contain other zeros in its body. Because Lua has garbage\ncollection, there is no guarantee that the pointer returned by `lua_tolstring`\nwill be valid after the corresponding value is removed from the stack.\n
+lua_tointegerx lua_tointegerx(lua_State *L, int index, int *isnum) [lua_Integer]\nConverts the Lua value at the given index to the signed integral type\n`lua_Integer`. The Lua value must be a number or a string convertible to a\nnumber (see §3.4.2); otherwise, `lua_tointegerx` returns 0.\n\nIf the number is not an integer, it is truncated in some non-specified way.\n\nIf `isnum` is not `NULL`, its referent is assigned a boolean value that\nindicates whether the operation succeeded.\n
+lua_tolstring lua_tolstring(lua_State *L, int index, size_t *len) [const char*]\nConverts the Lua value at the given index to a C string. If `len` is not\n`NULL`, it also sets `*len` with the string length. The Lua value must be a\nstring or a number; otherwise, the function returns `NULL`. If the value is a\nnumber, then `lua_tolstring` also _changes the actual value in the stack to a\nstring_. (This change confuses `lua_next` when `lua_tolstring` is applied to\nkeys during a table traversal.)\n\n`lua_tolstring` returns a fully aligned pointer to a string inside the\nLua state. This string always has a zero ('\0') after its last character\n(as in C), but can contain other zeros in its body. Because Lua has garbage\ncollection, there is no guarantee that the pointer returned by `lua_tolstring`\nwill be valid after the corresponding value is removed from the stack.\n
lua_tonumber lua_tonumber(lua_State *L, int index) [lua_Number]\nEquivalent to `lua_tonumberx` with `isnum` equal to `NULL`.\n
-lua_tonumberx lua_tonumberx(lua_State *L, int index, int *isnum) [lua_Number]\nConverts the Lua value at the given acceptable index to the C type `lua_Number`\n(see `lua_Number`). The Lua value must be a number or a string convertible\nto a number (see §3.4.2); otherwise, `lua_tonumberx` returns 0.\n\nIf `isnum` is not `NULL`, its referent is assigned a boolean value that\nindicates whether the operation succeeded.\n
-lua_topointer lua_topointer(lua_State *L, int index) [const void*]\nConverts the value at the given acceptable index to a generic C pointer\n(`void*`). The value can be a userdata, a table, a thread, or a function;\notherwise, `lua_topointer` returns `NULL`. Different objects will give\ndifferent pointers. There is no way to convert the pointer back to its\noriginal value.\n\nTypically this function is used only for debug information.\n
+lua_tonumberx lua_tonumberx(lua_State *L, int index, int *isnum) [lua_Number]\nConverts the Lua value at the given index to the C type `lua_Number` (see\n`lua_Number`). The Lua value must be a number or a string convertible to a\nnumber (see §3.4.2); otherwise, `lua_tonumberx` returns 0.\n\nIf `isnum` is not `NULL`, its referent is assigned a boolean value that\nindicates whether the operation succeeded.\n
+lua_topointer lua_topointer(lua_State *L, int index) [const void*]\nConverts the value at the given index to a generic C pointer (`void*`).\nThe value can be a userdata, a table, a thread, or a function; otherwise,\n`lua_topointer` returns `NULL`. Different objects will give different\npointers. There is no way to convert the pointer back to its original value.\n\nTypically this function is used only for debug information.\n
lua_tostring lua_tostring(lua_State *L, int index) [const char*]\nEquivalent to `lua_tolstring` with `len` equal to `NULL`.\n
-lua_tothread lua_tothread(lua_State *L, int index) [lua_State*]\nConverts the value at the given acceptable index to a Lua thread (represented\nas `lua_State*`). This value must be a thread; otherwise, the function\nreturns `NULL`.\n
+lua_tothread lua_tothread(lua_State *L, int index) [lua_State*]\nConverts the value at the given index to a Lua thread (represented as\n`lua_State*`). This value must be a thread; otherwise, the function\nreturns `NULL`.\n
lua_tounsigned lua_tounsigned(lua_State *L, int index) [lua_Unsigned]\nEquivalent to `lua_tounsignedx` with `isnum` equal to `NULL`.\n
-lua_tounsignedx lua_tounsignedx(lua_State *L, int index, int *isnum) [lua_Unsigned]\nConverts the Lua value at the given acceptable index to the unsigned integral\ntype `lua_Unsigned`. The Lua value must be a number or a string convertible to\na number (see §3.4.2); otherwise, `lua_tounsignedx` returns 0.\n\nIf the number is not an integer, it is truncated in some non-specified way.\nIf the number is outside the range of representable values, it is normalized to\nthe remainder of its division by one more than the maximum representable value.\n\nIf `isnum` is not `NULL`, its referent is assigned a boolean value that\nindicates whether the operation succeeded.\n
-lua_touserdata lua_touserdata(lua_State *L, int index) [void*]\nIf the value at the given acceptable index is a full userdata, returns\nits block address. If the value is a light userdata, returns its pointer.\nOtherwise, returns `NULL`.\n
-lua_type lua_type(lua_State *L, int index) [int]\nReturns the type of the value in the given acceptable index, or `LUA_TNONE` for\na non-valid index.\n\nThe types returned by `lua_type` are coded by the following constants defined in\n`lua.h`: `LUA_TNIL`, `LUA_TNUMBER`, `LUA_TBOOLEAN`, `LUA_TSTRING`, `LUA_TTABLE`,\n`LUA_TFUNCTION`, `LUA_TUSERDATA`, `LUA_TTHREAD`, and `LUA_TLIGHTUSERDATA`.\n
+lua_tounsignedx lua_tounsignedx(lua_State *L, int index, int *isnum) [lua_Unsigned]\nConverts the Lua value at the given index to the unsigned integral type\n`lua_Unsigned`. The Lua value must be a number or a string convertible to a\nnumber (see §3.4.2); otherwise, `lua_tounsignedx` returns 0.\n\nIf the number is not an integer, it is truncated in some non-specified way.\nIf the number is outside the range of representable values, it is normalized to\nthe remainder of its division by one more than the maximum representable value.\n\nIf `isnum` is not `NULL`, its referent is assigned a boolean value that\nindicates whether the operation succeeded.\n
+lua_touserdata lua_touserdata(lua_State *L, int index) [void*]\nIf the value at the given index is a full userdata, returns its block address.\nIf the value is a light userdata, returns its pointer. Otherwise, returns\n`NULL`.\n
+lua_type lua_type(lua_State *L, int index) [int]\nReturns the type of the value in the given index, or `LUA_TNONE` for a non-valid\n(but acceptable) index.\n\nThe types returned by `lua_type` are coded by the following constants defined in\n`lua.h`: `LUA_TNIL`, `LUA_TNUMBER`, `LUA_TBOOLEAN`, `LUA_TSTRING`, `LUA_TTABLE`,\n`LUA_TFUNCTION`, `LUA_TUSERDATA`, `LUA_TTHREAD`, and `LUA_TLIGHTUSERDATA`.\n
lua_typename lua_typename(lua_State *L, int tp) [const char*]\nReturns the name of the type encoded by the value `tp`, which must be one\nthe values returned by `lua_type`.\n
lua_Unsigned lua_Unsigned [typedef unsigned long lua_Unsigned]\nThe type used by the Lua API to represent unsigned integral values. It must\nhave at least 32 bits.\n\nBy default it is an `unsigned int` or an `unsigned long`, whichever can hold\n32-bit values.\n
+lua_upvalueindex lua_upvalueindex(lua_State *L, int i) [int]\nReturns the pseudo-index that represents the `i`-th upvalue of the running\nfunction (see §4.4).\n
lua_version lua_version(lua_State *L) [const lua_Number]\nReturns the address of the version number stored in the Lua core. When called\nwith a valid `lua_State`, returns the address of the version used to create that\nstate. When called with `NULL`, returns the address of the version running the\ncall.\n
lua_Writer (*lua_Writer)(lua_State *L, const void* p, size_t sz, void* ud) [int]\nThe type of the writer function used by `lua_dump`. Every time it produces\nanother piece of chunk, `lua_dump` calls the writer, passing along the buffer\nto be written (`p`), its size (`sz`), and the `data` parameter supplied to\n`lua_dump`.\n\nThe writer returns an error code: 0 means no errors; any other value means\nan error and stops `lua_dump` from calling the writer again.\n
lua_xmove lua_xmove(lua_State *from, lua_State *to, int n) [void]\nExchange values between different threads of the same state.\n\nThis function pops `n` values from the stack `from`, and pushes them onto\nthe stack `to`.\n
@@ -149,16 +152,16 @@ luaL_execresult luaL_execresult(lua_State *L, int stat) [int]\nThis function pro
luaL_fileresult luaL_fileresult(lua_State *L, int stat, const char *fname) [int]\nThis function produces the return values for file-related functions in the\nstandard library (`io.open`, `os.rename`, `file:seek`, etc.).\n
luaL_getmetafield luaL_getmetafield(lua_State *L, int obj, const char *e) [int]\nPushes onto the stack the field `e` from the metatable of the object at index\n`obj`. If the object does not have a metatable, or if the metatable does\nnot have this field, returns false and pushes nothing.\n
luaL_getmetatable luaL_getmetatable(lua_State *L, const char *tname) [void]\nPushes onto the stack the metatable associated with name `tname` in the\nregistry (see `luaL_newmetatable`).\n
-luaL_getsubtable luaL_getsubtable(lua_State *L, int idx, const char *fname) [int]\nEnsures that the value `t[fname]`, where `t` is the value at the valid index\n`idx`, is a table, and pushes that table onto the stack. Returns true if it\nfinds a previous table there and false if it creates a new table.\n
+luaL_getsubtable luaL_getsubtable(lua_State *L, int idx, const char *fname) [int]\nEnsures that the value `t[fname]`, where `t` is the value at index `idx`, is\na table, and pushes that table onto the stack. Returns true if it finds a\nprevious table there and false if it creates a new table.\n
luaL_gsub luaL_gsub(lua_State *L, const char *s, const char *p, const char *r) [const char*]\nCreates a copy of string `s` by replacing any occurrence of the string `p`\nwith the string `r`. Pushes the resulting string on the stack and returns it.\n
-luaL_len luaL_len(lua_State *L, int index) [int]\nReturns the "length" of the value at the given acceptable index as a number; it\nis equivalent to the '`#`' operator in Lua (see §3.4.6). Raises an error if the\nresult of the operation is not a number. (This case only can happen through\nmetamethods.)\n
+luaL_len luaL_len(lua_State *L, int index) [int]\nReturns the "length" of the value at the given index as a number; it is\nequivalent to the '`#`' operator in Lua (see §3.4.6). Raises an error if the\nresult of the operation is not a number. (This case only can happen through\nmetamethods.)\n
luaL_loadbuffer luaL_loadbuffer(lua_State *L, const char *buff, size_t sz, const char *name) [int]\nEquivalent to `luaL_loadbufferx` with `mode` equal to `NULL`.\n
luaL_loadbufferx luaL_loadbufferx(lua_State *L, const char *buff, size_t sz, const char *name, const char *mode) [int]\nLoads a buffer as a Lua chunk. This function uses `lua_load` to load the\nchunk in the buffer pointed to by `buff` with size `sz`.\n\nThis function returns the same results as `lua_load`. `name` is the chunk\nname, used for debug information and error messages. The string `mode` works as\nin function `lua_load`.\n
luaL_loadfile luaL_loadfile(lua_State *L, const char *filename) [int]\nEquivalent to `luaL_loadfilex` with `mode` equal to `NULL`.\n
luaL_loadfilex luaL_loadfilex(lua_State *L, const char *filename, const char *mode) [int]\nLoads a file as a Lua chunk. This function uses `lua_load` to load the chunk\nin the file named `filename`. If `filename` is `NULL`, then it loads from the\nstandard input. The first line in the file is ignored if it starts with a `#`.\n\nThe string `mode` works as in function `lua_load`.\n\nThis function returns the same results as `lua_load`, but it has an extra\nerror code `LUA_ERRFILE` if it cannot open/read the file or the file has a wrong\nmode.\n\nAs `lua_load`, this function only loads the chunk; it does not run it.\n
luaL_loadstring luaL_loadstring(lua_State *L, const char *s) [int]\nLoads a string as a Lua chunk. This function uses `lua_load` to load the\nchunk in the zero-terminated string `s`.\n\nThis function returns the same results as `lua_load`.\n\nAlso as `lua_load`, this function only loads the chunk; it does not run it.\n
-luaL_newlib luaL_newlib(lua_State *L, const luaL_Reg *l) [int]\nCreates a new table and registers there the functions in list `l`. It is\nimplemented as the following macro:\n\n (luaL_newlibtable(L,l), luaL_setfuncs(L,l,0))\n
-luaL_newlibtable luaL_newlibtable(lua_State *L, const luaL_Reg l[]) [int]\nCreates a new table with a size optimized to store all entries in the array `l`\n(but does not actually store them). It is intended to be used in conjunction\nwith `luaL_setfuncs` (see `luaL_newlib`).\n\nIt is implemented as a macro. The array `l` must be the actual array, not a\npointer to it.\n
+luaL_newlib luaL_newlib(lua_State *L, const luaL_Reg *l) [void]\nCreates a new table and registers there the functions in list `l`. It is\nimplemented as the following macro:\n\n (luaL_newlibtable(L,l), luaL_setfuncs(L,l,0))\n
+luaL_newlibtable luaL_newlibtable(lua_State *L, const luaL_Reg l[]) [void]\nCreates a new table with a size optimized to store all entries in the array `l`\n(but does not actually store them). It is intended to be used in conjunction\nwith `luaL_setfuncs` (see `luaL_newlib`).\n\nIt is implemented as a macro. The array `l` must be the actual array, not a\npointer to it.\n
luaL_newmetatable luaL_newmetatable(lua_State *L, const char *tname) [int]\nIf the registry already has the key `tname`, returns 0. Otherwise, creates\na new table to be used as a metatable for userdata, adds it to the registry\nwith key `tname`, and returns 1.\n\nIn both cases pushes onto the stack the final value associated with `tname`\nin the registry.\n
luaL_newstate luaL_newstate(void) [lua_State*]\nCreates a new Lua state. It calls `lua_newstate` with an allocator based\non the standard C `realloc` function and then sets a panic function (see\n`lua_atpanic`) that prints an error message to the standard error output in\ncase of fatal errors.\n\nReturns the new state, or `NULL` if there is a memory allocation error.\n
luaL_openlibs luaL_openlibs(lua_State *L) [void]\nOpens all standard Lua libraries into the given state.\n
@@ -179,7 +182,7 @@ luaL_requiref luaL_requiref(lua_State *L, const char *modname, lua_CFunction ope
luaL_setfuncs luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup) [void]\nRegisters all functions in the array `l` (see `luaL_Reg`) into the table on the\ntop of the stack (below optional upvalues, see next).\n\nWhen `nup` is not zero, all functions are created sharing `nup` upvalues, which\nmust be previously pushed on the stack on top of the library table. These\nvalues are popped from the stack after the registration.\n
luaL_setmetatable luaL_setmetatable(lua_State *L, const char *tname) [void]\nSets the metatable of the object at the top of the stack as the metatable\nassociated with name `tname` in the registry (see `luaL_newmetatable`).\n
luaL_testudata luaL_testudata(lua_State *L, int arg, const char *tname) [void]\nThis function works like `luaL_checkudata`, except that, when the test fails,\nit returns `NULL` instead of throwing an error.\n
-luaL_tolstring luaL_tolstring(lua_State *L, int idx, size_t *len) [const char*]\nConverts any Lua value at the given acceptable index to a C string in a\nreasonable format. The resulting string is pushed onto the stack and also\nreturned by the function. If `len` is not `NULL`, the function also sets `*len`\nwith the string length.\n\nIf the value has a metatable with a `"__tostring"` field, then `luaL_tolstring`\ncalls the corresponding metamethod with the value as argument, and uses the\nresult of the call as its result.\n
+luaL_tolstring luaL_tolstring(lua_State *L, int idx, size_t *len) [const char*]\nConverts any Lua value at the given index to a C string in a reasonable format.\nThe resulting string is pushed onto the stack and also returned by the function.\nIf `len` is not `NULL`, the function also sets `*len` with the string length.\n\nIf the value has a metatable with a `"__tostring"` field, then `luaL_tolstring`\ncalls the corresponding metamethod with the value as argument, and uses the\nresult of the call as its result.\n
luaL_traceback luaL_traceback(lua_State *L, lua_State *L1, const char *msg, int level) [void]\nCreates and pushes a traceback of the stack `L1`. If `msg` is not `NULL` it is\nappended at the beginning of the traceback. The `level` parameter tells at\nwhich level to start the traceback.\n
luaL_typename luaL_typename(lua_State *L, int index) [const char*]\nReturns the name of the type of the value at the given index.\n
luaL_unref luaL_unref(lua_State *L, int t, int ref) [void]\nReleases reference `ref` from the table at index `t` (see `luaL_ref`).\nThe entry is removed from the table, so that the referred object can be\ncollected. The reference `ref` is also freed to be used again.\n\nIf `ref` is `LUA_NOREF` or `LUA_REFNIL`, `luaL_unref` does nothing.\n