lua5.4
| 宏定义 | 类型定义 | 函数
lobject.h 文件参考
#include <stdarg.h>
#include "llimits.h"
#include "lua.h"
lobject.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

union  Value
 
struct  TValue
 
union  StackValue
 
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
 

宏定义

#define LUA_TUPVAL   LUA_NUMTYPES /* upvalues */
 
#define LUA_TPROTO   (LUA_NUMTYPES+1) /* function prototypes */
 
#define LUA_TDEADKEY   (LUA_NUMTYPES+2) /* removed keys in tables */
 
#define LUA_TOTALTYPES   (LUA_TPROTO + 2)
 
#define makevariant(t, v)   ((t) | ((v) << 4))
 
#define TValuefields   Value value_; lu_byte tt_
 
#define val_(o)   ((o)->value_)
 
#define valraw(o)   (&val_(o))
 
#define rawtt(o)   ((o)->tt_)
 
#define novariant(t)   ((t) & 0x0F)
 
#define withvariant(t)   ((t) & 0x3F)
 
#define ttypetag(o)   withvariant(rawtt(o))
 
#define ttype(o)   (novariant(rawtt(o)))
 
#define checktag(o, t)   (rawtt(o) == (t))
 
#define checktype(o, t)   (ttype(o) == (t))
 
#define righttt(obj)   (ttypetag(obj) == gcvalue(obj)->tt)
 
#define checkliveness(L, obj)
 
#define settt_(o, t)   ((o)->tt_=(t))
 
#define setobj(L, obj1, obj2)
 
#define setobjs2s(L, o1, o2)   setobj(L,s2v(o1),s2v(o2))
 
#define setobj2s(L, o1, o2)   setobj(L,s2v(o1),o2)
 
#define setobjt2t   setobj
 
#define setobj2n   setobj
 
#define setobj2t   setobj
 
#define s2v(o)   (&(o)->val)
 
#define LUA_VNIL   makevariant(LUA_TNIL, 0)
 
#define LUA_VEMPTY   makevariant(LUA_TNIL, 1)
 
#define LUA_VABSTKEY   makevariant(LUA_TNIL, 2)
 
#define ttisnil(v)   checktype((v), LUA_TNIL)
 
#define ttisstrictnil(o)   checktag((o), LUA_VNIL)
 
#define setnilvalue(obj)   settt_(obj, LUA_VNIL)
 
#define isabstkey(v)   checktag((v), LUA_VABSTKEY)
 
#define isnonstrictnil(v)   (ttisnil(v) && !ttisstrictnil(v))
 
#define isempty(v)   ttisnil(v)
 
#define ABSTKEYCONSTANT   {NULL}, LUA_VABSTKEY
 
#define setempty(v)   settt_(v, LUA_VEMPTY)
 
#define LUA_VFALSE   makevariant(LUA_TBOOLEAN, 0)
 
#define LUA_VTRUE   makevariant(LUA_TBOOLEAN, 1)
 
#define ttisboolean(o)   checktype((o), LUA_TBOOLEAN)
 
#define ttisfalse(o)   checktag((o), LUA_VFALSE)
 
#define ttistrue(o)   checktag((o), LUA_VTRUE)
 
#define l_isfalse(o)   (ttisfalse(o) || ttisnil(o))
 
#define setbfvalue(obj)   settt_(obj, LUA_VFALSE)
 
#define setbtvalue(obj)   settt_(obj, LUA_VTRUE)
 
#define LUA_VTHREAD   makevariant(LUA_TTHREAD, 0)
 
#define ttisthread(o)   checktag((o), ctb(LUA_VTHREAD))
 
#define thvalue(o)   check_exp(ttisthread(o), gco2th(val_(o).gc))
 
#define setthvalue(L, obj, x)
 
#define setthvalue2s(L, o, t)   setthvalue(L,s2v(o),t)
 
