Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+8
+8
apps/plugins/lua/rocklib_aux.pl
··· 51 51 # you want to manually port them to Lua. The format is a standard Perl regular 52 52 # expression. 53 53 my @forbidden_functions = ('^open$', 54 + '^open_utf8$', 54 55 '^close$', 55 56 '^read$', 56 57 '^write$', 57 58 '^mkdir$', 58 59 '^rmdir$', 60 + '^remove$', 61 + '^rename$', 59 62 '^lseek$', 60 63 '^ftruncate$', 61 64 '^filesize$', 62 65 '^fdprintf$', 63 66 '^read_line$', 64 67 '^[a-z]+dir$', 68 + '^s?+rand$', 69 + '^strl?+cpy$', 70 + '^strl?+cat$', 71 + '^codec_', 72 + '^timer_', 65 73 '^__.+$', 66 74 '^.+_(un)?cached$', 67 75 '^audio_play$',