#include <stdio.h>#include <stdlib.h>#include <string.h>#include "lua.h"#include "lauxlib.h"#include "lualib.h"
Go to the source code of this file.
Defines | |
| #define | ldblib_c |
| #define | LUA_LIB |
| #define | HOOKKEY "_HKEY" |
| #define | gethooktable(L) luaL_getsubtable(L, LUA_REGISTRYINDEX, HOOKKEY); |
Functions | |
| static int | db_getregistry (lua_State *L) |
| static int | db_getmetatable (lua_State *L) |
| static int | db_setmetatable (lua_State *L) |
| static int | db_getuservalue (lua_State *L) |
| static int | db_setuservalue (lua_State *L) |
| static void | settabss (lua_State *L, const char *i, const char *v) |
| static void | settabsi (lua_State *L, const char *i, int v) |
| static void | settabsb (lua_State *L, const char *i, int v) |
| static lua_State * | getthread (lua_State *L, int *arg) |
| static void | treatstackoption (lua_State *L, lua_State *L1, const char *fname) |
| static int | db_getinfo (lua_State *L) |
| static int | db_getlocal (lua_State *L) |
| static int | db_setlocal (lua_State *L) |
| static int | auxupvalue (lua_State *L, int get) |
| static int | db_getupvalue (lua_State *L) |
| static int | db_setupvalue (lua_State *L) |
| static int | checkupval (lua_State *L, int argf, int argnup) |
| static int | db_upvalueid (lua_State *L) |
| static int | db_upvaluejoin (lua_State *L) |
| static void | hookf (lua_State *L, lua_Debug *ar) |
| static int | makemask (const char *smask, int count) |
| static char * | unmakemask (int mask, char *smask) |
| static int | db_sethook (lua_State *L) |
| static int | db_gethook (lua_State *L) |
| static int | db_debug (lua_State *L) |
| static int | db_traceback (lua_State *L) |
| LUAMOD_API int | luaopen_debug (lua_State *L) |
Variables | |
| static const luaL_Reg | dblib [] |
| #define gethooktable | ( | L | ) | luaL_getsubtable(L, LUA_REGISTRYINDEX, HOOKKEY); |
Definition at line 256 of file ldblib.c.
Referenced by db_gethook(), db_sethook(), and hookf().
| static int auxupvalue | ( | lua_State * | L, | |
| int | get | |||
| ) | [static] |
Definition at line 205 of file ldblib.c.
References lua_getupvalue(), lua_insert(), lua_pushstring(), lua_setupvalue(), LUA_TFUNCTION, luaL_checkint, and luaL_checktype().
Referenced by db_getupvalue(), and db_setupvalue().


| static int checkupval | ( | lua_State * | L, | |
| int | argf, | |||
| int | argnup | |||
| ) | [static] |
Definition at line 228 of file ldblib.c.
References lua_getinfo(), lua_pushvalue(), LUA_TFUNCTION, luaL_argcheck, luaL_checkint, luaL_checktype(), and lua_Debug::nups.
Referenced by db_upvalueid(), and db_upvaluejoin().


| static int db_debug | ( | lua_State * | L | ) | [static] |
Definition at line 337 of file ldblib.c.
References ana::buffer(), lua_pcall, lua_settop(), lua_tostring, luai_writestringerror, and luaL_loadbuffer.

| static int db_gethook | ( | lua_State * | L | ) | [static] |
Definition at line 318 of file ldblib.c.
References gethooktable, getthread(), hookf(), lua_gethook(), lua_gethookcount(), lua_gethookmask(), lua_pushinteger(), lua_pushliteral, lua_pushstring(), lua_rawgetp(), lua_remove(), mask, and unmakemask().

| static int db_getinfo | ( | lua_State * | L | ) | [static] |
Definition at line 112 of file ldblib.c.
References lua_Debug::currentline, getthread(), lua_Debug::istailcall, lua_Debug::isvararg, lua_Debug::lastlinedefined, lua_Debug::linedefined, lua_createtable(), lua_getinfo(), lua_getstack(), lua_isfunction, lua_isnumber(), lua_pushfstring(), lua_pushnil(), lua_pushvalue(), lua_tointeger, lua_tostring, lua_xmove(), luaL_argerror(), luaL_optstring, lua_Debug::name, lua_Debug::namewhat, lua_Debug::nparams, lua_Debug::nups, settabsb(), settabsi(), settabss(), lua_Debug::short_src, lua_Debug::source, treatstackoption(), and lua_Debug::what.

| static int db_getlocal | ( | lua_State * | L | ) | [static] |
Definition at line 162 of file ldblib.c.
References getthread(), lua_getlocal(), lua_getstack(), lua_isfunction, lua_pushnil(), lua_pushstring(), lua_pushvalue(), lua_xmove(), luaL_argerror(), and luaL_checkint.

| static int db_getmetatable | ( | lua_State * | L | ) | [static] |
Definition at line 31 of file ldblib.c.
References lua_getmetatable(), lua_pushnil(), and luaL_checkany().

| static int db_getregistry | ( | lua_State * | L | ) | [static] |
Definition at line 25 of file ldblib.c.
References lua_pushvalue(), and LUA_REGISTRYINDEX.

| static int db_getupvalue | ( | lua_State * | L | ) | [static] |
Definition at line 217 of file ldblib.c.
References auxupvalue().