#define CommonHeader   struct GCObject *next; lu_byte tt; lu_byte marked
 
#define BIT_ISCOLLECTABLE   (1 << 6)
 
#define iscollectable(o)   (rawtt(o) & BIT_ISCOLLECTABLE)
 
#define ctb(t)   ((t) | BIT_ISCOLLECTABLE)
 
#define gcvalue(o)   check_exp(iscollectable(o), val_(o).gc)
 
#define gcvalueraw(v)   ((v).gc)
 
#define setgcovalue(L, obj, x)
 
#define LUA_VNUMINT   makevariant(LUA_TNUMBER, 0) /* integer numbers */
 
#define LUA_VNUMFLT   makevariant(LUA_TNUMBER, 1) /* float numbers */
 
#define ttisnumber(o)   checktype((o), LUA_TNUMBER)
 
#define ttisfloat(o)   checktag((o), LUA_VNUMFLT)
 
#define ttisinteger(o)   checktag((o), LUA_VNUMINT)
 
#define nvalue(o)
 
#define fltvalue(o)   check_exp(ttisfloat(o), val_(o).n)
 
#define ivalue(o)   check_exp(ttisinteger(o), val_(o).i)
 
#define fltvalueraw(v)   ((v).n)
 
#define ivalueraw(v)   ((v).i)
 
#define setfltvalue(obj, x)   { TValue *io=(obj); val_(io).n=(x); settt_(io, LUA_VNUMFLT); }
 
#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_VNUMINT); }
 
#define chgivalue(obj, x)   { TValue *io=(obj); lua_assert(ttisinteger(io)); val_(io).i=(x); }
 
#define LUA_VSHRSTR   makevariant(LUA_TSTRING, 0) /* short strings */
 
#define LUA_VLNGSTR   makevariant(LUA_TSTRING, 1) /* long strings */
 
#define ttisstring(o)   checktype((o), LUA_TSTRING)
 
#define ttisshrstring(o)   checktag((o), ctb(LUA_VSHRSTR))
 
#define ttislngstring(o)   checktag((o), ctb(LUA_VLNGSTR))
 
#define tsvalueraw(v)   (gco2ts((v).gc))
 
#define tsvalue(o)   check_exp(ttisstring(o), gco2ts(val_(o).gc))
 
#define setsvalue(L, obj, x)
 
#define setsvalue2s(L, o, s)   setsvalue(L,s2v(o),s)
 
#define setsvalue2n   setsvalue
 
#define getstr(ts)   ((ts)->contents)
 
#define svalue(o)   getstr(tsvalue(o))
 
#define tsslen(s)   ((s)->tt == LUA_VSHRSTR ? (s)->shrlen : (s)->u.lnglen)
 
#define vslen(o)   tsslen(tsvalue(o))
 
#define LUA_VLIGHTUSERDATA   makevariant(LUA_TLIGHTUSERDATA, 0)
 
#define LUA_VUSERDATA   makevariant(LUA_TUSERDATA, 0)
 
#define ttislightuserdata(o)   checktag((o), LUA_VLIGHTUSERDATA)
 
#define ttisfulluserdata(o)   checktag((o), ctb(LUA_VUSERDATA))
 
#define pvalue(o)   check_exp(ttislightuserdata(o), val_(o).p)
 
#define uvalue(o)   check_exp(ttisfulluserdata(o), gco2u(val_(o).gc))
 
#define pvalueraw(v)   ((v).p)
 
#define setpvalue(obj, x)   { TValue *io=(obj); val_(io).p=(x); settt_(io, LUA_VLIGHTUSERDATA); }
 
#define setuvalue(L, obj, x)
 
#define udatamemoffset(nuv)
 
#define getudatamem(u)   (cast_charp(u) + udatamemoffset((u)->nuvalue))
 
#define sizeudata(nuv, nb)   (udatamemoffset(nuv) + (nb))
 
#define LUA_VPROTO   makevariant(LUA_TPROTO, 0)
 
#define LUA_VUPVAL   makevariant(LUA_TUPVAL, 0)
 
#define LUA_VLCL   makevariant(LUA_TFUNCTION, 0) /* Lua closure */
 
#define LUA_VLCF   makevariant(LUA_TFUNCTION, 1) /* light C function */
 
#define LUA_VCCL   makevariant(LUA_TFUNCTION, 2) /* C closure */
 
#define ttisfunction(o)   checktype(o, LUA_TFUNCTION)
 
#define ttisclosure(o)   ((rawtt(o) & 0x1F) == LUA_VLCL)
 
#define ttisLclosure(o)   checktag((o), ctb(LUA_VLCL))
 
#define ttislcf(o)   checktag((o), LUA_VLCF)
 
#define ttisCclosure(o)   checktag((o), ctb(LUA_VCCL))
 
#define isLfunction(o)   ttisLclosure(o)
 
#define clvalue(o)   check_exp(ttisclosure(o), gco2cl(val_(o).gc))
 
#define clLvalue(o)   check_exp(ttisLclosure(o), gco2lcl(val_(o).gc))
 
#define fvalue(o)   check_exp(ttislcf(o), val_(o).f)
 
#define clCvalue(o)   check_exp(ttisCclosure(o), gco2ccl(val_(o).gc))
 
#define fvalueraw(v)   ((v).f)
 
#define setclLvalue(L, obj, x)
 
#define setclLvalue2s(L, o, cl)   setclLvalue(L,s2v(o),cl)
 
#define setfvalue(obj, x)   { TValue *io=(obj); val_(io).f=(x); settt_(io, LUA_VLCF); }
 
#define setclCvalue(L, obj, x)
 
#define ClosureHeader   CommonHeader; lu_byte nupvalues; GCObject *gclist
 
#define getproto(o)   (clLvalue(o)->p)
 
#define LUA_VTABLE   makevariant(LUA_TTABLE, 0)
 
#define ttistable(o)   checktag((o), ctb(LUA_VTABLE))
 
#define hvalue(o)   check_exp(ttistable(o), gco2t(val_(o).gc))
 
#define sethvalue(L, obj, x)
 
#define sethvalue2s(L, o, h)   sethvalue(L,s2v(o),h)
 
#define setnodekey(L, node, obj)
 
#define getnodekey(L, obj, node)
 
#define BITRAS   (1 << 7)
 
#define isrealasize(t)   (!((t)->flags & BITRAS))
 
#define setrealasize(t)   ((t)->flags &= cast_byte(~BITRAS))
 
#define setnorealasize(t)   ((t)->flags |= BITRAS)
 
#define keytt(node)   ((node)->u.key_tt)
 
#define keyval(node)   ((node)->u.key_val)
 
#define keyisnil(node)   (keytt(node) == LUA_TNIL)
 
#define keyisinteger(node)   (keytt(node) == LUA_VNUMINT)
 
#define keyival(node)   (keyval(node).i)
 
#define keyisshrstr(node)   (keytt(node) == ctb(LUA_VSHRSTR))
 
#define keystrval(node)   (gco2ts(keyval(node).gc))
 
#define setnilkey(node)   (keytt(node) = LUA_TNIL)
 
#define keyiscollectable(n)   (keytt(n) & BIT_ISCOLLECTABLE)
 
#define gckey(n)   (keyval(n).gc)
 
#define gckeyN(n)   (keyiscollectable(n) ? gckey(n) : NULL)
 
#define setdeadkey(node)   (keytt(node) = LUA_TDEADKEY)
 
#define keyisdead(node)   (keytt(node) == LUA_TDEADKEY)
 
#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 UTF8BUFFSZ   8
 

类型定义

typedef union Value Value
 
typedef struct TValue TValue
 
typedef union StackValue StackValue
 
typedef StackValueStkId
 
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
 

函数

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)
 

宏定义说明

◆ ABSTKEYCONSTANT

#define ABSTKEYCONSTANT   {NULL}, LUA_VABSTKEY

◆ BIT_ISCOLLECTABLE

#define BIT_ISCOLLECTABLE   (1 << 6)

◆ BITRAS

#define BITRAS   (1 << 7)

◆ checkliveness

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

◆ checktag

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

◆ checktype

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

◆ chgfltvalue

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

◆ chgivalue

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

◆ 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

◆ clvalue

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

◆ CommonHeader

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

◆ ctb

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

◆ fltvalue

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

◆ fltvalueraw

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

◆ fvalue

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

◆ fvalueraw

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

◆ gckey

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

◆ gckeyN

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

◆ gcvalue

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

◆ gcvalueraw

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

◆ getnodekey

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

◆ getproto

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

◆ getstr

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

◆ getudatamem

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

◆ hvalue

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

◆ isabstkey

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

◆ iscollectable

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

◆ isempty

#define isempty (   v)    ttisnil(v)

◆ isLfunction

#define isLfunction (   o)    ttisLclosure(o)

◆ isnonstrictnil

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

◆ isrealasize

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

◆ ivalue

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

◆ ivalueraw

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

◆ keyiscollectable

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

◆ keyisdead

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

◆ keyisinteger

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

◆ keyisnil

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

◆ keyisshrstr

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

◆ keyival

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

◆ keystrval

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

◆ keytt

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

◆ keyval

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

◆ l_isfalse

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

◆ lmod

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

◆ LUA_TDEADKEY

#define LUA_TDEADKEY   (LUA_NUMTYPES+2) /* removed keys in tables */

◆ LUA_TOTALTYPES

#define LUA_TOTALTYPES   (LUA_TPROTO + 2)

◆ LUA_TPROTO

#define LUA_TPROTO   (LUA_NUMTYPES+1) /* function prototypes */

◆ LUA_TUPVAL

#define LUA_TUPVAL   LUA_NUMTYPES /* upvalues */

◆ LUA_VABSTKEY

#define LUA_VABSTKEY   makevariant(LUA_TNIL, 2)

◆ LUA_VCCL

#define LUA_VCCL   makevariant(LUA_TFUNCTION, 2) /* C closure */

◆ LUA_VEMPTY

#define LUA_VEMPTY   makevariant(LUA_TNIL, 1)

◆ LUA_VFALSE

#define LUA_VFALSE   makevariant(LUA_TBOOLEAN, 0)

◆ LUA_VLCF

#define LUA_VLCF   makevariant(LUA_TFUNCTION, 1) /* light C function */

◆ LUA_VLCL

#define LUA_VLCL   makevariant(LUA_TFUNCTION, 0) /* Lua closure */

◆ LUA_VLIGHTUSERDATA

#define LUA_VLIGHTUSERDATA   makevariant(LUA_TLIGHTUSERDATA, 0)

◆ LUA_VLNGSTR

#define LUA_VLNGSTR   makevariant(LUA_TSTRING, 1) /* long strings */

◆ LUA_VNIL

#define LUA_VNIL   makevariant(LUA_TNIL, 0)

◆ LUA_VNUMFLT

#define LUA_VNUMFLT   makevariant(LUA_TNUMBER, 1) /* float numbers */

◆ LUA_VNUMINT

#define LUA_VNUMINT   makevariant(LUA_TNUMBER, 0) /* integer numbers */

◆ LUA_VPROTO

#define LUA_VPROTO   makevariant(LUA_TPROTO, 0)

◆ LUA_VSHRSTR

#define LUA_VSHRSTR   makevariant(LUA_TSTRING, 0) /* short strings */

◆ LUA_VTABLE

#define LUA_VTABLE   makevariant(LUA_TTABLE, 0)

◆ LUA_VTHREAD

