blob: 095ef80665fa984b64dfeef46ba2e3c0b49a6f6c [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
2 #include <sys/driver_hooks.h>
3
4 set_driver_hook(H_MODIFY_COMMAND_FNAME, value)
5
6 <value> being:
7
8 int|string <name>(string cmd)
9
10DESCRIPTION
11 Mandatory hook specifying the name of the 'modify_command'
12 lfun to call for newly entered commands as result of a
13 set_modify_command().
14
15 Hook setting must be a string.
16
17 If set_modify_command() is used for an interactive user, all
18 newly entered commands are first passed to the function named
19 by this hook.
20
21 The function is called with the command as argument.
22
23 If the result is a string, it is the new command to execute
24 instead of the given one. Note that it is not possible to make
25 several commands from one this way!
26
27 If the result is a non-zero number, the given command is to be
28 ignored. In case of the closure/lfun setting this may mean
29 that the closure/lfun already executed it.
30
31 If the result is 0, the originally given command is to be
32 used.
33
34 It is possible for the hook to change the command giver
35 (this_player()) for the execution of the command. This means
36 that even though the commands are execute for the original
37 commandgiver, this_player() will return the changed
38 commandgiver.
39
40HISTORY
41
42SEE ALSO
43 hooks(C), command(H), modify_command(H), notify_fail(H),
44 send_notify_fail(H)