utf8.offset()

utf8.offset (s, n [, i])nsiniin#s + 1utf8.offset(s, -n)nnil As a special case, when n is 0 the function returns the start of the encoding of the character that contains the i-th byte of s. This function assumes that s is a valid UTF-8 string.

lua_pushcfunction

lua_pushcfunction[-0, +1, โ€“] void lua_pushcfunction (lua_State *L, lua_CFunction f); Pushes a C function onto the stack. This function receives a pointer to a C function and pushes onto the stack a Lua value of type function that, when called, invokes the corresponding C function. Any function to be callable by Lua must follow the correct protocol to receive its parameters and return its results (see lua_CFunction).

io.output()

io.output ([file]) Similar to io.input, but operates over the default output file.

lua_yield

lua_yield[-?, +?, e] int lua_yield (lua_State *L, int nresults); This function is equivalent to lua_yieldk, but it has no continuation (see ยง4.7). Therefore, when the thread resumes, it continues the function that called the function calling lua_yield.

lua_pushvalue

lua_pushvalue[-0, +1, โ€“] void lua_pushvalue (lua_State *L, int index); Pushes a copy of the element at the given index onto the stack.

debug.sethook()

debug.sethook ([thread,] hook, mask [, count]) Sets the given function as a hook. The string mask and the number count describe when the hook will be called. The string mask may have any combination of the following characters, with the given meaning: 'c': the hook is called every time Lua calls a function; 'r': the hook is called every time Lua returns from a function; 'l': the hook is called every time Lua enters a new line of code. Moreover, with a count different from zero, the

luaL_tolstring

luaL_tolstring[-0, +1, e] const char *luaL_tolstring (lua_State *L, int idx, size_t *len); Converts any Lua value at the given index to a C string in a reasonable format. The resulting string is pushed onto the stack and also returned by the function. If len is not NULL, the function also sets *len with the string length. If the value has a metatable with a __tostring field, then luaL_tolstring calls the corresponding metamethod with the value as argument, and uses the result of the call a

luaL_optnumber

luaL_optnumber[-0, +0, v] lua_Number luaL_optnumber (lua_State *L, int arg, lua_Number d); If the function argument arg is a number, returns this number. If this argument is absent or is nil, returns d. Otherwise, raises an error.

luaL_execresult

luaL_execresult[-0, +3, m] int luaL_execresult (lua_State *L, int stat); This function produces the return values for process-related functions in the standard library (os.execute and io.close).

load()

load (chunk [, chunkname [, mode [, env]]]) Loads a chunk. If chunk is a string, the chunk is this string. If chunk is a function, load calls it repeatedly to get the chunk pieces. Each call to chunk must return a string that concatenates with previous results. A return of an empty string, nil, or no value signals the end of the chunk. If there are no syntactic errors, returns the compiled chunk as a function; otherwise, returns nil plus the error message. If the resulting function has