aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lua
diff options
context:
space:
mode:
authorFerenc Wágner <wferi@niif.hu>2013-10-14 19:57:57 +0200
committerFerenc Wágner <wferi@niif.hu>2014-03-01 17:40:35 +0100
commit7c01256715ea611da8ad47c135ae41f5dd54f9e3 (patch)
treed2e10b26cbb4b88f99035d1b2f3155689566c06a /com32/lua
parentf4bbf85ee5224ab5f29ff7ca900c6f25437eed07 (diff)
downloadsyslinux-7c01256715ea611da8ad47c135ae41f5dd54f9e3.tar.gz
syslinux-7c01256715ea611da8ad47c135ae41f5dd54f9e3.tar.xz
syslinux-7c01256715ea611da8ad47c135ae41f5dd54f9e3.zip
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')
-rw-r--r--com32/lua/src/cpu.c4
-rw-r--r--com32/lua/src/dmi.c14
2 files changed, 14 insertions, 4 deletions
diff --git a/com32/lua/src/cpu.c b/com32/lua/src/cpu.c
index 69914f79..2e822cd3 100644
--- a/com32/lua/src/cpu.c
+++ b/com32/lua/src/cpu.c
@@ -9,13 +9,13 @@
#include"lualib.h"
#include"cpuid.h"
-void add_string_item(lua_State *L, const char *item, const char *value_str) {
+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);
}
-void add_int_item(lua_State *L, const char *item, int value_int) {
+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);
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