diff options
author | April Chin <April.Chin@Sun.COM> | 2008-12-27 14:59:38 -0800 |
---|---|---|
committer | April Chin <April.Chin@Sun.COM> | 2008-12-27 14:59:38 -0800 |
commit | 7c2fbfb345896881c631598ee3852ce9ce33fb07 (patch) | |
tree | 4b173b5657508562dfc0aa05f7d056d1e9add505 /usr/src/lib/libshell/common/include/shell.h | |
parent | 6071ac1de68fed78e1e10052045bbb5f1732a263 (diff) | |
download | illumos-gate-7c2fbfb345896881c631598ee3852ce9ce33fb07.tar.gz |
PSARC/2008/094 ksh93 Update 1
PSARC/2008/344 ksh93 Integration Update 1 Amendments 1
PSARC/2008/589 Remove /usr/bin/printf from PSARC case 2008 094
6619428 *ksh93* RFE: Update ksh93 in Solaris to ast-ksh.2008-11-04
6788659 RFE: Update libpp in Solaris to ast-open.2008-07-25
6561901 RFE: Add "shcomp" (shell script compiler) + kernel module to exec binary sh code
6599668 RFE: Move consumers of alias.sh over to ksh93
6595183 *ksh93* RFE: Update ksh93-integration demo code
6775901 *ksh93* no C message catalogs are generated for ksh93
6451262 *sleep* RFE: /usr/bin/sleep should support floating-point values
6687139 *ksh93* command substitution, exec, and stdout redirection cause allocation loop
6703761 *ksh93* crashes in script containing uncommon output redirections
6715496 *ksh93* SEGVs on array reinitialization
6713682 *ksh93* Creating a compound variable in a subshell "bleeds through" to the calling subshell
6672350 *ksh93* causes parent shell to die when child shell is suspended
6745015 *ksh93* VARIABLE=`command substitution` assignment is not reliable on OpenSolaris
6710205 *ksh93* problem with command substitution (within back quotes) containing \$'
6737600 *ksh93* exits debugger when user presses ctrl-c
6748645 *ksh93* fc -l -e - is mis-parsed, outputs wrong error message "-e - requires single argument"
6754020 *ksh93* does weird '[' expansion
6753538 *ksh93* umask modification leaks out of a ksh93 subshell
6766246 *ksh93* bug in pattern matching
6763594 *ksh93* executes command after "command" builtin twice on failure
6762665 *ksh93* Difficult-to-reproduce SIGSEGV in ksh93
Diffstat (limited to 'usr/src/lib/libshell/common/include/shell.h')
-rw-r--r-- | usr/src/lib/libshell/common/include/shell.h | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/usr/src/lib/libshell/common/include/shell.h b/usr/src/lib/libshell/common/include/shell.h index 66ccd20436..b82e582cfc 100644 --- a/usr/src/lib/libshell/common/include/shell.h +++ b/usr/src/lib/libshell/common/include/shell.h @@ -1,10 +1,10 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1982-2007 AT&T Knowledge Ventures * +* Copyright (c) 1982-2008 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * -* by AT&T Knowledge Ventures * +* by AT&T Intellectual Property * * * * A copy of the License is available at * * http://www.opensource.org/licenses/cpl1.0.txt * @@ -27,7 +27,7 @@ * */ -#include <cmd.h> +#include <ast.h> #include <cdt.h> #ifdef _SH_PRIVATE # include "name.h" @@ -35,7 +35,7 @@ # include <nval.h> #endif /* _SH_PRIVATE */ -#define SH_VERSION 20060510 +#define SH_VERSION 20071012 #undef NOT_USED #define NOT_USED(x) (&x,1) @@ -47,8 +47,9 @@ typedef struct } Shopt_t; -typedef void (*Shinit_f)(int); -typedef int (*Shbltin_f)(int, char*[], void*); +typedef struct Shell_s Shell_t; + +typedef void (*Shinit_f)(Shell_t*, int); typedef int (*Shwait_f)(int, long, int); union Shnode_u; @@ -115,6 +116,7 @@ typedef struct sh_scope char **argv; char *cmdname; char *filename; + char *funname; int lineno; Dt_t *var_tree; struct sh_scope *self; @@ -124,7 +126,7 @@ typedef struct sh_scope * Saves the state of the shell */ -typedef struct sh_static +struct Shell_s { Shopt_t options; /* set -o options */ Dt_t *var_tree; /* for shell variables */ @@ -136,10 +138,11 @@ typedef struct sh_static int exitval; /* most recent exit value */ unsigned char trapnote; /* set when trap/signal is pending */ char subshell; /* set for virtual subshell */ + char shcomp; /* set when runing shcomp */ #ifdef _SH_PRIVATE _SH_PRIVATE #endif /* _SH_PRIVATE */ -} Shell_t; +}; /* flags for sh_parse */ #define SH_NL 1 /* Treat new-lines as ; */ @@ -149,9 +152,13 @@ typedef struct sh_static #define SH_IOCOPROCESS (-2) #define SH_IOHISTFILE (-3) +#include <cmd.h> + /* symbolic value for sh_fdnotify */ #define SH_FDCLOSE (-1) +#undef getenv /* -lshell provides its own */ + #if defined(__EXPORT__) && defined(_DLL) # ifdef _BLD_shell # define extern __EXPORT__ @@ -169,7 +176,8 @@ extern int sh_trap(const char*,int); extern int sh_fun(Namval_t*,Namval_t*, char*[]); extern int sh_funscope(int,char*[],int(*)(void*),void*,int); extern Sfio_t *sh_iogetiop(int,int); -extern int sh_main(int, char*[], void(*)(int)); +extern int sh_main(int, char*[], Shinit_f); +extern int sh_run(int, char*[]); extern void sh_menu(Sfio_t*, int, char*[]); extern Namval_t *sh_addbuiltin(const char*, int(*)(int, char*[],void*), void*); extern char *sh_fmtq(const char*); |