sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
lobject.h File Reference
#include <stdarg.h>
#include "llimits.h"
#include "lua.h"

Go to the source code of this file.

Classes

union  Value
struct  TValue
union  StackValue
union  StkIdRel
struct  GCObject
struct  TString
union  UValue
struct  Udata
struct  Udata0
struct  Upvaldesc
struct  LocVar
struct  AbsLineInfo
struct  Proto
struct  UpVal
struct  CClosure
struct  LClosure
union  Closure
union  Node
struct  Node::NodeKey
struct  Table

Macros

#define LUA_TUPVAL   LUA_NUMTYPES
#define LUA_TPROTO   (LUA_NUMTYPES+1)
#define LUA_TDEADKEY   (LUA_NUMTYPES+2)
#define LUA_TOTALTYPES   (LUA_TPROTO + 2)
#define makevariant(t, v)
#define TValuefields   Value value_; lu_byte tt_
#define val_(o)
#define valraw(o)
#define rawtt(o)
#define novariant(t)
#define withvariant(t)
#define ttypetag(o)
#define ttype(o)
#define checktag(o, t)
#define checktype(o, t)
#define righttt(obj)
#define checkliveness(L, obj)
#define settt_(o, t)
#define setobj(L, obj1, obj2)
#define setobjs2s(L, o1, o2)
#define setobj2s(L, o1, o2)
#define setobjt2t   setobj
#define setobj2n   setobj
#define setobj2t   setobj
#define s2v(o)
#define LUA_VNIL   makevariant(LUA_TNIL, 0)
#define LUA_VEMPTY   makevariant(LUA_TNIL, 1)
#define LUA_VABSTKEY   makevariant(LUA_TNIL, 2)
#define ttisnil(v)
#define ttisstrictnil(o)
#define setnilvalue(obj)
#define isabstkey(v)
#define isnonstrictnil(v)
#define isempty(v)
#define ABSTKEYCONSTANT   {NULL}, LUA_VABSTKEY
#define setempty(v)
#define LUA_VFALSE   makevariant(LUA_TBOOLEAN, 0)
#define LUA_VTRUE   makevariant(LUA_TBOOLEAN, 1)
#define ttisboolean(o)
#define ttisfalse(o)
#define ttistrue(o)
#define l_isfalse(o)
#define setbfvalue(obj)
#define setbtvalue(obj)
#define LUA_VTHREAD   makevariant(LUA_TTHREAD, 0)
#define ttisthread(o)
#define thvalue(o)
#define setthvalue(L, obj, x)
#define setthvalue2s(L, o, t)
#define CommonHeader   struct GCObject *next; lu_byte tt; lu_byte marked
#define BIT_ISCOLLECTABLE   (1 << 6)
#define iscollectable(o)
#define ctb(t)
#define gcvalue(o)
#define gcvalueraw(v)
#define setgcovalue(L, obj, x)
#define LUA_VNUMINT   makevariant(LUA_TNUMBER, 0)
#define LUA_VNUMFLT   makevariant(LUA_TNUMBER, 1)
#define ttisnumber(o)
#define ttisfloat(o)
#define ttisinteger(o)
#define nvalue(o)
#define fltvalue(o)
#define ivalue(o)
#define fltvalueraw(v)
#define ivalueraw(v)
#define setfltvalue(obj, x)
#define chgfltvalue(obj, x)
#define setivalue(obj, x)
#define chgivalue(obj, x)
#define LUA_VSHRSTR   makevariant(LUA_TSTRING, 0)
#define LUA_VLNGSTR   makevariant(LUA_TSTRING, 1)
#define ttisstring(o)
#define ttisshrstring(o)
#define ttislngstring(o)
#define tsvalueraw(v)
#define tsvalue(o)
#define setsvalue(L, obj, x)
#define setsvalue2s(L, o, s)
#define setsvalue2n   setsvalue
#define getstr(ts)
#define svalue(o)
#define tsslen(s)
#define vslen(o)
#define LUA_VLIGHTUSERDATA   makevariant(LUA_TLIGHTUSERDATA, 0)
#define LUA_VUSERDATA   makevariant(LUA_TUSERDATA, 0)
#define ttislightuserdata(o)
#define ttisfulluserdata(o)
#define pvalue(o)
#define uvalue(o)
#define pvalueraw(v)
#define setpvalue(obj, x)
#define setuvalue(L, obj, x)
#define udatamemoffset(nuv)
#define getudatamem(u)
#define sizeudata(nuv, nb)
#define LUA_VPROTO   makevariant(LUA_TPROTO, 0)
#define LUA_VUPVAL   makevariant(LUA_TUPVAL, 0)
#define LUA_VLCL   makevariant(LUA_TFUNCTION, 0)
#define LUA_VLCF   makevariant(LUA_TFUNCTION, 1)
#define LUA_VCCL   makevariant(LUA_TFUNCTION, 2)
#define ttisfunction(o)
#define ttisLclosure(o)
#define ttislcf(o)
#define ttisCclosure(o)
#define ttisclosure(o)
#define isLfunction(o)
#define clvalue(o)
#define clLvalue(o)
#define fvalue(o)
#define clCvalue(o)
#define fvalueraw(v)
#define setclLvalue(L, obj, x)
#define setclLvalue2s(L, o, cl)
#define setfvalue(obj, x)
#define setclCvalue(L, obj, x)
#define ClosureHeader   CommonHeader; lu_byte nupvalues; GCObject *gclist
#define getproto(o)
#define LUA_VTABLE   makevariant(LUA_TTABLE, 0)
#define ttistable(o)
#define hvalue(o)
#define sethvalue(L, obj, x)
#define sethvalue2s(L, o, h)
#define setnodekey(L, node, obj)
#define getnodekey(L, obj, node)
#define BITRAS   (1 << 7)
#define isrealasize(t)
#define setrealasize(t)
#define setnorealasize(t)
#define keytt(node)
#define keyval(node)
#define keyisnil(node)
#define keyisinteger(node)
#define keyival(node)
#define keyisshrstr(node)
#define keystrval(node)
#define setnilkey(node)
#define keyiscollectable(n)
#define gckey(n)
#define gckeyN(n)
#define setdeadkey(node)
#define keyisdead(node)
#define lmod(s, size)
#define twoto(x)
#define sizenode(t)
#define UTF8BUFFSZ   8

