The Battle for Wesnoth  1.15.1+dev
Classes | Macros | Typedefs | Functions | Variables
lobject.h File Reference
#include <stdarg.h>
#include "llimits.h"
#include "lua.h"
Include dependency graph for lobject.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  GCObject
 
union  Value
 
struct  lua_TValue
 
struct  TString
 
union  UTString
 
struct  Udata
 
union  UUdata
 
struct  Upvaldesc
 
struct  LocVar
 
struct  Proto
 
struct  CClosure
 
struct  LClosure
 
union  Closure
 
union  TKey
 
struct  Node
 
struct  Table
 

Macros

#define LUA_TPROTO   LUA_NUMTAGS /* function prototypes */
 
#define LUA_TDEADKEY   (LUA_NUMTAGS+1) /* removed keys in tables */
 
#define LUA_TOTALTAGS   (LUA_TPROTO + 2)
 
#define LUA_TLCL   (LUA_TFUNCTION | (0 << 4)) /* Lua closure */
 
#define LUA_TLCF   (LUA_TFUNCTION | (1 << 4)) /* light C function */
 
#define LUA_TCCL   (LUA_TFUNCTION | (2 << 4)) /* C closure */
 
#define LUA_TSHRSTR   (LUA_TSTRING | (0 << 4)) /* short strings */
 
#define LUA_TLNGSTR   (LUA_TSTRING | (1 << 4)) /* long strings */
 
#define LUA_TNUMFLT   (LUA_TNUMBER | (0 << 4)) /* float numbers */
 
#define LUA_TNUMINT   (LUA_TNUMBER | (1 << 4)) /* integer numbers */
 
#define BIT_ISCOLLECTABLE   (1 << 6)
 
#define ctb(t)   ((t) | BIT_ISCOLLECTABLE)
 
#define CommonHeader   GCObject *next; lu_byte tt; lu_byte marked
 
#define TValuefields   Value value_; int tt_
 
#define NILCONSTANT   {NULL}, LUA_TNIL
 
#define val_(o)   ((o)->value_)
 
#define rttype(o)   ((o)->tt_)
 
#define novariant(x)   ((x) & 0x0F)
 
#define ttype(o)   (rttype(o) & 0x3F)
 
#define ttnov(o)   (novariant(rttype(o)))
 
#define checktag(o, t)   (rttype(o) == (t))
 
#define checktype(o, t)   (ttnov(o) == (t))
 
#define ttisnumber(o)   checktype((o), LUA_TNUMBER)
 
#define ttisfloat(o)   checktag((o), LUA_TNUMFLT)
 
#define ttisinteger(o)   checktag((o), LUA_TNUMINT)
 
#define ttisnil(o)   checktag((o), LUA_TNIL)
 
#define ttisboolean(o)   checktag((o), LUA_TBOOLEAN)
 
#define ttislightuserdata(o)   checktag((o), LUA_TLIGHTUSERDATA)
 
#define ttisstring(o)   checktype((o), LUA_TSTRING)
 
#define ttisshrstring(o)   checktag((o), ctb(LUA_TSHRSTR))
 
#define ttislngstring(o)   checktag((o), ctb(LUA_TLNGSTR))
 
#define ttistable(o)   checktag((o), ctb(LUA_TTABLE))
 
#define ttisfunction(o)   checktype(o, LUA_TFUNCTION)
 
#define ttisclosure(o)   ((rttype(o) & 0x1F) == LUA_TFUNCTION)
 
#define ttisCclosure(o)   checktag((o), ctb(LUA_TCCL))
 
#define ttisLclosure(o)   checktag((o), ctb(LUA_TLCL))
 
#define ttislcf(o)   checktag((o), LUA_TLCF)
 
#define ttisfulluserdata(o)   checktag((o), ctb(LUA_TUSERDATA))
 
#define ttisthread(o)   checktag((o), ctb(LUA_TTHREAD))
 
#define ttisdeadkey(o)   checktag((o), LUA_TDEADKEY)
 
#define ivalue(o)   check_exp(ttisinteger(o), val_(o).i)
 
#define fltvalue(o)   check_exp(ttisfloat(o), val_(o).n)
 
#define nvalue(o)
 
#define gcvalue(o)   check_exp(iscollectable(o), val_(o).gc)
 
#define pvalue(o)   check_exp(ttislightuserdata(o), val_(o).p)
 
#define tsvalue(o)   check_exp(ttisstring(o), gco2ts(val_(o).gc))
 
