mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-06-10 18:58:03 +02:00
51486: clarify module development section
This commit is contained in:
parent
ea0bd72dd8
commit
9bd9693fdb
2 changed files with 12 additions and 7 deletions
|
@ -1,5 +1,7 @@
|
||||||
2023-03-05 Bart Schaefer <schaefer@zsh.org>
|
2023-03-05 Bart Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* 51486: Etc/zsh-development-guide: clarify module section
|
||||||
|
|
||||||
* 51485: Doc/Makefile.in, Doc/Zsh/mod_ksh93.yo, Src/utils.c,
|
* 51485: Doc/Makefile.in, Doc/Zsh/mod_ksh93.yo, Src/utils.c,
|
||||||
Src/Modules/ksh93.c, Src/Modules/ksh93.mdd: module for several
|
Src/Modules/ksh93.c, Src/Modules/ksh93.mdd: module for several
|
||||||
ksh93 features, mostly enabled only in ksh emulation.
|
ksh93 features, mostly enabled only in ksh emulation.
|
||||||
|
|
|
@ -371,8 +371,8 @@ particular they can be called before or after `boot_'.
|
||||||
The function named `boot_' should register function wrappers, hooks and
|
The function named `boot_' should register function wrappers, hooks and
|
||||||
anything that will be visible to the user that is not handled by features_
|
anything that will be visible to the user that is not handled by features_
|
||||||
and enables_ (so features should not be turned on here). It will be called
|
and enables_ (so features should not be turned on here). It will be called
|
||||||
after the `setup_'-function, and also after the initial set of features
|
after the initial set of features have been set by calls to `features_'
|
||||||
have been set by calls to `features_' and `enables_'.
|
and `enables_'.
|
||||||
|
|
||||||
The function named `cleanup_', is called when the user tries to unload
|
The function named `cleanup_', is called when the user tries to unload
|
||||||
a module and should de-register all features and hooks. A call
|
a module and should de-register all features and hooks. A call
|
||||||
|
@ -624,17 +624,20 @@ There are four macros used:
|
||||||
- the name of the parameter
|
- the name of the parameter
|
||||||
- the parameter flags to set for it (from the PM_* flags defined
|
- the parameter flags to set for it (from the PM_* flags defined
|
||||||
in zsh.h)
|
in zsh.h)
|
||||||
- optionally a pointer to a variable holding the value of the
|
- optionally a pointer to the value of the parameter
|
||||||
parameter
|
|
||||||
- a GSU pointer to the three functions that will be used to get
|
- a GSU pointer to the three functions that will be used to get
|
||||||
the value of the parameter, store a value in the parameter,
|
the value of the parameter, store a value in the parameter,
|
||||||
and unset the parameter
|
and unset the parameter
|
||||||
- the other macros provide simple ways to define the most common
|
- the other macros provide simple ways to define the most common
|
||||||
types of parameters; they get the name of the parameter and a
|
types of parameters; they get the name of the parameter and a
|
||||||
pointer to a variable holding the value as arguments; they are
|
pointer to a variable holding the value as arguments; they are
|
||||||
used to define integer-, scalar-, and array-parameters, so the
|
used to define integer-, scalar-, and array-parameters, so for
|
||||||
variables whose addresses are given should be of type `long',
|
those macros the pointer to the parameter value should be the
|
||||||
`char *', and `char **', respectively
|
address of a variable of type `long', `char *',or `char **',
|
||||||
|
respectively, pointing in turn to the desired value.
|
||||||
|
- Parameters used in a module that don't have special behaviour
|
||||||
|
shouldn't be declared in this way, instead they should just be
|
||||||
|
created in `boot_' with the standard parameter functions.
|
||||||
|
|
||||||
GSU (get, set, unset) structures are defined in Src/zsh.h for each of
|
GSU (get, set, unset) structures are defined in Src/zsh.h for each of
|
||||||
the parameter types scalar, integer, float, array, and hash.
|
the parameter types scalar, integer, float, array, and hash.
|
||||||
|
|
Loading…
Reference in a new issue