The Battle for Wesnoth  1.15.2+dev
Classes | 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.

Classes

struct  UpVal
 

Macros

#define sizeCclosure(n)
 
#define sizeLclosure(n)
 
#define isintwups(L)   (L->twups != L)
 
#define MAXUPVAL   255
 
#define upisopen(up)   ((up)->v != &(up)->u.value)
 

Functions

LUAI_FUNC ProtoluaF_newproto (lua_State *L)
 
LUAI_FUNC CClosureluaF_newCclosure (lua_State *L, int nelems)
 
LUAI_FUNC LClosureluaF_newLclosure (lua_State *L, int nelems)
 
LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl)
 
LUAI_FUNC UpValluaF_findupval (lua_State *L, StkId level)
 
LUAI_FUNC void luaF_close (lua_State *L, StkId level)
 
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

◆ isintwups

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

Definition at line 22 of file lfunc.h.

Referenced by luaF_findupval(), and traversethread().

◆ MAXUPVAL

#define MAXUPVAL   255

Definition at line 29 of file lfunc.h.

Referenced by index2addr(), lua_pushcclosure(), and newupvalue().

◆ sizeCclosure

#define sizeCclosure (   n)
Value:
(cast(int, sizeof(CClosure)) + \
cast(int, sizeof(TValue)*((n)-1)))
#define cast(t, exp)
Definition: llimits.h:111
static map_location::DIRECTION n

Definition at line 14 of file lfunc.h.

Referenced by freeobj(), luaF_newCclosure(), and traverseCclosure().

◆ sizeLclosure

#define sizeLclosure (   n)
Value:
(cast(int, sizeof(LClosure)) + \
cast(int, sizeof(TValue *)*((n)-1)))
#define cast(t, exp)
Definition: llimits.h:111
static map_location::DIRECTION n

Definition at line 17 of file lfunc.h.

Referenced by freeLclosure(), luaF_newLclosure(), and traverseLclosure().

◆ upisopen

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

Function Documentation

◆ luaF_close()

LUAI_FUNC void luaF_close ( lua_State L,
StkId  level 
)

◆ luaF_findupval()

LUAI_FUNC UpVal* luaF_findupval ( lua_State L,
StkId  level 
)

◆ 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 140 of file lfunc.cpp.

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

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

◆ luaF_initupvals()

LUAI_FUNC void luaF_initupvals ( lua_State L,
LClosure cl 
)

Definition at line 45 of file lfunc.cpp.

References i, luaM_new, UpVal::refcount, 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  nelems 
)

Definition at line 25 of file lfunc.cpp.

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

Referenced by lua_pushcclosure().

◆ luaF_newLclosure()

LUAI_FUNC LClosure* luaF_newLclosure ( lua_State L,
int  nelems 
)

Definition at line 33 of file lfunc.cpp.

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

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

◆ luaF_newproto()

LUAI_FUNC Proto* luaF_newproto ( lua_State L)