From: Bart Schaefer <firstname.lastname@example.org>
To: Zsh hackers list <email@example.com>
Subject: [PATCH] Clarify module section of zsh-development-guide
Date: Sun, 26 Feb 2023 20:38:31 -0800 [thread overview]
Message-ID: <CAH+w=7apMx858EjYHLRkz-PBkrditA7qFTjPXetreORXQoTcKw@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 123 bytes --]
These are edits based on my rambling in workers/51481.
I have not yet added anything about wrappers and local parameters.
[-- Attachment #2: zsh-dev-guide.txt --]
[-- Type: text/plain, Size: 2277 bytes --]
diff --git a/Etc/zsh-development-guide b/Etc/zsh-development-guide
index da6932003..5cb542709 100644
@@ -371,8 +371,8 @@ particular they can be called before or after `boot_'.
The function named `boot_' should register function wrappers, hooks and
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
-after the `setup_'-function, and also after the initial set of features
-have been set by calls to `features_' and `enables_'.
+after the initial set of features have been set by calls to `features_'
The function named `cleanup_', is called when the user tries to unload
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 parameter flags to set for it (from the PM_* flags defined
- - optionally a pointer to a variable holding the value of the
+ - optionally a pointer to the value of 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
- used to define integer-, scalar-, and array-parameters, so the
- variables whose addresses are given should be of type `long',
- `char *', and `char **', respectively
+ used to define integer-, scalar-, and array-parameters, so for
+ those macros the pointer to the parameter value should be the
+ 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
the parameter types scalar, integer, float, array, and hash.
reply other threads:[~2023-02-27 4:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).