summaryrefslogtreecommitdiff
path: root/apps/plugins/lua
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2012-01-29 21:55:26 +0100
committerThomas Martitz <kugel@rockbox.org>2012-01-29 22:35:49 +0100
commit7728ff5912aebe2b21a3c0ca0d8624ec97dabdb6 (patch)
tree44840a4584c0107a557891e7b4f77585299a8969 /apps/plugins/lua
parent112bc71a0c7d5a981d37eaa5062f8a93d7ccc067 (diff)
downloadrockbox-7728ff5912aebe2b21a3c0ca0d8624ec97dabdb6.zip
rockbox-7728ff5912aebe2b21a3c0ca0d8624ec97dabdb6.tar.gz
rockbox-7728ff5912aebe2b21a3c0ca0d8624ec97dabdb6.tar.bz2
rockbox-7728ff5912aebe2b21a3c0ca0d8624ec97dabdb6.tar.xz
Export runtime detected paths to lua scripts. Adapt stopwatch to not use
hardcoded path. Change-Id: I5b843002d63a332b3fad02973d00b9863d283062
Diffstat (limited to 'apps/plugins/lua')
-rw-r--r--apps/plugins/lua/rocklib.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c
index 809b269..6a6be38 100644
--- a/apps/plugins/lua/rocklib.c
+++ b/apps/plugins/lua/rocklib.c
@@ -699,7 +699,8 @@ static const luaL_Reg rocklib[] =
extern const luaL_Reg rocklib_aux[];
-#define RB_CONSTANT(x) lua_pushinteger(L, x); lua_setfield(L, -2, #x);
+#define RB_CONSTANT(x) lua_pushinteger(L, x); lua_setfield(L, -2, #x);
+#define RB_STRING_CONSTANT(x) lua_pushstring(L, x); lua_setfield(L, -2, #x);
/*
** Open Rockbox library
*/
@@ -727,6 +728,15 @@ LUALIB_API int luaopen_rock(lua_State *L)
RB_CONSTANT(SCREEN_REMOTE);
#endif
+ /* some useful paths constants */
+ RB_STRING_CONSTANT(ROCKBOX_DIR);
+ RB_STRING_CONSTANT(HOME_DIR);
+ RB_STRING_CONSTANT(PLUGIN_DIR);
+ RB_STRING_CONSTANT(PLUGIN_APPS_DATA_DIR);
+ RB_STRING_CONSTANT(PLUGIN_GAMES_DATA_DIR);
+ RB_STRING_CONSTANT(PLUGIN_DATA_DIR);
+ RB_STRING_CONSTANT(VIEWERS_DATA_DIR);
+
rli_init(L);
return 1;