summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/rocklib.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lua/rocklib.c')
-rw-r--r--apps/plugins/lua/rocklib.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c
index e617f3e4bf..6b24984130 100644
--- a/apps/plugins/lua/rocklib.c
+++ b/apps/plugins/lua/rocklib.c
@@ -637,6 +637,7 @@ RB_WRAP(buttonlight_brightness_set)
637 637
638/* DEVICE STRING / FILENAME MANIPULATION */ 638/* DEVICE STRING / FILENAME MANIPULATION */
639 639
640#if 0 /*See files.lua */
640RB_WRAP(strip_extension) 641RB_WRAP(strip_extension)
641{ 642{
642 const char* filename = luaL_checkstring(L, -1); 643 const char* filename = luaL_checkstring(L, -1);
@@ -672,6 +673,7 @@ RB_WRAP(create_numbered_filename)
672 673
673 return 1; 674 return 1;
674} 675}
676#endif
675 677
676RB_WRAP(utf8encode) 678RB_WRAP(utf8encode)
677{ 679{
@@ -697,6 +699,7 @@ RB_WRAP(strncasecmp)
697 return 1; 699 return 1;
698} 700}
699 701
702 /* ROCKBOX SETTINGS / INFO */
700static int mem_read_write(lua_State *L, uintptr_t address, size_t maxsize, bool isstr_p) 703static int mem_read_write(lua_State *L, uintptr_t address, size_t maxsize, bool isstr_p)
701{ 704{
702 if(isstr_p) /*pointer to string (**char)*/ 705 if(isstr_p) /*pointer to string (**char)*/
@@ -844,6 +847,12 @@ RB_WRAP(audio_current_track)
844 return mem_read_write(L, address, maxsize, isstr_p); 847 return mem_read_write(L, address, maxsize, isstr_p);
845} 848}
846 849
850RB_WRAP(settings_save)
851{
852 rb->settings_save();
853 return 0;
854}
855
847#if 0 856#if 0
848RB_WRAP(read_mem) 857RB_WRAP(read_mem)
849{ 858{
@@ -906,6 +915,12 @@ RB_WRAP(restart_lua)
906 return -1; 915 return -1;
907} 916}
908 917
918RB_WRAP(show_logo)
919{
920 rb->show_logo();
921 return 0;
922}
923
909#define RB_FUNC(func) {#func, rock_##func} 924#define RB_FUNC(func) {#func, rock_##func}
910#define RB_ALIAS(name, func) {name, rock_##func} 925#define RB_ALIAS(name, func) {name, rock_##func}
911static const luaL_Reg rocklib[] = 926static const luaL_Reg rocklib[] =
@@ -967,8 +982,10 @@ static const luaL_Reg rocklib[] =
967#endif 982#endif
968 983
969 /* DEVICE STRING / FILENAME MANIPULATION */ 984 /* DEVICE STRING / FILENAME MANIPULATION */
985#if 0 /*See files.lua */
970 RB_FUNC(strip_extension), 986 RB_FUNC(strip_extension),
971 RB_FUNC(create_numbered_filename), 987 RB_FUNC(create_numbered_filename),
988#endif
972 RB_FUNC(utf8encode), 989 RB_FUNC(utf8encode),
973 RB_FUNC(strncasecmp), 990 RB_FUNC(strncasecmp),
974 991
@@ -977,6 +994,7 @@ static const luaL_Reg rocklib[] =
977 RB_FUNC(global_settings), 994 RB_FUNC(global_settings),
978 RB_FUNC(audio_next_track), 995 RB_FUNC(audio_next_track),
979 RB_FUNC(audio_current_track), 996 RB_FUNC(audio_current_track),
997 RB_FUNC(settings_save),
980 998
981 /* SPEAKING */ 999 /* SPEAKING */
982 {"talk_number", rock_talk}, 1000 {"talk_number", rock_talk},
@@ -985,6 +1003,7 @@ static const luaL_Reg rocklib[] =
985 1003
986 /* MISC */ 1004 /* MISC */
987 RB_FUNC(restart_lua), 1005 RB_FUNC(restart_lua),
1006 RB_FUNC(show_logo),
988 1007
989 {NULL, NULL} 1008 {NULL, NULL}
990}; 1009};