Commit graph

13 commits

Author SHA1 Message Date
George Kiagiadakis
e2d6e5b992 lua: enable loading scripts with a shebang
* skip the shebang before loading the file in the interpreter,
  as # is not a valid lua comment
* allow loading scripts with a relative path in interactive mode
2021-02-18 13:47:34 +02:00
Raghavendra
c791ed3a62 m-lua-scripting: add WpPipewireObject api 2021-02-16 20:15:13 +05:30
George Kiagiadakis
1c0f0b8684 wplua: pass SANDBOX_CONFIG as a script argument
avoids keeping it forever as a global
2021-02-03 17:16:51 +02:00
George Kiagiadakis
460ff6591d wplua: allow exchanging arguments and results with scripts 2021-02-03 17:16:51 +02:00
George Kiagiadakis
5647f0bf9e wplua: allow loading relative paths from wplua_load_path()
convert them to absolute before creating the URI
2021-02-03 17:16:51 +02:00
George Kiagiadakis
94d527e187 wplua: add flags to modify the sandbox behavior
with ISOLATE_ENV, it isolates the global environment between scripts
just like it did before; without it, it uses a common environment

with MINIMAL_STD, it restricts even further the available library
functions; useful for configuration files that don't need to do
actual scripting, just to define some tables
2021-02-03 17:16:51 +02:00
George Kiagiadakis
d0d2f2a59e wplua: use only the basename of the files for debug/error messages 2020-12-18 18:26:31 +02:00
George Kiagiadakis
067da200fc wplua: use the error handler also when loading chunks
... and improve its output
2020-12-18 18:25:43 +02:00
George Kiagiadakis
da375a7408 wplua: use the registry to store vtables & closures 2020-12-16 23:19:07 +02:00
George Kiagiadakis
70931969b4 wplua: remove TypeClass, push constructors as ClassName_new 2020-12-16 23:14:58 +02:00
George Kiagiadakis
65b817f6fc wplua: add proper GError domain & error codes 2020-12-15 18:36:14 +02:00
George Kiagiadakis
8b4c5af49c wplua: implement sandboxing of scripts
All loaded scripts can now be run in a protected environment
so that they cannot do any harm to the host or to each other
2020-12-15 18:28:28 +02:00
George Kiagiadakis
7d692e0246 wplua: new simple engine to integrate GObject with Lua 2020-12-11 17:07:20 +02:00