From c7d8b0dfb8ae9670e2bc11ecf563200069a3a12f Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 11 Feb 2009 20:42:15 +0000 Subject: 26546, 26556: sticky emulation for functions defined in emulate ... -c ... environments, plus documentation --- Src/zsh.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Src/zsh.h') diff --git a/Src/zsh.h b/Src/zsh.h index 36755c719..159806f2c 100644 --- a/Src/zsh.h +++ b/Src/zsh.h @@ -1067,6 +1067,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 */ }; /* Shell function context types. */ @@ -1790,6 +1791,20 @@ struct histent { #define EMULATE_SH (1<<3) /* Bourne shell */ #define EMULATE_ZSH (1<<4) /* `native' mode */ +/* Test for a shell emulation. Use this rather than emulation directly. */ +#define EMULATION(X) (emulation & (X)) + +/* Return only base shell emulation field. */ +#define SHELL_EMULATION() (emulation & ((1<<5)-1)) + +/* Additional flags */ + +#define EMULATE_FULLY (1<<5) /* "emulate -R" in effect */ +/* + * Higher bits are used in options.c, record lowest unused bit... + */ +#define EMULATE_UNUSED (1<<6) + /* option indices */ enum { -- cgit 1.4.1