Defines | Functions | Variables

lua/ldblib.c 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.c:

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_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 []

Define Documentation

#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().

#define HOOKKEY   "_HKEY"

Definition at line 21 of file ldblib.c.

#define ldblib_c

Definition at line 12 of file ldblib.c.

#define LUA_LIB

Definition at line 13 of file ldblib.c.


Function Documentation

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

static int db_gethook ( lua_State L  )  [static]
static int db_getinfo ( lua_State L  )  [static]
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.

Here is the call graph for this function:

static int db_getmetatable ( lua_State L  )  [static]

Definition at line 31 of file ldblib.c.

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

Here is the call graph for this function:

static int db_getregistry ( lua_State L  )  [static]

Definition at line 25 of file ldblib.c.

References lua_pushvalue(), and LUA_REGISTRYINDEX.

Here is the call graph for this function:

static int db_getupvalue ( lua_State L  )  [static]

Definition at line 217 of file ldblib.c.

References auxupvalue().

Here is the call graph for this function:

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().

Here is the call graph for this function:

static int db_sethook ( lua_State L  )  [static]
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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

static int db_setupvalue ( lua_State L  )  [static]

Definition at line 222 of file ldblib.c.

References auxupvalue(), and luaL_checkany().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

static int db_upvalueid ( lua_State L  )  [static]

Definition at line 239 of file ldblib.c.

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

Here is the call graph for this function:

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.

Here is the call graph for this function:

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

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().

Here is the call graph for this function:

Here is the caller graph for this function:

static void hookf ( lua_State L,
lua_Debug ar 
) [static]

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().

Here is the call graph for this function:

Here is the caller graph for this function:

LUAMOD_API int luaopen_debug ( lua_State L  ) 

Definition at line 387 of file ldblib.c.

References luaL_newlib.

Referenced by LuaKernel::LuaKernel().

Here is the caller graph for this function:

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

Definition at line 275 of file ldblib.c.

References mask.

Referenced by db_sethook().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 101 of file ldblib.c.

References lua_pushvalue(), lua_remove(), lua_setfield(), and lua_xmove().

Referenced by db_getinfo().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:


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}
}

Definition at line 366 of file ldblib.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:06:22 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs