The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Macros | Functions
lapi.cpp File Reference
#include <stdarg.h>
#include <string.h>
#include "lua.h"
#include "lapi.h"
#include "ldebug.h"
#include "ldo.h"
#include "lfunc.h"
#include "lgc.h"
#include "lmem.h"
#include "lobject.h"
#include "lstate.h"
#include "lstring.h"
#include "ltable.h"
#include "ltm.h"
#include "lundump.h"
#include "lvm.h"
Include dependency graph for lapi.cpp:

Go to the source code of this file.

Classes

struct  CallS
 

Macros

#define lapi_c
 
#define LUA_CORE
 
#define NONVALIDVALUE   cast(TValue *, luaO_nilobject)
 
#define isvalid(o)   ((o) != luaO_nilobject)
 
#define ispseudo(i)   ((i) <= LUA_REGISTRYINDEX)
 
#define isstackindex(i, o)   (isvalid(o) && !ispseudo(i))
 
#define api_checkvalidindex(L, o)   api_check(L, isvalid(o), "invalid index")
 
#define api_checkstackindex(L, i, o)   api_check(L, isstackindex(i, o), "index not in the stack")
 
#define checkresults(L, na, nr)
 

Functions

static TValueindex2addr (lua_State *L, int idx)
 
static void growstack (lua_State *L, void *ud)
 
LUA_API int lua_checkstack (lua_State *L, int size)
 
LUA_API void lua_xmove (lua_State *from, lua_State *to, int n)
 
LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf)
 
LUA_API const lua_Numberlua_version (lua_State *L)
 
LUA_API int lua_absindex (lua_State *L, int idx)
 
LUA_API int lua_gettop (lua_State *L)
 
LUA_API void lua_settop (lua_State *L, int idx)
 
LUA_API void lua_remove (lua_State *L, int idx)
 
LUA_API void lua_insert (lua_State *L, int idx)
 
static void moveto (lua_State *L, TValue *fr, int idx)
 
LUA_API void lua_replace (lua_State *L, int idx)
 
LUA_API void lua_copy (lua_State *L, int fromidx, int toidx)
 
LUA_API void lua_pushvalue (lua_State *L, int idx)
 
LUA_API int lua_type (lua_State *L, int idx)
 
LUA_API const char * lua_typename (lua_State *L, int t)
 
LUA_API int lua_iscfunction (lua_State *L, int idx)
 
LUA_API int lua_isnumber (lua_State *L, int idx)
 
LUA_API int lua_isstring (lua_State *L, int idx)
 
LUA_API int lua_isuserdata (lua_State *L, int idx)
 
LUA_API int lua_rawequal (lua_State *L, int index1, int index2)
 
LUA_API void lua_arith (lua_State *L, int op)
 
LUA_API int lua_compare (lua_State *L, int index1, int index2, int op)
 
LUA_API lua_Number lua_tonumberx (lua_State *L, int idx, int *isnum)
 
LUA_API lua_Integer lua_tointegerx (lua_State *L, int idx, int *isnum)
 
LUA_API lua_Unsigned lua_tounsignedx (lua_State *L, int idx, int *isnum)
 
LUA_API int lua_toboolean (lua_State *L, int idx)
 
LUA_API const char * lua_tolstring (lua_State *L, int idx, size_t *len)
 
LUA_API size_t lua_rawlen (lua_State *L, int idx)
 
LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx)
 
LUA_API voidlua_touserdata (lua_State *L, int idx)
 
LUA_API lua_Statelua_tothread (lua_State *L, int idx)
 
LUA_API const voidlua_topointer (lua_State *L, int idx)
 
LUA_API void lua_pushnil (lua_State *L)
 
LUA_API void lua_pushnumber (lua_State *L, lua_Number n)
 
LUA_API void lua_pushinteger (lua_State *L, lua_Integer n)
 
LUA_API void lua_pushunsigned (lua_State *L, lua_Unsigned u)
 
LUA_API const char * lua_pushlstring (lua_State *L, const char *s, size_t len)
 
LUA_API const char * lua_pushstring (lua_State *L, const char *s)
 
LUA_API const char * lua_pushvfstring (lua_State *L, const char *fmt, va_list argp)
 
LUA_API const char * lua_pushfstring (lua_State *L, const char *fmt,...)
 
LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n)
 
LUA_API void lua_pushboolean (lua_State *L, int b)
 
LUA_API void lua_pushlightuserdata (lua_State *L, void *p)
 
LUA_API int lua_pushthread (lua_State *L)
 
LUA_API void lua_getglobal (lua_State *L, const char *var)
 
LUA_API void lua_gettable (lua_State *L, int idx)
 
LUA_API void lua_getfield (lua_State *L, int idx, const char *k)
 
LUA_API void lua_rawget (lua_State *L, int idx)
 
LUA_API void lua_rawgeti (lua_State *L, int idx, int n)
 
LUA_API void lua_rawgetp (lua_State *L, int idx, const void *p)
 
LUA_API void lua_createtable (lua_State *L, int narray, int nrec)
 
LUA_API int lua_getmetatable (lua_State *L, int objindex)
 
LUA_API void lua_getuservalue (lua_State *L, int idx)
 
LUA_API void lua_setglobal (lua_State *L, const char *var)
 
LUA_API void lua_settable (lua_State *L, int idx)
 
LUA_API void lua_setfield (lua_State *L, int idx, const char *k)
 
LUA_API void lua_rawset (lua_State *L, int idx)
 
LUA_API void lua_rawseti (lua_State *L, int idx, int n)
 
LUA_API void lua_rawsetp (lua_State *L, int idx, const void *p)
 
LUA_API int lua_setmetatable (lua_State *L, int objindex)
 
LUA_API void lua_setuservalue (lua_State *L, int idx)
 
LUA_API int lua_getctx (lua_State *L, int *ctx)
 
LUA_API void lua_callk (lua_State *L, int nargs, int nresults, int ctx, lua_CFunction k)
 
static void f_call (lua_State *L, void *ud)
 
LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc, int ctx, lua_CFunction k)
 
LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data, const char *chunkname, const char *mode)
 
LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data)
 
LUA_API int lua_status (lua_State *L)
 
LUA_API int lua_gc (lua_State *L, int what, int data)
 
LUA_API int lua_error (lua_State *L)
 
LUA_API int lua_next (lua_State *L, int idx)
 
LUA_API void lua_concat (lua_State *L, int n)
 
LUA_API void lua_len (lua_State *L, int idx)
 
LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud)
 
LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud)
 
LUA_API voidlua_newuserdata (lua_State *L, size_t size)
 
static const char * aux_upvalue (StkId fi, int n, TValue **val, GCObject **owner)
 
LUA_API const char * lua_getupvalue (lua_State *L, int funcindex, int n)
 
LUA_API const char * lua_setupvalue (lua_State *L, int funcindex, int n)
 
static UpVal ** getupvalref (lua_State *L, int fidx, int n, LClosure **pf)
 
LUA_API voidlua_upvalueid (lua_State *L, int fidx, int n)
 
LUA_API void lua_upvaluejoin (lua_State *L, int fidx1, int n1, int fidx2, int n2)
 

Macro Definition Documentation

#define api_checkstackindex (   L,
  i,
 
)    api_check(L, isstackindex(i, o), "index not in the stack")

Definition at line 45 of file lapi.cpp.

Referenced by lua_insert(), lua_pcallk(), and lua_remove().

#define api_checkvalidindex (   L,
 
)    api_check(L, isvalid(o), "invalid index")

Definition at line 43 of file lapi.cpp.

Referenced by moveto().

#define checkresults (   L,
  na,
  nr 
)
Value:
api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)), \
"results from function overflow current stack size")
#define LUA_MULTRET
Definition: lua.h:33
#define api_check(l, e, msg)
Definition: llimits.h:84

Definition at line 869 of file lapi.cpp.

Referenced by lua_callk(), and lua_pcallk().

#define ispseudo (   i)    ((i) <= LUA_REGISTRYINDEX)

Definition at line 38 of file lapi.cpp.

Referenced by index2addr(), and lua_absindex().

#define isstackindex (   i,
 
)    (isvalid(o) && !ispseudo(i))

Definition at line 41 of file lapi.cpp.

#define isvalid (   o)    ((o) != luaO_nilobject)

Definition at line 35 of file lapi.cpp.

Referenced by lua_compare(), lua_rawequal(), and lua_type().

#define lapi_c

Definition at line 10 of file lapi.cpp.

#define LUA_CORE

Definition at line 11 of file lapi.cpp.

#define NONVALIDVALUE   cast(TValue *, luaO_nilobject)

Definition at line 32 of file lapi.cpp.

Referenced by index2addr().

Function Documentation

static const char* aux_upvalue ( StkId  fi,
int  n,
TValue **  val,
GCObject **  owner 
)
static
static void f_call ( lua_State L,
void ud 
)
static

Definition at line 915 of file lapi.cpp.

References cast, CallS::func, luaD_call(), and CallS::nresults.

Referenced by lua_pcallk().

static UpVal** getupvalref ( lua_State L,
int  fidx,
int  n,
LClosure **  pf 
)
static

Definition at line 1240 of file lapi.cpp.

References api_check, clLvalue, index2addr(), ttisLclosure, and LClosure::upvals.

Referenced by lua_upvalueid(), and lua_upvaluejoin().

static void growstack ( lua_State L,
void ud 
)
static

Definition at line 80 of file lapi.cpp.

References luaD_growstack().

Referenced by lua_checkstack().

static TValue* index2addr ( lua_State L,
int  idx 
)
static
LUA_API int lua_absindex ( lua_State L,
int  idx 
)
LUA_API void lua_arith ( lua_State L,
int  op 
)
LUA_API lua_CFunction lua_atpanic ( lua_State L,
lua_CFunction  panicf 
)

Definition at line 121 of file lapi.cpp.

References G, lua_lock, and lua_unlock.

Referenced by luaL_newstate().

LUA_API void lua_callk ( lua_State L,
int  nargs,
int  nresults,
int  ctx,
lua_CFunction  k 
)
LUA_API int lua_checkstack ( lua_State L,
int  size 
)
LUA_API int lua_compare ( lua_State L,
int  index1,
int  index2,
int  op 
)
LUA_API void lua_concat ( lua_State L,
int  n 
)
LUA_API void lua_copy ( lua_State L,
int  fromidx,
int  toidx 
)

Definition at line 220 of file lapi.cpp.

References index2addr(), lua_lock, lua_unlock, and moveto().

Referenced by luaB_xpcall(), and pushglobalfuncname().

LUA_API void lua_createtable ( lua_State L,
int  narray,
int  nrec 
)
LUA_API int lua_dump ( lua_State L,
lua_Writer  writer,
void data 
)

Definition at line 991 of file lapi.cpp.

References api_checknelems, getproto, isLfunction, lua_lock, lua_unlock, luaU_dump(), and lua_State::top.

Referenced by str_dump().

LUA_API int lua_error ( lua_State L)
LUA_API int lua_gc ( lua_State L,
int  what,
int  data 
)
LUA_API lua_Alloc lua_getallocf ( lua_State L,
void **  ud 
)

Definition at line 1151 of file lapi.cpp.

References G, lua_lock, and lua_unlock.

LUA_API int lua_getctx ( lua_State L,
int ctx 
)

Definition at line 874 of file lapi.cpp.

References CallInfo::c, CallInfo::callstatus, lua_State::ci, CIST_YIELDED, LUA_OK, and CallInfo::u.

Referenced by pcallcont().

LUA_API void lua_getfield ( lua_State L,
int  idx,
const char *  k 
)
LUA_API void lua_getglobal ( lua_State L,
const char *  var 
)
LUA_API int lua_getmetatable ( lua_State L,
int  objindex 
)
LUA_API void lua_gettable ( lua_State L,
int  idx 
)
LUA_API int lua_gettop ( lua_State L)

Definition at line 154 of file lapi.cpp.

References cast_int, lua_State::ci, CallInfo::func, and lua_State::top.

Referenced by andaux(), game_lua_kernel::apply_effect(), aux_lines(), auxresume(), b_or(), b_xor(), ai::cfun_ai_get_attacks(), ai::cfun_attack_rating(), lua_callable::do_compare(), docall(), dofilecont(), dotty(), finishpcall(), g_read(), g_write(), ai::lua_ai_context::get_arguments(), lua_kernel_base::get_attribute_names(), lua_kernel_base::get_global_var_names(), ai::lua_ai_context::get_persistent_data(), ai::lua_ai_action_handler::handle(), impl_context_accessor(), lua_gui2::intf_add_dialog_tree_node(), lua_kernel_base::intf_dofile(), lua_gui2::intf_get_dialog_value(), lua_map_location::intf_get_direction(), lua_kernel_base::intf_print(), lua_gui2::intf_remove_dialog_item(), lua_gui2::intf_set_dialog_active(), lua_gui2::intf_set_dialog_callback(), lua_gui2::intf_set_dialog_canvas(), lua_gui2::intf_set_dialog_markup(), lua_gui2::intf_set_dialog_value(), lua_gui2::intf_set_dialog_visible(), ll_module(), load_fake_units(), luaB_assert(), luaB_auxwrap(), luaB_coresume(), luaB_costatus(), luaB_pcall(), luaB_print(), luaB_select(), luaB_xpcall(), luaB_yield(), luaL_loadfilex(), luaL_traceback(), luaW_pcall(), luaW_toconfig(), mapgen_lua_kernel::mapgen_lua_kernel(), math_max(), math_min(), math_random(), pack(), lua_kernel_base::protected_call(), game_lua_kernel::push_builtin_effect(), ai::push_movements(), pushglobalfuncname(), ai::lua_ai_context::set_arguments(), ai::lua_ai_context::set_persistent_data(), str_char(), str_format(), and tinsert().

LUA_API const char* lua_getupvalue ( lua_State L,
int  funcindex,
int  n 
)

Definition at line 1207 of file lapi.cpp.

References api_incr_top, aux_upvalue(), index2addr(), lua_lock, lua_unlock, setobj2s, and lua_State::top.

Referenced by auxupvalue().

LUA_API void lua_getuservalue ( lua_State L,
int  idx 
)
LUA_API void lua_insert ( lua_State L,
int  idx 
)
LUA_API int lua_iscfunction ( lua_State L,
int  idx 
)

Definition at line 255 of file lapi.cpp.

References index2addr(), ttisCclosure, and ttislcf.

Referenced by db_upvaluejoin(), and set_env().

LUA_API int lua_isnumber ( lua_State L,
int  idx 
)
LUA_API int lua_isstring ( lua_State L,
int  idx 
)
LUA_API int lua_isuserdata ( lua_State L,
int  idx 
)
LUA_API void lua_len ( lua_State L,
int  idx 
)

Definition at line 1141 of file lapi.cpp.

References api_incr_top, index2addr(), lua_lock, lua_unlock, luaV_objlen(), and lua_State::top.

Referenced by luaL_len().

LUA_API int lua_load ( lua_State L,
lua_Reader  reader,
void data,
const char *  chunkname,
const char *  mode 
)
LUA_API void* lua_newuserdata ( lua_State L,
size_t  size 
)
LUA_API int lua_next ( lua_State L,
int  idx 
)
LUA_API int lua_pcallk ( lua_State L,
int  nargs,
int  nresults,
int  errfunc,
int  ctx,
lua_CFunction  k 
)
LUA_API void lua_pushboolean ( lua_State L,
int  b 
)

Definition at line 571 of file lapi.cpp.

References api_incr_top, lua_lock, lua_unlock, setbvalue, and lua_State::top.

Referenced by aux_lines(), b_test(), ai::cfun_ai_get_leader_ignores_keep(), ai::cfun_ai_get_passive_leader(), ai::cfun_ai_get_passive_leader_shares_keep(), ai::cfun_ai_get_simple_targeting(), ai::cfun_ai_get_support_villages(), ai::cfun_ai_is_dst_src_enemy_valid(), ai::cfun_ai_is_dst_src_valid(), ai::cfun_ai_is_src_dst_enemy_valid(), ai::cfun_ai_is_src_dst_valid(), finishpcall(), ai::impl_ai_aspect_get(), lua_common::impl_tstring_eq(), lua_common::impl_tstring_le(), lua_common::impl_tstring_lt(), impl_unit_equality(), impl_unit_status_get(), game_lua_kernel::intf_check_end_level_disabled(), intf_compare_versions(), intf_eval_conditional(), game_lua_kernel::intf_fire_event(), game_lua_kernel::intf_fire_wml_menu_item(), lua_gui2::intf_get_dialog_value(), game_lua_kernel::intf_get_terrain_info(), intf_get_viewing_side(), lua_fileops::intf_have_file(), game_lua_kernel::intf_is_enemy(), game_lua_kernel::intf_is_skipping_messages(), game_lua_kernel::intf_match_location(), game_lua_kernel::intf_match_side(), game_lua_kernel::intf_match_unit(), lua_map_location::intf_tiles_adjacent(), intf_unit_ability(), game_lua_kernel::intf_view_locked(), ll_loadfunc(), ll_require(), ai::lua_ai_load::lua_ai_load(), lua_check_impl::lua_push(), luaB_collectgarbage(), luaB_coresume(), luaB_corunning(), luaB_rawequal(), luaL_execresult(), luaL_fileresult(), luaW_pushsimweapon(), os_execute(), pmain(), ai::push_attack_analysis(), game_lua_kernel::push_builtin_effect(), setboolfield(), settabsb(), ai::transform_ai_action(), and ai::lua_ai_load::~lua_ai_load().

