1eda14cbcSMatt Macy /* 2eda14cbcSMatt Macy ** $Id: lfunc.h,v 2.8.1.1 2013/04/12 18:48:47 roberto Exp $ 3eda14cbcSMatt Macy ** Auxiliary functions to manipulate prototypes and closures 4eda14cbcSMatt Macy ** See Copyright Notice in lua.h 5eda14cbcSMatt Macy */ 6eda14cbcSMatt Macy 7eda14cbcSMatt Macy #ifndef lfunc_h 8eda14cbcSMatt Macy #define lfunc_h 9eda14cbcSMatt Macy 10eda14cbcSMatt Macy 11eda14cbcSMatt Macy #include "lobject.h" 12eda14cbcSMatt Macy 13eda14cbcSMatt Macy 14eda14cbcSMatt Macy #define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ 15*15f0b8c3SMartin Matuska cast(int, sizeof(TValue)*((n)))) 16eda14cbcSMatt Macy 17eda14cbcSMatt Macy #define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ 18*15f0b8c3SMartin Matuska cast(int, sizeof(TValue *)*((n)))) 19eda14cbcSMatt Macy 20eda14cbcSMatt Macy 21eda14cbcSMatt Macy LUAI_FUNC Proto *luaF_newproto (lua_State *L); 22eda14cbcSMatt Macy LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems); 23eda14cbcSMatt Macy LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems); 24eda14cbcSMatt Macy LUAI_FUNC UpVal *luaF_newupval (lua_State *L); 25eda14cbcSMatt Macy LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); 26eda14cbcSMatt Macy LUAI_FUNC void luaF_close (lua_State *L, StkId level); 27eda14cbcSMatt Macy LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); 28eda14cbcSMatt Macy LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv); 29eda14cbcSMatt Macy LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, 30eda14cbcSMatt Macy int pc); 31eda14cbcSMatt Macy 32eda14cbcSMatt Macy 33eda14cbcSMatt Macy #endif 34