Typedefs

typedef union Value Value
typedef struct TValue TValue
typedef union StackValue StackValue
typedef StackValue * StkId
typedef struct GCObject GCObject
typedef struct TString TString
typedef union UValue UValue
typedef struct Udata Udata
typedef struct Udata0 Udata0
typedef struct Upvaldesc Upvaldesc
typedef struct LocVar LocVar
typedef struct AbsLineInfo AbsLineInfo
typedef struct Proto Proto
typedef struct UpVal UpVal
typedef struct CClosure CClosure
typedef struct LClosure LClosure
typedef union Closure Closure
typedef union Node Node
typedef struct Table Table

Functions

LUAI_FUNC int luaO_utf8esc (char *buff, unsigned long x)
LUAI_FUNC int luaO_ceillog2 (unsigned int x)
LUAI_FUNC int luaO_rawarith (lua_State *L, int op, const TValue *p1, const TValue *p2, TValue *res)
LUAI_FUNC void luaO_arith (lua_State *L, int op, const TValue *p1, const TValue *p2, StkId 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, TValue *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 srclen)

Macro Definition Documentation

◆ ABSTKEYCONSTANT

#define ABSTKEYCONSTANT   {NULL}, LUA_VABSTKEY

Definition at line 225 of file lobject.h.

◆ BIT_ISCOLLECTABLE

#define BIT_ISCOLLECTABLE   (1 << 6)

Definition at line 302 of file lobject.h.

◆ BITRAS

#define BITRAS   (1 << 7)

Definition at line 737 of file lobject.h.

◆ checkliveness

#define checkliveness ( L,
obj )
Value:
((void)L, lua_longassert(!iscollectable(obj) || \
(righttt(obj) && (L == NULL || !isdead(G(L),gcvalue(obj))))))

Definition at line 110 of file lobject.h.

◆ checktag

#define checktag ( o,
t )
Value:
(rawtt(o) == (t))

Definition at line 95 of file lobject.h.

◆ checktype

#define checktype ( o,
t )
Value:
(ttype(o) == (t))

Definition at line 96 of file lobject.h.