LUA_API void lua_pushcclosure ( lua_State L,
lua_CFunction  fn,
int  n 
)
LUA_API const char* lua_pushfstring ( lua_State L,
const char *  fmt,
  ... 
)
LUA_API void lua_pushinteger ( lua_State L,
lua_Integer  n 
)

Definition at line 477 of file lapi.cpp.

References api_incr_top, cast_num, lua_lock, lua_unlock, setnvalue, and lua_State::top.

Referenced by aux_lines(), ai::cfun_ai_get_recruitment_pattern(), ai::cfun_ai_get_targets(), cfun_exec_candidate_action(), lua_pathfind_cost_calculator::cost(), db_gethook(), ai::unit_advancements_aspect::get_advancements(), get_new_thread(), lua_callable::get_value(), gmatch(), gmatch_aux(), hookf(), ai::impl_ai_aspect_get(), ai::impl_ai_get(), impl_unit_attacks_len(), impl_unit_get(), lua_common::impl_vconfig_ipairs(), lua_common::impl_vconfig_ipairs_iter(), lua_common::impl_vconfig_size(), lua_map_location::intf_distance_between(), game_lua_kernel::intf_find_cost_map(), intf_find_path(), game_lua_kernel::intf_find_path(), game_lua_kernel::intf_find_reach(), game_lua_kernel::intf_find_vacant_tile(), lua_gui2::intf_get_dialog_value(), intf_get_image_size(), lua_map_location::intf_get_in_basis_N_NE(), game_lua_kernel::intf_get_locations(), game_lua_kernel::intf_get_map_size(), game_lua_kernel::intf_get_mouseover_tile(), lua_map_location::intf_get_relative_dir(), game_lua_kernel::intf_get_selected_tile(), game_lua_kernel::intf_get_starting_location(), game_lua_kernel::intf_get_terrain_info(), game_lua_kernel::intf_get_time_of_day(), intf_get_time_stamp(), intf_get_viewing_side(), game_lua_kernel::intf_get_village_owner(), game_lua_kernel::intf_get_villages(), game_lua_kernel::intf_kill(), lua_map_location::intf_parse_direction(), intf_unit_defense(), intf_unit_jamming_cost(), intf_unit_movement_cost(), intf_unit_resistance(), intf_unit_vision_cost(), ipairsaux(), luaB_collectgarbage(), luaB_rawlen(), luaB_select(), luaL_execresult(), luaL_fileresult(), luaL_unref(), luaW_pushfaivariant(), luaW_pushlocation(), main(), math_frexp(), pack(), pairsmeta(), ai::push_attack_analysis(), ai::push_location_key(), push_onecapture(), game_lua_kernel::run_filter(), setfield(), settabsi(), lua_gui2::show_dialog(), lua_gui2::show_message_dialog(), str_byte(), str_find_aux(), str_gsub(), str_len(), ai::lua_object< T >::to_type(), and ai::transform_ai_action().

LUA_API void lua_pushlightuserdata ( lua_State L,
void p 
)
LUA_API const char* lua_pushlstring ( lua_State L,
const char *  s,
size_t  len 
)
LUA_API void lua_pushnil ( lua_State L)
LUA_API void lua_pushnumber ( lua_State L,
lua_Number  n 
)
LUA_API const char* lua_pushstring ( lua_State L,
const char *  s 
)

Definition at line 507 of file lapi.cpp.

References api_incr_top, getstr, lua_lock, lua_pushnil(), lua_unlock, luaC_checkGC, luaS_new(), setsvalue2s, and lua_State::top.

Referenced by auxupvalue(), ai::cfun_ai_get_grouping(), ai::cfun_ai_get_recruitment_pattern(), ai::cfun_ai_get_targets(), game_lua_kernel::cfun_builtin_effect(), checkload(), db_gethook(), db_getlocal(), db_sethook(), db_setlocal(), dolibrary(), findloader(), finishpcall(), game_lua_kernel::game_lua_kernel(), lua_kernel_base::get_attribute_names(), getargs(), hookf(), ai::impl_ai_aspect_set(), ai::impl_ai_get(), impl_name_generator_call(), impl_race_get(), lua_rng::impl_rng_destroy(), impl_side_get(), lua_common::impl_tstring_tostring(), impl_unit_attacks_get(), impl_unit_get(), impl_unit_type_get(), lua_common::impl_vconfig_get(), game_lua_kernel::initialize(), lua_cpp::intf_cleanup(), intf_debug(), intf_debug_ai(), intf_describe_plugins(), lua_map_location::intf_distance_between(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_find_path(), game_lua_kernel::intf_find_reach(), lua_gui2::intf_get_dialog_value(), lua_map_location::intf_get_relative_dir(), game_lua_kernel::intf_get_terrain(), game_lua_kernel::intf_get_terrain_info(), game_lua_kernel::intf_get_time_of_day(), intf_get_traits(), intf_name_generator(), lua_kernel_base::intf_require(), lua_map_location::intf_rotate_right_around_center(), lua_gui2::intf_set_dialog_callback(), lua_map_location::intf_tiles_adjacent(), lua_cpp::intf_tostring(), lua_map_location::intf_vector_sum(), lua_map_location::intf_write_direction(), ll_loadlib(), ll_require(), game_lua_kernel::load_game(), lua_kernel_base::load_package(), application_lua_kernel::load_script_from_file(), ai::lua_ai_load::lua_ai_load(), lua_kernel_base::lua_kernel_base(), luaB_type(), luaL_execresult(), luaL_fileresult(), luaL_getmetafield(), luaL_requiref(), luaL_tolstring(), luaW_filltable(), luaW_pushfaivariant(), luaW_pushrace(), luaW_pushsimweapon(), luaW_pushunittype(), modinit(), os_getenv(), os_setlocale(), os_tmpname(), ai::push_attack_analysis(), game_lua_kernel::push_builtin_effect(), push_component(), push_locations_talbe(), ai::push_movements(), pushline(), lua_common::register_gettext_metatable(), lua_unit_type::register_metatable(), lua_race::register_metatable(), lua_team::register_metatable(), lua_formula_bridge::register_metatables(), lua_common::register_tstring_metatable(), lua_common::register_vconfig_metatable(), game_lua_kernel::run_event(), application_lua_kernel::thread::run_script(), searcher_Croot(), game_lua_kernel::set_wml_action(), setpath(), settabss(), special_locations_newindex(), special_locations_next(), ai::lua_object< T >::to_type(), ai::transform_ai_action(), and ai::lua_ai_load::~lua_ai_load().

LUA_API int lua_pushthread ( lua_State L)

Definition at line 587 of file lapi.cpp.

References api_incr_top, G, lua_lock, lua_unlock, setthvalue, and lua_State::top.

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

LUA_API void lua_pushunsigned ( lua_State L,
lua_Unsigned  u 
)
LUA_API void lua_pushvalue ( lua_State L,
int  idx 
)

Definition at line 229 of file lapi.cpp.

References api_incr_top, index2addr(), lua_lock, lua_unlock, setobj2s, and lua_State::top.

Referenced by add_value(), game_lua_kernel::apply_effect(), aux_lines(), auxsort(), checkupval(), lua_pathfind_cost_calculator::cost(), ai::lua_ai_context::create(), ai::lua_ai_action_handler::create(), createmeta(), createmetatable(), createsearcherstable(), createstdfile(), db_getinfo(), db_getlocal(), db_getregistry(), db_sethook(), db_traceback(), dooptions(), f_write(), g_iofile(), ai::generate_and_push_ai_state(), generic_reader(), get_new_thread(), ai::impl_ai_get(), game_lua_kernel::impl_theme_items_get(), game_lua_kernel::impl_theme_items_set(), impl_unit_attacks_get(), impl_unit_get(), impl_unit_type_get(), lua_common::impl_vconfig_ipairs(), lua_common::impl_vconfig_pairs(), intf_describe_plugins(), intf_do_unsynced(), game_lua_kernel::intf_get_recall_units(), game_lua_kernel::intf_get_units(), lua_kernel_base::intf_require(), lua_gui2::intf_set_dialog_callback(), io_readline(), ll_addtoclib(), ll_module(), ll_require(), ll_seeall(), load_aux(), lua_rng::load_tables(), luaB_cocreate(), luaB_error(), luaB_print(), luaB_xpcall(), luaL_callmeta(), luaL_findtable(), luaL_getsubtable(), luaL_newmetatable(), luaL_pushmodule(), luaL_requiref(), luaL_setfuncs(), luaL_tolstring(), luaopen_package(), modinit(), pack(), pairsmeta(), game_lua_kernel::push_builtin_effect(), lua_cpp::register_metatable(), set_env(), lua_cpp::set_functions(), lua_gui2::show_dialog(), sort_comp(), special_locations_pairs(), and treatstackoption().

LUA_API const char* lua_pushvfstring ( lua_State L,
const char *  fmt,
va_list  argp 
)

Definition at line 525 of file lapi.cpp.

References lua_lock, lua_unlock, luaC_checkGC, and luaO_pushvfstring().

Referenced by luaL_error().

LUA_API int lua_rawequal ( lua_State L,
int  index1,
int  index2 
)

Definition at line 280 of file lapi.cpp.

References index2addr(), isvalid, and luaV_rawequalobj.

Referenced by findfield(), luaB_rawequal(), luaL_testudata(), and luaW_hasmetatable().

LUA_API void lua_rawget ( lua_State L,
int  idx 
)

Definition at line 633 of file lapi.cpp.

References api_check, hvalue, index2addr(), lua_lock, lua_unlock, luaH_get(), setobj2s, lua_State::top, and ttistable.

Referenced by ai::call_lua_filter_fcn(), ai::lua_ai_action_handler::create(), db_gethook(), ai::generate_and_push_ai_state(), ai::lua_ai_context::get_arguments(), lua_kernel_base::get_attribute_names(), get_new_thread(), ai::lua_ai_context::get_persistent_data(), ai::lua_ai_action_handler::handle(), hookf(), ai::impl_ai_get(), impl_race_get(), impl_unit_attacks_get(), impl_unit_get(), impl_unit_type_get(), game_lua_kernel::initialize(), lua_formula_bridge::intf_compile_formula(), intf_copy_unit(), intf_create_unit(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_find_path(), game_lua_kernel::intf_find_reach(), game_lua_kernel::intf_get_displayed_unit(), game_lua_kernel::intf_get_recall_units(), game_lua_kernel::intf_get_unit(), game_lua_kernel::intf_get_units(), lua_kernel_base::intf_require(), lua_gui2::intf_set_dialog_callback(), ai::lua_ai_load::lua_ai_load(), luaB_rawget(), luaL_findtable(), luaL_getmetafield(), luaW_getglobal(), luaW_hasmetatable(), luaW_pcall(), luaW_pushfaivariant(), luaW_pushlocalunit(), lua_kernel_base::protected_call(), game_lua_kernel::run_filter(), ai::lua_ai_context::set_arguments(), ai::lua_ai_context::set_persistent_data(), game_lua_kernel::set_wml_action(), ai::lua_object< T >::to_type(), ai::lua_ai_action_handler::~lua_ai_action_handler(), and ai::lua_ai_context::~lua_ai_context().

LUA_API void lua_rawgeti ( lua_State L,
int  idx,
int  n 
)
LUA_API void lua_rawgetp ( lua_State L,
int  idx,
const void p 
)
LUA_API size_t lua_rawlen ( lua_State L,
int  idx 
)
LUA_API void lua_rawset ( lua_State L,
int  idx 
)
LUA_API void lua_rawseti ( lua_State L,
int  idx,
int  n 
)
LUA_API void lua_rawsetp ( lua_State L,
int  idx,
const void p 
)
LUA_API void lua_remove ( lua_State L,
int  idx 
)
LUA_API void lua_replace ( lua_State L,
int  idx 
)
LUA_API void lua_setallocf ( lua_State L,
lua_Alloc  f,
void ud 
)

Definition at line 1161 of file lapi.cpp.

References G, lua_lock, and lua_unlock.

LUA_API void lua_setfield ( lua_State L,
int  idx,
const char *  k 
)

Definition at line 752 of file lapi.cpp.

References api_checknelems, index2addr(), lua_lock, lua_unlock, luaS_new(), luaV_settable(), setsvalue2s, and lua_State::top.

Referenced by ai::lua_ai_context::create(), createmeta(), createmetatable(), createstdfile(), db_sethook(), g_iofile(), game_lua_kernel::game_lua_kernel(), ai::generate_and_push_ai_state(), ai::generate_and_push_ai_table(), ai::impl_ai_get(), lua_common::impl_vconfig_get(), game_lua_kernel::initialize(), game_lua_kernel::intf_get_terrain_info(), game_lua_kernel::intf_get_time_of_day(), ll_addtoclib(), ll_require(), ll_seeall(), lua_rng::load_tables(), lua_kernel_base::lua_kernel_base(), luaL_getsubtable(), luaL_newmetatable(), luaL_openlibs(), luaL_pushmodule(), luaL_requiref(), luaL_setfuncs(), luaopen_base(), luaopen_math(), luaopen_package(), luaW_filltable(), luaW_pushrace(), luaW_pushracetable(), luaW_pushsimdata(), luaW_pushsimweapon(), luaW_pushunittype(), modinit(), pack(), pmain(), lua_common::register_gettext_metatable(), lua_cpp::register_metatable(), lua_unit_type::register_metatable(), lua_race::register_metatable(), lua_team::register_metatable(), lua_formula_bridge::register_metatables(), lua_common::register_tstring_metatable(), lua_common::register_vconfig_metatable(), ai::lua_ai_context::set_arguments(), lua_cpp::set_functions(), ai::lua_ai_context::set_persistent_data(), setboolfield(), setfield(), setpath(), settabsb(), settabsi(), settabss(), ai::transform_ai_action(), treatstackoption(), and ai::lua_ai_context::update_state().

LUA_API void lua_setglobal ( lua_State L,
const char *  var 
)
LUA_API int lua_setmetatable ( lua_State L,
int  objindex 
)
LUA_API void lua_settable ( lua_State L,
int  idx 
)
LUA_API void lua_settop ( lua_State L,
int  idx 
)
LUA_API const char* lua_setupvalue ( lua_State L,
int  funcindex,
int  n 
)
LUA_API void lua_setuservalue ( lua_State L,
int  idx 
)
LUA_API int lua_status ( lua_State L)
LUA_API int lua_toboolean ( lua_State L,
int  idx 
)
LUA_API lua_CFunction lua_tocfunction ( lua_State L,
int  idx 
)

Definition at line 412 of file lapi.cpp.

References clCvalue, fvalue, index2addr(), ttisCclosure, and ttislcf.

LUA_API lua_Integer lua_tointegerx ( lua_State L,
int  idx,
int isnum 
)

Definition at line 343 of file lapi.cpp.

References index2addr(), lua_number2integer, nvalue, and tonumber.

Referenced by getfield(), luaL_checkinteger(), and luaL_len().

LUA_API const char* lua_tolstring ( lua_State L,
int  idx,
size_t *  len 
)
LUA_API lua_Number lua_tonumberx ( lua_State L,
int  idx,
int isnum 
)
LUA_API const void* lua_topointer ( lua_State L,
int  idx 
)
LUA_API lua_State* lua_tothread ( lua_State L,
int  idx 
)

Definition at line 431 of file lapi.cpp.

References index2addr(), thvalue, and ttisthread.

Referenced by getthread(), luaB_auxwrap(), luaB_coresume(), and luaB_costatus().

LUA_API lua_Unsigned lua_tounsignedx ( lua_State L,
int  idx,
int isnum 
)

Definition at line 360 of file lapi.cpp.

References index2addr(), lua_number2unsigned, nvalue, and tonumber.

Referenced by luaL_checkunsigned().

LUA_API void* lua_touserdata ( lua_State L,
int  idx 
)
LUA_API int lua_type ( lua_State L,
int  idx 
)
LUA_API const char* lua_typename ( lua_State L,
int  t 
)
LUA_API void* lua_upvalueid ( lua_State L,
int  fidx,
int  n 
)

Definition at line 1251 of file lapi.cpp.

References api_check, clCvalue, getupvalref(), index2addr(), LUA_TCCL, LUA_TLCL, ttype, and CClosure::upvalue.

Referenced by db_upvalueid().

LUA_API void lua_upvaluejoin ( lua_State L,
int  fidx1,
int  n1,
int  fidx2,
int  n2 
)

Definition at line 1270 of file lapi.cpp.

References getupvalref(), and luaC_objbarrier.

Referenced by db_upvaluejoin().

LUA_API const lua_Number* lua_version ( lua_State L)

Definition at line 131 of file lapi.cpp.

References G, LUA_VERSION_NUM, and game_config::version.

Referenced by f_luaopen(), and luaL_checkversion_().

LUA_API void lua_xmove ( lua_State from,
lua_State to,
int  n 
)
static void moveto ( lua_State L,
TValue fr,
int  idx 
)
static