Use names defined in lualib.h for library registration.

This commit is contained in:
Mike Pall
2011-02-02 02:38:59 +01:00
parent 1505d6ffde
commit 2c8945d3e7
11 changed files with 17 additions and 19 deletions

View File

@@ -504,10 +504,10 @@ static GCobj *io_std_new(lua_State *L, FILE *fp, const char *name)
LUALIB_API int luaopen_io(lua_State *L)
{
lj_lib_pushcf(L, lj_cf_io_lines_iter, FF_io_lines_iter);
LJ_LIB_REG_(L, NULL, io_method);
LJ_LIB_REG(L, NULL, io_method);
copyTV(L, L->top, L->top-1); L->top++;
lua_setfield(L, LUA_REGISTRYINDEX, LUA_FILEHANDLE);
LJ_LIB_REG(L, io);
LJ_LIB_REG(L, LUA_IOLIBNAME, io);
setgcref(G(L)->gcroot[GCROOT_IO_INPUT], io_std_new(L, stdin, "stdin"));
setgcref(G(L)->gcroot[GCROOT_IO_OUTPUT], io_std_new(L, stdout, "stdout"));
io_std_new(L, stderr, "stderr");