The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros | Functions | Variables
ldblib.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
Include dependency graph for ldblib.cpp:

Go to the source code of this file.

Macros

#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_Stategetthread (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 []
 

Macro Definition Documentation

#define gethooktable (   L)    luaL_getsubtable(L, LUA_REGISTRYINDEX, HOOKKEY)

Definition at line 255 of file ldblib.cpp.

Referenced by db_gethook(), db_sethook(), and hookf().

#define HOOKKEY   "_HKEY"

Definition at line 20 of file ldblib.cpp.

#define ldblib_c

Definition at line 11 of file ldblib.cpp.

#define LUA_LIB

Definition at line 12 of file ldblib.cpp.

Function Documentation

static int auxupvalue ( lua_State L,
int  get 
)
static
static int checkupval ( lua_State L,
int  argf,
int  argnup 
)
static
static int db_debug ( lua_State L)
static

Definition at line 343 of file ldblib.cpp.

References lua_pcall, lua_settop(), lua_tostring, luai_writestringerror, and luaL_loadbuffer.

static int db_gethook ( lua_State L)
static
static int db_getinfo ( lua_State L)
static
static int db_getlocal ( lua_State L)
static
static int db_getmetatable ( lua_State L)
static

Definition at line 30 of file ldblib.cpp.

References lua_getmetatable(), lua_pushnil(), and luaL_checkany().

static int db_getregistry ( lua_State L)
static

Definition at line 24 of file ldblib.cpp.

References lua_pushvalue(), and LUA_REGISTRYINDEX.

static int db_getupvalue ( lua_State L)
static

Definition at line 216 of file ldblib.cpp.

References auxupvalue().

static int db_getuservalue ( lua_State L)
static

Definition at line 49 of file ldblib.cpp.

References lua_getuservalue(), lua_pushnil(), LUA_TUSERDATA, and lua_type().

static int db_sethook ( lua_State L)
static
static int db_setlocal ( lua_State L)
static
static int db_setmetatable ( lua_State L)
static

Definition at line 39 of file ldblib.cpp.

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 221 of file ldblib.cpp.

References auxupvalue(), and luaL_checkany().

static int db_setuservalue ( lua_State L)
static
static int db_traceback ( lua_State L)
static
static int db_upvalueid ( lua_State L)
static

Definition at line 238 of file ldblib.cpp.

References checkupval(), lua_pushlightuserdata(), and lua_upvalueid().

static int db_upvaluejoin ( lua_State L)
static

Definition at line 245 of file ldblib.cpp.

References checkupval(), lua_iscfunction(), lua_upvaluejoin(), and luaL_argcheck.

static lua_State* getthread ( lua_State L,
int arg 
)
static

Definition at line 88 of file ldblib.cpp.

References lua_isthread, and lua_tothread().

Referenced by db_gethook(), db_getinfo(), db_getlocal(), db_sethook(), db_setlocal(), and db_traceback().

static void hookf ( lua_State L,
lua_Debug ar 
)
static
LUAMOD_API int luaopen_debug ( lua_State L)

Definition at line 393 of file ldblib.cpp.

References luaL_newlib.

Referenced by lua_kernel_base::lua_kernel_base().

static int makemask ( const char *  smask,
int  count 
)
static

Definition at line 275 of file ldblib.cpp.

References LUA_MASKCALL, LUA_MASKCOUNT, LUA_MASKLINE, LUA_MASKRET, and mask.

Referenced by db_sethook().

static void settabsb ( lua_State L,
const char *  i,
int  v 
)
static

Definition at line 82 of file ldblib.cpp.

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 76 of file ldblib.cpp.

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 70 of file ldblib.cpp.

References lua_pushstring(), and lua_setfield().

Referenced by db_getinfo().

static void treatstackoption ( lua_State L,
lua_State L1,
const char *  fname 
)
static

Definition at line 100 of file ldblib.cpp.

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.cpp.

References i, LUA_MASKCALL, LUA_MASKLINE, and LUA_MASKRET.

Referenced by db_gethook().

Variable Documentation

const luaL_Reg dblib[]
static
Initial value:
= {
{"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}
}
static int db_setmetatable(lua_State *L)
Definition: ldblib.cpp:39
static int db_setuservalue(lua_State *L)
Definition: ldblib.cpp:58
static int db_setupvalue(lua_State *L)
Definition: ldblib.cpp:221
static int db_getinfo(lua_State *L)
Definition: ldblib.cpp:111
static int db_traceback(lua_State *L)
Definition: ldblib.cpp:358
static int db_gethook(lua_State *L)
Definition: ldblib.cpp:323
static int db_debug(lua_State *L)
Definition: ldblib.cpp:343
static int db_upvaluejoin(lua_State *L)
Definition: ldblib.cpp:245
static int db_getuservalue(lua_State *L)
Definition: ldblib.cpp:49
static int db_getregistry(lua_State *L)
Definition: ldblib.cpp:24
static int db_upvalueid(lua_State *L)
Definition: ldblib.cpp:238
static int db_sethook(lua_State *L)
Definition: ldblib.cpp:295
static int db_getmetatable(lua_State *L)
Definition: ldblib.cpp:30
static int db_setlocal(lua_State *L)
Definition: ldblib.cpp:190
static int db_getlocal(lua_State *L)
Definition: ldblib.cpp:161
static int db_getupvalue(lua_State *L)
Definition: ldblib.cpp:216

Definition at line 372 of file ldblib.cpp.