Export runtime detected paths to lua scripts. Adapt stopwatch to not use
hardcoded path. Change-Id: I5b843002d63a332b3fad02973d00b9863d283062
This commit is contained in:
parent
112bc71a0c
commit
7728ff5912
2 changed files with 12 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
require "actions"
|
||||
require "buttons"
|
||||
|
||||
STOPWATCH_FILE = "/.rockbox/rocks/apps/stopwatch.dat"
|
||||
STOPWATCH_FILE = rb.PLUGIN_APPS_DATA_DIR .. "/stopwatch.dat"
|
||||
|
||||
|
||||
local LapsView = {
|
||||
|
|
Loading…
Reference in a new issue