blob: 0a1e023262f9decb67052e6fa81cc99eaa24710a [file] [log] [blame]
Zesstra19d4cd42021-05-07 09:49:10 +02001SYNOPSIS
2 #include <sys/driver_hooks.h>
3
4 set_driver_hook(H_CREATE_LWOBJECT, value)
5
6 <value> being:
7
8 void <name> (...)
9 void <closure> ()
10 void <closure> (lwobject obj_to_init, ...)
11
12DESCRIPTION
13 Optional hooks to initialize a lightweight object after creation.
Zesstradaf2c672025-08-02 15:59:17 +020014 Hook setting can be any closure, or the name of the function
15 (static or public) to call in the object.
Zesstra19d4cd42021-05-07 09:49:10 +020016
Zesstradaf2c672025-08-02 15:59:17 +020017 If the hook is an unbound lambda closure expecting arguments,
18 it is bound to the current object and called with the created
19 object as the first argument and any further arguments from the
20 new_lwobject() call. If the hook is an unbound lambda closure
21 without arguments, it is bound to the object to be initalized and
22 called. If the hook is any other type of closure, it is called
23 with the created object as the first argument and any further
24 arguments from the new_lwobject() call.
Zesstra19d4cd42021-05-07 09:49:10 +020025
26 If the hook is defined as the name of an lfun in the lightweight
27 object, it is called in the new lwobject with any further arguments
28 from the new_lwobject() call.
29
30HISTORY
31 LDMud 3.6.5 introduced lightweight objects.
32
33SEE ALSO
Zesstradaf2c672025-08-02 15:59:17 +020034 hooks(C), create_lwobject_copy(H), create_lwobject_restore(H),
35 create_ob(H), create_super(H), create_clone(H)