summaryrefslogtreecommitdiff
path: root/Src/zsh.h
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-10-11 20:14:01 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-10-11 20:14:01 +0000
commit4b86cc48f704152ccca13c50bc3acd59b4217ecc (patch)
treecfae43df67e766bd504da4a287a5e9307c931a60 /Src/zsh.h
parentad92cb3203e5d95be91019633e8f1f5835b12794 (diff)
downloadzsh-4b86cc48f704152ccca13c50bc3acd59b4217ecc.tar.gz
zsh-4b86cc48f704152ccca13c50bc3acd59b4217ecc.zip
30726: make shell options passed to emulate stick along with the emulation
Diffstat (limited to 'Src/zsh.h')
-rw-r--r--Src/zsh.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/Src/zsh.h b/Src/zsh.h
index fee27ac10..e51572bcf 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -407,6 +407,7 @@ typedef struct cmdnam *Cmdnam;
typedef struct complist *Complist;
typedef struct conddef *Conddef;
typedef struct dirsav *Dirsav;
+typedef struct emulation_options *Emulation_options;
typedef struct features *Features;
typedef struct feature_enables *Feature_enables;
typedef struct funcstack *Funcstack;
@@ -1099,7 +1100,7 @@ struct shfunc {
char *filename; /* Name of file located in */
zlong lineno; /* line number in above file */
Eprog funcdef; /* function definition */
- int emulation; /* sticky emulation for function */
+ Emulation_options sticky; /* sticky emulation definitions, if any */
};
/* Shell function context types. */
@@ -2104,6 +2105,12 @@ enum {
OPT_SIZE
};
+/*
+ * Size required to fit an option number.
+ * If OPT_SIZE goes above 256 this will need to expand.
+ */
+typedef unsigned char OptIndex;
+
#undef isset
#define isset(X) (opts[X])
#define unset(X) (!opts[X])
@@ -2112,6 +2119,27 @@ enum {
#define jobbing (isset(MONITOR))
#define islogin (isset(LOGINSHELL))
+/*
+ * Record of emulation and options that need to be set
+ * for a full "emulate".
+ */
+struct emulation_options {
+ /* The emulation itself */
+ int emulation;
+ /* The number of options in on_opts. */
+ int n_on_opts;
+ /* The number of options in off_opts. */
+ int n_off_opts;
+ /*
+ * Array of options to be turned on.
+ * Only options specified explicitly in the emulate command
+ * are recorded. Null if n_on_opts is zero.
+ */
+ OptIndex *on_opts;
+ /* Array of options to be turned off, similar. */
+ OptIndex *off_opts;
+};
+
/***********************************************/
/* Definitions for terminal and display control */
/***********************************************/