| static int db_getuservalue | ( | lua_State * | L | ) | [static] |
Definition at line 50 of file ldblib.c.
References lua_getuservalue(), lua_pushnil(), LUA_TUSERDATA, and lua_type().

| static int db_sethook | ( | lua_State * | L | ) | [static] |
Definition at line 295 of file ldblib.c.
References preferences::editor::TransitionUpdateMode::count, gethooktable, getthread(), lua_isnoneornil, lua_pop, lua_pushvalue(), lua_rawsetp(), lua_sethook(), lua_settop(), LUA_TFUNCTION, luaL_checkstring, luaL_checktype(), luaL_optint, and makemask().

| static int db_setlocal | ( | lua_State * | L | ) | [static] |
Definition at line 191 of file ldblib.c.
References getthread(), lua_getstack(), lua_pushstring(), lua_setlocal(), lua_settop(), lua_xmove(), luaL_argerror(), luaL_checkany(), and luaL_checkint.

| static int db_setmetatable | ( | lua_State * | L | ) | [static] |
Definition at line 40 of file ldblib.c.
References lua_setmetatable(), lua_settop(), LUA_TNIL, LUA_TTABLE, lua_type(), and luaL_argcheck.

| static int db_setupvalue | ( | lua_State * | L | ) | [static] |
Definition at line 222 of file ldblib.c.
References auxupvalue(), and luaL_checkany().

| static int db_setuservalue | ( | lua_State * | L | ) | [static] |
Definition at line 59 of file ldblib.c.
References lua_isnoneornil, lua_settop(), lua_setuservalue(), LUA_TLIGHTUSERDATA, LUA_TTABLE, LUA_TUSERDATA, lua_type(), luaL_argerror(), and luaL_checktype().

| static int db_traceback | ( | lua_State * | L | ) | [static] |
Definition at line 352 of file ldblib.c.
References getthread(), game_config::images::level, lua_isnoneornil, lua_pushvalue(), lua_tostring, luaL_optint, luaL_traceback(), and game_logic::msg().

| static int db_upvalueid | ( | lua_State * | L | ) | [static] |
Definition at line 239 of file ldblib.c.
References checkupval(), lua_pushlightuserdata(), and lua_upvalueid().

| static int db_upvaluejoin | ( | lua_State * | L | ) | [static] |
Definition at line 246 of file ldblib.c.
References checkupval(), lua_iscfunction(), lua_upvaluejoin(), and luaL_argcheck.

Definition at line 89 of file ldblib.c.
References lua_isthread, and lua_tothread().
Referenced by db_gethook(), db_getinfo(), db_getlocal(), db_sethook(), db_setlocal(), and db_traceback().


Definition at line 259 of file ldblib.c.
References lua_Debug::currentline, lua_Debug::event, gethooktable, lua_assert, lua_call, lua_getinfo(), lua_isfunction, lua_pushinteger(), lua_pushnil(), lua_pushstring(), and lua_rawgetp().
Referenced by db_gethook().


| LUAMOD_API int luaopen_debug | ( | lua_State * | L | ) |
Definition at line 387 of file ldblib.c.
References luaL_newlib.
Referenced by LuaKernel::LuaKernel().

| static int makemask | ( | const char * | smask, | |
| int | count | |||
| ) | [static] |
Definition at line 275 of file ldblib.c.
References mask.
Referenced by db_sethook().

| static void settabsb | ( | lua_State * | L, | |
| const char * | i, | |||
| int | v | |||
| ) | [static] |
Definition at line 83 of file ldblib.c.
References lua_pushboolean(), and lua_setfield().
Referenced by db_getinfo().


| static void settabsi | ( | lua_State * | L, | |
| const char * | i, | |||
| int | v | |||
| ) | [static] |
Definition at line 77 of file ldblib.c.
References lua_pushinteger(), and lua_setfield().
Referenced by db_getinfo().


| static void settabss | ( | lua_State * | L, | |
| const char * | i, | |||
| const char * | v | |||
| ) | [static] |
Definition at line 71 of file ldblib.c.
References lua_pushstring(), and lua_setfield().
Referenced by db_getinfo().


Definition at line 101 of file ldblib.c.
References lua_pushvalue(), lua_remove(), lua_setfield(), and lua_xmove().
Referenced by db_getinfo().


| static char* unmakemask | ( | int | mask, | |
| char * | smask | |||
| ) | [static] |
Definition at line 285 of file ldblib.c.
References LUA_MASKCALL, LUA_MASKLINE, and LUA_MASKRET.
Referenced by db_gethook().

{
{"debug", db_debug},
{"getuservalue", db_getuservalue},
{"gethook", db_gethook},
{"getinfo", db_getinfo},
{"getlocal", db_getlocal},
{"getregistry", db_getregistry},
{"getmetatable", db_getmetatable},
{"getupvalue", db_getupvalue},
{"upvaluejoin", db_upvaluejoin},
{"upvalueid", db_upvalueid},
{"setuservalue", db_setuservalue},
{"sethook", db_sethook},
{"setlocal", db_setlocal},
{"setmetatable", db_setmetatable},
{"setupvalue", db_setupvalue},
{"traceback", db_traceback},
{NULL, NULL}
}
| Generated by doxygen 1.7.1 on Fri May 25 2012 01:06:22 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |