#include "lprefix.h"
#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"
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 | isupvalue(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) |
Variables | |
const char | lua_ident [] |
#define api_checkstackindex | ( | l, | |
i, | |||
o | |||
) | api_check(l, isstackindex(i, o), "index not in the stack") |
Definition at line 56 of file lapi.cpp.
Referenced by lua_pcallk(), and lua_rotate().
Definition at line 54 of file lapi.cpp.
Referenced by lua_copy().
#define checkresults | ( | L, | |
na, | |||
nr | |||
) |
Definition at line 904 of file lapi.cpp.
Referenced by lua_callk(), and lua_pcallk().
#define ispseudo | ( | i | ) | ((i) <= LUA_REGISTRYINDEX) |
Definition at line 46 of file lapi.cpp.
Referenced by index2addr(), and lua_absindex().
#define isupvalue | ( | i | ) | ((i) < LUA_REGISTRYINDEX) |
Definition at line 49 of file lapi.cpp.
Referenced by lua_copy().
#define isvalid | ( | o | ) | ((o) != luaO_nilobject) |
Definition at line 43 of file lapi.cpp.
Referenced by lua_compare(), lua_rawequal(), and lua_type().
#define NONVALIDVALUE cast(TValue *, luaO_nilobject) |
Definition at line 40 of file lapi.cpp.
Referenced by index2addr().
|
static |
Definition at line 1197 of file lapi.cpp.
References clCvalue, clLvalue, f, getstr, LUA_TCCL, LUA_TLCL, name, Upvaldesc::name, p, LClosure::p, ttype, LClosure::upvals, CClosure::upvalue, Proto::upvalues, and UpVal::v.
Referenced by lua_getupvalue(), and lua_setupvalue().
Definition at line 588 of file lapi.cpp.
References api_incr_top, lua_unlock, luaH_getstr(), luaS_new(), luaV_fastget, luaV_finishget(), setobj2s, setsvalue2s, lua_State::top, and ttnov.
Referenced by lua_getfield(), and lua_getglobal().
Definition at line 743 of file lapi.cpp.
References api_checknelems, api_incr_top, lua_unlock, luaH_getstr(), luaS_new(), luaV_fastset, luaV_finishset(), setsvalue2s, and lua_State::top.
Referenced by lua_setfield(), and lua_setglobal().
|
static |
Definition at line 941 of file lapi.cpp.
References c, cast, CallS::func, luaD_callnoyield(), and CallS::nresults.
Referenced by lua_pcallk().
Definition at line 1257 of file lapi.cpp.
References api_check, clLvalue, f, index2addr(), p, ttisLclosure, and LClosure::upvals.
Referenced by lua_upvalueid(), and lua_upvaluejoin().
|
static |
Definition at line 91 of file lapi.cpp.
References luaD_growstack(), and utf8::size().
Referenced by lua_checkstack().
Definition at line 60 of file lapi.cpp.
References api_check, lua_State::ci, clCvalue, CallInfo::func, G, ispseudo, LUA_REGISTRYINDEX, MAXUPVAL, NONVALIDVALUE, lua_State::top, ttislcf, and CClosure::upvalue.
Referenced by getupvalref(), lua_compare(), lua_copy(), lua_getfield(), lua_geti(), lua_getmetatable(), lua_gettable(), lua_getupvalue(), lua_getuservalue(), lua_iscfunction(), lua_isinteger(), lua_isnumber(), lua_isstring(), lua_isuserdata(), lua_len(), lua_next(), lua_pcallk(), lua_pushvalue(), lua_rawequal(), lua_rawget(), lua_rawgeti(), lua_rawgetp(), lua_rawlen(), lua_rawset(), lua_rawseti(), lua_rawsetp(), lua_rotate(), lua_setfield(), lua_seti(), lua_setmetatable(), lua_settable(), lua_setupvalue(), lua_setuservalue(), lua_toboolean(), lua_tocfunction(), lua_tointegerx(), lua_tolstring(), lua_tonumberx(), lua_topointer(), lua_tothread(), lua_touserdata(), lua_type(), and lua_upvalueid().
Definition at line 160 of file lapi.cpp.
References cast_int, lua_State::ci, CallInfo::func, ispseudo, and lua_State::top.
Referenced by lua_kernel_base::get_attribute_names(), ai::lua_ai_action_handler::handle(), impl_add_animation(), lua_stringx::intf_str_join_map(), luaL_callmeta(), luaL_getsubtable(), luaL_ref(), luaL_unref(), luaW_getwidgetcallback(), luaW_pushwidgettable(), luaW_pushwindowtable(), luaW_setwidgetcallback(), luaW_table_set(), luaW_tableget(), luaW_toconfig(), luaW_tolocation(), push_unit_attacks_table(), and ai::lua_object< T >::store().
Definition at line 302 of file lapi.cpp.
References api_checknelems, api_incr_top, lua_lock, LUA_OPBNOT, LUA_OPUNM, lua_unlock, luaO_arith(), setobjs2s, and lua_State::top.
LUA_API lua_CFunction lua_atpanic | ( | lua_State * | L, |
lua_CFunction | panicf | ||
) |
Definition at line 134 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, | ||
lua_KContext | ctx, | ||
lua_KFunction | k | ||
) |
Definition at line 909 of file lapi.cpp.
References adjustresults, api_check, api_checknelems, CallInfo::c, checkresults, lua_State::ci, isLua, lua_lock, LUA_OK, lua_unlock, luaD_call(), luaD_callnoyield(), lua_State::nny, lua_State::status, lua_State::top, and CallInfo::u.
Referenced by luaB_dofile().
Definition at line 97 of file lapi.cpp.
References api_check, cast_int, lua_State::ci, EXTRA_STACK, growstack(), lua_lock, LUA_OK, lua_unlock, luaD_rawrunprotected(), LUAI_MAXSTACK, n, lua_State::stack, lua_State::stack_last, CallInfo::top, and lua_State::top.
Referenced by auxresume(), checkstack(), luaL_checkstack(), luaW_filltable(), luaW_toconfig(), luaW_tolocation(), and unpack().
Definition at line 318 of file lapi.cpp.
References api_check, i, index2addr(), isvalid, lua_lock, LUA_OPEQ, LUA_OPLE, LUA_OPLT, lua_unlock, luaV_equalobj(), luaV_lessequal(), and luaV_lessthan().
Referenced by lua_callable::do_compare(), math_max(), math_min(), sort_comp(), and tmove().
Definition at line 1140 of file lapi.cpp.
References api_checknelems, api_incr_top, lua_lock, lua_unlock, luaC_checkGC, luaS_newlstr(), luaV_concat(), setsvalue2s, and lua_State::top.
Referenced by findfield(), luaB_auxwrap(), luaB_error(), luaL_error(), and luaL_traceback().
Definition at line 222 of file lapi.cpp.
References api_checkvalidindex, lua_State::ci, clCvalue, CallInfo::func, index2addr(), isupvalue, lua_lock, lua_unlock, luaC_barrier, and setobj.
Referenced by pushglobalfuncname().
Definition at line 684 of file lapi.cpp.
References api_incr_top, lua_lock, lua_unlock, luaC_checkGC, luaH_new(), luaH_resize(), sethvalue, t, and lua_State::top.
Referenced by ai::cfun_ai_get_attacks(), 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_recruitment_pattern(), ai::cfun_ai_get_targets(), createclibstable(), createmetatable(), createsearcherstable(), db_sethook(), ai::lua_object< T >::from_type(), game_lua_kernel::game_lua_kernel(), ai::impl_ai_aspect_get(), impl_side_get(), lua_common::impl_vconfig_get(), lua_common::impl_vconfig_ipairs_iter(), intf_default_generate_height_map(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_find_path(), intf_find_path(), game_lua_kernel::intf_find_reach(), game_lua_kernel::intf_get_locations(), game_lua_kernel::intf_get_sides(), game_lua_kernel::intf_get_villages(), ll_require(), game_lua_kernel::load_game(), lua_kernel_base::lua_kernel_base(), lua_check_impl::lua_push(), luaL_newmetatable(), luaL_tolstring(), luaW_filltable(), lua_stringx::luaW_open(), luaW_push_locationset(), luaW_pushlocation(), luaW_pushrace(), luaW_pushracetable(), luaW_pushsimdata(), luaW_pushsimweapon(), luaW_pushsinglecolor(), luaW_pushslocs(), luaW_pushwidgettable(), luaW_pushwidgettablecontainer(), luaW_pushwindowtable(), os_date(), pack(), push_component(), ai::push_move_map(), ai::push_movements(), push_unit_attacks_table(), lua_colors::register_metatables(), lua_audio::register_table(), and lua_common::register_tstring_metatable().
LUA_API int lua_dump | ( | lua_State * | L, |
lua_Writer | writer, | ||
void * | data, | ||
int | strip | ||
) |
Definition at line 1016 of file lapi.cpp.
References api_checknelems, getproto, isLfunction, lua_lock, lua_unlock, luaU_dump(), and lua_State::top.
Referenced by str_dump().
Definition at line 1114 of file lapi.cpp.
References api_checknelems, lua_lock, and luaG_errormsg().
Referenced by mapgen_lua_kernel::create_map(), mapgen_lua_kernel::create_scenario(), ai::lua_object< T >::from_type(), ai::impl_ai_aspect_set(), lua_rng::impl_rng_destroy(), impl_unit_type_new(), lua_cpp::intf_cleanup(), intf_deprecated_message(), lua_map_location::intf_distance_between(), lua_map_location::intf_get_relative_dir(), intf_name_generator(), lua_map_location::intf_rotate_right_around_center(), intf_switch_ai(), lua_map_location::intf_tiles_adjacent(), lua_map_location::intf_vector_diff(), lua_map_location::intf_vector_sum(), lua_fileops::load_file(), application_lua_kernel::load_script_from_file(), application_lua_kernel::load_script_from_string(), luaB_auxwrap(), luaB_dofile(), luaB_error(), luaL_error(), special_locations_newindex(), and lua_kernel_base::throw_exception().
Definition at line 1040 of file lapi.cpp.
References cast, cast_int, g, G, global_State::GCdebt, global_State::gcpause, global_State::gcrunning, GCSpause, global_State::gcstate, global_State::gcstepmul, GCSTEPSIZE, gettotalbytes, LUA_GCCOLLECT, LUA_GCCOUNT, LUA_GCCOUNTB, LUA_GCISRUNNING, LUA_GCRESTART, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL, LUA_GCSTEP, LUA_GCSTOP, lua_lock, lua_unlock, luaC_checkGC, luaC_fullgc(), luaC_step(), and luaE_setdebt().
Referenced by luaB_collectgarbage().
Definition at line 1166 of file lapi.cpp.
References f, G, lua_lock, and lua_unlock.
Referenced by resizebox().
Definition at line 622 of file lapi.cpp.
References auxgetstr(), index2addr(), and lua_lock.
Referenced by ai::cfun_attack_rating(), cfun_exec_candidate_action(), cfun_exec_stage(), checkclib(), ai::lua_ai_action_handler::create(), lua_callable::do_compare(), findfile(), findloader(), g_iofile(), ai::generate_and_push_ai_state(), ai::lua_ai_context::get_arguments(), ai::lua_ai_context::get_persistent_data(), getboolfield(), getfield(), getiofile(), ai::lua_ai_action_handler::handle(), impl_add_animation(), lua_kernel_base::interactive_run(), io_close(), io_lines(), ll_require(), load_fake_units(), ai::lua_ai_load::lua_ai_load(), luaL_getsubtable(), luaL_requiref(), luaL_tolstring(), luaopen_table(), lua_stringx::luaW_open(), luaW_pcall_internal(), luaW_tolocation(), noenv(), pushglobalfuncname(), searcher_preload(), ai::lua_ai_context::set_arguments(), ai::lua_ai_context::set_persistent_data(), lua_gui2::show_message_dialog(), lua_kernel_base::throwing_run(), ai::lua_object< T >::to_type(), ai::lua_ai_context::update_state(), ai::lua_ai_action_handler::~lua_ai_action_handler(), and ai::lua_ai_context::~lua_ai_context().
Definition at line 605 of file lapi.cpp.
References auxgetstr(), G, hvalue, lua_lock, LUA_RIDX_GLOBALS, and luaH_getint().
Referenced by application_lua_kernel::application_lua_kernel(), game_lua_kernel::game_lua_kernel(), lua_kernel_base::get_global_var_names(), lua_stringx::impl_str_index(), game_lua_kernel::initialize(), intf_describe_plugins(), lua_kernel_base::intf_print(), lua_kernel_base::intf_require(), lua_stringx::intf_str_format(), lua_stringx::intf_str_join(), lua_stringx::intf_str_join_map(), ai::lua_ai_load::lua_ai_load(), lua_kernel_base::lua_kernel_base(), luaB_print(), lua_stringx::luaW_open(), mapgen_lua_kernel::mapgen_lua_kernel(), lua_colors::register_metatables(), lua_preferences::register_table(), lua_unit_type::register_table(), lua_audio::register_table(), game_lua_kernel::set_wml_action(), game_lua_kernel::set_wml_condition(), and ai::lua_ai_load::~lua_ai_load().
LUA_API int lua_geti | ( | lua_State * | L, |
int | idx, | ||
lua_Integer | n | ||
) |
Definition at line 628 of file lapi.cpp.
References api_incr_top, index2addr(), lua_lock, lua_unlock, luaH_getint(), luaV_fastget, luaV_finishget(), setivalue, setobj2s, t, lua_State::top, and ttnov.
Referenced by addfield(), auxsort(), lua_wml::intf_load_wml(), lua_stringx::intf_str_join(), ipairsaux(), luaW_to_locationset(), partition(), tinsert(), tmove(), tremove(), unpack(), and filter_impl::~filter_impl().
Definition at line 697 of file lapi.cpp.
References api_incr_top, G, hvalue, index2addr(), lua_lock, LUA_TTABLE, LUA_TUSERDATA, lua_unlock, sethvalue, lua_State::top, ttnov, and uvalue.
Referenced by checktab(), db_getmetatable(), lua_callable::do_compare(), ll_require(), luaB_getmetatable(), luaL_getmetafield(), luaL_testudata(), and lua_stringx::luaW_open().
Definition at line 612 of file lapi.cpp.
References index2addr(), lua_lock, lua_unlock, luaV_gettable, t, lua_State::top, and ttnov.
Referenced by add_value(), lua_callable::get_value(), lua_stringx::impl_str_index(), impl_unit_attacks_next(), lua_kernel_base::lua_kernel_base(), luaW_table_get_def(), luaW_tableget(), and ai::lua_object< T >::to_type().
Definition at line 167 of file lapi.cpp.
References cast_int, lua_State::ci, CallInfo::func, and lua_State::top.
Referenced by game_lua_kernel::apply_effect(), aux_lines(), auxresume(), ai::cfun_ai_get_attacks(), ai::cfun_attack_rating(), lua_callable::do_compare(), dofilecont(), 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_kernel_base::interactive_run(), intf_add_dialog_item(), intf_add_item_of_type(), intf_dialog_close(), lua_kernel_base::intf_dofile(), game_lua_kernel::intf_find_path(), lua_map_location::intf_get_direction(), game_lua_kernel::intf_log_replay(), intf_music_add(), intf_music_remove(), lua_kernel_base::intf_print(), intf_remove_dialog_item(), intf_set_dialog_callback(), intf_set_dialog_canvas(), lua_stringx::intf_str_format(), ll_require(), 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_internal(), luaW_toconfig(), mapgen_lua_kernel::mapgen_lua_kernel(), math_max(), math_min(), math_random(), pack(), 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(), tinsert(), and utfchar().
Definition at line 1222 of file lapi.cpp.
References api_incr_top, aux_upvalue(), index2addr(), lua_lock, lua_unlock, name, setobj2s, and lua_State::top.
Referenced by auxupvalue(), and checkupval().
Definition at line 724 of file lapi.cpp.
References api_check, api_incr_top, getuservalue, index2addr(), lua_lock, lua_unlock, lua_State::top, ttisfulluserdata, ttnov, and uvalue.
Referenced by db_getuservalue().
Definition at line 264 of file lapi.cpp.
References index2addr(), ttisCclosure, and ttislcf.
Referenced by db_upvaluejoin(), and ll_require().
Definition at line 270 of file lapi.cpp.
References index2addr(), and ttisinteger.
Referenced by addliteral(), g_write(), lua_widget::impl_widget_get(), intf_music_add(), luaL_tolstring(), math_abs(), math_ceil(), math_floor(), math_fmod(), math_modf(), and math_type().
Definition at line 276 of file lapi.cpp.
References index2addr(), n, and tonumber.
Referenced by ai::ai_attack(), game_lua_kernel::apply_effect(), find_widget_impl(), lua_callable::get_inputs(), impl_add_animation(), impl_music_get(), impl_music_set(), impl_unit_attacks_get(), impl_unit_attacks_set(), lua_common::impl_vconfig_get(), interror(), intf_add_item_of_type(), game_lua_kernel::intf_get_time_of_day(), game_lua_kernel::intf_get_unit(), intf_music_add(), intf_random(), game_lua_kernel::intf_set_end_campaign_text(), game_lua_kernel::intf_simulate_combat(), intf_sound_volume(), intf_terainmap_create(), game_lua_kernel::intf_toggle_fog(), load_fake_units(), luaW_tolocation(), lua_gui2::show_menu(), lua_gui2::show_message_dialog(), and ai::lua_object< T >::to_type().
Definition at line 283 of file lapi.cpp.
References cvt2str, index2addr(), and ttisstring.
Referenced by add_value(), addfield(), game_lua_kernel::apply_effect(), mapgen_lua_kernel::create_map(), findloader(), generic_reader(), ai::unit_advancements_aspect::get_advancements(), lua_kernel_base::get_global_var_names(), impl_add_animation(), ai::impl_ai_get(), lua_common::impl_gettext(), lua_formula_bridge::intf_compile_formula(), lua_stringx::intf_format(), lua_map_location::intf_get_direction(), game_lua_kernel::intf_get_unit(), lua_wml::intf_load_wml(), game_lua_kernel::intf_log(), intf_log(), game_lua_kernel::intf_log_replay(), intf_name_generator(), game_lua_kernel::intf_set_time_of_day(), game_lua_kernel::intf_shroud_op(), intf_switch_ai(), intf_transform_unit(), intf_unit_defense(), intf_unit_jamming_cost(), intf_unit_movement_cost(), intf_unit_vision_cost(), lua_wml::intf_wml_merge(), load_fake_units(), luaL_tolstring(), luaW_iststring(), lua_kernel_base::protected_call(), and ai::lua_object< T >::to_type().
Definition at line 289 of file lapi.cpp.
References index2addr(), ttisfulluserdata, and ttislightuserdata.
Referenced by ai::cfun_ai_get_suitable_keep(), lua_kernel_base::get_attribute_names(), game_lua_kernel::intf_find_path(), game_lua_kernel::intf_find_reach(), luaW_iststring(), and luaW_tolocation().
Definition at line 1156 of file lapi.cpp.
References api_incr_top, index2addr(), lua_lock, lua_unlock, luaV_objlen(), t, and lua_State::top.
Referenced by impl_unit_attacks_next(), lua_wml::intf_load_wml(), and luaL_len().
LUA_API int lua_load | ( | lua_State * | L, |
lua_Reader | reader, | ||
void * | data, | ||
const char * | chunkname, | ||
const char * | mode | ||
) |
Definition at line 992 of file lapi.cpp.
References clLvalue, f, G, hvalue, lua_lock, LUA_OK, LUA_RIDX_GLOBALS, lua_unlock, luaC_upvalbarrier, luaD_protectedparser(), luaH_getint(), luaZ_init(), setobj, lua_State::top, LClosure::upvals, and UpVal::v.
Referenced by lua_fileops::lua_filestream::lua_loadfile(), luaB_load(), luaL_loadbufferx(), and luaL_loadfilex().
Definition at line 1184 of file lapi.cpp.
References api_incr_top, getudatamem, lua_lock, lua_unlock, luaC_checkGC, luaS_newudata(), setuvalue, and lua_State::top.
Referenced by game_lua_kernel::game_lua_kernel(), gmatch(), lua_common::intf_textdomain(), lua_kernel_base::lua_kernel_base(), luaW_pushunittype(), newbox(), newprefile(), operator new(), lua_colors::register_metatables(), and lua_audio::register_table().
Definition at line 1123 of file lapi.cpp.
References api_check, api_incr_top, hvalue, index2addr(), lua_lock, lua_unlock, luaH_next(), t, lua_State::top, and ttistable.
Referenced by checktab(), findfield(), lua_kernel_base::get_attribute_names(), lua_kernel_base::get_global_var_names(), lua_callable::get_inputs(), lua_callable::get_value(), intf_name_generator(), lua_stringx::intf_str_join_map(), lua_kernel_base::lua_kernel_base(), luaB_next(), and luaW_toconfig().
LUA_API int lua_pcallk | ( | lua_State * | L, |
int | nargs, | ||
int | nresults, | ||
int | errfunc, | ||
lua_KContext | ctx, | ||
lua_KFunction | k | ||
) |
Definition at line 948 of file lapi.cpp.
References adjustresults, lua_State::allowhook, api_check, api_checknelems, api_checkstackindex, CallInfo::c, CallInfo::callstatus, checkresults, lua_State::ci, CIST_YPCALL, lua_State::errfunc, CallInfo::extra, f_call(), CallS::func, index2addr(), isLua, lua_lock, LUA_OK, lua_unlock, luaD_call(), luaD_pcall(), lua_State::nny, CallS::nresults, savestack, setoah, lua_State::status, lua_State::top, and CallInfo::u.
Referenced by luaB_pcall(), and luaB_xpcall().
Definition at line 557 of file lapi.cpp.
References api_incr_top, lua_lock, lua_unlock, setbvalue, and lua_State::top.
Referenced by aux_lines(), 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(), cfun_wml_condition(), finishpcall(), ai::lua_object< T >::from_type(), impl_color_equality(), impl_track_eq(), lua_common::impl_tstring_eq(), lua_common::impl_tstring_le(), lua_common::impl_tstring_lt(), impl_unit_attack_equal(), impl_unit_attack_match(), impl_unit_equality(), impl_unit_status_get(), impl_unit_type_equal(), intf_compare_versions(), intf_eval_conditional(), game_lua_kernel::intf_fire_event(), game_lua_kernel::intf_fire_wml_menu_item(), game_lua_kernel::intf_get_fog_or_shroud(), 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(), game_lua_kernel::intf_unit_ability(), game_lua_kernel::intf_view_locked(), lua_wml::intf_wml_equal(), lua_wml::intf_wml_matches_filter(), lua_wml::intf_wml_valid(), ll_require(), lookforfunc(), ai::lua_ai_load::lua_ai_load(), lua_check_impl::lua_push(), luaB_collectgarbage(), luaB_coresume(), luaB_corunning(), luaB_pcall(), luaB_rawequal(), luaB_xpcall(), luaB_yieldable(), luaL_execresult(), luaL_fileresult(), luaW_pushsimweapon(), luaW_pushtstring(), math_ult(), os_execute(), ai::push_attack_analysis(), game_lua_kernel::push_builtin_effect(), setboolfield(), settabsb(), lua_gui2::show_message_box(), 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 | ||
) |
Definition at line 532 of file lapi.cpp.
References api_check, api_checknelems, api_incr_top, CClosure::f, lua_lock, lua_unlock, luaC_checkGC, luaF_newCclosure(), MAXUPVAL, n, setclCvalue, setfvalue, setobj2n, lua_State::top, and CClosure::upvalue.
Referenced by aux_lines(), createsearcherstable(), ai::generate_and_push_ai_table(), gmatch(), ai::impl_ai_get(), lua_common::impl_vconfig_ipairs(), lua_common::impl_vconfig_pairs(), luaB_cowrap(), luaL_setfuncs(), lua_stringx::luaW_open(), ai::push_attack_analysis(), game_lua_kernel::push_builtin_effect(), lua_cpp::push_closure(), push_component(), game_lua_kernel::set_wml_action(), and game_lua_kernel::set_wml_condition().
Definition at line 519 of file lapi.cpp.
References lua_lock, lua_unlock, luaC_checkGC, and luaO_pushvfstring().
Referenced by checkoption(), db_getinfo(), errfile(), f_tostring(), intf_find_path(), loadfunc(), luaL_checkoption(), luaL_fileresult(), luaL_loadfilex(), luaL_tolstring(), luaL_traceback(), luaL_where(), luaW_type_error(), pushfuncname(), pushutfchar(), searcher_Croot(), searcher_preload(), searchpath(), setpath(), and typeerror().
LUA_API void lua_pushinteger | ( | lua_State * | L, |
lua_Integer | n | ||
) |
Definition at line 466 of file lapi.cpp.
References api_incr_top, lua_lock, lua_unlock, setivalue, and lua_State::top.
Referenced by aux_lines(), byteoffset(), ai::cfun_ai_get_recruitment_pattern(), ai::cfun_ai_get_targets(), cfun_exec_candidate_action(), codepoint(), lua_pathfind_cost_calculator::cost(), db_gethook(), f_seek(), ai::unit_advancements_aspect::get_advancements(), get_new_thread(), lua_callable::get_value(), hookf(), ai::impl_ai_aspect_get(), ai::impl_ai_get(), impl_music_get(), impl_music_len(), impl_unit_attacks_len(), lua_common::impl_vconfig_ipairs(), lua_common::impl_vconfig_ipairs_iter(), lua_common::impl_vconfig_size(), intf_default_generate_height_map(), lua_map_location::intf_distance_between(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_find_path(), intf_find_path(), game_lua_kernel::intf_find_reach(), game_lua_kernel::intf_find_vacant_tile(), 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_max_liminal_bonus(), game_lua_kernel::intf_get_mouseover_tile(), game_lua_kernel::intf_get_selected_tile(), 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(), intf_show_dialog(), intf_unit_defense(), intf_unit_jamming_cost(), intf_unit_movement_cost(), intf_unit_resistance(), intf_unit_vision_cost(), ipairsaux(), iter_aux(), iter_codes(), luaB_collectgarbage(), luaB_ipairs(), luaB_rawlen(), luaB_select(), luaB_tonumber(), luaL_execresult(), luaL_fileresult(), luaL_unref(), luaopen_math(), luaW_push_locationset(), luaW_pushfaivariant(), luaW_pushlocation(), luaW_pushtstring(), math_abs(), math_fmod(), math_random(), math_toint(), math_type(), pack(), pairsmeta(), ai::push_attack_analysis(), ai::push_move_map(), push_onecapture(), pushnumint(), game_lua_kernel::run_filter(), setfield(), settabsi(), lua_gui2::show_menu(), lua_gui2::show_message_dialog(), str_byte(), str_find_aux(), str_gsub(), str_len(), str_packsize(), str_unpack(), ai::lua_object< T >::to_type(), ai::transform_ai_action(), and utflen().
Definition at line 565 of file lapi.cpp.
References api_incr_top, lua_lock, lua_unlock, setpvalue, and lua_State::top.
Referenced by addtoclib(), ai::lua_ai_context::create(), db_upvalueid(), ai::generate_and_push_ai_table(), get_new_thread(), ai::impl_ai_get(), luaW_clearwindowtable(), luaW_pushwidgettable(), luaW_pushwidgettablecontainer(), luaW_pushwindowtable(), ai::push_attack_analysis(), push_component(), game_lua_kernel::set_wml_action(), and game_lua_kernel::set_wml_condition().
Definition at line 479 of file lapi.cpp.
References api_incr_top, getstr, lua_lock, lua_unlock, luaC_checkGC, luaS_new(), luaS_newlstr(), setsvalue2s, and lua_State::top.
Referenced by add_value(), ai::cfun_ai_get_leader_ignores_keep(), ai::cfun_ai_get_passive_leader(), ai::cfun_ai_get_passive_leader_shares_keep(), ai::lua_object< T >::from_type(), lua_kernel_base::get_attribute_names(), lua_callable::get_value(), impl_formula_tostring(), impl_race_get(), impl_unit_type_get(), impl_unit_type_next(), lua_common::impl_vconfig_ipairs_iter(), lua_common::impl_vconfig_pairs_iter(), lua_map_location::intf_get_relative_dir(), lua_stringx::intf_str_trim(), intf_switch_ai(), ll_require(), loadfunc(), lua_check_impl::lua_push(), luaL_pushresult(), luaL_tolstring(), luaopen_utf8(), luaW_getglobal(), luaW_pushfaivariant(), luaW_table_get_def(), luaW_table_set(), push_onecapture(), pushnexttemplate(), searcher_Croot(), lua_gui2::show_message_dialog(), str_sub(), and str_unpack().
Definition at line 450 of file lapi.cpp.
References api_incr_top, lua_lock, lua_unlock, setnilvalue, and lua_State::top.
Referenced by byteoffset(), checktab(), db_gethook(), db_getinfo(), db_getlocal(), db_getmetatable(), db_getuservalue(), findfield(), ai::lua_object< T >::from_type(), g_read(), lua_kernel_base::get_attribute_names(), lua_kernel_base::get_global_var_names(), lua_callable::get_inputs(), ai::typesafe_aspect< attacks_vector >::get_lua(), lua_callable::get_value(), hookf(), impl_music_get(), impl_slocs_get(), impl_unit_type_pairs(), intf_load(), intf_name_generator(), lua_stringx::intf_str_join_map(), io_lines(), io_noclose(), io_type(), ll_loadlib(), ll_searchpath(), load_aux(), lua_kernel_base::lua_kernel_base(), luaB_getmetatable(), luaB_next(), luaB_tonumber(), luaL_execresult(), luaL_fileresult(), luaW_clearwindowtable(), luaW_pushfaivariant(), luaW_pushtstring(), luaW_pushvariable(), luaW_pushweapon(), luaW_toconfig(), mapgen_lua_kernel::mapgen_lua_kernel(), math_toint(), math_type(), pairsmeta(), read_number(), lua_gui2::show_message_dialog(), special_locations_pairs(), str_find_aux(), str_pack(), tremove(), utflen(), ai::lua_ai_action_handler::~lua_ai_action_handler(), ai::lua_ai_context::~lua_ai_context(), and ai::lua_ai_load::~lua_ai_load().
LUA_API void lua_pushnumber | ( | lua_State * | L, |
lua_Number | n | ||
) |
Definition at line 458 of file lapi.cpp.
References api_incr_top, lua_lock, lua_unlock, setfltvalue, and lua_State::top.
Referenced by ai::cfun_ai_get_aggression(), ai::cfun_ai_get_caution(), ai::cfun_ai_get_leader_aggression(), ai::cfun_ai_get_leader_value(), ai::cfun_ai_get_scout_village_targeting(), ai::cfun_ai_get_suitable_keep(), ai::cfun_ai_get_targets(), ai::cfun_ai_get_village_value(), ai::cfun_ai_get_villages_per_scout(), ai::cfun_attack_rating(), checktab(), lua_pathfind_cost_calculator::cost(), ai::lua_object< T >::from_type(), lua_rng::impl_rng_draw(), lua_common::impl_tstring_len(), impl_unit_attacks_iter(), impl_unit_attacks_next(), impl_unit_type_count(), lua_stringx::intf_parse_range(), lua_fileops::intf_read_file(), game_lua_kernel::intf_skip_messages(), intf_sound_volume(), game_lua_kernel::intf_zoom(), lua_check_impl::lua_push(), luaB_collectgarbage(), luaopen_math(), luaW_pushfaivariant(), luaW_pushsimdata(), luaW_pushsimweapon(), luaW_pushtstring(), math_abs(), math_acos(), math_asin(), math_atan(), math_cos(), math_deg(), math_exp(), math_fmod(), math_log(), math_modf(), math_rad(), math_random(), math_sin(), math_sqrt(), math_tan(), math_type(), os_clock(), os_difftime(), ai::push_attack_analysis(), pushnumint(), special_locations_len(), and str_unpack().
Definition at line 491 of file lapi.cpp.
References api_incr_top, getstr, lua_lock, lua_unlock, luaC_checkGC, luaS_new(), s, setnilvalue, 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(), checkfield(), checkload(), db_gethook(), db_getlocal(), db_sethook(), db_setlocal(), findloader(), game_lua_kernel::game_lua_kernel(), hookf(), ai::impl_ai_aspect_set(), ai::impl_ai_get(), impl_name_generator_call(), lua_rng::impl_rng_destroy(), impl_side_get(), lua_common::impl_tstring_tostring(), impl_unit_type_new(), impl_unit_type_next(), lua_common::impl_vconfig_get(), lua_cpp::intf_cleanup(), game_lua_kernel::intf_create_animator(), 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_map_location::intf_get_relative_dir(), game_lua_kernel::intf_get_terrain(), 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_map_location::intf_tiles_adjacent(), lua_cpp::intf_tostring(), lua_map_location::intf_vector_diff(), lua_map_location::intf_vector_sum(), lua_wml::intf_wml_tostring(), ll_loadlib(), ll_require(), lua_kernel_base::load_core(), 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_newmetatable(), luaL_requiref(), luaL_tolstring(), luaW_checkrace(), luaW_filltable(), lua_gui2::luaW_open(), luaW_pushfaivariant(), luaW_pushrace(), luaW_pushsimweapon(), luaW_pushtstring(), luaW_tableget(), os_getenv(), os_setlocale(), os_tmpname(), ai::push_attack_analysis(), game_lua_kernel::push_builtin_effect(), push_component(), push_locations_table(), ai::push_movements(), pushglobalfuncname(), lua_units::register_attacks_metatables(), lua_common::register_gettext_metatable(), lua_cpp::register_metatable(), lua_race::register_metatable(), lua_widget::register_metatable(), lua_unit_type::register_metatable(), lua_formula_bridge::register_metatables(), lua_colors::register_metatables(), lua_terrainmap::register_metatables(), lua_units::register_metatables(), lua_terrainfilter::register_metatables(), lua_preferences::register_table(), lua_unit_type::register_table(), lua_audio::register_table(), 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(), game_lua_kernel::set_wml_condition(), 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().
Definition at line 573 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().
Definition at line 237 of file lapi.cpp.
References api_incr_top, index2addr(), lua_lock, lua_unlock, setobj2s, and lua_State::top.
Referenced by add_value(), addtoclib(), game_lua_kernel::apply_effect(), auxsort(), 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(), f_write(), lua_mapgen::filter::filter(), finishpcall(), g_iofile(), ai::generate_and_push_ai_state(), generic_reader(), lua_kernel_base::get_attribute_names(), lua_callable::get_inputs(), get_new_thread(), ai::impl_ai_get(), impl_side_get(), lua_stringx::impl_str_index(), game_lua_kernel::impl_theme_items_get(), game_lua_kernel::impl_theme_items_set(), impl_unit_attacks_iter(), impl_unit_attacks_next(), impl_unit_type_pairs(), lua_common::impl_vconfig_ipairs(), lua_common::impl_vconfig_pairs(), lua_kernel_base::interactive_run(), intf_describe_plugins(), intf_do_unsynced(), intf_load(), lua_kernel_base::intf_print(), lua_kernel_base::intf_require(), intf_set_dialog_callback(), intf_show_dialog(), game_lua_kernel::intf_skip_messages(), lua_stringx::intf_str_format(), lua_stringx::intf_str_join_map(), io_readline(), iter_codes(), ll_require(), load_aux(), lua_rng::load_tables(), luaB_cocreate(), luaB_error(), luaB_ipairs(), luaB_print(), luaB_xpcall(), luaL_callmeta(), luaL_getsubtable(), luaL_newmetatable(), luaL_requiref(), luaL_setfuncs(), luaL_tolstring(), luaopen_base(), luaopen_package(), luaW_pushslocs(), luaW_pushwidgettable(), luaW_pushwidgettablecontainer(), luaW_pushwindowtable(), luaW_to_locationset(), math_max(), math_min(), pairsmeta(), game_lua_kernel::push_builtin_effect(), push_unit_attacks_table(), lua_cpp::register_metatable(), lua_preferences::register_table(), game_lua_kernel::run_filter(), lua_cpp::set_functions(), sort_comp(), special_locations_pairs(), tmove(), WIDGET_GETTER(), and WIDGET_SETTER().
Definition at line 508 of file lapi.cpp.
References lua_lock, lua_unlock, luaC_checkGC, and luaO_pushvfstring().
Referenced by luaL_error().
Definition at line 295 of file lapi.cpp.
References index2addr(), isvalid, and luaV_rawequalobj.
Referenced by findfield(), luaB_rawequal(), and luaL_testudata().
Definition at line 647 of file lapi.cpp.
References api_check, hvalue, index2addr(), lua_lock, lua_unlock, luaH_get(), setobj2s, t, lua_State::top, ttistable, and ttnov.
Referenced by checkfield(), db_gethook(), get_new_thread(), hookf(), ai::impl_ai_get(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_find_path(), game_lua_kernel::intf_find_reach(), lua_kernel_base::intf_require(), luaB_rawget(), luaL_getmetafield(), luaL_tolstring(), luaW_checkrace(), luaW_getglobal(), luaW_getwidgetcallback(), luaW_pushwidgettable(), luaW_pushwidgettablecontainer(), luaW_pushwindowtable(), luaW_setwidgetcallback(), game_lua_kernel::set_wml_action(), game_lua_kernel::set_wml_condition(), and ai::lua_object< T >::to_type().
LUA_API int lua_rawgeti | ( | lua_State * | L, |
int | idx, | ||
lua_Integer | n | ||
) |
Definition at line 658 of file lapi.cpp.
References api_check, api_incr_top, hvalue, index2addr(), lua_lock, lua_unlock, luaH_getint(), setobj2s, t, lua_State::top, ttistable, and ttnov.
Referenced by ai::call_lua_filter_fcn(), findloader(), gctm(), ai::unit_advancements_aspect::get_advancements(), ai::lua_ai_context::get_arguments(), ai::lua_ai_context::get_persistent_data(), ai::lua_ai_action_handler::handle(), impl_add_animation(), impl_unit_attacks_get(), impl_unit_attacks_len(), impl_unit_attacks_set(), impl_unit_status_get(), impl_unit_status_set(), impl_unit_variables_get(), impl_unit_variables_set(), game_lua_kernel::intf_get_time_of_day(), game_lua_kernel::intf_terrain_mask(), load_fake_units(), ai::lua_ai_load::lua_ai_load(), lua_check_impl::lua_check(), luaL_ref(), luaL_unref(), luaW_toconfig(), luaW_tolocation(), luaW_toslocs(), read_rules_vector(), ai::lua_ai_context::set_arguments(), ai::lua_ai_context::set_persistent_data(), lua_gui2::show_message_dialog(), and ai::lua_object< T >::to_type().
Definition at line 670 of file lapi.cpp.
References api_check, api_incr_top, cast, hvalue, index2addr(), lua_lock, lua_unlock, luaH_get(), setobj2s, setpvalue, t, lua_State::top, ttistable, and ttnov.
Referenced by addtoclib(), checkclib(), db_gethook(), db_sethook(), and hookf().
Definition at line 392 of file lapi.cpp.
References hvalue, index2addr(), LUA_TLNGSTR, LUA_TSHRSTR, LUA_TTABLE, LUA_TUSERDATA, luaH_getn(), tsvalue, ttype, and uvalue.
Referenced by ai::cfun_ai_get_leader_ignores_keep(), ai::cfun_ai_get_passive_leader(), ai::cfun_ai_get_passive_leader_shares_keep(), ai::lua_ai_action_handler::create(), ai::lua_object< T >::from_type(), ai::generate_and_push_ai_state(), get_new_thread(), lua_callable::get_value(), impl_add_animation(), game_lua_kernel::intf_terrain_mask(), load_fake_units(), lua_check_impl::lua_check(), luaB_rawlen(), luaL_ref(), luaW_pushfaivariant(), luaW_to_locationset(), luaW_toconfig(), read_line(), read_rules_vector(), lua_gui2::show_message_dialog(), ai::lua_object< T >::to_type(), and filter_impl::~filter_impl().
Definition at line 801 of file lapi.cpp.
References api_check, api_checknelems, hvalue, index2addr(), invalidateTMcache, lua_lock, lua_unlock, luaC_barrierback, luaH_set(), setobj2t, lua_State::top, and ttistable.
Referenced by ai::cfun_ai_get_targets(), db_sethook(), game_lua_kernel::game_lua_kernel(), get_new_thread(), ai::impl_ai_get(), impl_race_get(), game_lua_kernel::impl_theme_items_get(), game_lua_kernel::impl_theme_items_set(), impl_unit_type_get(), intf_debug_ai(), intf_get_traits(), ai::lua_ai_load::lua_ai_load(), luaB_rawset(), luaW_clearwindowtable(), lua_gui2::luaW_open(), luaW_pushwidgettable(), luaW_pushwidgettablecontainer(), luaW_pushwindowtable(), luaW_setwidgetcallback(), ai::push_attack_analysis(), game_lua_kernel::push_builtin_effect(), push_component(), push_locations_table(), ai::push_movements(), lua_common::register_vconfig_metatable(), game_lua_kernel::set_wml_action(), game_lua_kernel::set_wml_condition(), and ai::lua_ai_load::~lua_ai_load().
LUA_API void lua_rawseti | ( | lua_State * | L, |
int | idx, | ||
lua_Integer | n | ||
) |
Definition at line 817 of file lapi.cpp.
References api_check, api_checknelems, hvalue, index2addr(), lua_lock, lua_unlock, luaC_barrierback, luaH_setint(), lua_State::top, and ttistable.
Referenced by addtoclib(), ai::cfun_ai_get_attacks(), ai::cfun_ai_get_leader_ignores_keep(), ai::cfun_ai_get_passive_leader(), ai::cfun_ai_get_passive_leader_shares_keep(), ai::lua_ai_action_handler::create(), createsearcherstable(), ai::lua_object< T >::from_type(), ai::generate_and_push_ai_state(), ai::impl_ai_aspect_get(), impl_side_get(), lua_common::impl_vconfig_get(), lua_common::impl_vconfig_ipairs_iter(), intf_default_generate_height_map(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_find_path(), intf_find_path(), game_lua_kernel::intf_find_reach(), game_lua_kernel::intf_get_locations(), game_lua_kernel::intf_get_recall_units(), game_lua_kernel::intf_get_sides(), game_lua_kernel::intf_get_units(), game_lua_kernel::intf_get_villages(), game_lua_kernel::load_game(), lua_check_impl::lua_push(), luaL_ref(), luaL_unref(), luaW_filltable(), luaW_push_locationset(), luaW_pushlocation(), luaW_pushsimdata(), luaW_pushslocs(), luaW_pushwidgettable(), ai::push_move_map(), ai::push_movements(), push_unit_attacks_table(), application_lua_kernel::thread::run_script(), ai::lua_ai_action_handler::~lua_ai_action_handler(), and ai::lua_ai_context::~lua_ai_context().
Definition at line 830 of file lapi.cpp.
References api_check, api_checknelems, cast, hvalue, index2addr(), lua_lock, lua_unlock, luaC_barrierback, luaH_set(), setobj2t, setpvalue, lua_State::top, and ttistable.
Referenced by createclibstable(), and db_sethook().
Definition at line 207 of file lapi.cpp.
References api_check, api_checkstackindex, index2addr(), lua_lock, lua_unlock, n, p, reverse(), t, and lua_State::top.
Referenced by aux_lines(), db_getlocal(), lua_kernel_base::intf_dofile(), luaB_xpcall(), luaW_setwidgetcallback(), and treatstackoption().
Definition at line 777 of file lapi.cpp.
References auxsetstr(), index2addr(), and lua_lock.
Referenced by addtoclib(), application_lua_kernel::application_lua_kernel(), ai::lua_ai_context::create(), createclibstable(), createmeta(), createmetatable(), createsearcherstable(), 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_aspect_get(), ai::impl_ai_get(), lua_common::impl_vconfig_get(), ai::lua_ai_context::init(), game_lua_kernel::initialize(), lua_kernel_base::interactive_run(), game_lua_kernel::intf_create_animator(), game_lua_kernel::intf_get_terrain_info(), game_lua_kernel::intf_get_time_of_day(), lua_fileops::intf_read_file(), ll_require(), lua_rng::load_tables(), lua_kernel_base::lua_kernel_base(), luaL_getsubtable(), luaL_newmetatable(), luaL_requiref(), luaL_setfuncs(), luaL_tolstring(), luaopen_base(), luaopen_math(), luaopen_package(), luaopen_utf8(), luaW_filltable(), lua_stringx::luaW_open(), luaW_pushrace(), luaW_pushracetable(), luaW_pushsimdata(), luaW_pushsimweapon(), mapgen_lua_kernel::mapgen_lua_kernel(), newbox(), pack(), push_error_handler(), lua_units::register_attacks_metatables(), lua_common::register_gettext_metatable(), lua_cpp::register_metatable(), lua_race::register_metatable(), lua_widget::register_metatable(), lua_unit_type::register_metatable(), lua_formula_bridge::register_metatables(), lua_colors::register_metatables(), lua_terrainmap::register_metatables(), lua_units::register_metatables(), lua_terrainfilter::register_metatables(), lua_preferences::register_table(), lua_unit_type::register_table(), lua_audio::register_table(), 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().
Definition at line 759 of file lapi.cpp.
References auxsetstr(), G, hvalue, lua_lock, LUA_RIDX_GLOBALS, and luaH_getint().
Referenced by application_lua_kernel::application_lua_kernel(), game_lua_kernel::game_lua_kernel(), lua_rng::load_tables(), ai::lua_ai_load::lua_ai_load(), lua_kernel_base::lua_kernel_base(), luaL_requiref(), luaopen_table(), and ai::lua_ai_load::~lua_ai_load().
LUA_API void lua_seti | ( | lua_State * | L, |
int | idx, | ||
lua_Integer | n | ||
) |
Definition at line 783 of file lapi.cpp.
References api_checknelems, api_incr_top, index2addr(), lua_lock, lua_unlock, luaH_getint(), luaV_fastset, luaV_finishset(), setivalue, t, and lua_State::top.
Referenced by pack(), set2(), tinsert(), tmove(), and tremove().
Definition at line 846 of file lapi.cpp.
References api_check, api_checknelems, G, gcvalue, hvalue, index2addr(), lua_lock, LUA_TTABLE, LUA_TUSERDATA, lua_unlock, luaC_checkfinalizer(), luaC_objbarrier, lua_State::top, ttisnil, ttistable, ttnov, and uvalue.
Referenced by createclibstable(), createmetatable(), db_sethook(), db_setmetatable(), game_lua_kernel::game_lua_kernel(), ai::generate_and_push_ai_table(), ai::impl_ai_get(), impl_race_get(), lua_common::impl_vconfig_ipairs(), lua_common::impl_vconfig_pairs(), game_lua_kernel::intf_create_animator(), game_lua_kernel::intf_get_end_level_data(), intf_name_generator(), ll_require(), lua_kernel_base::lua_kernel_base(), luaB_setmetatable(), luaL_setmetatable(), lua_stringx::luaW_open(), newbox(), game_lua_kernel::push_builtin_effect(), push_locations_table(), lua_colors::register_metatables(), lua_preferences::register_table(), lua_unit_type::register_table(), and lua_audio::register_table().
Definition at line 766 of file lapi.cpp.
References api_checknelems, index2addr(), lua_lock, lua_unlock, luaV_settable, t, and lua_State::top.
Referenced by ai::cfun_ai_get_recruitment_pattern(), ai::impl_ai_aspect_get(), lua_kernel_base::intf_require(), lua_check_impl::lua_push(), luaL_tolstring(), luaW_pushfaivariant(), luaW_table_set(), ai::push_move_map(), and application_lua_kernel::thread::run_script().
Definition at line 172 of file lapi.cpp.
References api_check, lua_State::ci, CallInfo::func, lua_lock, lua_unlock, setnilvalue, and lua_State::top.
Referenced by application_lua_kernel::application_lua_kernel(), game_lua_kernel::apply_effect(), ai::cfun_attack_rating(), db_debug(), db_sethook(), db_setlocal(), db_setmetatable(), db_setuservalue(), lua_callable::do_compare(), game_lua_kernel::game_lua_kernel(), 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(), gmatch(), ai::lua_ai_action_handler::handle(), game_lua_kernel::initialize(), lua_kernel_base::interactive_run(), game_lua_kernel::intf_get_recall_units(), game_lua_kernel::intf_get_sides(), game_lua_kernel::intf_get_units(), lua_stringx::intf_str_join_map(), io_readline(), ll_require(), lua_kernel_base::load_core(), load_fake_units(), lua_kernel_base::lua_kernel_base(), luaB_assert(), luaB_dofile(), luaB_error(), luaB_load(), luaB_next(), luaB_rawget(), luaB_rawset(), luaB_setmetatable(), luaB_tonumber(), luaL_loadfilex(), luaW_toconfig(), mapgen_lua_kernel::mapgen_lua_kernel(), math_ceil(), math_floor(), math_modf(), os_time(), pushglobalfuncname(), ai::lua_ai_context::set_arguments(), ai::lua_ai_context::set_persistent_data(), sort(), str_dump(), ai::lua_object< T >::to_type(), and ai::unit_advancements_aspect::unit_advancements_aspect().
Definition at line 1236 of file lapi.cpp.
References api_checknelems, aux_upvalue(), index2addr(), lua_lock, lua_unlock, luaC_barrier, luaC_upvalbarrier, name, setobj, and lua_State::top.
Referenced by auxupvalue(), lua_kernel_base::interactive_run(), intf_load(), ll_require(), load_aux(), and lua_kernel_base::throwing_run().
Definition at line 886 of file lapi.cpp.
References api_check, api_checknelems, gcvalue, index2addr(), lua_lock, lua_unlock, luaC_barrier, setuservalue, lua_State::top, ttisfulluserdata, and uvalue.
Referenced by db_setuservalue().
Definition at line 1031 of file lapi.cpp.
References lua_State::status.
Referenced by auxresume(), application_lua_kernel::thread::is_running(), application_lua_kernel::load_script_from_string(), luaB_costatus(), application_lua_kernel::thread::run_script(), and application_lua_kernel::thread::status().
Definition at line 337 of file lapi.cpp.
References api_incr_top, luaO_str2num(), and lua_State::top.
Referenced by luaB_tonumber(), and read_number().
Definition at line 367 of file lapi.cpp.
References index2addr(), and l_isfalse.
Referenced by add_value(), getboolfield(), io_readline(), ll_require(), luaB_assert(), luaL_requiref(), luaL_tolstring(), luaW_toboolean(), luaW_totstring(), noenv(), os_exit(), sort_comp(), str_dump(), and str_find_aux().
LUA_API lua_CFunction lua_tocfunction | ( | lua_State * | L, |
int | idx | ||
) |
Definition at line 404 of file lapi.cpp.
References clCvalue, fvalue, index2addr(), ttisCclosure, and ttislcf.
LUA_API lua_Integer lua_tointegerx | ( | lua_State * | L, |
int | idx, | ||
int * | pisnum | ||
) |
Definition at line 356 of file lapi.cpp.
References index2addr(), and tointeger.
Referenced by getfield(), lua_check_impl::lua_to_or_default(), luaL_checkinteger(), luaL_len(), and math_toint().
Definition at line 373 of file lapi.cpp.
References cvt2str, index2addr(), lua_lock, lua_unlock, luaC_checkGC, luaO_tostring(), svalue, ttisstring, and vslen.
Referenced by add_s(), addliteral(), generic_reader(), luaB_load(), luaB_print(), luaB_tonumber(), luaL_addvalue(), luaL_checklstring(), luaL_tolstring(), luaW_tostring(), and luaW_tostring_or_default().
LUA_API lua_Number lua_tonumberx | ( | lua_State * | L, |
int | idx, | ||
int * | pisnum | ||
) |
Definition at line 345 of file lapi.cpp.
References index2addr(), n, and tonumber.
Referenced by game_lua_kernel::intf_set_time_of_day(), lua_check_impl::lua_to_or_default(), luaL_checknumber(), and luaW_tolocation().
Definition at line 429 of file lapi.cpp.
References cast, clCvalue, clLvalue, fvalue, getudatamem, hvalue, index2addr(), LUA_TCCL, LUA_TLCF, LUA_TLCL, LUA_TLIGHTUSERDATA, LUA_TTABLE, LUA_TTHREAD, LUA_TUSERDATA, pvalue, thvalue, ttype, and uvalue.
Referenced by lua_callable::do_compare(), and luaL_tolstring().
Definition at line 423 of file lapi.cpp.
References index2addr(), thvalue, and ttisthread.
Referenced by getco(), getthread(), and luaB_auxwrap().
Definition at line 413 of file lapi.cpp.
References getudatamem, index2addr(), LUA_TLIGHTUSERDATA, LUA_TUSERDATA, pvalue, ttnov, and uvalue.
Referenced by ai::cfun_attack_rating(), cfun_exec_candidate_action(), cfun_exec_stage(), game_lua_kernel::cfun_wml_action(), cfun_wml_condition(), checkclib(), gctm(), ai::get_engine(), getiofile(), gmatch_aux(), impl_color_collect(), impl_end_level_data_collect(), impl_end_level_data_get(), game_lua_kernel::impl_end_level_data_set(), impl_formula_collect(), impl_formula_tostring(), lua_common::impl_gettext(), lua_common::impl_gettext_tostr(), impl_name_generator_call(), impl_name_generator_collect(), impl_terainmap_collect(), lua_common::impl_tstring_collect(), lua_common::impl_tstring_eq(), lua_common::impl_tstring_len(), lua_common::impl_tstring_tostring(), impl_unit_collect(), lua_common::impl_vconfig_collect(), lua_common::impl_vconfig_get(), lua_common::impl_vconfig_ipairs_collect(), lua_common::impl_vconfig_pairs_collect(), lua_common::impl_vconfig_size(), internal_get_unit(), io_readline(), luaL_testudata(), luaW_check_mgfilter(), LuaW_checkcolor(), luaW_checkterrainmap(), luaW_to_mgfilter(), luaW_toterrainmap(), and resizebox().
Definition at line 251 of file lapi.cpp.
References index2addr(), isvalid, LUA_TNONE, and ttnov.
Referenced by addliteral(), game_lua_kernel::apply_effect(), checktab(), mapgen_lua_kernel::create_map(), mapgen_lua_kernel::create_scenario(), db_getuservalue(), db_setmetatable(), findfield(), g_read(), g_write(), lua_kernel_base::get_attribute_names(), lua_callable::get_inputs(), lua_rng::impl_rng_destroy(), lua_stringx::impl_str_index(), lua_cpp::intf_cleanup(), lua_map_location::intf_get_direction(), lua_wml::intf_load_wml(), intf_name_generator(), application_lua_kernel::load_script_from_file(), application_lua_kernel::load_script_from_string(), luaB_auxwrap(), luaB_error(), luaB_rawlen(), luaB_select(), luaB_setmetatable(), luaB_tonumber(), luaB_type(), luaL_checkany(), luaL_checktype(), luaL_tolstring(), luaW_checkvariable(), luaW_toconfig(), luaW_tofaivariant(), luaW_toscalar(), luaW_totstring(), luaW_tovconfig(), math_type(), lua_kernel_base::protected_call(), lua_gui2::show_message_dialog(), str_gsub(), lua_common::tstring_concat_aux(), typeerror(), and WIDGET_SETTER().
Definition at line 257 of file lapi.cpp.
References api_check, LUA_NUMTAGS, LUA_TNONE, ttypename, and UNUSED.
Referenced by game_lua_kernel::apply_effect(), mapgen_lua_kernel::create_map(), mapgen_lua_kernel::create_scenario(), impl_add_animation(), lua_rng::impl_rng_destroy(), lua_cpp::intf_cleanup(), intf_find_path(), lua_map_location::intf_get_direction(), application_lua_kernel::load_script_from_file(), application_lua_kernel::load_script_from_string(), luaB_type(), luaW_checkvariable(), lua_kernel_base::protected_call(), lua_gui2::show_message_dialog(), and tag_error().
Definition at line 1267 of file lapi.cpp.
References api_check, clCvalue, f, getupvalref(), index2addr(), LUA_TCCL, LUA_TLCL, ttype, and CClosure::upvalue.
Referenced by db_upvalueid().
Definition at line 1286 of file lapi.cpp.
References getupvalref(), luaC_upvalbarrier, luaC_upvdeccount(), UpVal::refcount, and upisopen.
Referenced by db_upvaluejoin().
LUA_API const lua_Number* lua_version | ( | lua_State * | L | ) |
Definition at line 144 of file lapi.cpp.
References G, and LUA_VERSION_NUM.
Referenced by f_luaopen(), and luaL_checkversion_().
Definition at line 118 of file lapi.cpp.
References api_check, api_checknelems, lua_State::ci, G, i, lua_lock, lua_unlock, n, setobj2s, CallInfo::top, and lua_State::top.
Referenced by auxresume(), db_gethook(), db_getinfo(), db_getlocal(), db_sethook(), db_setlocal(), luaB_cocreate(), and treatstackoption().
Definition at line 193 of file lapi.cpp.
References setobj, setobj2s, and setobjs2s.
Referenced by pathfind::a_star_search(), game_data::activate_scope_variable(), wfl::builtins::DEFINE_WFL_FUNCTION(), gui::menu::do_sort(), gui::dialog_frame::draw(), gui2::event::implementation::fire_event(), wfl::function_symbol_table::get_builtins(), pathfind::paths::dest_vect::get_path(), events::mouse_handler::get_singleton(), events::sdl_handler::join_same(), gui2::event::sdl_event_handler::keyboard_dispatcher(), events::sdl_handler::leave(), lua_rotate(), gui2::event::sdl_event_handler::mouse(), help::unit_topic_generator::operator()(), events::sdl_handler::operator=(), editor::editor_action_chain::perform(), wb::mapbuilder::post_visit_team(), events::pump(), quit_confirmation::quit(), ai::composite_aspect< T >::recalculate(), wb::mapbuilder::restore_normal_map(), events::sdl_handler::sdl_handler(), wb::highlighter::set_mouseover_hex(), gui2::dialogs::campaign_selection::sort_campaigns(), wfl::string_expression::string_expression(), gui2::event::sdl_event_handler::touch_down(), gui2::event::sdl_event_handler::touch_motion(), gui2::event::sdl_event_handler::touch_multi_gesture(), gui2::event::sdl_event_handler::touch_up(), actions::undo::move_action::undo(), and unit_weapons().
const char lua_ident[] |