#define uvalue(o)   check_exp(ttisfulluserdata(o), gco2u(val_(o).gc))
 
#define clvalue(o)   check_exp(ttisclosure(o), gco2cl(val_(o).gc))
 
#define clLvalue(o)   check_exp(ttisLclosure(o), gco2lcl(val_(o).gc))
 
#define clCvalue(o)   check_exp(ttisCclosure(o), gco2ccl(val_(o).gc))
 
#define fvalue(o)   check_exp(ttislcf(o), val_(o).f)
 
#define hvalue(o)   check_exp(ttistable(o), gco2t(val_(o).gc))
 
#define bvalue(o)   check_exp(ttisboolean(o), val_(o).b)
 
#define thvalue(o)   check_exp(ttisthread(o), gco2th(val_(o).gc))
 
#define deadvalue(o)   check_exp(ttisdeadkey(o), cast(void *, val_(o).gc))
 
#define l_isfalse(o)   (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0))
 
#define iscollectable(o)   (rttype(o) & BIT_ISCOLLECTABLE)
 
#define righttt(obj)   (ttype(obj) == gcvalue(obj)->tt)
 
#define checkliveness(L, obj)
 
#define settt_(o, t)   ((o)->tt_=(t))
 
#define setfltvalue(obj, x)   { TValue *io=(obj); val_(io).n=(x); settt_(io, LUA_TNUMFLT); }
 
#define chgfltvalue(obj, x)   { TValue *io=(obj); lua_assert(ttisfloat(io)); val_(io).n=(x); }
 
#define setivalue(obj, x)   { TValue *io=(obj); val_(io).i=(x); settt_(io, LUA_TNUMINT); }
 
#define chgivalue(obj, x)   { TValue *io=(obj); lua_assert(ttisinteger(io)); val_(io).i=(x); }
 
#define setnilvalue(obj)   settt_(obj, LUA_TNIL)
 
#define setfvalue(obj, x)   { TValue *io=(obj); val_(io).f=(x); settt_(io, LUA_TLCF); }
 
#define setpvalue(obj, x)   { TValue *io=(obj); val_(io).p=(x); settt_(io, LUA_TLIGHTUSERDATA); }
 
#define setbvalue(obj, x)   { TValue *io=(obj); val_(io).b=(x); settt_(io, LUA_TBOOLEAN); }
 
#define setgcovalue(L, obj, x)
 
#define setsvalue(L, obj, x)
 
#define setuvalue(L, obj, x)
 
#define setthvalue(L, obj, x)
 
#define setclLvalue(L, obj, x)
 
#define setclCvalue(L, obj, x)
 
#define sethvalue(L, obj, x)
 
#define setdeadvalue(obj)   settt_(obj, LUA_TDEADKEY)
 
#define setobj(L, obj1, obj2)
 
#define setobjs2s   setobj
 
#define setobj2s   setobj
 
#define setsvalue2s   setsvalue
 
#define sethvalue2s   sethvalue
 
#define setptvalue2s   setptvalue
 
#define setobjt2t   setobj
 
#define setobj2n   setobj
 
#define setsvalue2n   setsvalue
 
#define setobj2t(L, o1, o2)   ((void)L, *(o1)=*(o2), checkliveness(L,(o1)))
 
#define getstr(ts)   check_exp(sizeof((ts)->extra), cast(char *, (ts)) + sizeof(UTString))
 
#define svalue(o)   getstr(tsvalue(o))
 
#define tsslen(s)   ((s)->tt == LUA_TSHRSTR ? (s)->shrlen : (s)->u.lnglen)
 
#define vslen(o)   tsslen(tsvalue(o))
 
#define getudatamem(u)   check_exp(sizeof((u)->ttuv_), (cast(char*, (u)) + sizeof(UUdata)))
 
#define setuservalue(L, u, o)
 
#define getuservalue(L, u, o)
 
#define ClosureHeader   CommonHeader; lu_byte nupvalues; GCObject *gclist
 
#define isLfunction(o)   ttisLclosure(o)
 
#define getproto(o)   (clLvalue(o)->p)
 
#define setnodekey(L, key, obj)
 
#define lmod(s, size)   (check_exp((size&(size-1))==0, (cast(int, (s) & ((size)-1)))))
 
#define twoto(x)   (1<<(x))
 
#define sizenode(t)   (twoto((t)->lsizenode))
 
#define luaO_nilobject   (&luaO_nilobject_)
 
#define UTF8BUFFSZ   8
 

Typedefs

typedef struct GCObject GCObject
 
typedef union Value Value
 
