Add documentation to builtin core.run_callbacks (#10494)

This commit is contained in:
Desour 2020-10-21 22:05:32 +02:00 committed by Nils Dagsson Moskopp
parent c66ec62c77
commit c400b9d9e8
Signed by: erlehmann
GPG Key ID: A3BC671C35191080
1 changed files with 7 additions and 0 deletions

View File

@ -4,6 +4,13 @@ core.callback_origins = {}
local getinfo = debug.getinfo local getinfo = debug.getinfo
debug.getinfo = nil debug.getinfo = nil
--- Runs given callbacks.
--
-- Note: this function is also called from C++
-- @tparam table callbacks a table with registered callbacks, like `core.registered_on_*`
-- @tparam number mode a RunCallbacksMode, as defined in src/script/common/c_internal.h
-- @param ... arguments for the callback
-- @return depends on mode
function core.run_callbacks(callbacks, mode, ...) function core.run_callbacks(callbacks, mode, ...)
assert(type(callbacks) == "table") assert(type(callbacks) == "table")
local cb_len = #callbacks local cb_len = #callbacks