1/*	$NetBSD$	*/
2
3/*
4** Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 roberto Exp
5** Lua tables (hash)
6** See Copyright Notice in lua.h
7*/
8
9#ifndef ltable_h
10#define ltable_h
11
12#include "lobject.h"
13
14
15#define gnode(t,i)	(&(t)->node[i])
16#define gkey(n)		(&(n)->i_key.nk)
17#define gval(n)		(&(n)->i_val)
18#define gnext(n)	((n)->i_key.nk.next)
19
20#define key2tval(n)	(&(n)->i_key.tvk)
21
22
23LUAI_FUNC const TValue *luaH_getnum (Table *t, int key);
24LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key);
25LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
26LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key);
27LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
28LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key);
29LUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash);
30LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize);
31LUAI_FUNC void luaH_free (lua_State *L, Table *t);
32LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
33LUAI_FUNC int luaH_getn (Table *t);
34
35
36#if defined(LUA_DEBUG)
37LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
38LUAI_FUNC int luaH_isdummy (Node *n);
39#endif
40
41
42#endif
43