mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 05:16:05 +01:00
51342: update PARAMDEF description
This commit is contained in:
parent
88ccf2be1e
commit
c8c894f83f
2 changed files with 9 additions and 4 deletions
|
@ -1,5 +1,7 @@
|
||||||
2023-01-31 Bart Schaefer <schaefer@zsh.org>
|
2023-01-31 Bart Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* 51342: Etc/zsh-development-guide: update PARAMDEF description
|
||||||
|
|
||||||
* 51337: Doc/Zsh/expn.yo, Doc/Zsh/mod_parameter.yo: parameter
|
* 51337: Doc/Zsh/expn.yo, Doc/Zsh/mod_parameter.yo: parameter
|
||||||
attributes cross-reference typeset equivalents (or lack thereof)
|
attributes cross-reference typeset equivalents (or lack thereof)
|
||||||
|
|
||||||
|
|
|
@ -612,7 +612,7 @@ For defining parameters, a module can call `createparam()' directly or
|
||||||
use a table to describe them, e.g.:
|
use a table to describe them, e.g.:
|
||||||
|
|
||||||
static struct paramdef patab[] = {
|
static struct paramdef patab[] = {
|
||||||
PARAMDEF("foo", PM_INTEGER, NULL, get_foo, set_foo, unset_foo),
|
PARAMDEF("foo", PM_INTEGER, NULL, foo_gsu),
|
||||||
INTPARAMDEF("exint", &intparam),
|
INTPARAMDEF("exint", &intparam),
|
||||||
STRPARAMDEF("exstr", &strparam),
|
STRPARAMDEF("exstr", &strparam),
|
||||||
ARRPARAMDEF("exarr", &arrparam),
|
ARRPARAMDEF("exarr", &arrparam),
|
||||||
|
@ -626,9 +626,9 @@ There are four macros used:
|
||||||
in zsh.h)
|
in zsh.h)
|
||||||
- optionally a pointer to a variable holding the value of the
|
- optionally a pointer to a variable holding the value of the
|
||||||
parameter
|
parameter
|
||||||
- three functions that will be used to get the value of the
|
- a GSU pointer to the three functions that will be used to get
|
||||||
parameter, store a value in the parameter, and unset the
|
the value of the parameter, store a value in the parameter,
|
||||||
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
|
||||||
|
@ -636,6 +636,9 @@ There are four macros used:
|
||||||
variables whose addresses are given should be of type `long',
|
variables whose addresses are given should be of type `long',
|
||||||
`char *', and `char **', respectively
|
`char *', and `char **', respectively
|
||||||
|
|
||||||
|
GSU (get, set, unset) structures are defined in Src/zsh.h for each of
|
||||||
|
the parameter types scalar, integer, float, array, and hash.
|
||||||
|
|
||||||
For a description of how to write functions for getting or setting the
|
For a description of how to write functions for getting or setting the
|
||||||
value of parameters, or how to write a function to unset a parameter,
|
value of parameters, or how to write a function to unset a parameter,
|
||||||
see the description of the following functions in the `params.c' file:
|
see the description of the following functions in the `params.c' file:
|
||||||
|
|
Loading…
Reference in a new issue