1 /***********************************************************************
3 * This software is part of the ast package *
4 * Copyright (c) 1982-2010 AT&T Intellectual Property *
5 * and is licensed under the *
6 * Common Public License, Version 1.0 *
7 * by AT&T Intellectual Property *
9 * A copy of the License is available at *
10 * http://www.opensource.org/licenses/cpl1.0.txt *
11 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
13 * Information and Software Systems Research *
17 * David Korn <dgk@research.att.com> *
19 ***********************************************************************/
31 # define IOBSIZE SF_BUFSIZE
36 #define SF_CLOSING SF_CLOSE
39 #define SF_APPENDWR SF_APPEND
42 /* used for output of shell errors */
52 #define IOCLOSE (IOSEEK|IONOSEEK)
54 #define IOSUBSHELL 0x8000 /* must be larger than any file descriptor */
57 * The remainder of this file is only used when compiled with shell
66 #define sh_inuse(f2) (sh.fdptrs[f2])
68 extern int sh_iocheckfd(Shell_t
*,int);
69 extern void sh_ioinit(Shell_t
*);
70 extern int sh_iomovefd(int);
71 extern int sh_iorenumber(Shell_t
*,int,int);
72 extern void sh_pclose(int[]);
73 extern void sh_iorestore(Shell_t
*,int,int);
74 #if defined(__EXPORT__) && defined(_BLD_DLL) && defined(_BLD_shell)
77 extern Sfio_t
*sh_iostream(Shell_t
*,int);
78 extern int sh_redirect(Shell_t
*,struct ionod
*,int);
79 extern void sh_iosave(Shell_t
*, int,int,char*);
80 extern void sh_iounsave(Shell_t
*);
81 extern int sh_chkopen(const char*);
82 extern int sh_ioaccess(int,int);
83 extern int sh_devtofd(const char*);
84 extern int sh_source(Shell_t
*, Sfio_t
*, const char*);
86 /* the following are readonly */
87 extern const char e_pexists
[];
88 extern const char e_query
[];
89 extern const char e_history
[];
90 extern const char e_argtype
[];
91 extern const char e_create
[];
92 extern const char e_tmpcreate
[];
93 extern const char e_exists
[];
94 extern const char e_file
[];
95 extern const char e_redirect
[];
96 extern const char e_formspec
[];
97 extern const char e_badregexp
[];
98 extern const char e_open
[];
99 extern const char e_notseek
[];
100 extern const char e_noread
[];
101 extern const char e_badseek
[];
102 extern const char e_badwrite
[];
103 extern const char e_badpattern
[];
104 extern const char e_toomany
[];
105 extern const char e_pipe
[];
106 extern const char e_unknown
[];
107 extern const char e_devnull
[];
108 extern const char e_profile
[];
109 extern const char e_sysprofile
[];
111 extern const char e_sysrc
[];
115 extern const char e_bash_sysrc
[];
117 extern const char e_bash_rc
[];
118 extern const char e_bash_login
[];
119 extern const char e_bash_logout
[];
120 extern const char e_bash_profile
[];
122 extern const char e_stdprompt
[];
123 extern const char e_supprompt
[];
124 extern const char e_ambiguous
[];