Github User Fetcher 1.0.0
C Application with Server and GUI
|
#include <math.h>
#include <string.h>
#include "lua.h"
#include "ldebug.h"
#include "ldo.h"
#include "lgc.h"
#include "lmem.h"
#include "lobject.h"
#include "lstate.h"
#include "ltable.h"
Go to the source code of this file.
Macros | |
#define | ltable_c |
#define | LUA_CORE |
#define | MAXBITS (LUAI_BITSINT-2) |
#define | MAXASIZE (1 << MAXBITS) |
#define | hashpow2(t, n) (gnode(t, lmod((n), sizenode(t)))) |
#define | hashstr(t, str) hashpow2(t, (str)->tsv.hash) |
#define | hashboolean(t, p) hashpow2(t, p) |
#define | hashmod(t, n) (gnode(t, ((n) % ((sizenode(t)-1)|1)))) |
#define | hashpointer(t, p) hashmod(t, IntPoint(p)) |
#define | numints cast_int(sizeof(lua_Number)/sizeof(int)) |
#define | dummynode (&dummynode_) |
Functions | |
static Node * | hashnum (const Table *t, lua_Number n) |
static Node * | mainposition (const Table *t, const TValue *key) |
static int | arrayindex (const TValue *key) |
static int | findindex (lua_State *L, Table *t, StkId key) |
int | luaH_next (lua_State *L, Table *t, StkId key) |
static int | computesizes (int nums[], int *narray) |
static int | countint (const TValue *key, int *nums) |
static int | numusearray (const Table *t, int *nums) |
static int | numusehash (const Table *t, int *nums, int *pnasize) |
static void | setarrayvector (lua_State *L, Table *t, int size) |
static void | setnodevector (lua_State *L, Table *t, int size) |
static void | resize (lua_State *L, Table *t, int nasize, int nhsize) |
void | luaH_resizearray (lua_State *L, Table *t, int nasize) |
static void | rehash (lua_State *L, Table *t, const TValue *ek) |
Table * | luaH_new (lua_State *L, int narray, int nhash) |
void | luaH_free (lua_State *L, Table *t) |
static Node * | getfreepos (Table *t) |
static TValue * | newkey (lua_State *L, Table *t, const TValue *key) |
const TValue * | luaH_getnum (Table *t, int key) |
const TValue * | luaH_getstr (Table *t, TString *key) |
const TValue * | luaH_get (Table *t, const TValue *key) |
TValue * | luaH_set (lua_State *L, Table *t, const TValue *key) |
TValue * | luaH_setnum (lua_State *L, Table *t, int key) |
TValue * | luaH_setstr (lua_State *L, Table *t, TString *key) |
static int | unbound_search (Table *t, unsigned int j) |
int | luaH_getn (Table *t) |
Variables | |
static const Node | dummynode_ |
#define dummynode (&dummynode_) |
Definition at line 73 of file lua-5.1.5/src/ltable.c.
Referenced by luaH_free(), luaH_getn(), luaH_new(), luaH_resizearray(), newkey(), resize(), and setnodevector().
#define hashboolean | ( | t, | |
p ) hashpow2(t, p) |
Definition at line 53 of file lua-5.1.5/src/ltable.c.
Referenced by mainposition().
Definition at line 60 of file lua-5.1.5/src/ltable.c.
Referenced by hashnum().
Definition at line 63 of file lua-5.1.5/src/ltable.c.
Referenced by mainposition().
Definition at line 50 of file lua-5.1.5/src/ltable.c.
#define hashstr | ( | t, | |
str ) hashpow2(t, (str)->tsv.hash) |
Definition at line 52 of file lua-5.1.5/src/ltable.c.
Referenced by luaH_getstr(), and mainposition().
#define ltable_c |
Definition at line 24 of file lua-5.1.5/src/ltable.c.
#define LUA_CORE |
Definition at line 25 of file lua-5.1.5/src/ltable.c.
#define MAXASIZE (1 << MAXBITS) |
Definition at line 47 of file lua-5.1.5/src/ltable.c.
Referenced by countint().
#define MAXBITS (LUAI_BITSINT-2) |
Definition at line 44 of file lua-5.1.5/src/ltable.c.
Referenced by numusearray(), rehash(), and setnodevector().
#define numints cast_int(sizeof(lua_Number)/sizeof(int)) |
Definition at line 69 of file lua-5.1.5/src/ltable.c.
Referenced by hashnum().
|
static |
Definition at line 120 of file lua-5.1.5/src/ltable.c.
References cast_num, lua_number2int, luai_numeq, nvalue, and ttisnumber.
Referenced by countint(), and findindex().
|
static |
Definition at line 189 of file lua-5.1.5/src/ltable.c.
References lua_assert.
Referenced by rehash().
|
static |
Definition at line 211 of file lua-5.1.5/src/ltable.c.
References arrayindex(), ceillog2, and MAXASIZE.
Referenced by numusehash(), and rehash().
Definition at line 137 of file lua-5.1.5/src/ltable.c.
References arrayindex(), cast_int, gcvalue, gkey, gnext, gnode, iscollectable, key2tval, LUA_QL, LUA_TDEADKEY, luaG_runerror(), luaO_rawequalObj(), mainposition(), Table::sizearray, ttisnil, and ttype.
Referenced by luaH_next().
Definition at line 382 of file lua-5.1.5/src/ltable.c.
References gkey, Table::lastfree, Table::node, NULL, and ttisnil.
Referenced by newkey().
|
static |
Definition at line 84 of file lua-5.1.5/src/ltable.c.
References gnode, hashmod, luai_numeq, and numints.
Referenced by luaH_getnum(), and mainposition().
Definition at line 374 of file lua-5.1.5/src/ltable.c.
References Table::array, dummynode, luaM_free, luaM_freearray, Table::node, Table::sizearray, and sizenode.
Referenced by freeobj(), freeobj(), freeobj(), and freeobj().
Definition at line 469 of file lua-5.1.5/src/ltable.c.
References cast_num, gnext, gval, key2tval, lua_number2int, LUA_TNIL, LUA_TNUMBER, LUA_TSTRING, luaH_getnum(), luaH_getstr(), luai_numeq, luaO_nilobject, luaO_rawequalObj(), mainposition(), nvalue, rawtsvalue, and ttype.
Referenced by addk(), lua_gettable(), lua_rawget(), lua_rawgetp(), lua_settable(), luaH_set(), luaV_execute(), luaV_finishget(), luaV_finishset(), luaV_finishset(), luaV_gettable(), and luaV_settable().
int luaH_getn | ( | Table * | t | ) |
Definition at line 560 of file lua-5.1.5/src/ltable.c.
References Table::array, dummynode, Table::node, Table::sizearray, ttisnil, and unbound_search().
Referenced by lua_objlen(), lua_rawlen(), luaV_execute(), and luaV_objlen().
Definition at line 435 of file lua-5.1.5/src/ltable.c.
References Table::array, cast, cast_num, gkey, gnext, gval, hashnum(), luai_numeq, luaO_nilobject, nvalue, Table::sizearray, and ttisnumber.
Referenced by lua_rawgeti(), luaH_get(), luaH_setnum(), and unbound_search().
Definition at line 455 of file lua-5.1.5/src/ltable.c.
References gkey, gnext, gval, hashstr, luaO_nilobject, rawtsvalue, and ttisstring.
Referenced by auxgetstr(), auxgetstr(), auxsetstr(), auxsetstr(), luaH_get(), luaH_setstr(), luaT_gettm(), luaT_gettmbyobj(), luaV_execute(), luaV_execute(), and luaX_newstring().
Definition at line 358 of file lua-5.1.5/src/ltable.c.
References Table::array, cast, cast_byte, dummynode, Table::flags, Table::lsizenode, LUA_TTABLE, luaC_link(), luaM_new, Table::metatable, Table::node, NULL, obj2gco, setarrayvector(), setnodevector(), and Table::sizearray.
Referenced by adjust_varargs(), collectvalidlines(), collectvalidlines(), collectvalidlines(), collectvalidlines(), f_luaopen(), init_registry(), init_registry(), init_registry(), lua_createtable(), luaV_execute(), luaV_execute(), luaV_execute(), luaY_parser(), open_func(), and open_func().
Definition at line 162 of file lua-5.1.5/src/ltable.c.
References Table::array, cast_num, findindex(), gnode, gval, key2tval, setnvalue, setobj2s, Table::sizearray, sizenode, and ttisnil.
Referenced by lua_next().
Definition at line 327 of file lua-5.1.5/src/ltable.c.
References dummynode, Table::node, resize(), and sizenode.
Referenced by luaV_execute(), luaV_execute(), and luaV_execute().
Definition at line 494 of file lua-5.1.5/src/ltable.c.
References cast, Table::flags, luaG_runerror(), luaH_get(), luai_numisnan, luaO_nilobject, newkey(), nvalue, ttisnil, and ttisnumber.
Referenced by addk(), addk(), addk(), aux_rawset(), lua_rawset(), lua_rawsetp(), luaV_settable(), luaX_newstring(), newkey(), and resize().
Definition at line 508 of file lua-5.1.5/src/ltable.c.
References cast, cast_num, luaH_getnum(), luaO_nilobject, newkey(), and setnvalue.
Referenced by adjust_varargs(), collectvalidlines(), lua_rawseti(), luaV_execute(), and resize().
Definition at line 520 of file lua-5.1.5/src/ltable.c.
References cast, luaH_getstr(), luaO_nilobject, newkey(), and setsvalue.
Referenced by adjust_varargs(), and luaX_newstring().
Definition at line 100 of file lua-5.1.5/src/ltable.c.
References bvalue, gcvalue, hashboolean, hashnum(), hashpointer, hashstr, LUA_TBOOLEAN, LUA_TLIGHTUSERDATA, LUA_TNUMBER, LUA_TSTRING, nvalue, pvalue, rawtsvalue, and ttype.
Referenced by findindex(), luaH_get(), and newkey().
Definition at line 399 of file lua-5.1.5/src/ltable.c.
References dummynode, getfreepos(), gkey, gnext, gval, key2tval, lua_assert, luaC_barriert, luaH_set(), mainposition(), NULL, rehash(), setnilvalue, and ttisnil.
Referenced by luaH_set(), luaH_setnum(), and luaH_setstr().
|
static |
Definition at line 222 of file lua-5.1.5/src/ltable.c.
References Table::array, MAXBITS, Table::sizearray, and ttisnil.
Referenced by rehash().
|
static |
Definition at line 247 of file lua-5.1.5/src/ltable.c.
References countint(), gval, key2tval, Table::node, sizenode, and ttisnil.
Referenced by rehash().
Definition at line 333 of file lua-5.1.5/src/ltable.c.
References computesizes(), countint(), MAXBITS, numusearray(), numusehash(), and resize().
Referenced by newkey().
Definition at line 297 of file lua-5.1.5/src/ltable.c.
References Table::array, dummynode, gval, key2tval, Table::lsizenode, luaH_set(), luaH_setnum(), luaM_freearray, luaM_reallocvector, Table::node, setarrayvector(), setnodevector(), setobjt2t, Table::sizearray, ttisnil, and twoto.
Referenced by luaH_resizearray(), and rehash().
Definition at line 263 of file lua-5.1.5/src/ltable.c.
References Table::array, luaM_reallocvector, setnilvalue, and Table::sizearray.
Referenced by luaH_new(), and resize().
Definition at line 272 of file lua-5.1.5/src/ltable.c.
References cast, cast_byte, ceillog2, dummynode, gkey, gnext, gnode, gval, Table::lastfree, Table::lsizenode, luaG_runerror(), luaM_newvector, MAXBITS, Table::node, NULL, setnilvalue, and twoto.
Referenced by luaH_new(), and resize().
|
static |
Definition at line 532 of file lua-5.1.5/src/ltable.c.
References cast, luaH_getnum(), MAX_INT, and ttisnil.
Referenced by luaH_getn().