typedef struct lua_TValue TValue
 
typedef TValueStkId
 
typedef struct TString TString
 
typedef union UTString UTString
 
typedef struct Udata Udata
 
typedef union UUdata UUdata
 
typedef struct Upvaldesc Upvaldesc
 
typedef struct LocVar LocVar
 
typedef struct Proto Proto
 
typedef struct UpVal UpVal
 
typedef struct CClosure CClosure
 
typedef struct LClosure LClosure
 
typedef union Closure Closure
 
typedef union TKey TKey
 
typedef struct Node Node
 
typedef struct Table Table
 

Functions

LUAI_FUNC int luaO_int2fb (unsigned int x)
 
LUAI_FUNC int luaO_fb2int (int x)
 
LUAI_FUNC int luaO_utf8esc (char *buff, unsigned long x)
 
LUAI_FUNC int luaO_ceillog2 (unsigned int x)
 
LUAI_FUNC void luaO_arith (lua_State *L, int op, const TValue *p1, const TValue *p2, TValue *res)
 
LUAI_FUNC size_t luaO_str2num (const char *s, TValue *o)
 
LUAI_FUNC int luaO_hexavalue (int c)
 
LUAI_FUNC void luaO_tostring (lua_State *L, StkId obj)
 
LUAI_FUNC const char * luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp)
 
LUAI_FUNC const char * luaO_pushfstring (lua_State *L, const char *fmt,...)
 
LUAI_FUNC void luaO_chunkid (char *out, const char *source, size_t len)
 

Variables

LUAI_DDEC const TValue luaO_nilobject_
 

Macro Definition Documentation

◆ BIT_ISCOLLECTABLE

#define BIT_ISCOLLECTABLE   (1 << 6)

Definition at line 63 of file lobject.h.

◆ bvalue

#define bvalue (   o)    check_exp(ttisboolean(o), val_(o).b)

Definition at line 176 of file lobject.h.

Referenced by DumpConstants(), luaV_equalobj(), and mainposition().

◆ checkliveness

#define checkliveness (   L,
  obj 
)
Value:
(righttt(obj) && (L == NULL || !isdead(G(L),gcvalue(obj)))))
#define gcvalue(o)
Definition: lobject.h:167
#define G(L)
Definition: lstate.h:205
#define righttt(obj)
Definition: lobject.h:188
#define isdead(g, v)
Definition: lgc.h:96
#define lua_longassert(c)
Definition: llimits.h:91
#define iscollectable(o)
Definition: lobject.h:184

Definition at line 190 of file lobject.h.

◆ checktag

#define checktag (   o,
  t 
)    (rttype(o) == (t))

Definition at line 140 of file lobject.h.

◆ checktype

#define checktype (   o,
  t 
)    (ttnov(o) == (t))

Definition at line 141 of file lobject.h.

◆ chgfltvalue

#define chgfltvalue (   obj,
 
)    { TValue *io=(obj); lua_assert(ttisfloat(io)); val_(io).n=(x); }

Definition at line 201 of file lobject.h.

Referenced by luaV_execute().

◆ chgivalue

#define chgivalue (   obj,
 
)    { TValue *io=(obj); lua_assert(ttisinteger(io)); val_(io).i=(x); }

Definition at line 207 of file lobject.h.

Referenced by luaV_execute().

◆ clCvalue

#define clCvalue (   o)    check_exp(ttisCclosure(o), gco2ccl(val_(o).gc))

◆ clLvalue

#define clLvalue (   o)    check_exp(ttisLclosure(o), gco2lcl(val_(o).gc))

◆ ClosureHeader

#define ClosureHeader   CommonHeader; lu_byte nupvalues; GCObject *gclist

Definition at line 443 of file lobject.h.

◆ clvalue

#define clvalue (   o)    check_exp(ttisclosure(o), gco2cl(val_(o).gc))

Definition at line 171 of file lobject.h.

Referenced by lua_getinfo().

◆ CommonHeader

#define CommonHeader   GCObject *next; lu_byte tt; lu_byte marked

Definition at line 79 of file lobject.h.

◆ ctb

#define ctb (   t)    ((t) | BIT_ISCOLLECTABLE)

Definition at line 66 of file lobject.h.

◆ deadvalue

#define deadvalue (   o)    check_exp(ttisdeadkey(o), cast(void *, val_(o).gc))

Definition at line 179 of file lobject.h.

Referenced by findindex().

◆ fltvalue

#define fltvalue (   o)    check_exp(ttisfloat(o), val_(o).n)

◆ fvalue

#define fvalue (   o)    check_exp(ttislcf(o), val_(o).f)

Definition at line 174 of file lobject.h.

Referenced by lua_tocfunction(), lua_topointer(), luaD_precall(), luaV_equalobj(), and mainposition().

◆ gcvalue

#define gcvalue (   o)    check_exp(iscollectable(o), val_(o).gc)

◆ getproto

#define getproto (   o)    (clLvalue(o)->p)

Definition at line 468 of file lobject.h.

Referenced by lua_dump(), and luaV_execute().

◆ getstr

#define getstr (   ts)    check_exp(sizeof((ts)->extra), cast(char *, (ts)) + sizeof(UTString))

◆ getudatamem

#define getudatamem (   u)    check_exp(sizeof((u)->ttuv_), (cast(char*, (u)) + sizeof(UUdata)))

Definition at line 368 of file lobject.h.

Referenced by lua_newuserdata(), lua_topointer(), and lua_touserdata().

◆ getuservalue

#define getuservalue (   L,
  u,
 
)
Value:
{ TValue *io=(o); const Udata *iu = (u); \
io->value_ = iu->user_; settt_(io, iu->ttuv_); \
checkliveness(L,io); }
lu_byte ttuv_
Definition: lobject.h:348
union Value user_
Definition: lobject.h:351
Definition: lobject.h:346
#define settt_(o, t)
Definition: lobject.h:196

Definition at line 377 of file lobject.h.

Referenced by lua_getuservalue(), and reallymarkobject().

◆ hvalue

#define hvalue (   o)    check_exp(ttistable(o), gco2t(val_(o).gc))

◆ iscollectable

#define iscollectable (   o)    (rttype(o) & BIT_ISCOLLECTABLE)

Definition at line 184 of file lobject.h.

Referenced by findindex(), and iscleared().

◆ isLfunction

#define isLfunction (   o)    ttisLclosure(o)

Definition at line 466 of file lobject.h.

Referenced by lua_dump(), and lua_getlocal().

◆ ivalue

#define ivalue (   o)    check_exp(ttisinteger(o), val_(o).i)

◆ l_isfalse

#define l_isfalse (   o)    (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0))

◆ lmod

#define lmod (   s,
  size 
)    (check_exp((size&(size-1))==0, (cast(int, (s) & ((size)-1)))))

Definition at line 514 of file lobject.h.

Referenced by internshrstr(), luaS_remove(), and luaS_resize().

◆ LUA_TCCL

#define LUA_TCCL   (LUA_TFUNCTION | (2 << 4)) /* C closure */

◆ LUA_TDEADKEY

#define LUA_TDEADKEY   (LUA_NUMTAGS+1) /* removed keys in tables */

Definition at line 23 of file lobject.h.

◆ LUA_TLCF

#define LUA_TLCF   (LUA_TFUNCTION | (1 << 4)) /* light C function */

Definition at line 48 of file lobject.h.

Referenced by lua_topointer(), luaD_precall(), luaV_equalobj(), and mainposition().

◆ LUA_TLCL

#define LUA_TLCL   (LUA_TFUNCTION | (0 << 4)) /* Lua closure */

◆ LUA_TLNGSTR

#define LUA_TLNGSTR   (LUA_TSTRING | (1 << 4)) /* long strings */

◆ LUA_TNUMFLT

#define LUA_TNUMFLT   (LUA_TNUMBER | (0 << 4)) /* float numbers */

Definition at line 58 of file lobject.h.

Referenced by DumpConstants(), LoadConstants(), luaH_get(), luaV_equalobj(), and mainposition().

◆ LUA_TNUMINT

#define LUA_TNUMINT   (LUA_TNUMBER | (1 << 4)) /* integer numbers */

Definition at line 59 of file lobject.h.

Referenced by DumpConstants(), LoadConstants(), luaH_get(), luaV_equalobj(), and mainposition().

◆ LUA_TOTALTAGS

#define LUA_TOTALTAGS   (LUA_TPROTO + 2)

Definition at line 28 of file lobject.h.

◆ LUA_TPROTO

#define LUA_TPROTO   LUA_NUMTAGS /* function prototypes */

Definition at line 22 of file lobject.h.

Referenced by freeobj(), luaF_newproto(), propagatemark(), and reallymarkobject().

◆ LUA_TSHRSTR

#define LUA_TSHRSTR   (LUA_TSTRING | (0 << 4)) /* short strings */

◆ luaO_nilobject

#define luaO_nilobject   (&luaO_nilobject_)

