Zesstra | 19d4cd4 | 2021-05-07 09:49:10 +0200 | [diff] [blame^] | 1 | SYNOPSIS |
| 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 | |
| 12 | DESCRIPTION |
| 13 | Optional hooks to initialize a lightweight object after creation. |
| 14 | Hook setting can be unbound lambda closures, or the name of the |
| 15 | function (static or public) to call in the object. |
| 16 | |
| 17 | If the hook is a closure expecting arguments, it is bound to the |
| 18 | current object and called with the created object as the first |
| 19 | argument and any further arguments from the new_lwobject() call. |
| 20 | If the hook is a closure without arguments, it is bound to |
| 21 | the object to be initalized and called. |
| 22 | |
| 23 | If the hook is defined as the name of an lfun in the lightweight |
| 24 | object, it is called in the new lwobject with any further arguments |
| 25 | from the new_lwobject() call. |
| 26 | |
| 27 | HISTORY |
| 28 | LDMud 3.6.5 introduced lightweight objects. |
| 29 | |
| 30 | SEE ALSO |
| 31 | hooks(C), create_ob(H), create_super(H), create_clone(H) |