diff options
author | William Wilgus <me.theuser@yahoo.com> | 2019-07-28 07:26:20 -0500 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2019-07-28 07:29:10 -0500 |
commit | ddf612c84b558bc3343d413c04cdddf59b23a2ed (patch) | |
tree | fd685cd5bcf2a370a2d4823d58f046ccec8d4797 | |
parent | fd20114eb2b2148d368f954a38bbf72748956216 (diff) | |
download | rockbox-ddf612c84b558bc3343d413c04cdddf59b23a2ed.tar.gz rockbox-ddf612c84b558bc3343d413c04cdddf59b23a2ed.zip |
lua remove unneeded plugin functions
Change-Id: I04bc38d03b7f0ca65a815685eb6ab0f5ff825c45
-rw-r--r-- | apps/plugins/lua/rocklib.c | 12 | ||||
-rwxr-xr-x | apps/plugins/lua/rocklib_aux.pl | 7 |
2 files changed, 18 insertions, 1 deletions
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c index b37f5245dc..d1ef3adaaf 100644 --- a/apps/plugins/lua/rocklib.c +++ b/apps/plugins/lua/rocklib.c | |||
@@ -77,6 +77,15 @@ RB_WRAP(schedule_cpu_boost) | |||
77 | } | 77 | } |
78 | #endif | 78 | #endif |
79 | 79 | ||
80 | RB_WRAP(thread_set_priority) | ||
81 | { | ||
82 | unsigned int thread_id = rb->thread_self(); | ||
83 | int priority = (int) luaL_checkint(L, 1); | ||
84 | int result = rb->thread_set_priority(thread_id, priority); | ||
85 | lua_pushinteger(L, result); | ||
86 | return 1; | ||
87 | } | ||
88 | |||
80 | RB_WRAP(current_path) | 89 | RB_WRAP(current_path) |
81 | { | 90 | { |
82 | return get_current_path(L, 1); | 91 | return get_current_path(L, 1); |
@@ -769,6 +778,7 @@ static const luaL_Reg rocklib[] = | |||
769 | #ifdef HAVE_SCHEDULER_BOOSTCTRL | 778 | #ifdef HAVE_SCHEDULER_BOOSTCTRL |
770 | RB_FUNC(schedule_cpu_boost), | 779 | RB_FUNC(schedule_cpu_boost), |
771 | #endif | 780 | #endif |
781 | RB_FUNC(thread_set_priority), | ||
772 | 782 | ||
773 | RB_FUNC(current_path), | 783 | RB_FUNC(current_path), |
774 | 784 | ||
@@ -846,7 +856,7 @@ LUALIB_API int luaopen_rock(lua_State *L) | |||
846 | lua_pushstring(L, "rb_defines"); | 856 | lua_pushstring(L, "rb_defines"); |
847 | if (lua_pcall (L, 1, 0, 0)) | 857 | if (lua_pcall (L, 1, 0, 0)) |
848 | lua_pop(L, 1); | 858 | lua_pop(L, 1); |
849 | #if 0 | 859 | #if 0 /* see rb_defines.lua */ |
850 | static const struct lua_int_reg rlib_const_int[] = | 860 | static const struct lua_int_reg rlib_const_int[] = |
851 | { | 861 | { |
852 | /* useful integer constants */ | 862 | /* useful integer constants */ |
diff --git a/apps/plugins/lua/rocklib_aux.pl b/apps/plugins/lua/rocklib_aux.pl index c059801b8b..542a928a12 100755 --- a/apps/plugins/lua/rocklib_aux.pl +++ b/apps/plugins/lua/rocklib_aux.pl | |||
@@ -53,6 +53,7 @@ my @ported_functions; | |||
53 | my @forbidden_functions = ('^open$', | 53 | my @forbidden_functions = ('^open$', |
54 | '^open_utf8$', | 54 | '^open_utf8$', |
55 | '^close$', | 55 | '^close$', |
56 | 'dcache', | ||
56 | '^read$', | 57 | '^read$', |
57 | '^write$', | 58 | '^write$', |
58 | '^mkdir$', | 59 | '^mkdir$', |
@@ -101,7 +102,13 @@ my @forbidden_functions = ('^open$', | |||
101 | '^pcm_(set_frequency|calculate_peaks)$', | 102 | '^pcm_(set_frequency|calculate_peaks)$', |
102 | '^sound_(set|current|default|min|max|unit|pitch|val2phys)$', | 103 | '^sound_(set|current|default|min|max|unit|pitch|val2phys)$', |
103 | '^mixer_(set|get)_frequency$', | 104 | '^mixer_(set|get)_frequency$', |
105 | '^rock_plugin_get_current_filename$', | ||
106 | '^plugin_release_audio_buffer$', | ||
107 | '^reload_directory$', | ||
108 | '^set_current_file$', | ||
109 | '^set_dirfilter$', | ||
104 | '^(trigger|cancel)_cpu_boost$', | 110 | '^(trigger|cancel)_cpu_boost$', |
111 | '^thread_', | ||
105 | '^round_value_to_list32$'); | 112 | '^round_value_to_list32$'); |
106 | 113 | ||
107 | my $rocklib = sprintf("%s/rocklib.c", $ARGV[0]); | 114 | my $rocklib = sprintf("%s/rocklib.c", $ARGV[0]); |