◆ NILCONSTANT

#define NILCONSTANT   {NULL}, LUA_TNIL

Definition at line 120 of file lobject.h.

◆ novariant

#define novariant (   x)    ((x) & 0x0F)

Definition at line 130 of file lobject.h.

Referenced by luaC_newobj().

◆ nvalue

#define nvalue (   o)
Value:
#define cast_num(i)
Definition: llimits.h:115
#define ttisinteger(o)
Definition: lobject.h:144
#define check_exp(c, e)
Definition: llimits.h:90
#define fltvalue(o)
Definition: lobject.h:164
#define ivalue(o)
Definition: lobject.h:163
#define ttisnumber(o)
Definition: lobject.h:142

Definition at line 165 of file lobject.h.

Referenced by luaV_tonumber_(), and validop().

◆ pvalue

#define pvalue (   o)    check_exp(ttislightuserdata(o), val_(o).p)

Definition at line 168 of file lobject.h.

Referenced by lua_topointer(), lua_touserdata(), luaV_equalobj(), and mainposition().

◆ righttt

#define righttt (   obj)    (ttype(obj) == gcvalue(obj)->tt)

Definition at line 188 of file lobject.h.

◆ rttype

#define rttype (   o)    ((o)->tt_)

Definition at line 127 of file lobject.h.

◆ setbvalue

#define setbvalue (   obj,
 
)    { TValue *io=(obj); val_(io).b=(x); settt_(io, LUA_TBOOLEAN); }

◆ setclCvalue

#define setclCvalue (   L,
  obj,
 
)
Value:
{ TValue *io = (obj); CClosure *x_ = (x); \
val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TCCL)); \
checkliveness(L,io); }
#define ctb(t)
Definition: lobject.h:66
#define LUA_TCCL
Definition: lobject.h:49
#define obj2gco(v)
Definition: lstate.h:238
#define settt_(o, t)
Definition: lobject.h:196

Definition at line 245 of file lobject.h.

Referenced by lua_pushcclosure().

◆ setclLvalue

#define setclLvalue (   L,
  obj,
 
)
Value:
{ TValue *io = (obj); LClosure *x_ = (x); \
val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TLCL)); \
checkliveness(L,io); }
#define ctb(t)
Definition: lobject.h:66
#define obj2gco(v)
Definition: lstate.h:238
#define LUA_TLCL
Definition: lobject.h:47
#define settt_(o, t)
Definition: lobject.h:196

Definition at line 240 of file lobject.h.

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

◆ setdeadvalue

#define setdeadvalue (   obj)    settt_(obj, LUA_TDEADKEY)

Definition at line 255 of file lobject.h.

Referenced by removeentry().

◆ setfltvalue

#define setfltvalue (   obj,
 
)    { TValue *io=(obj); val_(io).n=(x); settt_(io, LUA_TNUMFLT); }

◆ setfvalue

#define setfvalue (   obj,
 
)    { TValue *io=(obj); val_(io).f=(x); settt_(io, LUA_TLCF); }

Definition at line 212 of file lobject.h.

Referenced by lua_pushcclosure().

◆ setgcovalue

#define setgcovalue (   L,
  obj,
 
)
Value:
{ TValue *io = (obj); GCObject *i_g=(x); \
val_(io).gc = i_g; settt_(io, ctb(i_g->tt)); }
#define ctb(t)
Definition: lobject.h:66
#define settt_(o, t)
Definition: lobject.h:196

Definition at line 221 of file lobject.h.

Referenced by GCTM().

◆ sethvalue

#define sethvalue (   L,
  obj,
 
)
Value:
{ TValue *io = (obj); Table *x_ = (x); \
val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TTABLE)); \
checkliveness(L,io); }
#define ctb(t)
Definition: lobject.h:66
Definition: lobject.h:497
#define obj2gco(v)
Definition: lstate.h:238
#define settt_(o, t)
Definition: lobject.h:196
#define LUA_TTABLE
Definition: lua.h:69

Definition at line 250 of file lobject.h.

Referenced by collectvalidlines(), init_registry(), lua_createtable(), lua_getmetatable(), luaV_execute(), luaY_parser(), and nilK().

◆ sethvalue2s

#define sethvalue2s   sethvalue

Definition at line 273 of file lobject.h.

◆ setivalue

#define setivalue (   obj,
 
)    { TValue *io=(obj); val_(io).i=(x); settt_(io, LUA_TNUMINT); }

◆ setnilvalue

#define setnilvalue (   obj)    settt_(obj, LUA_TNIL)

