aboutsummaryrefslogtreecommitdiff
path: root/tests/lua/src/lfunc.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-04-29 13:53:27 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-04-29 13:53:27 -0700
commitaa62072c9b7dcc3b650af9fe24f23853c688d07b (patch)
tree0e7ec6479d598cf63cc4ac36cd6e6dc99dc190d3 /tests/lua/src/lfunc.h
parent3b6735c64c450e50ec948c07bf9ddbe4a68a87dc (diff)
make lua test build from source
Diffstat (limited to 'tests/lua/src/lfunc.h')
-rw-r--r--tests/lua/src/lfunc.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/lua/src/lfunc.h b/tests/lua/src/lfunc.h
new file mode 100644
index 00000000..e236a717
--- /dev/null
+++ b/tests/lua/src/lfunc.h
@@ -0,0 +1,33 @@
+/*
+** $Id: lfunc.h,v 2.8 2012/05/08 13:53:33 roberto Exp $
+** Auxiliary functions to manipulate prototypes and closures
+** See Copyright Notice in lua.h
+*/
+
+#ifndef lfunc_h
+#define lfunc_h
+
+
+#include "lobject.h"
+
+
+#define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \
+ cast(int, sizeof(TValue)*((n)-1)))
+
+#define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \
+ cast(int, sizeof(TValue *)*((n)-1)))
+
+
+LUAI_FUNC Proto *luaF_newproto (lua_State *L);
+LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems);
+LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems);
+LUAI_FUNC UpVal *luaF_newupval (lua_State *L);
+LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
+LUAI_FUNC void luaF_close (lua_State *L, StkId level);
+LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);
+LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv);
+LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,
+ int pc);
+
+
+#endif