Zesstra | daf2c67 | 2025-08-02 15:59:17 +0200 | [diff] [blame] | 1 | SYNOPSIS |
| 2 | #include <sys/driver_hooks.h> |
| 3 | |
| 4 | set_driver_hook(H_CREATE_LWOBJECT_COPY, value) |
| 5 | |
| 6 | <value> being: |
| 7 | |
| 8 | void <name> () |
| 9 | void <closure> () |
| 10 | void <closure> (lwobject obj_to_init) |
| 11 | |
| 12 | DESCRIPTION |
| 13 | Optional hook to finish initialization of a copy of a 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 | |
| 27 | HISTORY |
| 28 | Introduced in LDMud 3.6.6. |
| 29 | |
| 30 | SEE ALSO |
| 31 | hooks(C), create_lwobject(H), copy(E), deep_copy(E) |