mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-18 10:53:45 +01:00
Removed LUALIB_API from source file method bodies (#235)
This commit is contained in:
parent
222f03bbda
commit
f86d4c6995
11 changed files with 46 additions and 46 deletions
|
@ -30,7 +30,7 @@ static const char* currfuncname(lua_State* L)
|
||||||
return debugname;
|
return debugname;
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API l_noret luaL_argerrorL(lua_State* L, int narg, const char* extramsg)
|
l_noret luaL_argerrorL(lua_State* L, int narg, const char* extramsg)
|
||||||
{
|
{
|
||||||
const char* fname = currfuncname(L);
|
const char* fname = currfuncname(L);
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ LUALIB_API l_noret luaL_argerrorL(lua_State* L, int narg, const char* extramsg)
|
||||||
luaL_error(L, "invalid argument #%d (%s)", narg, extramsg);
|
luaL_error(L, "invalid argument #%d (%s)", narg, extramsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API l_noret luaL_typeerrorL(lua_State* L, int narg, const char* tname)
|
l_noret luaL_typeerrorL(lua_State* L, int narg, const char* tname)
|
||||||
{
|
{
|
||||||
const char* fname = currfuncname(L);
|
const char* fname = currfuncname(L);
|
||||||
const TValue* obj = luaA_toobject(L, narg);
|
const TValue* obj = luaA_toobject(L, narg);
|
||||||
|
@ -66,7 +66,7 @@ static l_noret tag_error(lua_State* L, int narg, int tag)
|
||||||
luaL_typeerrorL(L, narg, lua_typename(L, tag));
|
luaL_typeerrorL(L, narg, lua_typename(L, tag));
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API void luaL_where(lua_State* L, int level)
|
void luaL_where(lua_State* L, int level)
|
||||||
{
|
{
|
||||||
lua_Debug ar;
|
lua_Debug ar;
|
||||||
if (lua_getinfo(L, level, "sl", &ar) && ar.currentline > 0)
|
if (lua_getinfo(L, level, "sl", &ar) && ar.currentline > 0)
|
||||||
|
@ -77,7 +77,7 @@ LUALIB_API void luaL_where(lua_State* L, int level)
|
||||||
lua_pushliteral(L, ""); /* else, no information available... */
|
lua_pushliteral(L, ""); /* else, no information available... */
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API l_noret luaL_errorL(lua_State* L, const char* fmt, ...)
|
l_noret luaL_errorL(lua_State* L, const char* fmt, ...)
|
||||||
{
|
{
|
||||||
va_list argp;
|
va_list argp;
|
||||||
va_start(argp, fmt);
|
va_start(argp, fmt);
|
||||||
|
@ -90,7 +90,7 @@ LUALIB_API l_noret luaL_errorL(lua_State* L, const char* fmt, ...)
|
||||||
|
|
||||||
/* }====================================================== */
|
/* }====================================================== */
|
||||||
|
|
||||||
LUALIB_API int luaL_checkoption(lua_State* L, int narg, const char* def, const char* const lst[])
|
int luaL_checkoption(lua_State* L, int narg, const char* def, const char* const lst[])
|
||||||
{
|
{
|
||||||
const char* name = (def) ? luaL_optstring(L, narg, def) : luaL_checkstring(L, narg);
|
const char* name = (def) ? luaL_optstring(L, narg, def) : luaL_checkstring(L, narg);
|
||||||
int i;
|
int i;
|
||||||
|
@ -101,7 +101,7 @@ LUALIB_API int luaL_checkoption(lua_State* L, int narg, const char* def, const c
|
||||||
luaL_argerrorL(L, narg, msg);
|
luaL_argerrorL(L, narg, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API int luaL_newmetatable(lua_State* L, const char* tname)
|
int luaL_newmetatable(lua_State* L, const char* tname)
|
||||||
{
|
{
|
||||||
lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get registry.name */
|
lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get registry.name */
|
||||||
if (!lua_isnil(L, -1)) /* name already in use? */
|
if (!lua_isnil(L, -1)) /* name already in use? */
|
||||||
|
@ -113,7 +113,7 @@ LUALIB_API int luaL_newmetatable(lua_State* L, const char* tname)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API void* luaL_checkudata(lua_State* L, int ud, const char* tname)
|
void* luaL_checkudata(lua_State* L, int ud, const char* tname)
|
||||||
{
|
{
|
||||||
void* p = lua_touserdata(L, ud);
|
void* p = lua_touserdata(L, ud);
|
||||||
if (p != NULL)
|
if (p != NULL)
|
||||||
|
@ -131,25 +131,25 @@ LUALIB_API void* luaL_checkudata(lua_State* L, int ud, const char* tname)
|
||||||
luaL_typeerrorL(L, ud, tname); /* else error */
|
luaL_typeerrorL(L, ud, tname); /* else error */
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API void luaL_checkstack(lua_State* L, int space, const char* mes)
|
void luaL_checkstack(lua_State* L, int space, const char* mes)
|
||||||
{
|
{
|
||||||
if (!lua_checkstack(L, space))
|
if (!lua_checkstack(L, space))
|
||||||
luaL_error(L, "stack overflow (%s)", mes);
|
luaL_error(L, "stack overflow (%s)", mes);
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API void luaL_checktype(lua_State* L, int narg, int t)
|
void luaL_checktype(lua_State* L, int narg, int t)
|
||||||
{
|
{
|
||||||
if (lua_type(L, narg) != t)
|
if (lua_type(L, narg) != t)
|
||||||
tag_error(L, narg, t);
|
tag_error(L, narg, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API void luaL_checkany(lua_State* L, int narg)
|
void luaL_checkany(lua_State* L, int narg)
|
||||||
{
|
{
|
||||||
if (lua_type(L, narg) == LUA_TNONE)
|
if (lua_type(L, narg) == LUA_TNONE)
|
||||||
luaL_error(L, "missing argument #%d", narg);
|
luaL_error(L, "missing argument #%d", narg);
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API const char* luaL_checklstring(lua_State* L, int narg, size_t* len)
|
const char* luaL_checklstring(lua_State* L, int narg, size_t* len)
|
||||||
{
|
{
|
||||||
const char* s = lua_tolstring(L, narg, len);
|
const char* s = lua_tolstring(L, narg, len);
|
||||||
if (!s)
|
if (!s)
|
||||||
|
@ -157,7 +157,7 @@ LUALIB_API const char* luaL_checklstring(lua_State* L, int narg, size_t* len)
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API const char* luaL_optlstring(lua_State* L, int narg, const char* def, size_t* len)
|
const char* luaL_optlstring(lua_State* L, int narg, const char* def, size_t* len)
|
||||||
{
|
{
|
||||||
if (lua_isnoneornil(L, narg))
|
if (lua_isnoneornil(L, narg))
|
||||||
{
|
{
|
||||||
|
@ -169,7 +169,7 @@ LUALIB_API const char* luaL_optlstring(lua_State* L, int narg, const char* def,
|
||||||
return luaL_checklstring(L, narg, len);
|
return luaL_checklstring(L, narg, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API double luaL_checknumber(lua_State* L, int narg)
|
double luaL_checknumber(lua_State* L, int narg)
|
||||||
{
|
{
|
||||||
int isnum;
|
int isnum;
|
||||||
double d = lua_tonumberx(L, narg, &isnum);
|
double d = lua_tonumberx(L, narg, &isnum);
|
||||||
|
@ -178,12 +178,12 @@ LUALIB_API double luaL_checknumber(lua_State* L, int narg)
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API double luaL_optnumber(lua_State* L, int narg, double def)
|
double luaL_optnumber(lua_State* L, int narg, double def)
|
||||||
{
|
{
|
||||||
return luaL_opt(L, luaL_checknumber, narg, def);
|
return luaL_opt(L, luaL_checknumber, narg, def);
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API int luaL_checkboolean(lua_State* L, int narg)
|
int luaL_checkboolean(lua_State* L, int narg)
|
||||||
{
|
{
|
||||||
// This checks specifically for boolean values, ignoring
|
// This checks specifically for boolean values, ignoring
|
||||||
// all other truthy/falsy values. If the desired result
|
// all other truthy/falsy values. If the desired result
|
||||||
|
@ -194,12 +194,12 @@ LUALIB_API int luaL_checkboolean(lua_State* L, int narg)
|
||||||
return lua_toboolean(L, narg);
|
return lua_toboolean(L, narg);
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API int luaL_optboolean(lua_State* L, int narg, int def)
|
int luaL_optboolean(lua_State* L, int narg, int def)
|
||||||
{
|
{
|
||||||
return luaL_opt(L, luaL_checkboolean, narg, def);
|
return luaL_opt(L, luaL_checkboolean, narg, def);
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API int luaL_checkinteger(lua_State* L, int narg)
|
int luaL_checkinteger(lua_State* L, int narg)
|
||||||
{
|
{
|
||||||
int isnum;
|
int isnum;
|
||||||
int d = lua_tointegerx(L, narg, &isnum);
|
int d = lua_tointegerx(L, narg, &isnum);
|
||||||
|
@ -208,12 +208,12 @@ LUALIB_API int luaL_checkinteger(lua_State* L, int narg)
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API int luaL_optinteger(lua_State* L, int narg, int def)
|
int luaL_optinteger(lua_State* L, int narg, int def)
|
||||||
{
|
{
|
||||||
return luaL_opt(L, luaL_checkinteger, narg, def);
|
return luaL_opt(L, luaL_checkinteger, narg, def);
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API unsigned luaL_checkunsigned(lua_State* L, int narg)
|
unsigned luaL_checkunsigned(lua_State* L, int narg)
|
||||||
{
|
{
|
||||||
int isnum;
|
int isnum;
|
||||||
unsigned d = lua_tounsignedx(L, narg, &isnum);
|
unsigned d = lua_tounsignedx(L, narg, &isnum);
|
||||||
|
@ -222,12 +222,12 @@ LUALIB_API unsigned luaL_checkunsigned(lua_State* L, int narg)
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API unsigned luaL_optunsigned(lua_State* L, int narg, unsigned def)
|
unsigned luaL_optunsigned(lua_State* L, int narg, unsigned def)
|
||||||
{
|
{
|
||||||
return luaL_opt(L, luaL_checkunsigned, narg, def);
|
return luaL_opt(L, luaL_checkunsigned, narg, def);
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API int luaL_getmetafield(lua_State* L, int obj, const char* event)
|
int luaL_getmetafield(lua_State* L, int obj, const char* event)
|
||||||
{
|
{
|
||||||
if (!lua_getmetatable(L, obj)) /* no metatable? */
|
if (!lua_getmetatable(L, obj)) /* no metatable? */
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -245,7 +245,7 @@ LUALIB_API int luaL_getmetafield(lua_State* L, int obj, const char* event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API int luaL_callmeta(lua_State* L, int obj, const char* event)
|
int luaL_callmeta(lua_State* L, int obj, const char* event)
|
||||||
{
|
{
|
||||||
obj = abs_index(L, obj);
|
obj = abs_index(L, obj);
|
||||||
if (!luaL_getmetafield(L, obj, event)) /* no metafield? */
|
if (!luaL_getmetafield(L, obj, event)) /* no metafield? */
|
||||||
|
@ -263,7 +263,7 @@ static int libsize(const luaL_Reg* l)
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API void luaL_register(lua_State* L, const char* libname, const luaL_Reg* l)
|
void luaL_register(lua_State* L, const char* libname, const luaL_Reg* l)
|
||||||
{
|
{
|
||||||
if (libname)
|
if (libname)
|
||||||
{
|
{
|
||||||
|
@ -289,7 +289,7 @@ LUALIB_API void luaL_register(lua_State* L, const char* libname, const luaL_Reg*
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API const char* luaL_findtable(lua_State* L, int idx, const char* fname, int szhint)
|
const char* luaL_findtable(lua_State* L, int idx, const char* fname, int szhint)
|
||||||
{
|
{
|
||||||
const char* e;
|
const char* e;
|
||||||
lua_pushvalue(L, idx);
|
lua_pushvalue(L, idx);
|
||||||
|
@ -340,7 +340,7 @@ static size_t getnextbuffersize(lua_State* L, size_t currentsize, size_t desired
|
||||||
return newsize;
|
return newsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API void luaL_buffinit(lua_State* L, luaL_Buffer* B)
|
void luaL_buffinit(lua_State* L, luaL_Buffer* B)
|
||||||
{
|
{
|
||||||
// start with an internal buffer
|
// start with an internal buffer
|
||||||
B->p = B->buffer;
|
B->p = B->buffer;
|
||||||
|
@ -350,14 +350,14 @@ LUALIB_API void luaL_buffinit(lua_State* L, luaL_Buffer* B)
|
||||||
B->storage = nullptr;
|
B->storage = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API char* luaL_buffinitsize(lua_State* L, luaL_Buffer* B, size_t size)
|
char* luaL_buffinitsize(lua_State* L, luaL_Buffer* B, size_t size)
|
||||||
{
|
{
|
||||||
luaL_buffinit(L, B);
|
luaL_buffinit(L, B);
|
||||||
luaL_reservebuffer(B, size, -1);
|
luaL_reservebuffer(B, size, -1);
|
||||||
return B->p;
|
return B->p;
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API char* luaL_extendbuffer(luaL_Buffer* B, size_t additionalsize, int boxloc)
|
char* luaL_extendbuffer(luaL_Buffer* B, size_t additionalsize, int boxloc)
|
||||||
{
|
{
|
||||||
lua_State* L = B->L;
|
lua_State* L = B->L;
|
||||||
|
|
||||||
|
@ -388,13 +388,13 @@ LUALIB_API char* luaL_extendbuffer(luaL_Buffer* B, size_t additionalsize, int bo
|
||||||
return B->p;
|
return B->p;
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API void luaL_reservebuffer(luaL_Buffer* B, size_t size, int boxloc)
|
void luaL_reservebuffer(luaL_Buffer* B, size_t size, int boxloc)
|
||||||
{
|
{
|
||||||
if (size_t(B->end - B->p) < size)
|
if (size_t(B->end - B->p) < size)
|
||||||
luaL_extendbuffer(B, size - (B->end - B->p), boxloc);
|
luaL_extendbuffer(B, size - (B->end - B->p), boxloc);
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API void luaL_addlstring(luaL_Buffer* B, const char* s, size_t len)
|
void luaL_addlstring(luaL_Buffer* B, const char* s, size_t len)
|
||||||
{
|
{
|
||||||
if (size_t(B->end - B->p) < len)
|
if (size_t(B->end - B->p) < len)
|
||||||
luaL_extendbuffer(B, len - (B->end - B->p), -1);
|
luaL_extendbuffer(B, len - (B->end - B->p), -1);
|
||||||
|
@ -403,7 +403,7 @@ LUALIB_API void luaL_addlstring(luaL_Buffer* B, const char* s, size_t len)
|
||||||
B->p += len;
|
B->p += len;
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API void luaL_addvalue(luaL_Buffer* B)
|
void luaL_addvalue(luaL_Buffer* B)
|
||||||
{
|
{
|
||||||
lua_State* L = B->L;
|
lua_State* L = B->L;
|
||||||
|
|
||||||
|
@ -420,7 +420,7 @@ LUALIB_API void luaL_addvalue(luaL_Buffer* B)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API void luaL_pushresult(luaL_Buffer* B)
|
void luaL_pushresult(luaL_Buffer* B)
|
||||||
{
|
{
|
||||||
lua_State* L = B->L;
|
lua_State* L = B->L;
|
||||||
|
|
||||||
|
@ -444,7 +444,7 @@ LUALIB_API void luaL_pushresult(luaL_Buffer* B)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API void luaL_pushresultsize(luaL_Buffer* B, size_t size)
|
void luaL_pushresultsize(luaL_Buffer* B, size_t size)
|
||||||
{
|
{
|
||||||
B->p += size;
|
B->p += size;
|
||||||
luaL_pushresult(B);
|
luaL_pushresult(B);
|
||||||
|
@ -452,7 +452,7 @@ LUALIB_API void luaL_pushresultsize(luaL_Buffer* B, size_t size)
|
||||||
|
|
||||||
/* }====================================================== */
|
/* }====================================================== */
|
||||||
|
|
||||||
LUALIB_API const char* luaL_tolstring(lua_State* L, int idx, size_t* len)
|
const char* luaL_tolstring(lua_State* L, int idx, size_t* len)
|
||||||
{
|
{
|
||||||
if (luaL_callmeta(L, idx, "__tostring")) /* is there a metafield? */
|
if (luaL_callmeta(L, idx, "__tostring")) /* is there a metafield? */
|
||||||
{
|
{
|
||||||
|
|
|
@ -441,7 +441,7 @@ static void auxopen(lua_State* L, const char* name, lua_CFunction f, lua_CFuncti
|
||||||
lua_setfield(L, -2, name);
|
lua_setfield(L, -2, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API int luaopen_base(lua_State* L)
|
int luaopen_base(lua_State* L)
|
||||||
{
|
{
|
||||||
/* set global _G */
|
/* set global _G */
|
||||||
lua_pushvalue(L, LUA_GLOBALSINDEX);
|
lua_pushvalue(L, LUA_GLOBALSINDEX);
|
||||||
|
|
|
@ -236,7 +236,7 @@ static const luaL_Reg bitlib[] = {
|
||||||
{NULL, NULL},
|
{NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
LUALIB_API int luaopen_bit32(lua_State* L)
|
int luaopen_bit32(lua_State* L)
|
||||||
{
|
{
|
||||||
luaL_register(L, LUA_BITLIBNAME, bitlib);
|
luaL_register(L, LUA_BITLIBNAME, bitlib);
|
||||||
|
|
||||||
|
|
|
@ -272,7 +272,7 @@ static const luaL_Reg co_funcs[] = {
|
||||||
{NULL, NULL},
|
{NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
LUALIB_API int luaopen_coroutine(lua_State* L)
|
int luaopen_coroutine(lua_State* L)
|
||||||
{
|
{
|
||||||
luaL_register(L, LUA_COLIBNAME, co_funcs);
|
luaL_register(L, LUA_COLIBNAME, co_funcs);
|
||||||
|
|
||||||
|
|
|
@ -160,7 +160,7 @@ static const luaL_Reg dblib[] = {
|
||||||
{NULL, NULL},
|
{NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
LUALIB_API int luaopen_debug(lua_State* L)
|
int luaopen_debug(lua_State* L)
|
||||||
{
|
{
|
||||||
luaL_register(L, LUA_DBLIBNAME, dblib);
|
luaL_register(L, LUA_DBLIBNAME, dblib);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -17,7 +17,7 @@ static const luaL_Reg lualibs[] = {
|
||||||
{NULL, NULL},
|
{NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
LUALIB_API void luaL_openlibs(lua_State* L)
|
void luaL_openlibs(lua_State* L)
|
||||||
{
|
{
|
||||||
const luaL_Reg* lib = lualibs;
|
const luaL_Reg* lib = lualibs;
|
||||||
for (; lib->func; lib++)
|
for (; lib->func; lib++)
|
||||||
|
@ -28,7 +28,7 @@ LUALIB_API void luaL_openlibs(lua_State* L)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API void luaL_sandbox(lua_State* L)
|
void luaL_sandbox(lua_State* L)
|
||||||
{
|
{
|
||||||
// set all libraries to read-only
|
// set all libraries to read-only
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
|
@ -51,7 +51,7 @@ LUALIB_API void luaL_sandbox(lua_State* L)
|
||||||
lua_setsafeenv(L, LUA_GLOBALSINDEX, true);
|
lua_setsafeenv(L, LUA_GLOBALSINDEX, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API void luaL_sandboxthread(lua_State* L)
|
void luaL_sandboxthread(lua_State* L)
|
||||||
{
|
{
|
||||||
// create new global table that proxies reads to original table
|
// create new global table that proxies reads to original table
|
||||||
lua_newtable(L);
|
lua_newtable(L);
|
||||||
|
@ -81,7 +81,7 @@ static void* l_alloc(lua_State* L, void* ud, void* ptr, size_t osize, size_t nsi
|
||||||
return realloc(ptr, nsize);
|
return realloc(ptr, nsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
LUALIB_API lua_State* luaL_newstate(void)
|
lua_State* luaL_newstate(void)
|
||||||
{
|
{
|
||||||
return lua_newstate(l_alloc, NULL);
|
return lua_newstate(l_alloc, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -428,7 +428,7 @@ static const luaL_Reg mathlib[] = {
|
||||||
/*
|
/*
|
||||||
** Open math library
|
** Open math library
|
||||||
*/
|
*/
|
||||||
LUALIB_API int luaopen_math(lua_State* L)
|
int luaopen_math(lua_State* L)
|
||||||
{
|
{
|
||||||
uint64_t seed = uintptr_t(L);
|
uint64_t seed = uintptr_t(L);
|
||||||
seed ^= time(NULL);
|
seed ^= time(NULL);
|
||||||
|
|
|
@ -186,7 +186,7 @@ static const luaL_Reg syslib[] = {
|
||||||
{NULL, NULL},
|
{NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
LUALIB_API int luaopen_os(lua_State* L)
|
int luaopen_os(lua_State* L)
|
||||||
{
|
{
|
||||||
luaL_register(L, LUA_OSLIBNAME, syslib);
|
luaL_register(L, LUA_OSLIBNAME, syslib);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -1657,7 +1657,7 @@ static void createmetatable(lua_State* L)
|
||||||
/*
|
/*
|
||||||
** Open string library
|
** Open string library
|
||||||
*/
|
*/
|
||||||
LUALIB_API int luaopen_string(lua_State* L)
|
int luaopen_string(lua_State* L)
|
||||||
{
|
{
|
||||||
luaL_register(L, LUA_STRLIBNAME, strlib);
|
luaL_register(L, LUA_STRLIBNAME, strlib);
|
||||||
createmetatable(L);
|
createmetatable(L);
|
||||||
|
|
|
@ -527,7 +527,7 @@ static const luaL_Reg tab_funcs[] = {
|
||||||
{NULL, NULL},
|
{NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
LUALIB_API int luaopen_table(lua_State* L)
|
int luaopen_table(lua_State* L)
|
||||||
{
|
{
|
||||||
luaL_register(L, LUA_TABLIBNAME, tab_funcs);
|
luaL_register(L, LUA_TABLIBNAME, tab_funcs);
|
||||||
|
|
||||||
|
|
|
@ -283,7 +283,7 @@ static const luaL_Reg funcs[] = {
|
||||||
{NULL, NULL},
|
{NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
LUALIB_API int luaopen_utf8(lua_State* L)
|
int luaopen_utf8(lua_State* L)
|
||||||
{
|
{
|
||||||
luaL_register(L, LUA_UTF8LIBNAME, funcs);
|
luaL_register(L, LUA_UTF8LIBNAME, funcs);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue