From 6048f87e3c07d03df8a59da58c81608c5375f6dc Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 26 Sep 2013 00:41:14 +0200 Subject: Add initial Lua scripting support This is preliminary. There are still tons of issues, and any aspect of scripting may change in the future. I decided to merge this (preliminary) work now because it makes it easier to develop it, not because it's done. lua.rst is clear enough about it (plus some sarcasm). This requires linking to Lua. Lua has no official pkg-config file, but there are distribution specific .pc files, all with different names. Adding a non-pkg-config based configure test was considered, but we'd rather not. One major complication is that libquvi links against Lua too, and if the Lua version is different from mpv's, you will get a crash as soon as libquvi uses Lua. (libquvi by design always runs when a file is opened.) I would consider this the problem of distros and whoever builds mpv, but to make things easier for users, we add a terrible runtime test to the configure script, which probes whether libquvi will crash. This is disabled when cross-compiling, but in that case we hope the user knows what he is doing. --- mpvcore/mp_lua.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 mpvcore/mp_lua.h (limited to 'mpvcore/mp_lua.h') diff --git a/mpvcore/mp_lua.h b/mpvcore/mp_lua.h new file mode 100644 index 0000000000..050548e2d2 --- /dev/null +++ b/mpvcore/mp_lua.h @@ -0,0 +1,14 @@ +#ifndef MP_LUA_H +#define MP_LUA_H + +#include + +struct MPContext; + +void mp_lua_init(struct MPContext *mpctx); +void mp_lua_uninit(struct MPContext *mpctx); +void mp_lua_event(struct MPContext *mpctx, const char *name, const char *arg); +void mp_lua_script_dispatch(struct MPContext *mpctx, char *script_name, + int id, char *event); + +#endif -- cgit v1.2.3