◆ setnodekey

#define setnodekey (   L,
  key,
  obj 
)
Value:
{ TKey *k_=(key); const TValue *io_=(obj); \
k_->nk.value_ = io_->value_; k_->nk.tt_ = io_->tt_; \
(void)L; checkliveness(L,io_); }
Definition: lobject.h:475
struct TKey::@5 nk
#define checkliveness(L, obj)
Definition: lobject.h:190

Definition at line 485 of file lobject.h.

Referenced by luaH_newkey().

◆ setobj

#define setobj (   L,
  obj1,
  obj2 
)
Value:
{ TValue *io1=(obj1); *io1 = *(obj2); \
(void)L; checkliveness(L,io1); }
#define checkliveness(L, obj)
Definition: lobject.h:190

Definition at line 259 of file lobject.h.

Referenced by addk(), lua_copy(), lua_load(), lua_setupvalue(), luaF_close(), luaV_execute(), and reverse().

◆ setobj2n

#define setobj2n   setobj

Definition at line 278 of file lobject.h.

Referenced by lua_pushcclosure().

◆ setobj2s

#define setobj2s   setobj

◆ setobj2t

#define setobj2t (   L,
  o1,
  o2 
)    ((void)L, *(o1)=*(o2), checkliveness(L,(o1)))

Definition at line 282 of file lobject.h.

Referenced by lua_rawset(), lua_rawsetp(), luaH_setint(), and luaV_finishset().

◆ setobjs2s

#define setobjs2s   setobj

◆ setobjt2t

#define setobjt2t   setobj

Definition at line 276 of file lobject.h.

Referenced by luaH_resize().

◆ setptvalue2s

#define setptvalue2s   setptvalue

Definition at line 274 of file lobject.h.

◆ setpvalue

#define setpvalue (   obj,
 
)    { TValue *io=(obj); val_(io).p=(x); settt_(io, LUA_TLIGHTUSERDATA); }

Definition at line 215 of file lobject.h.

Referenced by lua_pushlightuserdata(), lua_rawgetp(), lua_rawsetp(), and luaK_intK().

◆ setsvalue

#define setsvalue (   L,
  obj,
 
)
Value:
{ TValue *io = (obj); TString *x_ = (x); \
val_(io).gc = obj2gco(x_); settt_(io, ctb(x_->tt)); \
checkliveness(L,io); }
#define ctb(t)
Definition: lobject.h:66
#define obj2gco(v)
Definition: lstate.h:238
#define settt_(o, t)
Definition: lobject.h:196

Definition at line 225 of file lobject.h.

Referenced by luaH_getstr(), and luaK_stringK().

◆ setsvalue2n

#define setsvalue2n   setsvalue

Definition at line 279 of file lobject.h.

Referenced by LoadConstants().

◆ setsvalue2s

#define setsvalue2s   setsvalue

◆ setthvalue

#define setthvalue (   L,
  obj,
 
)
Value:
{ TValue *io = (obj); lua_State *x_ = (x); \
val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TTHREAD)); \
checkliveness(L,io); }
#define ctb(t)
Definition: lobject.h:66
#define LUA_TTHREAD
Definition: lua.h:72
#define obj2gco(v)
Definition: lstate.h:238
#define settt_(o, t)
Definition: lobject.h:196

Definition at line 235 of file lobject.h.

Referenced by init_registry(), lua_newthread(), and lua_pushthread().

◆ settt_

#define settt_ (   o,
  t 
)    ((o)->tt_=(t))

Definition at line 196 of file lobject.h.

◆ setuservalue

#define setuservalue (   L,
  u,
 
)
Value:
{ const TValue *io=(o); Udata *iu = (u); \
iu->user_ = io->value_; iu->ttuv_ = rttype(io); \
checkliveness(L,io); }
lu_byte ttuv_
Definition: lobject.h:348
#define rttype(o)
Definition: lobject.h:127
union Value user_
Definition: lobject.h:351
Definition: lobject.h:346

Definition at line 371 of file lobject.h.

Referenced by lua_setuservalue(), and luaS_newudata().

◆ setuvalue

#define setuvalue (   L,
  obj,
 
)
Value:
{ TValue *io = (obj); Udata *x_ = (x); \
val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TUSERDATA)); \
checkliveness(L,io); }
#define ctb(t)
Definition: lobject.h:66
#define obj2gco(v)
Definition: lstate.h:238
#define LUA_TUSERDATA
Definition: lua.h:71
Definition: lobject.h:346
#define settt_(o, t)
Definition: lobject.h:196

Definition at line 230 of file lobject.h.

Referenced by lua_newuserdata().

◆ sizenode

#define sizenode (   t)    (twoto((t)->lsizenode))

Definition at line 519 of file lobject.h.

Referenced by luaH_free(), luaH_next(), and numusehash().

◆ svalue

#define svalue (   o)    getstr(tsvalue(o))

◆ thvalue

#define thvalue (   o)    check_exp(ttisthread(o), gco2th(val_(o).gc))

Definition at line 177 of file lobject.h.

Referenced by lua_topointer(), and lua_tothread().

◆ tsslen

#define tsslen (   s)    ((s)->tt == LUA_TSHRSTR ? (s)->shrlen : (s)->u.lnglen)

Definition at line 336 of file lobject.h.

Referenced by DumpString(), and l_strcmp().

◆ tsvalue

#define tsvalue (   o)    check_exp(ttisstring(o), gco2ts(val_(o).gc))

◆ ttisboolean

#define ttisboolean (   o)    checktag((o), LUA_TBOOLEAN)

Definition at line 146 of file lobject.h.

◆ ttisCclosure

#define ttisCclosure (   o)    checktag((o), ctb(LUA_TCCL))

Definition at line 154 of file lobject.h.

Referenced by lua_iscfunction(), and lua_tocfunction().

◆ ttisclosure

#define ttisclosure (   o)    ((rttype(o) & 0x1F) == LUA_TFUNCTION)

Definition at line 153 of file lobject.h.

Referenced by lua_getinfo().

◆ ttisdeadkey

#define ttisdeadkey (   o)    checktag((o), LUA_TDEADKEY)

Definition at line 159 of file lobject.h.

Referenced by findindex(), and mainposition().

◆ ttisfloat

#define ttisfloat (   o)    checktag((o), LUA_TNUMFLT)

Definition at line 143 of file lobject.h.

Referenced by LEnum(), LTnum(), luaH_newkey(), luaV_tointeger(), and read_numeral().

◆ ttisfulluserdata

#define ttisfulluserdata (   o)    checktag((o), ctb(LUA_TUSERDATA))

Definition at line 157 of file lobject.h.

Referenced by lua_getuservalue(), lua_isuserdata(), lua_setuservalue(), and luaT_objtypename().

◆ ttisfunction

#define ttisfunction (   o)    checktype(o, LUA_TFUNCTION)

Definition at line 152 of file lobject.h.

Referenced by GCTM(), lua_getinfo(), luaV_finishget(), luaV_finishset(), and tryfuncTM().

◆ ttisinteger

#define ttisinteger (   o)    checktag((o), LUA_TNUMINT)

◆ ttislcf

#define ttislcf (   o)    checktag((o), LUA_TLCF)

Definition at line 156 of file lobject.h.

Referenced by index2addr(), lua_iscfunction(), and lua_tocfunction().

◆ ttisLclosure

#define ttisLclosure (   o)    checktag((o), ctb(LUA_TLCL))

Definition at line 155 of file lobject.h.

Referenced by getupvalref().

◆ ttislightuserdata

#define ttislightuserdata (   o)    checktag((o), LUA_TLIGHTUSERDATA)

Definition at line 147 of file lobject.h.

Referenced by lua_isuserdata().

◆ ttislngstring

#define ttislngstring (   o)    checktag((o), ctb(LUA_TLNGSTR))

Definition at line 150 of file lobject.h.

◆ ttisnil

#define ttisnil (   o)    checktag((o), LUA_TNIL)

◆ ttisnumber

#define ttisnumber (   o)    checktype((o), LUA_TNUMBER)

Definition at line 142 of file lobject.h.

Referenced by luaO_tostring(), luaV_lessequal(), and luaV_lessthan().

◆ ttisshrstring

#define ttisshrstring (   o)    checktag((o), ctb(LUA_TSHRSTR))

Definition at line 149 of file lobject.h.

Referenced by luaH_getshortstr().

◆ ttisstring

#define ttisstring (   o)    checktype((o), LUA_TSTRING)

◆ ttistable

#define ttistable (   o)    checktag((o), ctb(LUA_TTABLE))

◆ ttisthread

#define ttisthread (   o)    checktag((o), ctb(LUA_TTHREAD))

Definition at line 158 of file lobject.h.

Referenced by lua_tothread().

◆ ttnov

#define ttnov (   o)    (novariant(rttype(o)))

◆ ttype

#define ttype (   o)    (rttype(o) & 0x3F)

◆ TValuefields

