blob: b108019474634e6fa158610d311f1a519699717f [file] [log] [blame]
Zesstradaf2c672025-08-02 15:59:17 +02001SYNOPSIS
2 #include <sys/driver_hooks.h>
3
4 set_driver_hook(H_CREATE_LWOBJECT_RESTORE, value)
5
6 <value> being:
7
8 void <name> ()
9 void <closure> ()
10 void <closure> (lwobject obj_to_init)
11
12DESCRIPTION
13 Optional hook to finish initialization of a restored lightweight
14 object. Hook setting can be any closure, or the name of the
15 function (static or public) to call in the object.
16
17 If the hook is an unbound lambda closure expecting arguments, it is
18 bound to the current object and called with the created object as
19 the first argument. If the hook is an unbound lambda closure without
20 arguments, it is bound to the object to be initalized and called.
21 If the hook is any other type of closure, it is called with the
22 created object as the first argument.
23
24 If the hook is defined as the name of an lfun in the lightweight
25 object, it is called in the new lwobject.
26
27HISTORY
28 Introduced in LDMud 3.6.6.
29
30SEE ALSO
31 hooks(C), create_lwobject(H), restore_value(E), restore_object(E)