#define LUA_VTHREAD   makevariant(LUA_TTHREAD, 0)

◆ LUA_VTRUE

#define LUA_VTRUE   makevariant(LUA_TBOOLEAN, 1)

◆ LUA_VUPVAL

#define LUA_VUPVAL   makevariant(LUA_TUPVAL, 0)

◆ LUA_VUSERDATA

#define LUA_VUSERDATA   makevariant(LUA_TUSERDATA, 0)

◆ makevariant

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

◆ novariant

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

◆ nvalue

#define nvalue (   o)
值:

◆ pvalue

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

◆ pvalueraw

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

◆ rawtt

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

◆ righttt

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

◆ s2v

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

◆ setbfvalue

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

◆ setbtvalue

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

◆ setclCvalue

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

◆ setclLvalue

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

◆ setclLvalue2s

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

◆ setdeadkey

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

◆ setempty

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

◆ setfltvalue

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

◆ setfvalue

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

◆ setgcovalue

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

◆ sethvalue

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

◆ sethvalue2s

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

◆ setivalue

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

◆ setnilkey

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

◆ setnilvalue

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

◆ setnodekey

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

◆ setnorealasize

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

◆ setobj

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

◆ setobj2n

#define setobj2n   setobj

◆ setobj2s

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

◆ setobj2t

#define setobj2t   setobj

◆ setobjs2s

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

◆ setobjt2t

#define setobjt2t   setobj

◆ setpvalue

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

◆ setrealasize

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

◆ setsvalue

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

◆ setsvalue2n

#define setsvalue2n   setsvalue

◆ setsvalue2s

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

◆ setthvalue

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

◆ setthvalue2s

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

◆ settt_

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

◆ setuvalue

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

◆ sizenode

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

◆ sizeudata

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

◆ svalue

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

◆ thvalue

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

◆ tsslen

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

◆ tsvalue

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

◆ tsvalueraw

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

◆ ttisboolean

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

◆ ttisCclosure

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

◆ ttisclosure

#define ttisclosure (   o)    ((rawtt(o) & 0x1F) == LUA_VLCL)

◆ ttisfalse

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

◆ ttisfloat

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

◆ ttisfulluserdata

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

◆ ttisfunction

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

◆ ttisinteger

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

◆ ttislcf

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

◆ ttisLclosure

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

◆ ttislightuserdata

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

◆ ttislngstring

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

◆ ttisnil

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

◆ ttisnumber

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

◆ ttisshrstring

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

◆ ttisstrictnil

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

◆ ttisstring

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

◆ ttistable

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

◆ ttisthread

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

◆ ttistrue

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

◆ ttype

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

◆ ttypetag

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

◆ TValuefields

#define TValuefields   Value value_; lu_byte tt_

◆ twoto

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

◆ udatamemoffset

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

◆ UTF8BUFFSZ

#define UTF8BUFFSZ   8

◆ uvalue

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

◆ val_

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

◆ valraw

#define valraw (   o)    (&val_(o))

◆ vslen

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

◆ withvariant

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

类型定义说明

◆ AbsLineInfo

typedef struct AbsLineInfo AbsLineInfo

◆ CClosure

typedef struct CClosure CClosure

◆ Closure

typedef union Closure Closure

◆ GCObject

typedef struct GCObject GCObject

◆ LClosure

typedef struct LClosure LClosure

◆ LocVar

typedef struct LocVar LocVar

◆ Node

typedef union Node Node

◆ Proto

typedef struct Proto Proto

◆ StackValue

typedef union StackValue StackValue

◆ StkId

typedef StackValue* StkId

◆ Table

typedef struct Table Table

◆ TString

typedef struct TString TString

◆ TValue

typedef struct TValue TValue

◆ Udata

typedef struct Udata Udata

◆ Udata0

typedef struct Udata0 Udata0

◆ UpVal

typedef struct UpVal UpVal

◆ Upvaldesc

