File indexing completed on 2026-11-07 10:37:56
0001
0002
0003
0004
0005
0006
0007 #ifndef lfunc_h
0008 #define lfunc_h
0009
0010
0011 #include "lobject.h"
0012
0013
0014 #define sizeCclosure(n) (cast_int(offsetof(CClosure, upvalue)) + \
0015 cast_int(sizeof(TValue)) * (n))
0016
0017 #define sizeLclosure(n) (cast_int(offsetof(LClosure, upvals)) + \
0018 cast_int(sizeof(TValue *)) * (n))
0019
0020
0021
0022 #define isintwups(L) (L->twups != L)
0023
0024
0025
0026
0027
0028
0029 #define MAXUPVAL 255
0030
0031
0032 #define upisopen(up) ((up)->v.p != &(up)->u.value)
0033
0034
0035 #define uplevel(up) check_exp(upisopen(up), cast(StkId, (up)->v.p))
0036
0037
0038
0039
0040
0041
0042 #define MAXMISS 10
0043
0044
0045
0046
0047 #define CLOSEKTOP (-1)
0048
0049
0050 LUAI_FUNC Proto *luaF_newproto (lua_State *L);
0051 LUAI_FUNC CClosure *luaF_newCclosure (lua_State *L, int nupvals);
0052 LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nupvals);
0053 LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl);
0054 LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
0055 LUAI_FUNC void luaF_newtbcupval (lua_State *L, StkId level);
0056 LUAI_FUNC void luaF_closeupval (lua_State *L, StkId level);
0057 LUAI_FUNC StkId luaF_close (lua_State *L, StkId level, int status, int yy);
0058 LUAI_FUNC void luaF_unlinkupval (UpVal *uv);
0059 LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);
0060 LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,
0061 int pc);
0062
0063
0064 #endif