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