blob: dcb1c9dd4d4f47404f24d66fc566708d6d842541 [file] [log] [blame]
SYNOPSIS
#include <sys/driver_hooks.h>
set_driver_hook(H_RESET, value)
<value> being:
void|int <closure> ( void )
void <name>(1)
DESCRIPTION
Optional hook to reset an object. Hook setting can be unbound
lambda closures, or the name of the function (static or public)
to call in the object.
If the hook is a closure, it is bound to the object to be
reset and called with no argument.
If the result of this call is a positive number, it is used as
the interval to wait before the next reset(). If the result
is 0, the default interval computed from TIME_TO_RESET is
used. If the result is a negative number, the object will not
be reset again, unless directed otherwise by set_next_reset().
If the hook is defined as the name of an lfun in the object,
it is called in the object with 1 as argument, and any result
is ignored. In this call the previous_object() is the object
initiating the reset. If the function does not exist, the
object won't be reset again.
Note that an object is only reset by call to this hook if it
has been used since the last reset.
HISTORY
LDMud 3.2.10 allowed static functions to be given by name.
SEE ALSO
hooks(C)