1323530Savg/*
2323530Savg** $Id: lfunc.h,v 2.8.1.1 2013/04/12 18:48:47 roberto Exp $
3323530Savg** Auxiliary functions to manipulate prototypes and closures
4323530Savg** See Copyright Notice in lua.h
5323530Savg*/
6323530Savg
7323530Savg#ifndef lfunc_h
8323530Savg#define lfunc_h
9323530Savg
10323530Savg
11323530Savg#include "lobject.h"
12323530Savg
13323530Savg
14323530Savg#define sizeCclosure(n)	(cast(int, sizeof(CClosure)) + \
15323530Savg                         cast(int, sizeof(TValue)*((n)-1)))
16323530Savg
17323530Savg#define sizeLclosure(n)	(cast(int, sizeof(LClosure)) + \
18323530Savg                         cast(int, sizeof(TValue *)*((n)-1)))
19323530Savg
20323530Savg
21323530SavgLUAI_FUNC Proto *luaF_newproto (lua_State *L);
22323530SavgLUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems);
23323530SavgLUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems);
24323530SavgLUAI_FUNC UpVal *luaF_newupval (lua_State *L);
25323530SavgLUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
26323530SavgLUAI_FUNC void luaF_close (lua_State *L, StkId level);
27323530SavgLUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);
28323530SavgLUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv);
29323530SavgLUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,
30323530Savg                                         int pc);
31323530Savg
32323530Savg
33323530Savg#endif
34