32 "$Lua: " LUA_VERSION
" " LUA_COPYRIGHT
" $\n"
33 "$Authors: " LUA_AUTHORS
" $\n"
34 "$URL: www.lua.org $\n";
39 #define api_check(L, o)
42 #define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->base))
44 #define api_incr_top(L) {api_check(L, L->top < L->ci->top); L->top++;}
53 if (idx > LUA_REGISTRYINDEX) {
58 case LUA_REGISTRYINDEX:
return registry(L);
59 case LUA_GLOBALSINDEX:
return gt(L);
62 idx = LUA_GLOBALSINDEX - idx;
64 return (idx <=
clvalue(func)->c.nupvalues)
65 ? &
clvalue(func)->c.upvalue[idx-1]
78 return L->
base + idx - 1;
95 if (o >= L->
top)
return NULL;
130 for (i = 0; i < n; i++) {
142 G(L)->panic = panicf;
236 return (o == NULL) ? LUA_TNONE :
ttype(o);
255 return (o != NULL &&
tonumber(o, &n));
261 return (t == LUA_TSTRING || t == LUA_TNUMBER);
274 return (o1 == NULL || o2 == NULL) ? 0
285 i = (o1 == NULL || o2 == NULL) ? 0
298 i = (o1 == NULL || o2 == NULL) ? 0
363 if (o == NULL)
return NULL;
365 case LUA_TUSERDATA:
return (
uvalue(o) + 1);
366 case LUA_TLIGHTUSERDATA:
return pvalue(o);
367 default:
return NULL;
380 if (o == NULL)
return NULL;
383 case LUA_TTABLE:
return hvalue(o);
384 case LUA_TFUNCTION:
return clvalue(o);
385 case LUA_TTHREAD:
return thvalue(o);
387 case LUA_TLIGHTUSERDATA:
389 default:
return NULL;
542 switch (
ttype(obj)) {
544 mt =
hvalue(obj)->metatable;
547 mt =
uvalue(obj)->uv.metatable;
621 switch (
ttype(obj)) {
626 case LUA_TUSERDATA: {
666 func = L->
top - (nargs+1);
743 const char *chunkname) {
748 if (!chunkname) chunkname =
"?";
779 #define GCscalel(x) ((x)>>10)
780 #define GCscale(x) (cast(int, GCscalel(x)))
781 #define GCunscale(x) (cast(lu_mem, x)<<10)
786 threshold =
GCscale(
G(L)->GCthreshold);
885 for (i=0; i<n; i++) {