◆ chgfltvalue

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

Definition at line 345 of file lobject.h.

◆ chgivalue

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

Definition at line 351 of file lobject.h.

◆ clCvalue

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

Definition at line 610 of file lobject.h.

◆ clLvalue

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

Definition at line 608 of file lobject.h.

◆ ClosureHeader

#define ClosureHeader   CommonHeader; lu_byte nupvalues; GCObject *gclist

Definition at line 650 of file lobject.h.

◆ clvalue

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

Definition at line 607 of file lobject.h.

◆ CommonHeader

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

Definition at line 292 of file lobject.h.

◆ ctb

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

Definition at line 307 of file lobject.h.

◆ fltvalue

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

Definition at line 336 of file lobject.h.

◆ fltvalueraw

#define fltvalueraw ( v)
Value:
((v).n)

Definition at line 339 of file lobject.h.

◆ fvalue

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

Definition at line 609 of file lobject.h.

◆ fvalueraw

#define fvalueraw ( v)
Value:
((v).f)

Definition at line 612 of file lobject.h.

◆ gckey

#define gckey ( n)
Value:
(keyval(n).gc)

Definition at line 772 of file lobject.h.

◆ gckeyN

#define gckeyN ( n)
Value:
(keyiscollectable(n) ? gckey(n) : NULL)

Definition at line 773 of file lobject.h.

◆ gcvalue

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

Definition at line 309 of file lobject.h.

◆ gcvalueraw

#define gcvalueraw ( v)
Value:
((v).gc)

Definition at line 311 of file lobject.h.

◆ getnodekey

#define getnodekey ( L,
obj,
node )
Value:
{ TValue *io_=(obj); const Node *n_=(node); \
io_->value_ = n_->u.key_val; io_->tt_ = n_->u.key_tt; \
checkliveness(L,io_); }

Definition at line 724 of file lobject.h.

◆ getproto

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

Definition at line 673 of file lobject.h.

◆ getstr

#define getstr ( ts)
Value:
((ts)->contents)

Definition at line 407 of file lobject.h.

◆ getudatamem

#define getudatamem ( u)
Value:
(cast_charp(u) + udatamemoffset((u)->nuvalue))

Definition at line 499 of file lobject.h.

◆ hvalue

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

Definition at line 688 of file lobject.h.

◆ isabstkey

#define isabstkey ( v)
Value:
checktag((v), LUA_VABSTKEY)

Definition at line 207 of file lobject.h.

◆ iscollectable

#define iscollectable ( o)
Value:
(rawtt(o) & BIT_ISCOLLECTABLE)

Definition at line 304 of file lobject.h.

◆ isempty

#define isempty ( v)
Value:
ttisnil(v)

Definition at line 221 of file lobject.h.

◆ isLfunction

#define isLfunction ( o)
Value:
ttisLclosure(o)

Definition at line 605 of file lobject.h.

◆ isnonstrictnil

#define isnonstrictnil ( v)
Value:
(ttisnil(v) && !ttisstrictnil(v))

Definition at line 213 of file lobject.h.

◆ isrealasize

#define isrealasize ( t)
Value:
(!((t)->flags & BITRAS))

Definition at line 738 of file lobject.h.

◆ ivalue

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

Definition at line 337 of file lobject.h.

◆ ivalueraw

#define ivalueraw ( v)
Value:
((v).i)

Definition at line 340 of file lobject.h.

◆ keyiscollectable

#define keyiscollectable ( n)
Value:
(keytt(n) & BIT_ISCOLLECTABLE)

Definition at line 770 of file lobject.h.

◆ keyisdead

#define keyisdead ( node)
Value:
(keytt(node) == LUA_TDEADKEY)

Definition at line 783 of file lobject.h.

◆ keyisinteger

#define keyisinteger ( node)
Value:
(keytt(node) == LUA_VNUMINT)

Definition at line 763 of file lobject.h.

◆ keyisnil

#define keyisnil ( node)
Value:
(keytt(node) == LUA_TNIL)

Definition at line 762 of file lobject.h.

◆ keyisshrstr

#define keyisshrstr ( node)
Value:
(keytt(node) == ctb(LUA_VSHRSTR))

Definition at line 765 of file lobject.h.

◆ keyival

#define keyival ( node)
Value:
(keyval(node).i)

Definition at line 764 of file lobject.h.

◆ keystrval

#define keystrval ( node)
Value:
(gco2ts(keyval(node).gc))

Definition at line 766 of file lobject.h.

◆ keytt

#define keytt ( node)
Value:
((node)->u.key_tt)

Definition at line 759 of file lobject.h.

◆ keyval

#define keyval ( node)
Value:
((node)->u.key_val)

Definition at line 760 of file lobject.h.

◆ l_isfalse

#define l_isfalse ( o)
Value:
(ttisfalse(o) || ttisnil(o))

Definition at line 251 of file lobject.h.

◆ lmod

#define lmod ( s,
size )
Value:
(check_exp((size&(size-1))==0, (cast_int((s) & ((size)-1)))))

Definition at line 792 of file lobject.h.

◆ LUA_TDEADKEY

#define LUA_TDEADKEY   (LUA_NUMTYPES+2)

Definition at line 28 of file lobject.h.

◆ LUA_TOTALTYPES

#define LUA_TOTALTYPES   (LUA_TPROTO + 2)

Definition at line 35 of file lobject.h.

◆ LUA_TPROTO

#define LUA_TPROTO   (LUA_NUMTYPES+1)

Definition at line 27 of file lobject.h.

◆ LUA_TUPVAL

#define LUA_TUPVAL   LUA_NUMTYPES

Definition at line 26 of file lobject.h.

◆ LUA_VABSTKEY

#define LUA_VABSTKEY   makevariant(LUA_TNIL, 2)

Definition at line 193 of file lobject.h.

◆ LUA_VCCL

#define LUA_VCCL   makevariant(LUA_TFUNCTION, 2)

Definition at line 596 of file lobject.h.

◆ LUA_VEMPTY

#define LUA_VEMPTY   makevariant(LUA_TNIL, 1)

Definition at line 190 of file lobject.h.

◆ LUA_VFALSE

#define LUA_VFALSE   makevariant(LUA_TBOOLEAN, 0)

Definition at line 243 of file lobject.h.

◆ LUA_VLCF

#define LUA_VLCF   makevariant(LUA_TFUNCTION, 1)

Definition at line 595 of file lobject.h.

◆ LUA_VLCL

#define LUA_VLCL   makevariant(LUA_TFUNCTION, 0)

Definition at line 594 of file lobject.h.

◆ LUA_VLIGHTUSERDATA

#define LUA_VLIGHTUSERDATA   makevariant(LUA_TLIGHTUSERDATA, 0)

Definition at line 433 of file lobject.h.

◆ LUA_VLNGSTR

#define LUA_VLNGSTR   makevariant(LUA_TSTRING, 1)

Definition at line 365 of file lobject.h.

◆ LUA_VNIL

#define LUA_VNIL   makevariant(LUA_TNIL, 0)

Definition at line 187 of file lobject.h.

◆ LUA_VNUMFLT

#define LUA_VNUMFLT   makevariant(LUA_TNUMBER, 1)

Definition at line 328 of file lobject.h.

◆ LUA_VNUMINT

#define LUA_VNUMINT   makevariant(LUA_TNUMBER, 0)

Definition at line 327 of file lobject.h.

◆ LUA_VPROTO

#define LUA_VPROTO   makevariant(LUA_TPROTO, 0)

Definition at line 513 of file lobject.h.

◆ LUA_VSHRSTR

#define LUA_VSHRSTR   makevariant(LUA_TSTRING, 0)

Definition at line 364 of file lobject.h.

◆ LUA_VTABLE

#define LUA_VTABLE   makevariant(LUA_TTABLE, 0)

Definition at line 684 of file lobject.h.

◆ LUA_VTHREAD

#define LUA_VTHREAD   makevariant(LUA_TTHREAD, 0)

Definition at line 266 of file lobject.h.

◆ LUA_VTRUE

#define LUA_VTRUE   makevariant(LUA_TBOOLEAN, 1)

Definition at line 244 of file lobject.h.

◆ LUA_VUPVAL

#define LUA_VUPVAL   makevariant(LUA_TUPVAL, 0)

Definition at line 590 of file lobject.h.

◆ LUA_VUSERDATA

#define LUA_VUSERDATA   makevariant(LUA_TUSERDATA, 0)

Definition at line 435 of file lobject.h.

◆ makevariant

#define makevariant ( t,
v )
Value:
((t) | ((v) << 4))

Definition at line 46 of file lobject.h.

◆ novariant

#define novariant ( t)
Value:
((t) & 0x0F)

Definition at line 84 of file lobject.h.

◆ nvalue

#define nvalue ( o)
Value:
check_exp(ttisnumber(o), \
(ttisinteger(o) ? cast_num(ivalue(o)) : fltvalue(o)))

Definition at line 334 of file lobject.h.

◆ pvalue

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

Definition at line 440 of file lobject.h.

◆ pvalueraw

#define pvalueraw ( v)
Value:
((v).p)

Definition at line 443 of file lobject.h.

◆ rawtt

#define rawtt ( o)
Value:
((o)->tt_)

Definition at line 81 of file lobject.h.

◆ righttt

#define righttt ( obj)
Value:
(ttypetag(obj) == gcvalue(obj)->tt)

Definition at line 102 of file lobject.h.

◆ s2v

#define s2v ( o)
Value:
(&(o)->val)

Definition at line 176 of file lobject.h.

◆ setbfvalue

#define setbfvalue ( obj)
Value:
settt_(obj, LUA_VFALSE)

Definition at line 254 of file lobject.h.

◆ setbtvalue

#define setbtvalue ( obj)
Value:
settt_(obj, LUA_VTRUE)

Definition at line 255 of file lobject.h.

◆ setclCvalue

#define setclCvalue ( L,
obj,
x )
Value:
{ TValue *io = (obj); CClosure *x_ = (x); \
val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VCCL)); \
checkliveness(L,io); }

Definition at line 624 of file lobject.h.

◆ setclLvalue

#define setclLvalue ( L,
obj,
x )
Value:
{ TValue *io = (obj); LClosure *x_ = (x); \
val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VLCL)); \
checkliveness(L,io); }

Definition at line 614 of file lobject.h.

◆ setclLvalue2s

#define setclLvalue2s ( L,
o,
cl )
Value:
setclLvalue(L,s2v(o),cl)

Definition at line 619 of file lobject.h.

◆ setdeadkey

#define setdeadkey ( node)
Value:
(keytt(node) = LUA_TDEADKEY)

Definition at line 782 of file lobject.h.

◆ setempty

#define setempty ( v)
Value:
settt_(v, LUA_VEMPTY)

Definition at line 229 of file lobject.h.

◆ setfltvalue

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

Definition at line 342 of file lobject.h.

◆ setfvalue

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

Definition at line 621 of file lobject.h.

◆ setgcovalue

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

Definition at line 313 of file lobject.h.

◆ sethvalue

#define sethvalue ( L,
obj,
x )
Value:
{ TValue *io = (obj); Table *x_ = (x); \
val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTABLE)); \
checkliveness(L,io); }

Definition at line 690 of file lobject.h.

◆ sethvalue2s

#define sethvalue2s ( L,
o,
h )
Value:
sethvalue(L,s2v(o),h)

Definition at line 695 of file lobject.h.

◆ setivalue

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

Definition at line 348 of file lobject.h.

◆ setnilkey

#define setnilkey ( node)
Value:
(keytt(node) = LUA_TNIL)

Definition at line 768 of file lobject.h.

◆ setnilvalue

#define setnilvalue ( obj)
Value:
settt_(obj, LUA_VNIL)

Definition at line 204 of file lobject.h.

◆ setnodekey

#define setnodekey ( L,
node,
obj )
Value:
{ Node *n_=(node); const TValue *io_=(obj); \
n_->u.key_val = io_->value_; n_->u.key_tt = io_->tt_; \
checkliveness(L,io_); }

Definition at line 717 of file lobject.h.

◆ setnorealasize

#define setnorealasize ( t)
Value:
((t)->flags |= BITRAS)

Definition at line 740 of file lobject.h.

◆ setobj

#define setobj ( L,
obj1,
obj2 )
Value:
{ TValue *io1=(obj1); const TValue *io2=(obj2); \
io1->value_ = io2->value_; settt_(io1, io2->tt_); \
checkliveness(L,io1); lua_assert(!isnonstrictnil(io1)); }

