diff options
| author | William Wilgus <me.theuser@yahoo.com> | 2018-10-12 11:58:09 -0400 |
|---|---|---|
| committer | William Wilgus <me.theuser@yahoo.com> | 2018-10-12 17:31:25 -0400 |
| commit | 0b7a8d5afd3d751fd0f6454098bc9fd1d05ee764 (patch) | |
| tree | 29cf72355d65dda948d16aef100e1eb9542fedf6 /apps/plugins/lua | |
| parent | d2cef81bba743cc7ee209bddf81f1c1e97387250 (diff) | |
| download | rockbox-0b7a8d5afd3d751fd0f6454098bc9fd1d05ee764.zip rockbox-0b7a8d5afd3d751fd0f6454098bc9fd1d05ee764.tar.gz rockbox-0b7a8d5afd3d751fd0f6454098bc9fd1d05ee764.tar.bz2 rockbox-0b7a8d5afd3d751fd0f6454098bc9fd1d05ee764.tar.xz | |
Lua remove unusable/unneeded functions from rocklib_aux
rocklib_aux is auto generated from plugin.h
there are a few functions that get added automatically that
are unusable without their companion functions or duplicate
functionality already supplied by lua
Duplicated functionality:
rb->rand, rb->srand
-- see math.rand math.srand
rb->remove, rb->rename
-- see os.remove, os.rename
Unusable:
rb->open_utf8
-- this should be added to the lua file open routines (if at all)
rb->codec_run_proc, rb->codec_close
-- without rb->codec_load_file these are pointless
rb->timer_set_period, timer_unregister
-- even with timer_register implemented lua is not
-- reentrant and crashes the state when timer fires
Shouldn't be used!:
rb->strlcpy, rb->strlcat, rb->strcpy, rb->strcat
-- lua reuses strings by hashed values you break this contract if
-- you change strings behind its back plus lua provides a way to
-- do these functions safely within the strings api
Change-Id: I2f65704a90930378cbbceb254e52f61e8074471e
Diffstat (limited to 'apps/plugins/lua')
| -rwxr-xr-x | apps/plugins/lua/rocklib_aux.pl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/plugins/lua/rocklib_aux.pl b/apps/plugins/lua/rocklib_aux.pl index 9103fcc..8256b83 100755 --- a/apps/plugins/lua/rocklib_aux.pl +++ b/apps/plugins/lua/rocklib_aux.pl @@ -51,17 +51,25 @@ my @ported_functions; # you want to manually port them to Lua. The format is a standard Perl regular # expression. my @forbidden_functions = ('^open$', + '^open_utf8$', '^close$', '^read$', '^write$', '^mkdir$', '^rmdir$', + '^remove$', + '^rename$', '^lseek$', '^ftruncate$', '^filesize$', '^fdprintf$', '^read_line$', '^[a-z]+dir$', + '^s?+rand$', + '^strl?+cpy$', + '^strl?+cat$', + '^codec_', + '^timer_', '^__.+$', '^.+_(un)?cached$', '^audio_play$', |