lualoader: Register loader.printc as global printc
This commit is contained in:
parent
379e652e1b
commit
59cccc5bce
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=330282
@ -307,6 +307,7 @@ static const struct luaL_Reg loaderlib[] = {
|
|||||||
REG_SIMPLE(command),
|
REG_SIMPLE(command),
|
||||||
REG_SIMPLE(getenv),
|
REG_SIMPLE(getenv),
|
||||||
REG_SIMPLE(perform),
|
REG_SIMPLE(perform),
|
||||||
|
/* Also registered as the global 'printc' */
|
||||||
REG_SIMPLE(printc),
|
REG_SIMPLE(printc),
|
||||||
REG_SIMPLE(setenv),
|
REG_SIMPLE(setenv),
|
||||||
REG_SIMPLE(time),
|
REG_SIMPLE(time),
|
||||||
@ -335,6 +336,8 @@ luaopen_loader(lua_State *L)
|
|||||||
lua_setfield(L, -2, "machine");
|
lua_setfield(L, -2, "machine");
|
||||||
lua_pushstring(L, MACHINE_ARCH);
|
lua_pushstring(L, MACHINE_ARCH);
|
||||||
lua_setfield(L, -2, "machine_arch");
|
lua_setfield(L, -2, "machine_arch");
|
||||||
|
/* Set global printc to loader.printc */
|
||||||
|
lua_register(L, "printc", lua_printc);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user