Definition at line 122 of file lobject.h.

◆ setobj2n

#define setobj2n   setobj

Definition at line 139 of file lobject.h.

◆ setobj2s

#define setobj2s ( L,
o1,
o2 )
Value:
setobj(L,s2v(o1),o2)

Definition at line 135 of file lobject.h.

◆ setobj2t

#define setobj2t   setobj

Definition at line 141 of file lobject.h.

◆ setobjs2s

#define setobjs2s ( L,
o1,
o2 )
Value:
setobj(L,s2v(o1),s2v(o2))

Definition at line 133 of file lobject.h.

◆ setobjt2t

#define setobjt2t   setobj

Definition at line 137 of file lobject.h.

◆ setpvalue

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

Definition at line 445 of file lobject.h.

◆ setrealasize

#define setrealasize ( t)
Value:
((t)->flags &= cast_byte(~BITRAS))

Definition at line 739 of file lobject.h.

◆ setsvalue

#define setsvalue ( L,
obj,
x )
Value:
{ TValue *io = (obj); TString *x_ = (x); \
val_(io).gc = obj2gco(x_); settt_(io, ctb(x_->tt)); \
checkliveness(L,io); }

Definition at line 375 of file lobject.h.

◆ setsvalue2n

#define setsvalue2n   setsvalue

Definition at line 384 of file lobject.h.

◆ setsvalue2s

#define setsvalue2s ( L,
o,
s )
Value:
setsvalue(L,s2v(o),s)

Definition at line 381 of file lobject.h.

◆ setthvalue

#define setthvalue ( L,
obj,
x )
Value:
{ TValue *io = (obj); lua_State *x_ = (x); \
val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTHREAD)); \
checkliveness(L,io); }

Definition at line 272 of file lobject.h.

◆ setthvalue2s

#define setthvalue2s ( L,
o,
t )
Value:
setthvalue(L,s2v(o),t)

Definition at line 277 of file lobject.h.

◆ settt_

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

Definition at line 118 of file lobject.h.

◆ setuvalue

#define setuvalue ( L,
obj,
x )
Value:
{ TValue *io = (obj); Udata *x_ = (x); \
val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VUSERDATA)); \
checkliveness(L,io); }

Definition at line 448 of file lobject.h.

◆ sizenode

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

Definition at line 797 of file lobject.h.

◆ sizeudata

#define sizeudata ( nuv,
nb )
Value:
(udatamemoffset(nuv) + (nb))

Definition at line 502 of file lobject.h.

◆ svalue

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

Definition at line 411 of file lobject.h.

◆ thvalue

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

Definition at line 270 of file lobject.h.

◆ tsslen

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

Definition at line 414 of file lobject.h.

◆ tsvalue

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

Definition at line 373 of file lobject.h.

◆ tsvalueraw

#define tsvalueraw ( v)
Value:
(gco2ts((v).gc))

Definition at line 371 of file lobject.h.

◆ ttisboolean

#define ttisboolean ( o)
Value:
checktype((o), LUA_TBOOLEAN)

Definition at line 246 of file lobject.h.

◆ ttisCclosure

#define ttisCclosure ( o)
Value:
checktag((o), ctb(LUA_VCCL))

Definition at line 601 of file lobject.h.

◆ ttisclosure

#define ttisclosure ( o)
Value:
(ttisLclosure(o) || ttisCclosure(o))

Definition at line 602 of file lobject.h.

◆ ttisfalse

#define ttisfalse ( o)
Value:
checktag((o), LUA_VFALSE)

Definition at line 247 of file lobject.h.

◆ ttisfloat

#define ttisfloat ( o)
Value:
checktag((o), LUA_VNUMFLT)

Definition at line 331 of file lobject.h.

◆ ttisfulluserdata

#define ttisfulluserdata ( o)
Value:
checktag((o), ctb(LUA_VUSERDATA))

Definition at line 438 of file lobject.h.

◆ ttisfunction

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

Definition at line 598 of file lobject.h.

◆ ttisinteger

#define ttisinteger ( o)
Value:
checktag((o), LUA_VNUMINT)

Definition at line 332 of file lobject.h.

◆ ttislcf

#define ttislcf ( o)
Value:
checktag((o), LUA_VLCF)

