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
This commit is contained in:
parent
d2cef81bba
commit
0b7a8d5afd
1 changed files with 8 additions and 0 deletions
|
@ -51,17 +51,25 @@ my @ported_functions;
|
||||||
# you want to manually port them to Lua. The format is a standard Perl regular
|
# you want to manually port them to Lua. The format is a standard Perl regular
|
||||||
# expression.
|
# expression.
|
||||||
my @forbidden_functions = ('^open$',
|
my @forbidden_functions = ('^open$',
|
||||||
|
'^open_utf8$',
|
||||||
'^close$',
|
'^close$',
|
||||||
'^read$',
|
'^read$',
|
||||||
'^write$',
|
'^write$',
|
||||||
'^mkdir$',
|
'^mkdir$',
|
||||||
'^rmdir$',
|
'^rmdir$',
|
||||||
|
'^remove$',
|
||||||
|
'^rename$',
|
||||||
'^lseek$',
|
'^lseek$',
|
||||||
'^ftruncate$',
|
'^ftruncate$',
|
||||||
'^filesize$',
|
'^filesize$',
|
||||||
'^fdprintf$',
|
'^fdprintf$',
|
||||||
'^read_line$',
|
'^read_line$',
|
||||||
'^[a-z]+dir$',
|
'^[a-z]+dir$',
|
||||||
|
'^s?+rand$',
|
||||||
|
'^strl?+cpy$',
|
||||||
|
'^strl?+cat$',
|
||||||
|
'^codec_',
|
||||||
|
'^timer_',
|
||||||
'^__.+$',
|
'^__.+$',
|
||||||
'^.+_(un)?cached$',
|
'^.+_(un)?cached$',
|
||||||
'^audio_play$',
|
'^audio_play$',
|
||||||
|
|
Loading…
Reference in a new issue