Update Doku aus Driversourcen
Change-Id: I455f0813b970151089b3dc1b8d9407eea323cdd1
diff --git a/doc/hook/auto_include b/doc/hook/auto_include
index a82adda..14683f5 100644
--- a/doc/hook/auto_include
+++ b/doc/hook/auto_include
@@ -10,9 +10,8 @@
, int sys_include)
DESCRIPTION
- Optional hook specifying a string to be included before
- the source of every compiled LPC object.
- Hook setting can be a string or a closure.
+ Optional hook specifying a string to be included before the source of
+ every compiled LPC object. Hook setting can be a string or a closure.
If the setting is a string, it will be automatically included before
the source of every compiled LPC object.
diff --git a/doc/hook/clean_up b/doc/hook/clean_up
index e00521a..d72999d 100644
--- a/doc/hook/clean_up
+++ b/doc/hook/clean_up
@@ -9,9 +9,8 @@
void|int <name>(int ref)
DESCRIPTION
- Optional hook to clean up an object.
- Hook setting can be any closure, or the name of the function
- to call in the object.
+ Optional hook to clean up an object. Hook setting can be any
+ closure, or the name of the function to call in the object.
This hook is called for an object if it hasn't been used
for at least TIME_TO_CLEAN_UP seconds, to give it the
@@ -37,7 +36,7 @@
the call has to result in a non-zero value.
If the hook specifies a non-existing lfun, or if the call
- returns 0, no further attempt to clean up this object will be done.
+ returns 0, no further attempt to clean up this object will be made.
HISTORY
diff --git a/doc/hook/clone_uids b/doc/hook/clone_uids
index 4bf902a..8d85790 100644
--- a/doc/hook/clone_uids
+++ b/doc/hook/clone_uids
@@ -9,12 +9,12 @@
DESCRIPTION
Mandatory hooks to determine the uid and euid of cloned
- objects. Hook settings can be any closure.
+ objects. Hook settings can be any closure.
When an object is cloned, the H_CLONE_UIDS hook is called with
- the blueprint object as first and the clone's designated name
- as second argument. The new object already exists, but has 0
- uids.
+ the blueprint object as the first argument and the clone's
+ designated name as the second. The new object already exists,
+ but has 0 uids.
For the result, the following possibilities exist (<num> is
a non-zero number, <no-string> is anything but a string):
diff --git a/doc/hook/create_clone b/doc/hook/create_clone
index bf3100e..3b349b7 100644
--- a/doc/hook/create_clone
+++ b/doc/hook/create_clone
@@ -16,7 +16,7 @@
If the hook is a closure expecting an argument, it is bound
to the current object and called with the created object as
- argument. If the hook as a closure without arguments, it is bound to
+ argument. If the hook is a closure without arguments, it is bound to
the object to be initalized and called.
If the result of the closure call is a non-zero number, it is used
diff --git a/doc/hook/create_ob b/doc/hook/create_ob
index 7de7ba3..3bb8798 100644
--- a/doc/hook/create_ob
+++ b/doc/hook/create_ob
@@ -10,14 +10,14 @@
int <closure> (object obj_to_init)
DESCRIPTION
- Optional hooks to initialize an explictely loaded
- object/blueprint after creation. Hook setting can be unbound
- lambda closures, or the name of the function (static or public) to
+ Optional hooks to initialize an explicitly loaded
+ object/blueprint after creation. 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 expecting an argument, it is bound
to the current object and called with the created object as
- argument. If the hook as a closure without arguments, it is bound to
+ argument. If the hook is a closure without arguments, it is bound to
the object to be initalized and called.
If the result of the closure call is a non-zero number, it is used
@@ -25,7 +25,7 @@
interval computed from TIME_TO_RESET is used.
If the hook is defined as the name of an lfun in the object,
- it is called in the object with 0 as argument, and any result
+ it is called in the object with 0 as argument and any result
is ignored.
HISTORY
diff --git a/doc/hook/create_super b/doc/hook/create_super
index a502730..0e51a4b 100644
--- a/doc/hook/create_super
+++ b/doc/hook/create_super
@@ -12,20 +12,21 @@
DESCRIPTION
Optional hooks to initialize a blueprint which is loaded by
inheritance after creation.
+
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 expecting an argument, it is bound
to the current object and called with the created object as
- argument. If the hook as a closure without arguments, it is bound to
- the object to be initalized and called.
+ argument. If the hook is a closure without arguments, it is bound to
+ the object to be initialized and called.
If the result of the closure call is a non-zero number, it is used
as the interval to wait before the first reset(), else the default
interval computed from TIME_TO_RESET is used.
If the hook is defined as the name of an lfun in the object,
- it is called in the object with 0 as argument, and any result
+ it is called in the object with 0 as argument and any result
is ignored.
HISTORY
diff --git a/doc/hook/default_method b/doc/hook/default_method
index 427a131..9f3cbab 100644
--- a/doc/hook/default_method
+++ b/doc/hook/default_method
@@ -36,7 +36,6 @@
If the hook can not (or doesn't want to) resolve the call, it
has to return 0.
-
HISTORY
Introduced in LDMud 3.3.113
diff --git a/doc/hook/default_prompt b/doc/hook/default_prompt
index 6231bb4..b3cfa55 100644
--- a/doc/hook/default_prompt
+++ b/doc/hook/default_prompt
@@ -14,8 +14,8 @@
The hook can be given as string or as closure. If it is a
closure, it is called with the commandgiver being the calling
- object. If the result is a string, it will be printed,
- otherwise ignored.
+ object. If the result is a string it will be printed,
+ otherwise it will be ignored.
HISTORY
Introduced in LDMud 3.3.163.
diff --git a/doc/hook/erq_stop b/doc/hook/erq_stop
index a135a1c..c5e08e3 100644
--- a/doc/hook/erq_stop
+++ b/doc/hook/erq_stop
@@ -9,7 +9,7 @@
DESCRIPTION
Optional hook to notify the mudlib about the termination of
- the erq demon. Hook setting may be any closure.
+ the erq demon. Hook setting may be any closure.
The closure is called without arguments and may do whatever it
likes to clean-up after the erq.
diff --git a/doc/hook/file_encoding b/doc/hook/file_encoding
new file mode 100644
index 0000000..3c7c6d8
--- /dev/null
+++ b/doc/hook/file_encoding
@@ -0,0 +1,27 @@
+SYNOPSIS
+ #include <sys/driver_hooks.h>
+
+ set_driver_hook(H_FILE_ENCODING, value)
+
+ <value> being:
+
+ string <text>
+ string <closure>(string filename)
+
+DESCRIPTION
+ Optonal hook specifying the name of the encoding to be used
+ for decoding a file. Hook setting can be a string or a closure.
+
+ If no hook was specified or the closure returns 0, then the
+ default "ascii" is used (and thus will throw an error upon
+ chars greater than 0x7f in the file).
+
+ If the settings is a closure, it will be called for every file
+ opened by the compiler or by read_file() and write_file()
+ (unless an explicit encoding was given).
+
+HISTORY
+ Introduced in LDMud 3.5.1
+
+SEE ALSO
+ hooks(C)
diff --git a/doc/hook/hook b/doc/hook/hook
index 3218445..7e66879 100644
--- a/doc/hook/hook
+++ b/doc/hook/hook
@@ -11,6 +11,7 @@
Some of the hooks are mandatory, some not. Most hooks accept
unbound lambda closures as values, some also lfun closures or
even strings.
+
The hooks are identified by an ordinal number, for which
symbolic names are defined in /sys/driverhooks.h.
diff --git a/doc/hook/include_dirs b/doc/hook/include_dirs
index 6557359..9ee2fb6 100644
--- a/doc/hook/include_dirs
+++ b/doc/hook/include_dirs
@@ -11,7 +11,7 @@
DESCRIPTION
Semi-mandatory hook specifying the directories where <>-type
include files are searched (this includes ""-includes not
- found as specified). Hook setting may be any closure or a
+ found as specified). Hook setting may be any closure or a
string array. If not set, only ""-type includes may be used in LPC
programs.
@@ -27,9 +27,9 @@
If the setting is a closure, it is called with the name of the
desired include file as first, and the name of the compiled
- LPC file as second argument. Result has to be the complete
+ LPC file as second argument. Result has to be the complete
path name of the include file to use. Leading slashes may be
- omitted. If the closure is a lambda closure, it is bound to
+ omitted. If the closure is a lambda closure, it is bound to
this_object() prior to execution.
HISTORY
diff --git a/doc/hook/load_uids b/doc/hook/load_uids
index 9d1e160..7221dd5 100644
--- a/doc/hook/load_uids
+++ b/doc/hook/load_uids
@@ -9,10 +9,10 @@
DESCRIPTION
Mandatory hooks to determine the uid and euid of loaded or
- cloned objects. Hook settings can be any closure.
+ cloned objects. Hook settings can be any closure.
When an object is newly loaded, the H_LOAD_UIDS hook is called
- with the object name as argument. The new object already
+ with the object name as argument. The new object already
exists, but has 0 uids.
For the result, the following possibilities exist (<num> is
diff --git a/doc/hook/no_echo b/doc/hook/no_echo
index b592529..fb30b9b 100644
--- a/doc/hook/no_echo
+++ b/doc/hook/no_echo
@@ -11,10 +11,10 @@
DESCRIPTION
Optional hook to specifiy how to perform the telnet actions to
switch the echo mode (used for e.g. password input_to()s).
- Hook setting may be any closure or a string. If not set, a
+ Hook setting may be any closure or a string. If not set, a
default handling is performed.
- If the setting is a string, it used as name of an lfun to call
+ If the setting is a string, it is used as name of an lfun to call
in the interactive <user>, where <flag> is the echo-flag
passed to the input_to() statement.
diff --git a/doc/hook/notify_fail b/doc/hook/notify_fail
index 8a4bacf..d229a55 100644
--- a/doc/hook/notify_fail
+++ b/doc/hook/notify_fail
@@ -11,7 +11,7 @@
DESCRIPTION
Mandatory hook to issue the default message if an entered
command couldn't be parsed and no notify_fail() command is in
- effect. Hook setting can be a any closure, or a string.
+ effect. Hook setting can be a any closure, or a string.
If set to a string, it is the message returned to the
player.
diff --git a/doc/hook/reset b/doc/hook/reset
index 23f1dea..dcb1c9d 100644
--- a/doc/hook/reset
+++ b/doc/hook/reset
@@ -9,23 +9,23 @@
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.
+ 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
+ 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
+ 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
+ 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
diff --git a/doc/hook/telnet_neg b/doc/hook/telnet_neg
index 0f8b8c1..937c5b7 100644
--- a/doc/hook/telnet_neg
+++ b/doc/hook/telnet_neg
@@ -10,7 +10,7 @@
DESCRIPTION
Optional hook to specifiy how to perform a single telnet
- negotiation. Hook setting may be any closure or a string. If
+ negotiation. Hook setting may be any closure or a string. If
not set, most telnet options are rejected (read: only a very
minimal negotiation takes place).
@@ -30,10 +30,9 @@
Alternatively, if H_NOECHO is set, this hook is called for
_all_ telnet data received.
- If the setting is a string, it used as name of an lfun to call
- in this_player(). Closures are just called, with unbound
- lambda-closures being bound to this_player() prior to
- execution.
+ If the setting is a string, it used as the name of an lfun to
+ call in this_player(). Closures are just called, with unbound
+ lambda-closures being bound to this_player() prior to execution.
The hook is called for a 'DO/DONT/WILL/WONT <opt>' with the action
(DO/DONT/...) as the first, and <opt> as the second argument.
@@ -42,7 +41,7 @@
IAC SB <opt> <opts>...
- followed by IAC SB/SE, the hook is called with 'SB' as first
+ followed by IAC SB/SE, the hook is called with 'SB' as first
argument, <opt> as second, and <opts> as an array of integers as
third argument.