rlm@1: /* rlm@1: ** $Id: lfunc.h,v 2.4.1.1 2007/12/27 13:02:25 roberto Exp $ rlm@1: ** Auxiliary functions to manipulate prototypes and closures rlm@1: ** See Copyright Notice in lua.h rlm@1: */ rlm@1: rlm@1: #ifndef lfunc_h rlm@1: #define lfunc_h rlm@1: rlm@1: rlm@1: #include "lobject.h" rlm@1: rlm@1: rlm@1: #define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ rlm@1: cast(int, sizeof(TValue)*((n)-1))) rlm@1: rlm@1: #define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ rlm@1: cast(int, sizeof(TValue *)*((n)-1))) rlm@1: rlm@1: rlm@1: LUAI_FUNC Proto *luaF_newproto (lua_State *L); rlm@1: LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e); rlm@1: LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e); rlm@1: LUAI_FUNC UpVal *luaF_newupval (lua_State *L); rlm@1: LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); rlm@1: LUAI_FUNC void luaF_close (lua_State *L, StkId level); rlm@1: LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); rlm@1: LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c); rlm@1: LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv); rlm@1: LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, rlm@1: int pc); rlm@1: rlm@1: rlm@1: #endif