From: Daniel Shahaf <danielsh@apache.org>
To: zsh-workers@zsh.org
Subject: [PATCH 3/3] internal: Document forklevel, locallevel, and exit_pending.
Date: Tue, 17 Dec 2019 07:44:28 +0000 [thread overview]
Message-ID: <20191217074428.3699-3-danielsh@apache.org> (raw)
In-Reply-To: <20191217074428.3699-1-danielsh@apache.org>
---
Src/builtin.c | 6 +++++-
Src/exec.c | 4 ++++
Src/params.c | 6 +++++-
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/Src/builtin.c b/Src/builtin.c
index 5fe5ea6d1..0ecabf854 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -5601,7 +5601,11 @@ bin_getopts(UNUSED(char *name), char **argv, UNUSED(Options ops), UNUSED(int fun
return 0;
}
-/* Flag that we should exit the shell as soon as all functions return. */
+/* Boolean flag that we should exit the shell as soon as all functions return.
+ *
+ * Set by the 'exit' builtin.
+ */
+
/**/
mod_export int
exit_pending;
diff --git a/Src/exec.c b/Src/exec.c
index 0d9d7de7c..50027654a 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -971,6 +971,10 @@ hashcmd(char *arg0, char **pp)
return cn;
}
+/* The value that 'locallevel' had when we forked. When we get back to this
+ * level, the current process (which is a subshell) will terminate.
+ */
+
/**/
int
forklevel;
diff --git a/Src/params.c b/Src/params.c
index da7a6b4c5..5eaafe34e 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -44,7 +44,11 @@
#endif
#endif
-/* what level of localness we are at */
+/* What level of localness we are at.
+ *
+ * Hand-wavingly, this is incremented at every function call and decremented
+ * at every function return. See startparamscope().
+ */
/**/
mod_export int locallevel;
prev parent reply other threads:[~2019-12-17 7:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-17 7:44 [PATCH 1/3] Fix the mktemp() warning, in debug builds only Daniel Shahaf
2019-12-17 7:44 ` [PATCH 2/3] Make 'make -s' print nothing when it does nothing Daniel Shahaf
2019-12-17 7:44 ` Daniel Shahaf [this message]
Reply instructions:
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191217074428.3699-3-danielsh@apache.org \
--to=danielsh@apache.org \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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
https://git.vuxu.org/mirror/zsh/
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).