mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
loader: Register the gfx stuff separately.
Move registration of the gfx stuff to separate function. However, no change in functionality is intended. Sponsored by: Netflix Reviewed by: kevans, jhb Differential Revision: https://reviews.freebsd.org/D43900 (cherry picked from commit 1dac5a34b64e2573236f38b23f8b1f92bd6a1d7c)
This commit is contained in:
parent
c54653978e
commit
5bbe8ec084
1 changed files with 11 additions and 0 deletions
|
|
@ -578,6 +578,10 @@ static const struct luaL_Reg loaderlib[] = {
|
|||
REG_SIMPLE(setenv),
|
||||
REG_SIMPLE(time),
|
||||
REG_SIMPLE(unsetenv),
|
||||
{ NULL, NULL },
|
||||
};
|
||||
|
||||
static const struct luaL_Reg gfxlib[] = {
|
||||
REG_SIMPLE(fb_bezier),
|
||||
REG_SIMPLE(fb_drawrect),
|
||||
REG_SIMPLE(fb_line),
|
||||
|
|
@ -627,10 +631,17 @@ lua_add_features(lua_State *L)
|
|||
lua_setfield(L, -2, "features");
|
||||
}
|
||||
|
||||
static void
|
||||
luaopen_gfx(lua_State *L)
|
||||
{
|
||||
luaL_newlib(L, gfxlib);
|
||||
}
|
||||
|
||||
int
|
||||
luaopen_loader(lua_State *L)
|
||||
{
|
||||
luaL_newlib(L, loaderlib);
|
||||
luaopen_gfx(L);
|
||||
/* Add loader.machine and loader.machine_arch properties */
|
||||
lua_pushstring(L, MACHINE);
|
||||
lua_setfield(L, -2, "machine");
|
||||
|
|
|
|||
Loading…
Reference in a new issue