proto.h revision 1.1.1.1 1 1.1 jtc /*
2 1.1 jtc * prototypes for PD-KSH
3 1.1 jtc * originally generated using "cproto.c 3.5 92/04/11 19:28:01 cthuang "
4 1.1 jtc * $Id: proto.h,v 1.1.1.1 1996/09/21 23:35:15 jtc Exp $
5 1.1 jtc */
6 1.1 jtc
7 1.1 jtc /* alloc.c */
8 1.1 jtc Area * ainit ARGS((Area *ap));
9 1.1 jtc void afreeall ARGS((Area *ap));
10 1.1 jtc void * alloc ARGS((size_t size, Area *ap));
11 1.1 jtc void * aresize ARGS((void *ptr, size_t size, Area *ap));
12 1.1 jtc void afree ARGS((void *ptr, Area *ap));
13 1.1 jtc /* c_ksh.c */
14 1.1 jtc int c_hash ARGS((char **wp));
15 1.1 jtc int c_cd ARGS((char **wp));
16 1.1 jtc int c_pwd ARGS((char **wp));
17 1.1 jtc int c_print ARGS((char **wp));
18 1.1 jtc int c_whence ARGS((char **wp));
19 1.1 jtc int c_command ARGS((char **wp));
20 1.1 jtc int c_typeset ARGS((char **wp));
21 1.1 jtc int c_alias ARGS((char **wp));
22 1.1 jtc int c_unalias ARGS((char **wp));
23 1.1 jtc int c_let ARGS((char **wp));
24 1.1 jtc int c_jobs ARGS((char **wp));
25 1.1 jtc int c_fgbg ARGS((char **wp));
26 1.1 jtc int c_kill ARGS((char **wp));
27 1.1 jtc void getopts_reset ARGS((int val));
28 1.1 jtc int c_getopts ARGS((char **wp));
29 1.1 jtc int c_bind ARGS((char **wp));
30 1.1 jtc /* c_sh.c */
31 1.1 jtc int c_label ARGS((char **wp));
32 1.1 jtc int c_shift ARGS((char **wp));
33 1.1 jtc int c_umask ARGS((char **wp));
34 1.1 jtc int c_dot ARGS((char **wp));
35 1.1 jtc int c_wait ARGS((char **wp));
36 1.1 jtc int c_read ARGS((char **wp));
37 1.1 jtc int c_eval ARGS((char **wp));
38 1.1 jtc int c_trap ARGS((char **wp));
39 1.1 jtc int c_brkcont ARGS((char **wp));
40 1.1 jtc int c_exitreturn ARGS((char **wp));
41 1.1 jtc int c_set ARGS((char **wp));
42 1.1 jtc int c_unset ARGS((char **wp));
43 1.1 jtc int c_ulimit ARGS((char **wp));
44 1.1 jtc int c_times ARGS((char **wp));
45 1.1 jtc int timex ARGS((struct op *t, int f));
46 1.1 jtc int c_exec ARGS((char **wp));
47 1.1 jtc int c_builtin ARGS((char **wp));
48 1.1 jtc /* c_test.c */
49 1.1 jtc int c_test ARGS((char **wp));
50 1.1 jtc /* edit.c: most prototypes in edit.h */
51 1.1 jtc void x_init ARGS((void));
52 1.1 jtc int x_read ARGS((char *buf, size_t len));
53 1.1 jtc void set_editmode ARGS((const char *ed));
54 1.1 jtc /* emacs.c: most prototypes in edit.h */
55 1.1 jtc int x_bind ARGS((const char *a1, const char *a2, int macro,
56 1.1 jtc int list));
57 1.1 jtc /* eval.c */
58 1.1 jtc char * substitute ARGS((const char *cp, int f));
59 1.1 jtc char ** eval ARGS((char **ap, int f));
60 1.1 jtc char * evalstr ARGS((char *cp, int f));
61 1.1 jtc char * evalonestr ARGS((char *cp, int f));
62 1.1 jtc char *debunk ARGS((char *dp, const char *sp));
63 1.1 jtc void expand ARGS((char *cp, XPtrV *wp, int f));
64 1.1 jtc int glob_str ARGS((char *cp, XPtrV *wp, int markdirs));
65 1.1 jtc /* exec.c */
66 1.1 jtc int fd_clexec ARGS((int fd));
67 1.1 jtc int execute ARGS((struct op * volatile t, volatile int flags));
68 1.1 jtc int shcomexec ARGS((char **wp));
69 1.1 jtc struct tbl * findfunc ARGS((const char *name, unsigned int h, int create));
70 1.1 jtc int define ARGS((const char *name, struct op *t));
71 1.1 jtc void builtin ARGS((const char *name, int (*func)(char **)));
72 1.1 jtc struct tbl * findcom ARGS((const char *name, int flags));
73 1.1 jtc void flushcom ARGS((int all));
74 1.1 jtc char * search ARGS((const char *name, const char *path, int mode,
75 1.1 jtc int *errnop));
76 1.1 jtc int search_access ARGS((const char *path, int mode, int *errnop));
77 1.1 jtc int pr_menu ARGS((char *const *ap));
78 1.1 jtc /* expr.c */
79 1.1 jtc int evaluate ARGS((const char *expr, long *rval, int error_ok));
80 1.1 jtc int v_evaluate ARGS((struct tbl *vp, const char *expr, volatile int error_ok));
81 1.1 jtc /* history.c */
82 1.1 jtc void init_histvec ARGS((void));
83 1.1 jtc void hist_init ARGS((Source *s));
84 1.1 jtc void hist_finish ARGS((void));
85 1.1 jtc void histsave ARGS((int lno, const char *cmd, int dowrite));
86 1.1 jtc #ifdef HISTORY
87 1.1 jtc int c_fc ARGS((register char **wp));
88 1.1 jtc void sethistsize ARGS((int n));
89 1.1 jtc void sethistfile ARGS((const char *name));
90 1.1 jtc # ifdef EASY_HISTORY
91 1.1 jtc void histappend ARGS((const char *cmd, int nl_seperate));
92 1.1 jtc # endif
93 1.1 jtc char ** histpos ARGS((void));
94 1.1 jtc int histN ARGS((void));
95 1.1 jtc int histnum ARGS((int n));
96 1.1 jtc int findhist ARGS((int start, int fwd, const char *str,
97 1.1 jtc int anchored));
98 1.1 jtc #endif /* HISTORY */
99 1.1 jtc /* io.c */
100 1.1 jtc void errorf ARGS((const char *fmt, ...))
101 1.1 jtc GCC_FUNC_ATTR2(noreturn, format(printf, 1, 2));
102 1.1 jtc void warningf ARGS((int fileline, const char *fmt, ...))
103 1.1 jtc GCC_FUNC_ATTR(format(printf, 2, 3));
104 1.1 jtc void bi_errorf ARGS((const char *fmt, ...))
105 1.1 jtc GCC_FUNC_ATTR(format(printf, 1, 2));
106 1.1 jtc void internal_errorf ARGS((int jump, const char *fmt, ...))
107 1.1 jtc GCC_FUNC_ATTR(format(printf, 2, 3));
108 1.1 jtc void error_prefix ARGS((int fileline));
109 1.1 jtc void shellf ARGS((const char *fmt, ...))
110 1.1 jtc GCC_FUNC_ATTR(format(printf, 1, 2));
111 1.1 jtc void shprintf ARGS((const char *fmt, ...))
112 1.1 jtc GCC_FUNC_ATTR(format(printf, 1, 2));
113 1.1 jtc int can_seek ARGS((int fd));
114 1.1 jtc void initio ARGS((void));
115 1.1 jtc int ksh_dup2 ARGS((int ofd, int nfd, int errok));
116 1.1 jtc int savefd ARGS((int fd, int noclose));
117 1.1 jtc void restfd ARGS((int fd, int ofd));
118 1.1 jtc void openpipe ARGS((int *pv));
119 1.1 jtc void closepipe ARGS((int *pv));
120 1.1 jtc int check_fd ARGS((char *name, int mode, const char **emsgp));
121 1.1 jtc #ifdef KSH
122 1.1 jtc void coproc_init ARGS((void));
123 1.1 jtc void coproc_read_close ARGS((int fd));
124 1.1 jtc void coproc_readw_close ARGS((int fd));
125 1.1 jtc void coproc_write_close ARGS((int fd));
126 1.1 jtc int coproc_getfd ARGS((int mode, const char **emsgp));
127 1.1 jtc void coproc_cleanup ARGS((int reuse));
128 1.1 jtc #endif /* KSH */
129 1.1 jtc struct temp *maketemp ARGS((Area *ap));
130 1.1 jtc /* jobs.c */
131 1.1 jtc void j_init ARGS((int mflagset));
132 1.1 jtc void j_exit ARGS((void));
133 1.1 jtc void j_change ARGS((void));
134 1.1 jtc int exchild ARGS((struct op *t, int flags, int close_fd));
135 1.1 jtc void startlast ARGS((void));
136 1.1 jtc int waitlast ARGS((void));
137 1.1 jtc int waitfor ARGS((const char *cp, int *sigp));
138 1.1 jtc int j_kill ARGS((const char *cp, int sig));
139 1.1 jtc int j_resume ARGS((const char *cp, int bg));
140 1.1 jtc int j_jobs ARGS((const char *cp, int slp, int nflag));
141 1.1 jtc void j_notify ARGS((void));
142 1.1 jtc pid_t j_async ARGS((void));
143 1.1 jtc int j_stopped_running ARGS((void));
144 1.1 jtc /* lex.c */
145 1.1 jtc int yylex ARGS((int cf));
146 1.1 jtc void yyerror ARGS((const char *fmt, ...))
147 1.1 jtc GCC_FUNC_ATTR2(noreturn, format(printf, 1, 2));
148 1.1 jtc Source * pushs ARGS((int type, Area *areap));
149 1.1 jtc void set_prompt ARGS((int to, Source *s));
150 1.1 jtc void pprompt ARGS((const char *cp, int ntruncate));
151 1.1 jtc /* mail.c */
152 1.1 jtc #ifdef KSH
153 1.1 jtc void mcheck ARGS((void));
154 1.1 jtc void mbset ARGS((char *p));
155 1.1 jtc void mpset ARGS((char *mptoparse));
156 1.1 jtc #endif /* KSH */
157 1.1 jtc /* main.c */
158 1.1 jtc int include ARGS((const char *name, int argc, char **argv,
159 1.1 jtc int intr_ok));
160 1.1 jtc int command ARGS((const char *comm));
161 1.1 jtc int shell ARGS((Source *volatile s, int volatile toplevel));
162 1.1 jtc void unwind ARGS((int i)) GCC_FUNC_ATTR(noreturn);
163 1.1 jtc void newenv ARGS((int type));
164 1.1 jtc void quitenv ARGS((void));
165 1.1 jtc void cleanup_parents_env ARGS((void));
166 1.1 jtc void aerror ARGS((Area *ap, const char *msg))
167 1.1 jtc GCC_FUNC_ATTR(noreturn);
168 1.1 jtc /* misc.c */
169 1.1 jtc void setctypes ARGS((const char *s, int t));
170 1.1 jtc void initctypes ARGS((void));
171 1.1 jtc char * ulton ARGS((unsigned long n, int base));
172 1.1 jtc char * str_save ARGS((const char *s, Area *ap));
173 1.1 jtc char * str_nsave ARGS((const char *s, int n, Area *ap));
174 1.1 jtc int option ARGS((const char *n));
175 1.1 jtc char * getoptions ARGS((void));
176 1.1 jtc void change_flag ARGS((enum sh_flag f, int what, int newval));
177 1.1 jtc int parse_args ARGS((char **argv, int what, int *setargsp));
178 1.1 jtc int getn ARGS((const char *as, int *ai));
179 1.1 jtc int bi_getn ARGS((const char *as, int *ai));
180 1.1 jtc char * strerror ARGS((int i));
181 1.1 jtc int gmatch ARGS((const char *s, const char *p, int isfile));
182 1.1 jtc int has_globbing ARGS((const char *xp, const char *xpe));
183 1.1 jtc const unsigned char *pat_scan ARGS((const unsigned char *p,
184 1.1 jtc const unsigned char *pe, int match_sep));
185 1.1 jtc void qsortp ARGS((void **base, size_t n, int (*f)(void *, void *)));
186 1.1 jtc int xstrcmp ARGS((void *p1, void *p2));
187 1.1 jtc void ksh_getopt_reset ARGS((Getopt *go, int));
188 1.1 jtc int ksh_getopt ARGS((char **argv, Getopt *go, const char *options));
189 1.1 jtc void print_value_quoted ARGS((const char *s));
190 1.1 jtc void print_columns ARGS((struct shf *shf, int n,
191 1.1 jtc char *(*func)(void *, int, char *, int),
192 1.1 jtc void *arg, int max_width));
193 1.1 jtc int strip_nuls ARGS((char *buf, int nbytes));
194 1.1 jtc char *str_zcpy ARGS((char *dst, const char *src, int dsize));
195 1.1 jtc int blocking_read ARGS((int fd, char *buf, int nbytes));
196 1.1 jtc int reset_nonblock ARGS((int fd));
197 1.1 jtc char *ksh_get_wd ARGS((char *buf, int bsize));
198 1.1 jtc /* path.c */
199 1.1 jtc int make_path ARGS((const char *cwd, const char *file,
200 1.1 jtc char **pathlist, XString *xsp, int *phys_pathp));
201 1.1 jtc void simplify_path ARGS((char *path));
202 1.1 jtc char *get_phys_path ARGS((const char *path));
203 1.1 jtc void set_current_wd ARGS((char *path));
204 1.1 jtc /* syn.c */
205 1.1 jtc void initkeywords ARGS((void));
206 1.1 jtc struct op * compile ARGS((Source *s));
207 1.1 jtc /* table.c */
208 1.1 jtc unsigned int hash ARGS((const char *n));
209 1.1 jtc void tinit ARGS((struct table *tp, Area *ap, int tsize));
210 1.1 jtc struct tbl * tsearch ARGS((struct table *tp, const char *n, unsigned int h));
211 1.1 jtc struct tbl * tenter ARGS((struct table *tp, const char *n, unsigned int h));
212 1.1 jtc void tdelete ARGS((struct tbl *p));
213 1.1 jtc void twalk ARGS((struct tstate *ts, struct table *tp));
214 1.1 jtc struct tbl * tnext ARGS((struct tstate *ts));
215 1.1 jtc struct tbl ** tsort ARGS((struct table *tp));
216 1.1 jtc /* trace.c */
217 1.1 jtc /* trap.c */
218 1.1 jtc void inittraps ARGS((void));
219 1.1 jtc #ifdef KSH
220 1.1 jtc void alarm_init ARGS((void));
221 1.1 jtc #endif /* KSH */
222 1.1 jtc Trap * gettrap ARGS((const char *name));
223 1.1 jtc RETSIGTYPE trapsig ARGS((int i));
224 1.1 jtc void intrcheck ARGS((void));
225 1.1 jtc int fatal_trap_check ARGS((void));
226 1.1 jtc int trap_pending ARGS((void));
227 1.1 jtc void runtraps ARGS((int intr));
228 1.1 jtc void runtrap ARGS((Trap *p));
229 1.1 jtc void cleartraps ARGS((void));
230 1.1 jtc void restoresigs ARGS((void));
231 1.1 jtc void settrap ARGS((Trap *p, char *s));
232 1.1 jtc int block_pipe ARGS((void));
233 1.1 jtc void restore_pipe ARGS((int restore_dfl));
234 1.1 jtc int setsig ARGS((Trap *p, handler_t f, int flags));
235 1.1 jtc void setexecsig ARGS((Trap *p, int restore));
236 1.1 jtc /* tree.c */
237 1.1 jtc int fptreef ARGS((struct shf *f, int indent, const char *fmt, ...));
238 1.1 jtc char * snptreef ARGS((char *s, int n, const char *fmt, ...));
239 1.1 jtc struct op * tcopy ARGS((struct op *t, Area *ap));
240 1.1 jtc char * wdcopy ARGS((const char *wp, Area *ap));
241 1.1 jtc char * wdscan ARGS((const char *wp, int c));
242 1.1 jtc void tfree ARGS((struct op *t, Area *ap));
243 1.1 jtc /* var.c */
244 1.1 jtc void newblock ARGS((void));
245 1.1 jtc void popblock ARGS((void));
246 1.1 jtc void initvar ARGS((void));
247 1.1 jtc struct tbl * global ARGS((const char *n));
248 1.1 jtc struct tbl * local ARGS((const char *n, bool_t copy));
249 1.1 jtc char * str_val ARGS((struct tbl *vp));
250 1.1 jtc long intval ARGS((struct tbl *vp));
251 1.1 jtc void setstr ARGS((struct tbl *vq, const char *s));
252 1.1 jtc struct tbl *setint_v ARGS((struct tbl *vq, struct tbl *vp));
253 1.1 jtc void setint ARGS((struct tbl *vq, long n));
254 1.1 jtc int getint ARGS((struct tbl *vp, long *nump));
255 1.1 jtc struct tbl * typeset ARGS((const char *var, Tflag set, Tflag clr, int field, int base));
256 1.1 jtc void unset ARGS((struct tbl *vp, int array_ref));
257 1.1 jtc char * skip_varname ARGS((const char *s, int aok));
258 1.1 jtc char *skip_wdvarname ARGS((const char *s, int aok));
259 1.1 jtc int is_wdvarname ARGS((const char *s, int aok));
260 1.1 jtc int is_wdvarassign ARGS((const char *s));
261 1.1 jtc char ** makenv ARGS((void));
262 1.1 jtc int array_ref_len ARGS((const char *cp));
263 1.1 jtc char * arrayname ARGS((const char *str));
264 1.1 jtc void set_array ARGS((const char *var, int reset, char **vals));
265 1.1 jtc /* version.c */
266 1.1 jtc /* vi.c: see edit.h */
267 1.1 jtc
268 1.1 jtc
269 1.1 jtc /* Hack to avoid billions of compile warnings on SunOS 4.1.x */
270 1.1 jtc #if defined(MUN) && defined(sun) && !defined(__svr4__)
271 1.1 jtc extern void bcopy ARGS((const void *src, void *dst, size_t size));
272 1.1 jtc extern int fclose ARGS((FILE *fp));
273 1.1 jtc extern int fprintf ARGS((FILE *fp, const char *fmt, ...));
274 1.1 jtc extern int fread ARGS((void *buf, int size, int num, FILE *fp));
275 1.1 jtc extern int ioctl ARGS((int fd, int request, void *arg));
276 1.1 jtc extern int killpg ARGS((int pgrp, int sig));
277 1.1 jtc extern int nice ARGS((int n));
278 1.1 jtc extern int readlink ARGS((const char *path, char *buf, int bufsize));
279 1.1 jtc extern int setpgrp ARGS((int pid, int pgrp));
280 1.1 jtc extern int strcasecmp ARGS((const char *s1, const char *s2));
281 1.1 jtc extern int tolower ARGS((int));
282 1.1 jtc extern int toupper ARGS((int));
283 1.1 jtc /* Include files aren't included yet */
284 1.1 jtc extern int getrlimit ARGS(( /* int resource, struct rlimit *rpl */ ));
285 1.1 jtc extern int getrusage ARGS(( /* int who, struct rusage *rusage */ ));
286 1.1 jtc extern int gettimeofday ARGS(( /* struct timeval *tv, struct timezone *tz */ ));
287 1.1 jtc extern int setrlimit ARGS(( /* int resource, struct rlimit *rlp */ ));
288 1.1 jtc extern int lstat ARGS(( /* const char *path, struct stat *buf */ ));
289 1.1 jtc #endif
290