blob: 0e51a4b21ea9964b7d90a41a4db6b0deb14b2b6d [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
2 #include <sys/driver_hooks.h>
3
4 set_driver_hook(H_CREATE_SUPER, value)
5
6 <value> being:
7
8 void <name> (0)
9 int <closure> ( void )
10 int <closure> (object obj_to_init)
11
12DESCRIPTION
13 Optional hooks to initialize a blueprint which is loaded by
14 inheritance after creation.
Zesstra7ea4a032019-11-26 20:11:40 +010015
MG Mud User88f12472016-06-24 23:31:02 +020016 Hook setting can be unbound lambda closures, or the name of
17 the function (static or public) to call in the object.
18
19 If the hook is a closure expecting an argument, it is bound
20 to the current object and called with the created object as
Zesstra7ea4a032019-11-26 20:11:40 +010021 argument. If the hook is a closure without arguments, it is bound to
22 the object to be initialized and called.
MG Mud User88f12472016-06-24 23:31:02 +020023
24 If the result of the closure call is a non-zero number, it is used
25 as the interval to wait before the first reset(), else the default
26 interval computed from TIME_TO_RESET is used.
27
28 If the hook is defined as the name of an lfun in the object,
Zesstra7ea4a032019-11-26 20:11:40 +010029 it is called in the object with 0 as argument and any result
MG Mud User88f12472016-06-24 23:31:02 +020030 is ignored.
31
32HISTORY
33 LDMud 3.2.10 allowed static functions to be given by name.
34
35SEE ALSO
36 hooks(C), create_ob(H), create_clone(H)