summaryrefslogtreecommitdiff
path: root/Src/zsh.h
diff options
context:
space:
mode:
Diffstat (limited to 'Src/zsh.h')
-rw-r--r--Src/zsh.h80
1 files changed, 59 insertions, 21 deletions
diff --git a/Src/zsh.h b/Src/zsh.h
index b83b8bdbb..dae2b2459 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -489,6 +489,7 @@ typedef struct complist *Complist;
typedef struct conddef *Conddef;
typedef struct dirsav *Dirsav;
typedef struct emulation_options *Emulation_options;
+typedef struct execcmd_params *Execcmd_params;
typedef struct features *Features;
typedef struct feature_enables *Feature_enables;
typedef struct funcstack *Funcstack;
@@ -622,27 +623,34 @@ struct timedfn {
/* (1<<4) is used for Z_END, see the wordcode definitions */
/* (1<<5) is used for Z_SIMPLE, see the wordcode definitions */
-/* Condition types. */
+/*
+ * Condition types.
+ *
+ * Careful when changing these: both cond_binary_ops in text.c and
+ * condstr in cond.c depend on these. (The zsh motto is "two instances
+ * are better than one". Or something.)
+ */
#define COND_NOT 0
#define COND_AND 1
#define COND_OR 2
#define COND_STREQ 3
-#define COND_STRNEQ 4
-#define COND_STRLT 5
-#define COND_STRGTR 6
-#define COND_NT 7
-#define COND_OT 8
-#define COND_EF 9
-#define COND_EQ 10
-#define COND_NE 11
-#define COND_LT 12
-#define COND_GT 13
-#define COND_LE 14
-#define COND_GE 15
-#define COND_REGEX 16
-#define COND_MOD 17
-#define COND_MODI 18
+#define COND_STRDEQ 4
+#define COND_STRNEQ 5
+#define COND_STRLT 6
+#define COND_STRGTR 7
+#define COND_NT 8
+#define COND_OT 9
+#define COND_EF 10
+#define COND_EQ 11
+#define COND_NE 12
+#define COND_LT 13
+#define COND_GT 14
+#define COND_LE 15
+#define COND_GE 16
+#define COND_REGEX 17
+#define COND_MOD 18
+#define COND_MODI 19
typedef int (*CondHandler) _((char **, int));
@@ -976,7 +984,8 @@ struct jobfile {
struct job {
pid_t gleader; /* process group leader of this job */
- pid_t other; /* subjob id or subshell pid */
+ pid_t other; /* subjob id (SUPERJOB)
+ * or subshell pid (SUBJOB) */
int stat; /* see STATs below */
char *pwd; /* current working dir of shell when *
* this job was spawned */
@@ -1008,6 +1017,8 @@ struct job {
#define STAT_SUBLEADER (0x2000) /* is super-job, but leader is sub-shell */
#define STAT_BUILTIN (0x4000) /* job at tail of pipeline is a builtin */
+#define STAT_SUBJOB_ORPHANED (0x8000)
+ /* STAT_SUBJOB with STAT_SUPERJOB exited */
#define SP_RUNNING -1 /* fake status for jobs currently running */
@@ -1381,6 +1392,21 @@ struct builtin {
*/
#define BINF_ASSIGN (1<<19)
+/**
+ * Parameters passed to execcmd().
+ * These are not opaque --- they are also used by the pipeline manager.
+ */
+struct execcmd_params {
+ LinkList args; /* All command prefixes, arguments & options */
+ LinkList redir; /* Redirections */
+ Wordcode beg; /* The code at the start of the command */
+ Wordcode varspc; /* The code for assignment parsed as such */
+ Wordcode assignspc; /* The code for assignment parsed as typeset */
+ int type; /* The WC_* type of the command */
+ int postassigns; /* The number of assignspc assiguments */
+ int htok; /* tokens in parameter list */
+};
+
struct module {
struct hashnode node;
union {
@@ -1563,7 +1589,7 @@ struct zpc_disables_save {
/*
* Bit vector of ZPC_COUNT disabled characters.
* We'll live dangerously and assumed ZPC_COUNT is no greater
- * than the number of bits an an unsigned int.
+ * than the number of bits an unsigned int.
*/
unsigned int disables;
};
@@ -1792,6 +1818,8 @@ struct tieddata {
#define PM_ZSHSTORED (1<<18) /* function stored in zsh form */
/* Remaining flags do not correspond directly to command line arguments */
+#define PM_DONTIMPORT_SUID (1<<19) /* do not import if running setuid */
+#define PM_SINGLE (1<<20) /* special can only have a single instance */
#define PM_LOCAL (1<<21) /* this parameter will be made local */
#define PM_SPECIAL (1<<22) /* special builtin parameter */
#define PM_DONTIMPORT (1<<23) /* do not import this variable */
@@ -2567,7 +2595,7 @@ struct ttyinfo {
#define txtchangeisset(T,X) ((T) & (X))
#define txtchangeget(T,A) (((T) & A ## _MASK) >> A ## _SHIFT)
-#define txtchangeset(T, X, Y) ((void)(T && (*T |= (X), *T &= ~(Y))))
+#define txtchangeset(T, X, Y) ((void)(T && (*T &= ~(Y), *T |= (X))))
/*
* For outputting sequences to change colour: specify foreground
@@ -2799,7 +2827,14 @@ enum errflag_bits {
/*
* User interrupt.
*/
- ERRFLAG_INT = 2
+ ERRFLAG_INT = 2,
+ /*
+ * Hard error --- return to top-level prompt in interactive
+ * shell. In non-interactive shell we'll typically already
+ * have exited. This is reset by "errflag = 0" in
+ * loop(toplevel = 1, ...).
+ */
+ ERRFLAG_HARD = 4
};
/***********/
@@ -2921,6 +2956,7 @@ struct parse_stack {
int incasepat;
int isnewlin;
int infor;
+ int inrepeat_;
int intypeset;
int eclen, ecused, ecnpats;
@@ -3095,7 +3131,9 @@ typedef wint_t convchar_t;
* much what the definition tells us. However, we happen to know this
* works on MacOS which doesn't define that.
*/
-#if defined(BROKEN_WCWIDTH) && (defined(__STDC_ISO_10646__) || defined(__APPLE__))
+#ifdef ENABLE_UNICODE9
+#define WCWIDTH(wc) mk_wcwidth(wc)
+#elif defined(BROKEN_WCWIDTH) && (defined(__STDC_ISO_10646__) || defined(__APPLE__))
#define WCWIDTH(wc) mk_wcwidth(wc)
#else
#define WCWIDTH(wc) wcwidth(wc)