summaryrefslogtreecommitdiff
path: root/src/ltable.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ltable.h')
-rw-r--r--src/ltable.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ltable.h b/src/ltable.h
index 2f6f5c2d..d69449b2 100644
--- a/src/ltable.h
+++ b/src/ltable.h
@@ -1,5 +1,5 @@
/*
-** $Id: ltable.h,v 2.16 2011/08/17 20:26:47 roberto Exp $
+** $Id: ltable.h,v 2.16.1.2 2013/08/30 15:49:41 roberto Exp $
** Lua tables (hash)
** See Copyright Notice in lua.h
*/
@@ -17,6 +17,10 @@
#define invalidateTMcache(t) ((t)->flags = 0)
+/* returns the key, given the value of a table entry */
+#define keyfromval(v) \
+ (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val))))
+
LUAI_FUNC const TValue *luaH_getint (Table *t, int key);
LUAI_FUNC void luaH_setint (lua_State *L, Table *t, int key, TValue *value);