]> git.proxmox.com Git - mirror_zfs.git/blame - module/lua/ltable.h
Prevent user accounting on readonly pool
[mirror_zfs.git] / module / lua / ltable.h
CommitLineData
d99a0153
CW
1/* BEGIN CSTYLED */
2/*
3** $Id: ltable.h,v 2.16.1.2 2013/08/30 15:49:41 roberto Exp $
4** Lua tables (hash)
5** See Copyright Notice in lua.h
6*/
7
8#ifndef ltable_h
9#define ltable_h
10
11#include "lobject.h"
12
13
cbce5813 14#define gnode(t,i) ((Node *)&(t)->node[i])
d99a0153
CW
15#define gkey(n) (&(n)->i_key.tvk)
16#define gval(n) (&(n)->i_val)
17#define gnext(n) ((n)->i_key.nk.next)
18
19#define invalidateTMcache(t) ((t)->flags = 0)
20
21/* returns the key, given the value of a table entry */
22#define keyfromval(v) \
23 (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val))))
24
25
26LUAI_FUNC const TValue *luaH_getint (Table *t, int key);
27LUAI_FUNC void luaH_setint (lua_State *L, Table *t, int key, TValue *value);
28LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
29LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
30LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key);
31LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key);
32LUAI_FUNC Table *luaH_new (lua_State *L);
33LUAI_FUNC void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize);
34LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize);
35LUAI_FUNC void luaH_free (lua_State *L, Table *t);
36LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
37LUAI_FUNC int luaH_getn (Table *t);
38
39
40#if defined(LUA_DEBUG)
41LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
42LUAI_FUNC int luaH_isdummy (Node *n);
43#endif
44
45
46#endif
47/* END CSTYLED */