lfunc.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. ** $Id: lfunc.h,v 2.4.1.1 2007/12/27 13:02:25 roberto Exp $
  3. ** Auxiliary functions to manipulate prototypes and closures
  4. ** See Copyright Notice in lua.h
  5. */
  6. #ifndef lfunc_h
  7. #define lfunc_h
  8. #include "lobject.h"
  9. #define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \
  10. cast(int, sizeof(TValue)*((n)-1)))
  11. #define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \
  12. cast(int, sizeof(TValue *)*((n)-1)))
  13. LUAI_FUNC Proto *luaF_newproto (lua_State *L);
  14. LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e);
  15. LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e);
  16. LUAI_FUNC UpVal *luaF_newupval (lua_State *L);
  17. LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
  18. LUAI_FUNC void luaF_close (lua_State *L, StkId level);
  19. LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);
  20. LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c);
  21. LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv);
  22. LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,
  23. int pc);
  24. #endif