mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 02:10:07 +01:00
lua: export _VERSION so plugins can check the lua version
Since we only support one version this is not very informative but let's include this now in case we ever need it in the future. Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1365>
This commit is contained in:
parent
32ed3060f9
commit
a595f0bd48
2 changed files with 3 additions and 3 deletions
|
|
@ -50,7 +50,7 @@ The Lua API available to plugins is limited to the following calls::
|
|||
|
||||
assert error ipairs next pairs tonumber
|
||||
pcall select print tostring type xpcall
|
||||
table string math
|
||||
table string math _VERSION
|
||||
|
||||
It is not possible to e.g. use the ``io`` module from a script.
|
||||
|
||||
|
|
|
|||
|
|
@ -1221,8 +1221,8 @@ libinput_lua_plugin_init_lua(struct libinput *libinput,
|
|||
|
||||
luaopen_base(L);
|
||||
static const char *allowed_funcs[] = {
|
||||
"assert", "error", "ipairs", "next", "pcall", "pairs",
|
||||
"print", "select", "tonumber", "tostring", "type", "xpcall",
|
||||
"assert", "error", "ipairs", "next", "pcall", "pairs", "print",
|
||||
"select", "tonumber", "tostring", "type", "xpcall", "_VERSION",
|
||||
};
|
||||
ARRAY_FOR_EACH(allowed_funcs, func) {
|
||||
lua_getglobal(L, *func);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue