blob: 54d4be7469b6d0d7f1819dc1f4becffea9cef57a [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
2 #include <sys/driver_hooks.h>
3
4 set_driver_hook(H_DEFAULT_METHOD, value)
5
6 <value> being:
7
8 int <name>(mixed & result, string fun, varargs args)
9 int <closure>(mixed & result, object ob, string fun, varargs args)
10
11DESCRIPTION
12 Optional hook to provide default implementation for unresolved
13 calls. Hook setting can be any closure, or the name of the
14 function to call in the object.
15
Zesstra85136122021-05-08 20:32:01 +020016 This hook is called whenever a call_other(), call_resolved(),
17 call_strict() or call_out() on named function (as opposed to
18 a closure) couldn't be resolved. The hook has then the
19 opportunity to provide a default implementation.
MG Mud User88f12472016-06-24 23:31:02 +020020
21 Exempt from this behaviour are calls to the master object, to
Zesstra85136122021-05-08 20:32:01 +020022 simul-efuns, and calls done with call_direct(),
23 call_direct_resolved() and call_strict_resolved().
MG Mud User88f12472016-06-24 23:31:02 +020024
25 If the hook is the name of an lfun, it is called in the target
26 object; otherwise if it is a closure, the target object is
27 passed as parameter <ob>.
28
29 The other parameters passed are the name <fun> of the called
30 function, the arguments <args> passed to the call (if any),
31 and a reference <result> to a variable for the call result.
32
33 If the hook can resolve the call, it has to return the call
34 result in <result> and 1 as function result.
35
36 If the hook can not (or doesn't want to) resolve the call, it
37 has to return 0.
38
MG Mud User88f12472016-06-24 23:31:02 +020039HISTORY
40 Introduced in LDMud 3.3.113
41
42SEE ALSO
43 hooks(C)