|
32 | 32 | #include "common/common.h" |
33 | 33 | #include "options/m_property.h" |
34 | 34 | #include "common/msg.h" |
35 | | -#include "common/msg_control.h" |
36 | 35 | #include "common/stats.h" |
37 | 36 | #include "options/m_option.h" |
38 | 37 | #include "input/input.h" |
@@ -499,39 +498,6 @@ static int load_lua(struct mp_script_args *args) |
499 | 498 | return r; |
500 | 499 | } |
501 | 500 |
|
502 | | -static int check_loglevel(lua_State *L, int arg) |
503 | | -{ |
504 | | - const char *level = luaL_checkstring(L, arg); |
505 | | - int n = mp_msg_find_level(level); |
506 | | - if (n >= 0) |
507 | | - return n; |
508 | | - luaL_error(L, "Invalid log level '%s'", level); |
509 | | - abort(); |
510 | | -} |
511 | | - |
512 | | -static int script_log(lua_State *L) |
513 | | -{ |
514 | | - struct script_ctx *ctx = get_ctx(L); |
515 | | - |
516 | | - int msgl = check_loglevel(L, 1); |
517 | | - |
518 | | - int last = lua_gettop(L); |
519 | | - lua_getglobal(L, "tostring"); // args... tostring |
520 | | - for (int i = 2; i <= last; i++) { |
521 | | - lua_pushvalue(L, -1); // args... tostring tostring |
522 | | - lua_pushvalue(L, i); // args... tostring tostring args[i] |
523 | | - lua_call(L, 1, 1); // args... tostring str |
524 | | - const char *s = lua_tostring(L, -1); |
525 | | - if (s == NULL) |
526 | | - return luaL_error(L, "Invalid argument"); |
527 | | - mp_msg(ctx->log, msgl, (i == 2 ? "%s" : " %s"), s); |
528 | | - lua_pop(L, 1); // args... tostring |
529 | | - } |
530 | | - mp_msg(ctx->log, msgl, "\n"); |
531 | | - |
532 | | - return 0; |
533 | | -} |
534 | | - |
535 | 501 | static int script_find_config_file(lua_State *L) |
536 | 502 | { |
537 | 503 | struct MPContext *mpctx = get_mpctx(L); |
@@ -1226,7 +1192,6 @@ struct fn_entry { |
1226 | 1192 | }; |
1227 | 1193 |
|
1228 | 1194 | static const struct fn_entry main_fns[] = { |
1229 | | - FN_ENTRY(log), |
1230 | 1195 | AF_ENTRY(raw_wait_event), |
1231 | 1196 | FN_ENTRY(request_event), |
1232 | 1197 | FN_ENTRY(find_config_file), |
|
0 commit comments