diff options
author | Ferenc Wágner <wferi@niif.hu> | 2013-10-14 19:57:57 +0200 |
---|---|---|
committer | Ferenc Wágner <wferi@niif.hu> | 2014-03-01 17:40:35 +0100 |
commit | 7c01256715ea611da8ad47c135ae41f5dd54f9e3 (patch) | |
tree | d2e10b26cbb4b88f99035d1b2f3155689566c06a /com32/lua/src/dmi.c | |
parent | f4bbf85ee5224ab5f29ff7ca900c6f25437eed07 (diff) | |
download | syslinux-7c01256715ea611da8ad47c135ae41f5dd54f9e3.tar.gz |
lua: make the dmi module standalone
By copying two short functions from the cpu module.
They do not warrant a separate module.
Also make those functions static in both modules.
Diffstat (limited to 'com32/lua/src/dmi.c')
-rw-r--r-- | com32/lua/src/dmi.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/com32/lua/src/dmi.c b/com32/lua/src/dmi.c index aa38df3a..f4755e8e 100644 --- a/com32/lua/src/dmi.c +++ b/com32/lua/src/dmi.c @@ -9,8 +9,18 @@ #include "lualib.h" #include "dmi/dmi.h" -extern void add_string_item(lua_State*, const char*, const char*); -extern void add_int_item(lua_State*, const char*, int); +static void add_string_item(lua_State *L, const char *item, const char *value_str) { + lua_pushstring(L,item); + lua_pushstring(L,value_str); + lua_settable(L,-3); +} + +static void add_int_item(lua_State *L, const char *item, int value_int) { + lua_pushstring(L,item); + lua_pushnumber(L,value_int); + lua_settable(L,-3); +} + typedef int (*table_fn)(lua_State*, s_dmi*); /* Add a Lua_String entry to the table on stack |