summaryrefslogtreecommitdiff
path: root/Src/zsh.h
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-08-07 16:25:14 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-08-07 16:25:14 +0000
commit2706eac45492b0fcdfc3cf104ac947e65d09ee25 (patch)
treeff7f6e2a05231a8444589e54c95313114ebcae07 /Src/zsh.h
parentc4f33330f6797d0c199abf522f79c3ccac88ed55 (diff)
downloadzsh-2706eac45492b0fcdfc3cf104ac947e65d09ee25.tar.gz
zsh-2706eac45492b0fcdfc3cf104ac947e65d09ee25.zip
25415: Make DEBUG_BEFORE_CMD the default.
Reuse ERR_EXIT in DEBUG traps. Clean up trapreturn code.
Diffstat (limited to 'Src/zsh.h')
-rw-r--r--Src/zsh.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/Src/zsh.h b/Src/zsh.h
index d245a416a..49c08c7ac 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -921,7 +921,9 @@ struct execstack {
int badcshglob;
pid_t cmdoutpid;
int cmdoutval;
- int trapreturn;
+ int trap_return;
+ int trap_state;
+ int trapisfunc;
int noerrs;
int subsh_close;
char *underscore;
@@ -2225,6 +2227,24 @@ struct heap {
#define ZSIG_ALIAS (1<<3) /* Trap is stored under an alias */
#define ZSIG_SHIFT 4
+/*
+ * State of traps, stored in trap_state.
+ */
+enum trap_state {
+ /* Traps are not active; trap_return is not useful. */
+ TRAP_STATE_INACTIVE,
+ /*
+ * Traps are set but haven't triggered; trap_return gives
+ * minus function depth.
+ */
+ TRAP_STATE_PRIMED,
+ /*
+ * Trap has triggered to force a return; trap_return givens
+ * return value.
+ */
+ TRAP_STATE_FORCE_RETURN
+};
+
/***********/
/* Sorting */
/***********/