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