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