Definition at line 600 of file lobject.h.

◆ ttisLclosure

#define ttisLclosure ( o)
Value:
checktag((o), ctb(LUA_VLCL))

Definition at line 599 of file lobject.h.

◆ ttislightuserdata

#define ttislightuserdata ( o)
Value:
checktag((o), LUA_VLIGHTUSERDATA)

Definition at line 437 of file lobject.h.

◆ ttislngstring

#define ttislngstring ( o)
Value:
checktag((o), ctb(LUA_VLNGSTR))

Definition at line 369 of file lobject.h.

◆ ttisnil

#define ttisnil ( v)
Value:
checktype((v), LUA_TNIL)

Definition at line 197 of file lobject.h.

◆ ttisnumber

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

Definition at line 330 of file lobject.h.

◆ ttisshrstring

#define ttisshrstring ( o)
Value:
checktag((o), ctb(LUA_VSHRSTR))

Definition at line 368 of file lobject.h.

◆ ttisstrictnil

#define ttisstrictnil ( o)
Value:
checktag((o), LUA_VNIL)

Definition at line 201 of file lobject.h.

◆ ttisstring

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

Definition at line 367 of file lobject.h.

◆ ttistable

#define ttistable ( o)
Value:
checktag((o), ctb(LUA_VTABLE))

Definition at line 686 of file lobject.h.

◆ ttisthread

#define ttisthread ( o)
Value:
checktag((o), ctb(LUA_VTHREAD))

Definition at line 268 of file lobject.h.

◆ ttistrue

#define ttistrue ( o)
Value:
checktag((o), LUA_VTRUE)

Definition at line 248 of file lobject.h.

◆ ttype

#define ttype ( o)
Value:
(novariant(rawtt(o)))

Definition at line 91 of file lobject.h.

◆ ttypetag

#define ttypetag ( o)
Value:
withvariant(rawtt(o))

Definition at line 88 of file lobject.h.

◆ TValuefields

#define TValuefields   Value value_; lu_byte tt_

Definition at line 69 of file lobject.h.

◆ twoto

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

Definition at line 796 of file lobject.h.

◆ udatamemoffset

#define udatamemoffset ( nuv)
Value:
((nuv) == 0 ? offsetof(Udata0, bindata) \
: offsetof(Udata, uv) + (sizeof(UValue) * (nuv)))

Definition at line 494 of file lobject.h.

◆ UTF8BUFFSZ

#define UTF8BUFFSZ   8

Definition at line 801 of file lobject.h.

◆ uvalue

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

Definition at line 441 of file lobject.h.

◆ val_

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

Definition at line 76 of file lobject.h.

◆ valraw

#define valraw ( o)
Value:
(val_(o))

Definition at line 77 of file lobject.h.

◆ vslen

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

Definition at line 417 of file lobject.h.

◆ withvariant

#define withvariant ( t)
Value:
((t) & 0x3F)

Definition at line 87 of file lobject.h.

Typedef Documentation

◆ StkId

typedef StackValue* StkId

Definition at line 162 of file lobject.h.

Function Documentation

◆ luaO_arith()

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

Definition at line 126 of file lobject.c.

◆ luaO_ceillog2()

LUAI_FUNC int luaO_ceillog2 ( unsigned int x)

Definition at line 35 of file lobject.c.

◆ luaO_chunkid()

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

Definition at line 567 of file lobject.c.

◆ luaO_hexavalue()

LUAI_FUNC int luaO_hexavalue ( int c)

Definition at line 135 of file lobject.c.

◆ luaO_pushfstring()

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

Definition at line 549 of file lobject.c.

◆ luaO_pushvfstring()

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

Definition at line 480 of file lobject.c.

◆ luaO_rawarith()

LUAI_FUNC int luaO_rawarith ( lua_State * L,
int op,
const TValue * p1,
const TValue * p2,
TValue * res )

Definition at line 89 of file lobject.c.

◆ luaO_str2num()

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

Definition at line 308 of file lobject.c.

◆ luaO_tostring()

LUAI_FUNC void luaO_tostring ( lua_State * L,
TValue * obj )

Definition at line 374 of file lobject.c.

◆ luaO_utf8esc()

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

Definition at line 323 of file lobject.c.