The Battle for Wesnoth  1.17.0-dev
Macros | Functions
lfunc.h File Reference
#include "lobject.h"
Include dependency graph for lfunc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define sizeCclosure(n)
 
#define sizeLclosure(n)
 
#define isintwups(L)   (L->twups != L)
 
#define MAXUPVAL   255
 
#define upisopen(up)   ((up)->v != &(up)->u.value)
 
#define uplevel(up)   check_exp(upisopen(up), cast(StkId, (up)->v))
 
#define MAXMISS   10
 
#define NOCLOSINGMETH   (-1)
 
#define CLOSEPROTECT   (-2)
 

Functions

LUAI_FUNC ProtoluaF_newproto (lua_State *L)
 
LUAI_FUNC CClosureluaF_newCclosure (lua_State *L, int nupvals)
 
LUAI_FUNC LClosureluaF_newLclosure (lua_State *L, int nupvals)
 
LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl)
 
LUAI_FUNC UpValluaF_findupval (lua_State *L, StkId level)
 
LUAI_FUNC void luaF_newtbcupval (lua_State *L, StkId level)
 
LUAI_FUNC int luaF_close (lua_State *L, StkId level, int status)
 
LUAI_FUNC void luaF_unlinkupval (UpVal *uv)
 
LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f)
 
LUAI_FUNC const char * luaF_getlocalname (const Proto *func, int local_number, int pc)
 

Macro Definition Documentation

◆ CLOSEPROTECT

#define CLOSEPROTECT   (-2)

Definition at line 53 of file lfunc.h.

Referenced by callclosemth(), close_state(), lua_resetthread(), and luaD_seterrorobj().

◆ isintwups

#define isintwups (   L)    (L->twups != L)

Definition at line 22 of file lfunc.h.

Referenced by luaF_findupval(), newupval(), and traversethread().

◆ MAXMISS

#define MAXMISS   10

Definition at line 42 of file lfunc.h.

◆ MAXUPVAL

#define MAXUPVAL   255

Definition at line 29 of file lfunc.h.

Referenced by allocupvalue(), index2value(), and lua_pushcclosure().

◆ NOCLOSINGMETH

#define NOCLOSINGMETH   (-1)

Definition at line 50 of file lfunc.h.

Referenced by luaE_freethread(), luaF_close(), and luaV_execute().

◆ sizeCclosure

#define sizeCclosure (   n)
Value:
(cast_int(offsetof(CClosure, upvalue)) + \
cast_int(sizeof(TValue)) * (n))
Definition: lobject.h:65
#define cast_int(i)
Definition: llimits.h:128
static map_location::DIRECTION n

Definition at line 14 of file lfunc.h.

Referenced by freeobj(), and luaF_newCclosure().

◆ sizeLclosure

#define sizeLclosure (   n)
Value:
(cast_int(offsetof(LClosure, upvals)) + \
cast_int(sizeof(TValue *)) * (n))
Definition: lobject.h:65
#define cast_int(i)
Definition: llimits.h:128
static map_location::DIRECTION n

Definition at line 17 of file lfunc.h.

Referenced by freeobj(), and luaF_newLclosure().

◆ upisopen

#define upisopen (   up)    ((up)->v != &(up)->u.value)

Definition at line 32 of file lfunc.h.

Referenced by freeupval(), luaF_unlinkupval(), reallymarkobject(), remarkupvals(), and sweep2old().

◆ uplevel

#define uplevel (   up)    check_exp(upisopen(up), cast(StkId, (up)->v))

Definition at line 35 of file lfunc.h.

Referenced by correctstack(), lua_toclose(), luaF_close(), luaF_findupval(), and luaF_newtbcupval().

Function Documentation

◆ luaF_close()

LUAI_FUNC int luaF_close ( lua_State L,
StkId  level,
int  status 
)

◆ luaF_findupval()

LUAI_FUNC UpVal* luaF_findupval ( lua_State L,
StkId  level 
)

Definition at line 88 of file lfunc.cpp.

References G, isdead, isintwups, lua_assert, newupval(), UpVal::open, lua_State::openupval, p, UpVal::u, and uplevel.

Referenced by pushclosure().

◆ luaF_freeproto()

LUAI_FUNC void luaF_freeproto ( lua_State L,
Proto f 
)

◆ luaF_getlocalname()

LUAI_FUNC const char* luaF_getlocalname ( const Proto func,
int  local_number,
int  pc 
)

Definition at line 289 of file lfunc.cpp.

References getstr, i, Proto::locvars, Proto::sizelocvars, LocVar::startpc, and LocVar::varname.

Referenced by getobjname(), lua_getlocal(), and luaG_findlocal().

◆ luaF_initupvals()

LUAI_FUNC void luaF_initupvals ( lua_State L,
LClosure cl 
)

Definition at line 48 of file lfunc.cpp.

References gco2upv, i, LUA_VUPVAL, luaC_newobj(), luaC_objbarrier, setnilvalue, UpVal::u, LClosure::upvals, UpVal::v, and UpVal::value.

Referenced by f_parser().

◆ luaF_newCclosure()

LUAI_FUNC CClosure* luaF_newCclosure ( lua_State L,
int  nupvals 
)

Definition at line 27 of file lfunc.cpp.

References c, cast_byte, gco2ccl, LUA_VCCL, luaC_newobj(), and sizeCclosure.

Referenced by lua_pushcclosure().

◆ luaF_newLclosure()

LUAI_FUNC LClosure* luaF_newLclosure ( lua_State L,
int  nupvals 
)

Definition at line 35 of file lfunc.cpp.

References c, cast_byte, gco2lcl, LUA_VLCL, luaC_newobj(), LClosure::p, sizeLclosure, and LClosure::upvals.

Referenced by luaU_undump(), luaY_parser(), and pushclosure().

◆ luaF_newproto()

LUAI_FUNC Proto* luaF_newproto ( lua_State L)

◆ luaF_newtbcupval()

LUAI_FUNC void luaF_newtbcupval ( lua_State L,
StkId  level 
)

◆ luaF_unlinkupval()

LUAI_FUNC void luaF_unlinkupval ( UpVal uv)

Definition at line 215 of file lfunc.cpp.

References lua_assert, UpVal::open, UpVal::u, and upisopen.

Referenced by freeupval(), and luaF_close().