#include "lprefix.h"
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
Go to the source code of this file.
Classes | |
struct | UBox |
struct | LoadF |
struct | LoadS |
Macros | |
#define | lauxlib_c |
#define | LUA_LIB |
#define | LEVELS1 10 /* size of the first part of the stack */ |
#define | LEVELS2 11 /* size of the second part of the stack */ |
#define | l_inspectstat(stat, what) /* no op */ |
#define | buffonstack(B) ((B)->b != (B)->initb) |
#define | freelist 0 |
Typedefs | |
typedef struct UBox | UBox |
typedef struct LoadF | LoadF |
typedef struct LoadS | LoadS |
Functions | |
static int | findfield (lua_State *L, int objidx, int level) |
static int | pushglobalfuncname (lua_State *L, lua_Debug *ar) |
static void | pushfuncname (lua_State *L, lua_Debug *ar) |
static int | lastlevel (lua_State *L) |
LUALIB_API void | luaL_traceback (lua_State *L, lua_State *L1, const char *msg, int level) |
LUALIB_API int | luaL_argerror (lua_State *L, int arg, const char *extramsg) |
static int | typeerror (lua_State *L, int arg, const char *tname) |
static void | tag_error (lua_State *L, int arg, int tag) |
LUALIB_API void | luaL_where (lua_State *L, int level) |
LUALIB_API int | luaL_error (lua_State *L, const char *fmt,...) |
LUALIB_API int | luaL_fileresult (lua_State *L, int stat, const char *fname) |
LUALIB_API int | luaL_execresult (lua_State *L, int stat) |
LUALIB_API int | luaL_newmetatable (lua_State *L, const char *tname) |
LUALIB_API void | luaL_setmetatable (lua_State *L, const char *tname) |
LUALIB_API void * | luaL_testudata (lua_State *L, int ud, const char *tname) |
LUALIB_API void * | luaL_checkudata (lua_State *L, int ud, const char *tname) |
LUALIB_API int | luaL_checkoption (lua_State *L, int arg, const char *def, const char *const lst[]) |
LUALIB_API void | luaL_checkstack (lua_State *L, int space, const char *msg) |
LUALIB_API void | luaL_checktype (lua_State *L, int arg, int t) |
LUALIB_API void | luaL_checkany (lua_State *L, int arg) |
LUALIB_API const char * | luaL_checklstring (lua_State *L, int arg, size_t *len) |
LUALIB_API const char * | luaL_optlstring (lua_State *L, int arg, const char *def, size_t *len) |
LUALIB_API lua_Number | luaL_checknumber (lua_State *L, int arg) |
LUALIB_API lua_Number | luaL_optnumber (lua_State *L, int arg, lua_Number def) |
static void | interror (lua_State *L, int arg) |
LUALIB_API lua_Integer | luaL_checkinteger (lua_State *L, int arg) |
LUALIB_API lua_Integer | luaL_optinteger (lua_State *L, int arg, lua_Integer def) |
static void * | resizebox (lua_State *L, int idx, size_t newsize) |
static int | boxgc (lua_State *L) |
static void * | newbox (lua_State *L, size_t newsize) |
LUALIB_API char * | luaL_prepbuffsize (luaL_Buffer *B, size_t sz) |
LUALIB_API void | luaL_addlstring (luaL_Buffer *B, const char *s, size_t l) |
LUALIB_API void | luaL_addstring (luaL_Buffer *B, const char *s) |
LUALIB_API void | luaL_pushresult (luaL_Buffer *B) |
LUALIB_API void | luaL_pushresultsize (luaL_Buffer *B, size_t sz) |
LUALIB_API void | luaL_addvalue (luaL_Buffer *B) |
LUALIB_API void | luaL_buffinit (lua_State *L, luaL_Buffer *B) |
LUALIB_API char * | luaL_buffinitsize (lua_State *L, luaL_Buffer *B, size_t sz) |
LUALIB_API int | luaL_ref (lua_State *L, int t) |
LUALIB_API void | luaL_unref (lua_State *L, int t, int ref) |
static const char * | getF (lua_State *L, void *ud, size_t *size) |
static int | errfile (lua_State *L, const char *what, int fnameindex) |
static int | skipBOM (LoadF *lf) |
static int | skipcomment (LoadF *lf, int *cp) |
LUALIB_API int | luaL_loadfilex (lua_State *L, const char *filename, const char *mode) |
static const char * | getS (lua_State *L, void *ud, size_t *size) |
LUALIB_API int | luaL_loadbufferx (lua_State *L, const char *buff, size_t size, const char *name, const char *mode) |
LUALIB_API int | luaL_loadstring (lua_State *L, const char *s) |
LUALIB_API int | luaL_getmetafield (lua_State *L, int obj, const char *event) |
LUALIB_API int | luaL_callmeta (lua_State *L, int obj, const char *event) |
LUALIB_API lua_Integer | luaL_len (lua_State *L, int idx) |
LUALIB_API const char * | luaL_tolstring (lua_State *L, int idx, size_t *len) |
LUALIB_API void | luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) |
LUALIB_API int | luaL_getsubtable (lua_State *L, int idx, const char *fname) |
LUALIB_API void | luaL_requiref (lua_State *L, const char *modname, lua_CFunction openf, int glb) |
LUALIB_API const char * | luaL_gsub (lua_State *L, const char *s, const char *p, const char *r) |
static void * | l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) |
static int | panic (lua_State *L) |
LUALIB_API lua_State * | luaL_newstate (void) |
LUALIB_API void | luaL_checkversion_ (lua_State *L, lua_Number ver, size_t sz) |
#define buffonstack | ( | B | ) | ((B)->b != (B)->initb) |
Definition at line 499 of file lauxlib.cpp.
Referenced by luaL_addvalue(), luaL_prepbuffsize(), and luaL_pushresult().
#define freelist 0 |
Definition at line 592 of file lauxlib.cpp.
Referenced by luaL_ref(), and luaL_unref().
#define l_inspectstat | ( | stat, | |
what | |||
) | /* no op */ |
Definition at line 267 of file lauxlib.cpp.
Referenced by luaL_execresult().
#define lauxlib_c |
Definition at line 7 of file lauxlib.cpp.
#define LEVELS1 10 /* size of the first part of the stack */ |
Definition at line 37 of file lauxlib.cpp.
Referenced by luaL_traceback().
#define LEVELS2 11 /* size of the second part of the stack */ |
Definition at line 38 of file lauxlib.cpp.
Referenced by luaL_traceback().
#define LUA_LIB |
Definition at line 8 of file lauxlib.cpp.
|
static |
|
static |
Definition at line 660 of file lauxlib.cpp.
References LUA_ERRFILE, lua_pushfstring(), lua_remove, and lua_tostring.
Referenced by luaL_loadfilex().
|
static |
Definition at line 46 of file lauxlib.cpp.
References lua_concat(), lua_insert, lua_istable, lua_next(), lua_pop, lua_pushliteral, lua_pushnil(), lua_rawequal(), lua_remove, LUA_TSTRING, and lua_type().
Referenced by pushglobalfuncname().
|
static |
Definition at line 642 of file lauxlib.cpp.
References LoadF::buff, LoadF::f, and LoadF::n.
Referenced by luaL_loadfilex().
|
static |
Definition at line 745 of file lauxlib.cpp.
References LoadS::s, and LoadS::size.
Referenced by luaL_loadbufferx().
|
static |
Definition at line 422 of file lauxlib.cpp.
References lua_isnumber(), LUA_TNUMBER, luaL_argerror(), and tag_error().
Referenced by luaL_checkinteger().
|
static |
Definition at line 1008 of file lauxlib.cpp.
Referenced by luaL_newstate().
|
static |
Definition at line 110 of file lauxlib.cpp.
References lua_getstack().
Referenced by luaL_traceback().
LUALIB_API void luaL_addlstring | ( | luaL_Buffer * | B, |
const char * | s, | ||
size_t | l | ||
) |
Definition at line 528 of file lauxlib.cpp.
References b, luaL_addsize, and luaL_prepbuffsize().
Referenced by add_s(), luaL_addstring(), luaL_addvalue(), luaL_gsub(), str_gsub(), str_pack(), tconcat(), and writer().
LUALIB_API void luaL_addstring | ( | luaL_Buffer * | B, |
const char * | s | ||
) |
Definition at line 537 of file lauxlib.cpp.
References luaL_addlstring().
Referenced by addquoted(), and luaL_gsub().
LUALIB_API void luaL_addvalue | ( | luaL_Buffer * | B | ) |
Definition at line 558 of file lauxlib.cpp.
References buffonstack, luaL_Buffer::L, lua_insert, lua_remove, lua_tolstring(), luaL_addlstring(), and s.
Referenced by add_s(), add_value(), addfield(), addliteral(), findloader(), searchpath(), str_format(), and utfchar().
LUALIB_API int luaL_argerror | ( | lua_State * | L, |
int | arg, | ||
const char * | extramsg | ||
) |
Definition at line 164 of file lauxlib.cpp.
References lua_getinfo(), lua_getstack(), lua_tostring, luaL_error(), lua_Debug::name, lua_Debug::namewhat, and pushglobalfuncname().
Referenced by addliteral(), ai::cfun_ai_get_suitable_keep(), checkoption(), db_getinfo(), db_getlocal(), db_setlocal(), g_read(), getdetails(), impl_add_animation(), impl_color_set(), impl_context_accessor(), lua_kernel_base::impl_game_config_set(), impl_music_set(), impl_terainfilter_set(), impl_terainmap_set(), impl_unit_attack_get(), impl_unit_attack_match(), impl_unit_attack_set(), impl_unit_attacks_get(), impl_unit_attacks_len(), impl_unit_attacks_set(), impl_unit_set(), impl_unit_status_get(), impl_unit_status_set(), impl_unit_variables_get(), impl_unit_variables_set(), lua_widget::impl_widget_get(), lua_widget::impl_widget_set(), interror(), intf_add_dialog_item(), intf_add_item_of_type(), intf_add_known_unit(), intf_add_modification(), lua_gui2::intf_add_widget_definition(), lua_fileops::intf_canonical_path(), intf_compare_versions(), intf_dialog_close(), game_lua_kernel::intf_end_turn(), game_lua_kernel::intf_erase_unit(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_find_path(), intf_find_path(), game_lua_kernel::intf_find_reach(), lua_map_location::intf_get_adjacent_tiles(), lua_map_location::intf_get_direction(), game_lua_kernel::intf_get_fog_or_shroud(), lua_map_location::intf_get_in_basis_N_NE(), intf_get_resource(), game_lua_kernel::intf_get_time_of_day(), game_lua_kernel::intf_get_unit(), game_lua_kernel::intf_get_units(), game_lua_kernel::intf_highlight_hex(), intf_invoke_synced_command(), intf_load(), lua_wml::intf_load_wml(), game_lua_kernel::intf_log_replay(), game_lua_kernel::intf_match_unit(), mapgen_gamemap::intf_mg_terrain_mask(), intf_music_add(), intf_name_generator(), game_lua_kernel::intf_put_recall_unit(), game_lua_kernel::intf_put_unit(), intf_random(), lua_fileops::intf_read_file(), intf_remove_dialog_item(), lua_kernel_base::intf_require(), game_lua_kernel::intf_select_unit(), intf_set_dialog_callback(), intf_set_dialog_canvas(), game_lua_kernel::intf_set_time_of_day(), game_lua_kernel::intf_set_variable(), game_lua_kernel::intf_shroud_op(), game_lua_kernel::intf_simulate_combat(), intf_sound_volume(), intf_synchronize_choice(), intf_synchronize_choices(), intf_terainfilter_create(), game_lua_kernel::intf_terrain_mask(), intf_transform_unit(), lua_map_location::intf_vector_negation(), lua_wml::intf_wml_merge(), load_fake_units(), lua_fileops::load_file(), lua_check_impl::lua_check(), luaL_checkany(), luaL_checkoption(), luaW_checkrace(), luaW_checkweapon(), luaW_checkwidget(), luaW_checkwidget_ptr(), luaW_table_get_def(), luaW_table_set(), luaW_type_error(), read_rules_vector(), lua_gui2::show_message_dialog(), str_format(), str_packsize(), str_unpack(), typeerror(), unit_show_error(), and WIDGET_SETTER().
LUALIB_API void luaL_buffinit | ( | lua_State * | L, |
luaL_Buffer * | B | ||
) |
Definition at line 569 of file lauxlib.cpp.
References luaL_Buffer::b, luaL_Buffer::initb, luaL_Buffer::L, LUAL_BUFFERSIZE, luaL_Buffer::n, and luaL_Buffer::size.
Referenced by findloader(), lua_fileops::intf_read_file(), luaL_buffinitsize(), luaL_gsub(), os_date(), read_all(), read_chars(), read_line(), searchpath(), str_dump(), str_format(), str_gsub(), str_pack(), tconcat(), and utfchar().
LUALIB_API char* luaL_buffinitsize | ( | lua_State * | L, |
luaL_Buffer * | B, | ||
size_t | sz | ||
) |
Definition at line 577 of file lauxlib.cpp.
References luaL_buffinit(), and luaL_prepbuffsize().
Referenced by str_char(), str_lower(), str_rep(), str_reverse(), and str_upper().
LUALIB_API int luaL_callmeta | ( | lua_State * | L, |
int | obj, | ||
const char * | event | ||
) |
Definition at line 788 of file lauxlib.cpp.
References lua_absindex(), lua_call, lua_pushvalue(), LUA_TNIL, and luaL_getmetafield().
Referenced by luaL_tolstring().
LUALIB_API void luaL_checkany | ( | lua_State * | L, |
int | arg | ||
) |
Definition at line 384 of file lauxlib.cpp.
References LUA_TNONE, lua_type(), and luaL_argerror().
Referenced by db_getmetatable(), db_setlocal(), db_setupvalue(), db_setuservalue(), io_type(), luaB_assert(), luaB_getmetatable(), luaB_ipairs(), luaB_pcall(), luaB_rawequal(), luaB_rawget(), luaB_rawset(), luaB_tonumber(), luaB_tostring(), math_toint(), math_type(), and pairsmeta().
LUALIB_API lua_Integer luaL_checkinteger | ( | lua_State * | L, |
int | arg | ||
) |
Definition at line 430 of file lauxlib.cpp.
References d, interror(), and lua_tointegerx().
Referenced by auxupvalue(), byteoffset(), checkupval(), db_getinfo(), db_getlocal(), db_setlocal(), g_read(), lua_common::impl_gettext(), impl_unit_attacks_get(), impl_unit_attacks_set(), lua_common::impl_vconfig_ipairs_iter(), lua_widget::impl_widget_get(), intf_add_item_of_type(), intf_append_ai(), intf_debug_ai(), intf_default_generate(), intf_default_generate_height_map(), intf_delay(), game_lua_kernel::intf_delay(), intf_deprecated_message(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_find_path(), intf_find_path(), game_lua_kernel::intf_find_reach(), lua_map_location::intf_get_direction(), game_lua_kernel::intf_get_side(), game_lua_kernel::intf_get_time_of_day(), game_lua_kernel::intf_is_enemy(), game_lua_kernel::intf_match_side(), intf_mg_get_tiles_radius(), intf_modify_ai(), intf_music_remove(), intf_remove_dialog_item(), lua_map_location::intf_rotate_right_around_center(), game_lua_kernel::intf_scroll(), intf_set_dialog_canvas(), game_lua_kernel::intf_set_side_id(), game_lua_kernel::intf_set_village_owner(), game_lua_kernel::intf_shroud_op(), intf_switch_ai(), ipairsaux(), l_checktime(), lua_check_impl::lua_check(), luaB_select(), luaB_tonumber(), luaL_optinteger(), math_random(), math_type(), math_ult(), pushutfchar(), str_char(), str_format(), str_pack(), str_rep(), str_sub(), tinsert(), tmove(), and unpack().
LUALIB_API const char* luaL_checklstring | ( | lua_State * | L, |
int | arg, | ||
size_t * | len | ||
) |
Definition at line 390 of file lauxlib.cpp.
References lua_tolstring(), LUA_TSTRING, s, and tag_error().
Referenced by byteoffset(), codepoint(), g_write(), gmatch(), lua_common::intf_textdomain(), iter_aux(), luaL_optlstring(), str_byte(), str_find_aux(), str_format(), str_gsub(), str_len(), str_lower(), str_pack(), str_rep(), str_reverse(), str_sub(), str_unpack(), str_upper(), and utflen().
LUALIB_API lua_Number luaL_checknumber | ( | lua_State * | L, |
int | arg | ||
) |
Definition at line 408 of file lauxlib.cpp.
References d, LUA_TNUMBER, lua_tonumberx(), and tag_error().
Referenced by impl_unit_attacks_next(), game_lua_kernel::intf_end_turn(), game_lua_kernel::intf_get_fog_or_shroud(), game_lua_kernel::intf_zoom(), lua_check_impl::lua_check(), luaL_optnumber(), math_abs(), math_acos(), math_asin(), math_atan(), math_ceil(), math_cos(), math_deg(), math_exp(), math_floor(), math_fmod(), math_log(), math_modf(), math_rad(), math_randomseed(), math_sin(), math_sqrt(), math_tan(), math_type(), str_format(), and str_pack().
LUALIB_API int luaL_checkoption | ( | lua_State * | L, |
int | arg, | ||
const char * | def, | ||
const char *const | lst[] | ||
) |
Definition at line 348 of file lauxlib.cpp.
References i, lua_pushfstring(), luaL_argerror(), luaL_checkstring, luaL_optstring, and name.
Referenced by f_seek(), f_setvbuf(), luaB_collectgarbage(), and os_setlocale().
LUALIB_API void luaL_checkstack | ( | lua_State * | L, |
int | space, | ||
const char * | msg | ||
) |
Definition at line 368 of file lauxlib.cpp.
References lua_checkstack(), and luaL_error().
Referenced by codepoint(), g_read(), generic_reader(), io_readline(), luaL_setfuncs(), luaL_traceback(), push_captures(), lua_cpp::set_functions(), str_byte(), and str_unpack().
LUALIB_API void luaL_checktype | ( | lua_State * | L, |
int | arg, | ||
int | t | ||
) |
Definition at line 378 of file lauxlib.cpp.
References lua_type(), and tag_error().
Referenced by auxupvalue(), checktab(), checkupval(), db_sethook(), db_setuservalue(), ll_require(), luaB_cocreate(), luaB_load(), luaB_next(), luaB_rawget(), luaB_rawset(), luaB_setmetatable(), luaB_tonumber(), luaB_xpcall(), os_time(), lua_gui2::show_message_dialog(), sort(), and str_dump().
LUALIB_API void* luaL_checkudata | ( | lua_State * | L, |
int | ud, | ||
const char * | tname | ||
) |
Definition at line 333 of file lauxlib.cpp.
References luaL_testudata(), p, and typeerror().
Referenced by get_track(), impl_add_animation(), impl_animator_collect(), impl_clear_animation(), lua_rng::impl_rng_draw(), lua_rng::impl_rng_seed(), game_lua_kernel::impl_run_animation(), lua_common::impl_tstring_le(), lua_common::impl_tstring_lt(), impl_unit_attack_collect(), impl_unit_type_next(), lua_common::impl_vconfig_ipairs_iter(), lua_common::impl_vconfig_pairs_iter(), impl_widget_collect(), lua_cpp::intf_closure_dispatcher(), lua_cpp::intf_dispatcher(), lua_cpp::intf_tostring(), luaW_checkunittype(), luaW_checkweapon_ref(), luaW_checkwidget(), and luaW_checkwidget_ptr().
LUALIB_API void luaL_checkversion_ | ( | lua_State * | L, |
lua_Number | ver, | ||
size_t | sz | ||
) |
Definition at line 1038 of file lauxlib.cpp.
References lua_version(), LUAI_UACNUMBER, luaL_error(), and LUAL_NUMSIZES.
LUALIB_API int luaL_error | ( | lua_State * | L, |
const char * | fmt, | ||
... | |||
) |
Definition at line 223 of file lauxlib.cpp.
References lua_concat(), lua_error(), lua_pushvfstring(), and luaL_where().
Referenced by add_s(), add_value(), addfield(), byteoffset(), capture_to_close(), check_capture(), checkload(), checkstack(), classend(), codepoint(), findfile(), findloader(), generic_reader(), getfield(), getiofile(), getnumlimit(), getoption(), impl_context_accessor(), impl_context_backend(), impl_track_get(), impl_track_set(), game_lua_kernel::intf_erase_unit(), game_lua_kernel::intf_extract_unit(), lua_map_location::intf_get_direction(), game_lua_kernel::intf_log_replay(), game_lua_kernel::intf_put_recall_unit(), game_lua_kernel::intf_put_unit(), lua_fileops::intf_read_file(), game_lua_kernel::intf_set_side_id(), lua_stringx::intf_str_join(), lua_stringx::intf_str_join_map(), lua_stringx::intf_str_map_split(), lua_stringx::intf_str_paren_split(), lua_stringx::intf_str_split(), io_readline(), iter_aux(), ll_require(), luaB_print(), luaB_setmetatable(), luaL_argerror(), luaL_checkstack(), luaL_checkversion_(), luaL_len(), luaL_prepbuffsize(), luaL_tolstring(), luaopen_bit32(), luaW_tostring(), match(), matchbalance(), math_random(), opencheck(), os_date(), os_time(), os_tmpname(), partition(), push_onecapture(), resizebox(), scanformat(), start_capture(), str_byte(), str_dump(), str_format(), str_gsub(), str_rep(), tinsert(), tofile(), unpack(), and unpackint().
LUALIB_API int luaL_execresult | ( | lua_State * | L, |
int | stat | ||
) |
Definition at line 274 of file lauxlib.cpp.
References l_inspectstat, lua_pushboolean(), lua_pushinteger(), lua_pushnil(), lua_pushstring(), and luaL_fileresult().
Referenced by io_pclose(), and os_execute().
LUALIB_API int luaL_fileresult | ( | lua_State * | L, |
int | stat, | ||
const char * | fname | ||
) |
Definition at line 234 of file lauxlib.cpp.
References lua_pushboolean(), lua_pushfstring(), lua_pushinteger(), lua_pushnil(), and lua_pushstring().
Referenced by f_flush(), f_seek(), f_setvbuf(), g_read(), g_write(), io_fclose(), io_flush(), io_open(), io_popen(), io_tmpfile(), luaL_execresult(), os_remove(), and os_rename().
LUALIB_API int luaL_getmetafield | ( | lua_State * | L, |
int | obj, | ||
const char * | event | ||
) |
Definition at line 772 of file lauxlib.cpp.
References lua_getmetatable(), lua_pop, lua_pushstring(), lua_rawget(), lua_remove, and LUA_TNIL.
Referenced by game_lua_kernel::apply_effect(), lua_kernel_base::get_attribute_names(), luaB_getmetatable(), luaB_setmetatable(), luaL_callmeta(), luaL_tolstring(), luaW_getmetafield(), pairsmeta(), and typeerror().
LUALIB_API int luaL_getsubtable | ( | lua_State * | L, |
int | idx, | ||
const char * | fname | ||
) |
Definition at line 951 of file lauxlib.cpp.
References lua_absindex(), lua_getfield(), lua_newtable, lua_pop, lua_pushvalue(), lua_setfield(), and LUA_TTABLE.
Referenced by luaL_requiref(), and luaopen_package().
LUALIB_API const char* luaL_gsub | ( | lua_State * | L, |
const char * | s, | ||
const char * | p, | ||
const char * | r | ||
) |
Definition at line 991 of file lauxlib.cpp.
References b, lua_tostring, luaL_addlstring(), luaL_addstring(), luaL_buffinit(), and luaL_pushresult().
Referenced by loadfunc(), searchpath(), and setpath().
LUALIB_API lua_Integer luaL_len | ( | lua_State * | L, |
int | idx | ||
) |
Definition at line 798 of file lauxlib.cpp.
References lua_len(), lua_pop, lua_tointegerx(), and luaL_error().
Referenced by addtoclib(), gctm(), lua_stringx::intf_str_join(), and unpack().
LUALIB_API int luaL_loadbufferx | ( | lua_State * | L, |
const char * | buff, | ||
size_t | size, | ||
const char * | name, | ||
const char * | mode | ||
) |
Definition at line 755 of file lauxlib.cpp.
References getS(), lua_load(), LoadS::s, utf8::size(), and LoadS::size.
Referenced by ai::lua_ai_context::create(), ai::lua_ai_action_handler::create(), intf_load(), lua_kernel_base::load_string(), and luaB_load().
LUALIB_API int luaL_loadfilex | ( | lua_State * | L, |
const char * | filename, | ||
const char * | mode | ||
) |
Definition at line 703 of file lauxlib.cpp.
References LoadF::buff, c, errfile(), LoadF::f, getF(), lua_gettop(), lua_load(), lua_pushfstring(), lua_pushliteral, lua_remove, lua_settop(), LUA_SIGNATURE, lua_tostring, LoadF::n, and skipcomment().
Referenced by luaB_loadfile().
LUALIB_API int luaL_loadstring | ( | lua_State * | L, |
const char * | s | ||
) |
Definition at line 764 of file lauxlib.cpp.
References luaL_loadbuffer.
Referenced by lua_kernel_base::get_attribute_names(), and application_lua_kernel::load_script_from_string().
LUALIB_API int luaL_newmetatable | ( | lua_State * | L, |
const char * | tname | ||
) |
Definition at line 299 of file lauxlib.cpp.
References lua_createtable(), lua_pop, lua_pushstring(), lua_pushvalue(), LUA_REGISTRYINDEX, lua_setfield(), LUA_TNIL, and luaL_getmetatable.
Referenced by createmeta(), lua_common::impl_vconfig_ipairs(), lua_common::impl_vconfig_pairs(), game_lua_kernel::intf_create_animator(), game_lua_kernel::intf_get_end_level_data(), lua_rng::load_tables(), lua_kernel_base::lua_kernel_base(), newbox(), 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_unit_type::register_table(), lua_audio::register_table(), lua_common::register_tstring_metatable(), and lua_common::register_vconfig_metatable().
LUALIB_API lua_State* luaL_newstate | ( | void | ) |
Definition at line 1031 of file lauxlib.cpp.
References l_alloc(), lua_atpanic(), lua_newstate(), and panic().
LUALIB_API lua_Integer luaL_optinteger | ( | lua_State * | L, |
int | arg, | ||
lua_Integer | def | ||
) |
Definition at line 440 of file lauxlib.cpp.
References luaL_checkinteger(), and luaL_opt.
Referenced by byteoffset(), codepoint(), db_sethook(), db_traceback(), f_seek(), f_setvbuf(), intf_name_generator(), luaB_collectgarbage(), luaB_error(), os_exit(), str_byte(), str_find_aux(), str_gsub(), str_sub(), str_unpack(), tconcat(), tremove(), unpack(), and utflen().
LUALIB_API const char* luaL_optlstring | ( | lua_State * | L, |
int | arg, | ||
const char * | def, | ||
size_t * | len | ||
) |
Definition at line 397 of file lauxlib.cpp.
References lua_isnoneornil, and luaL_checklstring().
Referenced by game_lua_kernel::intf_set_side_id(), os_date(), str_rep(), and tconcat().
LUALIB_API lua_Number luaL_optnumber | ( | lua_State * | L, |
int | arg, | ||
lua_Number | def | ||
) |
Definition at line 417 of file lauxlib.cpp.
References luaL_checknumber(), and luaL_opt.
Referenced by math_atan().
LUALIB_API char* luaL_prepbuffsize | ( | luaL_Buffer * | B, |
size_t | sz | ||
) |
Definition at line 505 of file lauxlib.cpp.
References luaL_Buffer::b, buffonstack, luaL_Buffer::L, luaL_error(), n, luaL_Buffer::n, newbox(), resizebox(), and luaL_Buffer::size.
Referenced by addliteral(), lua_fileops::intf_read_file(), luaL_addlstring(), luaL_buffinitsize(), os_date(), packint(), read_chars(), str_format(), and str_pack().
LUALIB_API void luaL_pushresult | ( | luaL_Buffer * | B | ) |
Definition at line 542 of file lauxlib.cpp.
References luaL_Buffer::b, buffonstack, luaL_Buffer::L, lua_pushlstring(), lua_remove, luaL_Buffer::n, and resizebox().
Referenced by findloader(), lua_fileops::intf_read_file(), luaL_gsub(), luaL_pushresultsize(), os_date(), read_all(), read_chars(), read_line(), searchpath(), str_dump(), str_format(), str_gsub(), str_pack(), tconcat(), and utfchar().
LUALIB_API void luaL_pushresultsize | ( | luaL_Buffer * | B, |
size_t | sz | ||
) |
Definition at line 552 of file lauxlib.cpp.
References luaL_addsize, and luaL_pushresult().
Referenced by str_char(), str_lower(), str_rep(), str_reverse(), and str_upper().
LUALIB_API int luaL_ref | ( | lua_State * | L, |
int | t | ||
) |
Definition at line 595 of file lauxlib.cpp.
References freelist, lua_absindex(), lua_isnil, lua_pop, lua_rawgeti(), lua_rawlen(), lua_rawseti(), LUA_REFNIL, and lua_tointeger.
Referenced by ai::lua_object< T >::to_type(), and ai::unit_advancements_aspect::unit_advancements_aspect().
LUALIB_API void luaL_requiref | ( | lua_State * | L, |
const char * | modname, | ||
lua_CFunction | openf, | ||
int | glb | ||
) |
Definition at line 971 of file lauxlib.cpp.
References lua_call, lua_getfield(), LUA_LOADED_TABLE, lua_pop, lua_pushcfunction, lua_pushstring(), lua_pushvalue(), LUA_REGISTRYINDEX, lua_remove, lua_setfield(), lua_setglobal(), lua_toboolean(), and luaL_getsubtable().
Referenced by lua_kernel_base::lua_kernel_base().
LUALIB_API void luaL_setfuncs | ( | lua_State * | L, |
const luaL_Reg * | l, | ||
int | nup | ||
) |
Definition at line 934 of file lauxlib.cpp.
References luaL_Reg::func, i, lua_pop, lua_pushcclosure(), lua_pushvalue(), lua_setfield(), luaL_checkstack(), and luaL_Reg::name.
Referenced by createmeta(), game_lua_kernel::game_lua_kernel(), game_lua_kernel::intf_create_animator(), game_lua_kernel::intf_get_end_level_data(), lua_rng::load_tables(), lua_kernel_base::lua_kernel_base(), luaL_tolstring(), luaopen_base(), luaopen_package(), lua_wml::luaW_open(), lua_gui2::luaW_open(), lua_stringx::luaW_open(), lua_widget::luaW_open(), mapgen_lua_kernel::mapgen_lua_kernel(), lua_common::register_gettext_metatable(), lua_race::register_metatable(), lua_audio::register_table(), lua_common::register_tstring_metatable(), and lua_common::register_vconfig_metatable().
LUALIB_API void luaL_setmetatable | ( | lua_State * | L, |
const char * | tname | ||
) |
Definition at line 312 of file lauxlib.cpp.
References lua_setmetatable(), and luaL_getmetatable.
Referenced by lua_rng::impl_rng_create(), impl_side_get(), lua_common::impl_tstring_concat(), impl_unit_type_get(), lua_formula_bridge::intf_compile_formula(), lua_common::intf_textdomain(), lua_mgfilter_setmetatable(), lua_slocs_setmetatable(), lua_terrainmap_setmetatable(), luaW_pushcolor(), luaW_pushrace(), luaW_pushslocs(), luaW_pushtstring(), luaW_pushunittype(), luaW_pushvconfig(), luaW_pushweapon(), luaW_pushwidget(), newprefile(), lua_cpp::push_function(), push_track(), push_unit_attacks_table(), and lua_unit::setmetatable().
LUALIB_API void* luaL_testudata | ( | lua_State * | L, |
int | ud, | ||
const char * | tname | ||
) |
Definition at line 318 of file lauxlib.cpp.
References lua_getmetatable(), lua_pop, lua_rawequal(), lua_touserdata(), luaL_getmetatable, and p.
Referenced by lua_rng::impl_rng_destroy(), impl_unit_type_lookup(), lua_cpp::intf_cleanup(), lua_formula_bridge::intf_eval_formula(), io_type(), luaL_checkudata(), luaW_checkconfig(), luaW_checkvariable(), luaW_is_mgfilter(), luaW_iscolor(), luaW_isslocs(), luaW_isterrainmap(), luaW_iststring(), luaW_isunit(), luaW_iswidget(), luaW_toconfig(), luaW_toscalar(), luaW_totstring(), luaW_tounittype(), luaW_tovconfig(), luaW_toweapon(), and lua_common::tstring_concat_aux().
LUALIB_API const char* luaL_tolstring | ( | lua_State * | L, |
int | idx, | ||
size_t * | len | ||
) |
Definition at line 810 of file lauxlib.cpp.
References e, lua_createtable(), lua_getfield(), lua_insert, lua_isinteger(), lua_isstring(), lua_istable, LUA_LOADED_TABLE, lua_pop, lua_pushfstring(), lua_pushglobaltable, lua_pushliteral, lua_pushlstring(), lua_pushstring(), lua_pushvalue(), lua_rawget(), LUA_REGISTRYINDEX, lua_remove, lua_setfield(), lua_settable(), LUA_TBOOLEAN, LUA_TNIL, LUA_TNUMBER, lua_toboolean(), lua_tointeger, lua_tolstring(), lua_tonumber, lua_topointer(), lua_tostring, LUA_TSTRING, LUA_TTABLE, lua_type(), LUAI_UACINT, LUAI_UACNUMBER, luaL_callmeta(), luaL_checkversion, luaL_error(), luaL_getmetafield(), luaL_setfuncs(), luaL_typename, LUALIB_API, luaL_Reg::name, and utf8::size().
Referenced by add_s(), addliteral(), luaB_tostring(), and str_format().
LUALIB_API void luaL_traceback | ( | lua_State * | L, |
lua_State * | L1, | ||
const char * | msg, | ||
int | level | ||
) |
Definition at line 125 of file lauxlib.cpp.
References lua_Debug::currentline, lua_Debug::istailcall, lastlevel(), LEVELS1, LEVELS2, lua_concat(), lua_getinfo(), lua_getstack(), lua_gettop(), lua_pushfstring(), lua_pushliteral, luaL_checkstack(), pushfuncname(), and lua_Debug::short_src.
Referenced by db_traceback().
LUALIB_API void luaL_unref | ( | lua_State * | L, |
int | t, | ||
int | ref | ||
) |
Definition at line 616 of file lauxlib.cpp.
References freelist, lua_absindex(), lua_pushinteger(), lua_rawgeti(), and lua_rawseti().
Referenced by ai::aspect_attacks_lua::recalculate(), and ai::unit_advancements_aspect::~unit_advancements_aspect().
LUALIB_API void luaL_where | ( | lua_State * | L, |
int | level | ||
) |
Definition at line 205 of file lauxlib.cpp.
References lua_Debug::currentline, lua_getinfo(), lua_getstack(), lua_pushfstring(), and lua_Debug::short_src.
Referenced by luaB_auxwrap(), luaB_error(), and luaL_error().
|
static |
Definition at line 482 of file lauxlib.cpp.
References UBox::box, boxgc(), UBox::bsize, lua_newuserdata(), lua_pushcfunction, lua_setfield(), lua_setmetatable(), luaL_newmetatable(), and resizebox().
Referenced by luaL_prepbuffsize().
|
static |
Definition at line 1024 of file lauxlib.cpp.
References lua_tostring, and lua_writestringerror.
Referenced by luaL_newstate().
Definition at line 94 of file lauxlib.cpp.
References lua_Debug::linedefined, lua_pushfstring(), lua_pushliteral, lua_remove, lua_tostring, lua_Debug::name, lua_Debug::namewhat, pushglobalfuncname(), lua_Debug::short_src, and lua_Debug::what.
Referenced by luaL_traceback().
Definition at line 73 of file lauxlib.cpp.
References findfield(), lua_copy(), lua_getfield(), lua_getinfo(), lua_gettop(), LUA_LOADED_TABLE, lua_pop, lua_pushstring(), LUA_REGISTRYINDEX, lua_remove, lua_settop(), lua_tostring, and name.
Referenced by luaL_argerror(), and pushfuncname().
|
static |
Definition at line 461 of file lauxlib.cpp.
References UBox::box, UBox::bsize, lua_getallocf(), lua_touserdata(), and luaL_error().
Referenced by boxgc(), luaL_prepbuffsize(), luaL_pushresult(), and newbox().
|
static |
Definition at line 669 of file lauxlib.cpp.
References LoadF::buff, c, LoadF::f, LoadF::n, and p.
Referenced by skipcomment().
|
static |
Definition at line 690 of file lauxlib.cpp.
References c, LoadF::f, and skipBOM().
Referenced by luaL_loadfilex().
|
static |
Definition at line 196 of file lauxlib.cpp.
References lua_typename(), and typeerror().
Referenced by interror(), luaL_checklstring(), luaL_checknumber(), and luaL_checktype().
|
static |
Definition at line 182 of file lauxlib.cpp.
References lua_pushfstring(), LUA_TLIGHTUSERDATA, lua_tostring, LUA_TSTRING, lua_type(), luaL_argerror(), luaL_getmetafield(), luaL_typename, and wfl::msg().
Referenced by luaL_checkudata(), and tag_error().