about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2023-01-31 17:45:42 -0800
committerBart Schaefer <schaefer@zsh.org>2023-01-31 17:45:42 -0800
commitc8c894f83fbb07b4f65b2ac8db639680062b25d9 (patch)
treea1e3e4c61ec9b183ec9ffb132447f21900d7e846
parent88ccf2be1e3ba70608e69639c8929254ff01fcc8 (diff)
downloadzsh-c8c894f83fbb07b4f65b2ac8db639680062b25d9.tar.gz
zsh-c8c894f83fbb07b4f65b2ac8db639680062b25d9.tar.xz
zsh-c8c894f83fbb07b4f65b2ac8db639680062b25d9.zip
51342: update PARAMDEF description
-rw-r--r--ChangeLog2
-rw-r--r--Etc/zsh-development-guide11
2 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index f2456de50..05c7d86c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 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
 	attributes cross-reference typeset equivalents (or lack thereof)
 
diff --git a/Etc/zsh-development-guide b/Etc/zsh-development-guide
index 565b0b1d9..da6932003 100644
--- a/Etc/zsh-development-guide
+++ b/Etc/zsh-development-guide
@@ -612,7 +612,7 @@ For defining parameters, a module can call `createparam()' directly or
 use a table to describe them, e.g.:
 
   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),
     STRPARAMDEF("exstr", &strparam),
     ARRPARAMDEF("exarr", &arrparam),
@@ -626,9 +626,9 @@ There are four macros used:
       in zsh.h)
     - optionally a pointer to a variable holding the value of the
       parameter
-    - three functions that will be used to get the value of the
-      parameter, store a value in the parameter, and unset the
-      parameter
+    - a GSU pointer to the three functions that will be used to get
+      the value of the parameter, store a value in the parameter,
+      and unset the parameter
   - the other macros provide simple ways to define the most common
     types of parameters; they get the name of the parameter and a
     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',
     `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 
 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: