#include "lprefix.h"
#include <limits.h>
#include <stddef.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
#include <time.h>
Go to the source code of this file.
Macros | |
#define | ltablib_c |
#define | LUA_LIB |
#define | TAB_R 1 /* read */ |
#define | TAB_W 2 /* write */ |
#define | TAB_L 4 /* length */ |
#define | TAB_RW (TAB_R | TAB_W) /* read/write */ |
#define | aux_getn(L, n, w) (checktab(L, n, (w) | TAB_L), luaL_len(L, n)) |
#define | sof(e) (sizeof(e) / sizeof(unsigned int)) |
#define | RANLIMIT 100u |
Typedefs | |
typedef unsigned int | IdxT |
Functions | |
static int | checkfield (lua_State *L, const char *key, int n) |
static void | checktab (lua_State *L, int arg, int what) |
static int | tinsert (lua_State *L) |
static int | tremove (lua_State *L) |
static int | tmove (lua_State *L) |
static void | addfield (lua_State *L, luaL_Buffer *b, lua_Integer i) |
static int | tconcat (lua_State *L) |
static int | tpack (lua_State *L) |
static int | tunpack (lua_State *L) |
static unsigned int | l_randomizePivot (void) |
static void | set2 (lua_State *L, IdxT i, IdxT j) |
static int | sort_comp (lua_State *L, int a, int b) |
static IdxT | partition (lua_State *L, IdxT lo, IdxT up) |
static IdxT | choosePivot (IdxT lo, IdxT up, unsigned int rnd) |
static void | auxsort (lua_State *L, IdxT lo, IdxT up, unsigned int rnd) |
static int | sort (lua_State *L) |
LUAMOD_API int | luaopen_table (lua_State *L) |
Variables | |
static const luaL_Reg | tab_funcs [] |
#define ltablib_c |
Definition at line 7 of file ltablib.cpp.
#define LUA_LIB |
Definition at line 8 of file ltablib.cpp.
#define RANLIMIT 100u |
Definition at line 260 of file ltablib.cpp.
Referenced by auxsort().
Definition at line 236 of file ltablib.cpp.
Referenced by l_randomizePivot().
#define TAB_L 4 /* length */ |
Definition at line 29 of file ltablib.cpp.
Referenced by checktab().
#define TAB_R 1 /* read */ |
Definition at line 27 of file ltablib.cpp.
Referenced by checktab(), tconcat(), and tmove().
Definition at line 30 of file ltablib.cpp.
#define TAB_W 2 /* write */ |
Definition at line 28 of file ltablib.cpp.
Referenced by checktab(), and tmove().
typedef unsigned int IdxT |
Definition at line 222 of file ltablib.cpp.
|
static |
Definition at line 146 of file ltablib.cpp.
References lua_geti(), lua_isstring(), luaL_addvalue(), luaL_error(), and luaL_typename.
Referenced by tconcat().
Definition at line 343 of file ltablib.cpp.
References choosePivot(), l_randomizePivot(), lua_geti(), lua_pop, lua_pushvalue(), n, p, partition(), RANLIMIT, set2(), and sort_comp().
Referenced by sort().
|
static |
Definition at line 36 of file ltablib.cpp.
References lua_pushstring(), lua_rawget(), and LUA_TNIL.
Referenced by checktab().
|
static |
Definition at line 46 of file ltablib.cpp.
References checkfield(), lua_getmetatable(), lua_pop, LUA_TTABLE, lua_type(), luaL_checktype(), n, TAB_L, TAB_R, and TAB_W.
Referenced by tmove().
|
static |
LUAMOD_API int luaopen_table | ( | lua_State * | L | ) |
Definition at line 424 of file ltablib.cpp.
References luaL_newlib.
Referenced by lua_kernel_base::lua_kernel_base().
Definition at line 296 of file ltablib.cpp.
References i, lua_geti(), lua_pop, luaL_error(), set2(), and sort_comp().
Referenced by auxsort(), and pathfind::find_routes().
Definition at line 263 of file ltablib.cpp.
References lua_seti().
Referenced by auxsort(), and partition().
|
static |
Definition at line 397 of file ltablib.cpp.
References aux_getn, auxsort(), lua_isnoneornil, lua_settop(), LUA_TFUNCTION, luaL_argcheck, luaL_checktype(), n, and TAB_RW.
Referenced by preferences::advanced_manager::advanced_manager(), ng::connect_engine::connect_engine(), about::credits_group::credits_group(), wfl::builtins::DEFINE_WFL_FUNCTION(), events::console_handler::do_choose_level(), ai::ai_default_rca::candidate_action_evaluation_loop::do_play_stage(), unit_filter_impl::unit_filter_compound::fill(), mp::game_info::game_info(), help::generate_ability_topics(), help::generate_contents_links(), help::generate_era_topics(), help::generate_faction_topics(), help::generate_trait_topics(), help::generate_unit_topics(), help::generate_weapon_special_topics(), CVideo::get_available_resolutions(), wfl::function_symbol_table::get_builtins(), filesystem::get_files_in_dir(), gui2::dialogs::attack_predictions::get_hitpoint_probabilities(), get_languages(), filesystem::get_logs_dir(), unit::get_modification_advances(), savegame::save_index_class::get_saves_list(), gui2::dialogs::title_screen::hotkey_callback_select_tests(), help::make_unit_links_list(), gui::menu::max_items_onscreen(), gui2::dialogs::faction_select::on_faction_select(), help::parse_config_internal(), metrics::requests(), gui2::dialogs::campaign_selection::sort_campaigns(), terrain_type::terrain_type(), gui2::dialogs::unit_recruit::unit_recruit(), unit_weapons(), ng::flg_manager::update_choosable_leaders(), and schema_validation::schema_self_validator::validate().
|
static |
Definition at line 273 of file ltablib.cpp.
References lua_call, lua_compare(), lua_isnil, LUA_OPLT, lua_pop, lua_pushvalue(), and lua_toboolean().
Referenced by auxsort(), and partition().
|
static |
Definition at line 155 of file ltablib.cpp.
References addfield(), aux_getn, b, i, luaL_addlstring(), luaL_buffinit(), luaL_optinteger(), luaL_optlstring(), luaL_pushresult(), and TAB_R.
|
static |
Definition at line 61 of file ltablib.cpp.
References aux_getn, e, i, lua_geti(), lua_gettop(), lua_seti(), luaL_argcheck, luaL_checkinteger(), luaL_error(), and TAB_RW.
|
static |
Definition at line 114 of file ltablib.cpp.
References checktab(), e, f, i, lua_compare(), lua_geti(), lua_isnoneornil, LUA_OPEQ, lua_pushvalue(), lua_seti(), luaL_argcheck, luaL_checkinteger(), n, t, TAB_R, and TAB_W.
|
static |
Definition at line 180 of file ltablib.cpp.
References i, lua_createtable(), lua_gettop(), lua_insert, lua_pushinteger(), lua_setfield(), lua_seti(), and n.
|
static |
Definition at line 90 of file ltablib.cpp.
References aux_getn, lua_geti(), lua_pushnil(), lua_seti(), luaL_argcheck, luaL_optinteger(), utf8::size(), and TAB_RW.
|
static |
Definition at line 193 of file ltablib.cpp.
References e, i, lua_checkstack(), lua_geti(), luaL_checkinteger(), luaL_error(), luaL_len(), luaL_opt, luaL_optinteger(), and n.