typedef struct Upvaldesc Upvaldesc

◆ UValue

typedef union UValue UValue

◆ Value

typedef union Value Value

函数说明

◆ luaO_arith()

LUAI_FUNC void luaO_arith ( lua_State L,
int  op,
const TValue p1,
const TValue p2,
StkId  res 
)
函数调用图:
这是这个函数的调用关系图:

◆ luaO_ceillog2()

LUAI_FUNC int luaO_ceillog2 ( unsigned int  x)
这是这个函数的调用关系图:

◆ luaO_chunkid()

LUAI_FUNC void luaO_chunkid ( char *  out,
const char *  source,
size_t  srclen 
)
这是这个函数的调用关系图:

◆ luaO_hexavalue()

LUAI_FUNC int luaO_hexavalue ( int  c)
这是这个函数的调用关系图:

◆ 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_rawarith()

LUAI_FUNC int luaO_rawarith ( lua_State L,
int  op,
const TValue p1,
const TValue p2,
TValue res 
)
函数调用图:
这是这个函数的调用关系图:

◆ luaO_str2num()

LUAI_FUNC size_t luaO_str2num ( const char *  s,
TValue o 
)
函数调用图:
这是这个函数的调用关系图:

◆ luaO_tostring()

LUAI_FUNC void luaO_tostring ( lua_State L,
TValue obj 
)
函数调用图:
这是这个函数的调用关系图:

◆ luaO_utf8esc()

LUAI_FUNC int luaO_utf8esc ( char *  buff,
unsigned long  x 
)
这是这个函数的调用关系图:
LUA_VTHREAD
#define LUA_VTHREAD
Definition: lobject.h:240
lua_assert
#define lua_assert(c)
Definition: lauxlib.h:169
Udata0
Definition: lobject.h:458
Node::NodeKey::key_tt
lu_byte key_tt
Definition: lobject.h:679
obj2gco
#define obj2gco(v)
Definition: lstate.h:347
gcvalue
#define gcvalue(o)
Definition: lobject.h:283
ttisinteger
#define ttisinteger(o)
Definition: lobject.h:306
isnonstrictnil
#define isnonstrictnil(v)
Definition: lobject.h:187
LUA_VTABLE
#define LUA_VTABLE
Definition: lobject.h:655
UValue
union UValue UValue
fltvalue
#define fltvalue(o)
Definition: lobject.h:310
ivalue
#define ivalue(o)
Definition: lobject.h:311
CClosure
Definition: lobject.h:624
G
#define G(L)
Definition: lstate.h:298
TString
Definition: lobject.h:364
righttt
#define righttt(obj)
Definition: lobject.h:96
Table
Definition: lobject.h:714
Udata
Definition: lobject.h:439
Node::NodeKey::key_val
Value key_val
Definition: lobject.h:681
lua_State
Definition: lstate.h:273
TValue
Definition: lobject.h:65
LClosure
Definition: lobject.h:631
lua_longassert
#define lua_longassert(c)
Definition: llimits.h:103
isdead
#define isdead(g, v)
Definition: lgc.h:96
Node::u
struct Node::NodeKey u
ttisnumber
#define ttisnumber(o)
Definition: lobject.h:304
Node
Definition: lobject.h:676
LUA_VLCL
#define LUA_VLCL
Definition: lobject.h:568
GCObject
Definition: lobject.h:270
LUA_VCCL
#define LUA_VCCL
Definition: lobject.h:570
LUA_VUSERDATA
#define LUA_VUSERDATA
Definition: lobject.h:409
iscollectable
#define iscollectable(o)
Definition: lobject.h:278
ctb
#define ctb(t)
Definition: lobject.h:281
cast_num
#define cast_num(i)
Definition: llimits.h:127
settt_
#define settt_(o, t)
Definition: lobject.h:112
check_exp
#define check_exp(c, e)
Definition: llimits.h:102