27 for (i = 1; i <= n; i++) {
49 for (i = 2; i <= n; i++)
51 for (i = 1; i < n; i++)
58 #define SPACECHARS " \f\n\r\t\v" 64 if (*s ==
'-') { s++; neg = 1; }
65 else if (*s ==
'+') s++;
66 if (!isalnum((
unsigned char)*s))
69 int digit = (isdigit((
unsigned char)*s)) ? *s -
'0' 70 : (toupper((
unsigned char)*s) -
'A') + 10;
71 if (digit >= base)
return NULL;
74 }
while (isalnum((
unsigned char)*s));
103 luaL_argcheck(L, 2 <= base && base <= 36, 2,
"base out of range");
104 if (
b_str2int(s, (
int)base, &n) == s + l) {
142 return luaL_error(L,
"cannot change a protected metatable");
191 static const char *
const opts[] = {
"stop",
"restart",
"collect",
192 "count",
"step",
"setpause",
"setstepmul",
193 "isrunning",
"generational",
"incremental", NULL};
207 int res =
lua_gc(L, o, step);
214 int previous =
lua_gc(L, o, p);
339 #define RESERVEDSLOT 5 359 luaL_error(L,
"reader function must return a string");
424 if (i < 0) i = n + i;
425 else if (i > n) i = n;
LUA_API int lua_isstring(lua_State *L, int idx)
#define lua_isnoneornil(L, n)
#define lua_pushcfunction(L, f)
LUA_API int lua_rawget(lua_State *L, int idx)
static const char * b_str2int(const char *s, int base, lua_Integer *pn)
LUALIB_API int luaL_checkoption(lua_State *L, int arg, const char *def, const char *const lst[])
LUA_API void lua_pushnil(lua_State *L)
LUA_KCONTEXT lua_KContext
static int luaB_print(lua_State *L)
LUA_API int lua_setmetatable(lua_State *L, int objindex)
static int luaB_type(lua_State *L)
LUA_API int lua_toboolean(lua_State *L, int idx)
static const char * generic_reader(lua_State *L, void *ud, size_t *size)
LUA_API void lua_rawset(lua_State *L, int idx)
#define luaL_argexpected(L, cond, arg, tname)
static int luaB_assert(lua_State *L)
LUA_API void lua_setfield(lua_State *L, int idx, const char *k)
#define lua_remove(L, idx)
static int luaB_xpcall(lua_State *L)
static int luaB_tostring(lua_State *L)
LUA_API int lua_error(lua_State *L)
LUALIB_API int luaL_loadbufferx(lua_State *L, const char *buff, size_t size, const char *name, const char *mode)
static int luaB_pcall(lua_State *L)
static int luaB_warn(lua_State *L)
LUA_API const char * lua_pushstring(lua_State *L, const char *s)
static int luaB_error(lua_State *L)
LUA_API int lua_geti(lua_State *L, int idx, lua_Integer n)
LUA_API void lua_pushvalue(lua_State *L, int idx)
#define luaL_loadfile(L, f)
static int luaB_rawequal(lua_State *L)
LUA_API void lua_settop(lua_State *L, int idx)
LUA_API int lua_getmetatable(lua_State *L, int objindex)
LUAMOD_API int luaopen_base(lua_State *L)
static int luaB_rawlen(lua_State *L)
static int luaB_rawset(lua_State *L)
LUA_API void lua_pushboolean(lua_State *L, int b)
static int luaB_select(lua_State *L)
#define lua_pushglobaltable(L)
static int luaB_setmetatable(lua_State *L)
static int pushmode(lua_State *L, int oldmode)
LUA_API int lua_pcallk(lua_State *L, int nargs, int nresults, int errfunc, lua_KContext ctx, lua_KFunction k)
#define lua_writestring(s, l)
LUA_API int lua_gc(lua_State *L, int what,...)
#define lua_pushliteral(L, s)
static int luaB_loadfile(lua_State *L)
LUA_API size_t lua_stringtonumber(lua_State *L, const char *s)
LUA_API const char * lua_tolstring(lua_State *L, int idx, size_t *len)
LUALIB_API void luaL_checkany(lua_State *L, int arg)
static int luaB_next(lua_State *L)
LUALIB_API void luaL_checkstack(lua_State *L, int space, const char *msg)
LUA_API int lua_next(lua_State *L, int idx)
LUALIB_API const char * luaL_tolstring(lua_State *L, int idx, size_t *len)
LUA_API void lua_concat(lua_State *L, int n)
LUALIB_API lua_Integer luaL_checkinteger(lua_State *L, int arg)
static int finishpcall(lua_State *L, int status, lua_KContext extra)
static int ipairsaux(lua_State *L)
LUA_API int lua_type(lua_State *L, int idx)
LUA_API void lua_callk(lua_State *L, int nargs, int nresults, lua_KContext ctx, lua_KFunction k)
static int luaB_tonumber(lua_State *L)
#define lua_replace(L, idx)
LUALIB_API lua_Integer luaL_optinteger(lua_State *L, int arg, lua_Integer def)
#define lua_tostring(L, i)
LUALIB_API int luaL_error(lua_State *L, const char *fmt,...)
static int luaB_getmetatable(lua_State *L)
static int luaB_rawget(lua_State *L)
LUA_UNSIGNED lua_Unsigned
#define lua_call(L, n, r)
LUA_API void lua_rotate(lua_State *L, int idx, int n)
LUA_API int lua_load(lua_State *L, lua_Reader reader, void *data, const char *chunkname, const char *mode)
static int luaB_collectgarbage(lua_State *L)
#define luaL_argcheck(L, cond, arg, extramsg)
static int luaB_pairs(lua_State *L)
static const luaL_Reg base_funcs[]
LUA_API void lua_pushinteger(lua_State *L, lua_Integer n)
LUALIB_API void luaL_checktype(lua_State *L, int arg, int t)
static int dofilecont(lua_State *L, int d1, lua_KContext d2)
static int luaB_ipairs(lua_State *L)
LUALIB_API int luaL_loadfilex(lua_State *L, const char *filename, const char *mode)
static int luaB_dofile(lua_State *L)
LUA_API const char * lua_setupvalue(lua_State *L, int funcindex, int n)
#define lua_insert(L, idx)
void lua_warning(lua_State *L, const char *msg, int tocont)
static int luaB_load(lua_State *L)
LUALIB_API int luaL_getmetafield(lua_State *L, int obj, const char *event)
LUALIB_API void luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup)
static int load_aux(lua_State *L, int status, int envidx)
LUA_API void lua_pushnumber(lua_State *L, lua_Number n)
LUA_API int lua_rawequal(lua_State *L, int index1, int index2)
#define luaL_optstring(L, n, d)
LUALIB_API void luaL_where(lua_State *L, int level)
LUA_API int lua_gettop(lua_State *L)
LUA_API lua_Unsigned lua_rawlen(lua_State *L, int idx)
#define luaL_checkstring(L, n)
LUA_API const char * lua_typename(lua_State *L, int t)