da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/***********************************************************************
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* This software is part of the ast package *
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. Faulkner* Copyright (c) 1982-2010 AT&T Intellectual Property *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* and is licensed under the *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Common Public License, Version 1.0 *
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin* by AT&T Intellectual Property *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* A copy of the License is available at *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Information and Software Systems Research *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* AT&T Research *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Florham Park NJ *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* David Korn <dgk@research.att.com> *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin***********************************************************************/
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * David Korn
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * AT&T Labs
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Interface definitions for shell command language
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif /* _SH_PRIVATE */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/* options */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintypedef struct
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin unsigned long v[4];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define SH_SUBSHARE 27 /* subshell shares state with parent */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * passed as flags to builtins in Nambltin_t struct when BLT_OPTIM is on
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/* The following type is used for error messages */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/* error messages */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const char e_defpath[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const char e_found[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const char e_nospace[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const char e_format[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const char e_number[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const char e_restricted[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const char e_recursive[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern char e_version[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Saves the state of the shell
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin unsigned char trapnote; /* set when trap/signal is pending */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif /* _SH_PRIVATE */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/* flags for sh_parse */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/* symbolic values for sh_iogetiop */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/* symbolic value for sh_fdnotify */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# define extern __EXPORT__
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# endif /* _BLD_shell */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif /* _DLL */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void sh_subfork(void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_reinit(char*[]);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void sh_delay(double);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_trap(const char*,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_funscope(int,char*[],int(*)(void*),void*,int);
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinextern int sh_run(int, char*[]);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Namval_t *sh_addbuiltin(const char*, int(*)(int, char*[],void*), void*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern char *sh_fmtq(const char*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern char *sh_fmtqf(const char*, int, int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_access(const char*,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_close(int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_dup(int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void sh_exit(int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_fcntl(int, int, ...);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int (*sh_fdnotify(int(*)(int,int)))(int,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_open(const char*, int, ...);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_openmax(void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_pipe(int[]);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void sh_sigcheck(void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern unsigned long sh_isoption(int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern unsigned long sh_onoption(int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern unsigned long sh_offoption(int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_waitsafe(void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin extern void **sh_getliblist(void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif /* SHOPT_DYNAMIC */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * direct access to sh is obsolete, use sh_getinterp() instead
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#if !defined(_SH_PRIVATE) && defined(__IMPORT__) && !defined(_BLD_shell)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif /* _DLL */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif /* !_SH_PRIVATE */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define SH_EXITMASK (SH_EXITSIG-1) /* normal exit status bits */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define SH_RUNPROG -1022 /* needs to be negative and < 256 */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif /* SH_INTERACTIVE */