#define TValuefields   Value value_; int tt_

Definition at line 110 of file lobject.h.

◆ twoto

#define twoto (   x)    (1<<(x))

Definition at line 518 of file lobject.h.

Referenced by setnodevector().

◆ UTF8BUFFSZ

#define UTF8BUFFSZ   8

Definition at line 531 of file lobject.h.

Referenced by luaO_pushvfstring(), luaO_utf8esc(), and utf8esc().

◆ uvalue

#define uvalue (   o)    check_exp(ttisfulluserdata(o), gco2u(val_(o).gc))

◆ val_

#define val_ (   o)    ((o)->value_)

◆ vslen

#define vslen (   o)    tsslen(tsvalue(o))

Definition at line 339 of file lobject.h.

Referenced by copy2buff(), lua_tolstring(), luaV_concat(), luaV_tointeger(), and luaV_tonumber_().

Typedef Documentation

◆ CClosure

typedef struct CClosure CClosure

◆ Closure

typedef union Closure Closure

◆ GCObject

typedef struct GCObject GCObject

Definition at line 72 of file lobject.h.

◆ LClosure

typedef struct LClosure LClosure

◆ LocVar

typedef struct LocVar LocVar

◆ Node

typedef struct Node Node

◆ Proto

typedef struct Proto Proto

◆ StkId

typedef TValue* StkId

Definition at line 294 of file lobject.h.

◆ Table

typedef struct Table Table

◆ TKey

typedef union TKey TKey

◆ TString

typedef struct TString TString

◆ TValue

typedef struct lua_TValue TValue

◆ Udata

typedef struct Udata Udata

◆ UpVal

typedef struct UpVal UpVal

Definition at line 436 of file lobject.h.

◆ Upvaldesc

typedef struct Upvaldesc Upvaldesc

◆ UTString

typedef union UTString UTString

◆ UUdata

typedef union UUdata UUdata

◆ Value

typedef union Value Value

Function Documentation

◆ luaO_arith()

LUAI_FUNC void luaO_arith ( lua_State L,
int  op,
const TValue p1,
const TValue p2,
TValue res 
)

◆ luaO_ceillog2()

LUAI_FUNC int luaO_ceillog2 ( unsigned int  x)

Definition at line 65 of file lobject.cpp.

Referenced by countint(), and setnodevector().

◆ luaO_chunkid()

LUAI_FUNC void luaO_chunkid ( char *  out,
const char *  source,
size_t  len 
)

Definition at line 487 of file lobject.cpp.

References addstr, LL, POS, PRE, and RETS.

Referenced by funcinfo(), and luaG_addinfo().

◆ luaO_fb2int()

LUAI_FUNC int luaO_fb2int ( int  x)

Definition at line 57 of file lobject.cpp.

Referenced by luaV_execute().

◆ luaO_hexavalue()

LUAI_FUNC int luaO_hexavalue ( int  c)

Definition at line 163 of file lobject.cpp.

References lisdigit, and ltolower.

Referenced by gethexa(), isneg(), l_str2int(), and readutf8esc().

◆ luaO_int2fb()

LUAI_FUNC int luaO_int2fb ( unsigned int  x)

Definition at line 41 of file lobject.cpp.

References cast_int, and e.

Referenced by constructor().

◆ luaO_pushfstring()

LUAI_FUNC const char* luaO_pushfstring ( lua_State L,
const char *  fmt,
  ... 
)

◆ luaO_pushvfstring()

LUAI_FUNC const char* luaO_pushvfstring ( lua_State L,
const char *  fmt,
va_list  argp 
)

◆ luaO_str2num()

LUAI_FUNC size_t luaO_str2num ( const char *  s,
TValue o 
)

Definition at line 331 of file lobject.cpp.

References e, i, l_str2d(), l_str2int(), n, setfltvalue, and setivalue.

Referenced by lua_stringtonumber(), luaV_tointeger(), luaV_tonumber_(), and read_numeral().

◆ luaO_tostring()

LUAI_FUNC void luaO_tostring ( lua_State L,
StkId  obj 
)

◆ luaO_utf8esc()

LUAI_FUNC int luaO_utf8esc ( char *  buff,
unsigned long  x 
)

Definition at line 346 of file lobject.cpp.

References cast, lua_assert, n, and UTF8BUFFSZ.

Referenced by luaO_pushvfstring(), and utf8esc().

Variable Documentation

◆ luaO_nilobject_

LUAI_DDEC const TValue luaO_nilobject_

Definition at line 528 of file lobject.h.