xref: /netbsd/bin/ksh/proto.h (revision 822c36bb)
1 /*	$NetBSD: proto.h,v 1.13 2018/06/03 12:18:29 kamil Exp $	*/
2 
3 /*
4  * prototypes for PD-KSH
5  * originally generated using "cproto.c 3.5 92/04/11 19:28:01 cthuang "
6  * $Id: proto.h,v 1.13 2018/06/03 12:18:29 kamil Exp $
7  */
8 
9 #include <stdbool.h>
10 
11 /* alloc.c */
12 Area *	ainit		ARGS((Area *));
13 void 	afreeall	ARGS((Area *));
14 void *	alloc		ARGS((size_t, Area *));
15 void *	aresize		ARGS((void *, size_t, Area *));
16 void 	afree		ARGS((void *, Area *));
17 /* c_ksh.c */
18 int 	c_hash		ARGS((char **));
19 int 	c_cd		ARGS((char **));
20 int 	c_pwd		ARGS((char **));
21 int 	c_print		ARGS((char **));
22 int 	c_whence	ARGS((char **));
23 int 	c_command	ARGS((char **));
24 int 	c_typeset	ARGS((char **));
25 int 	c_alias		ARGS((char **));
26 int 	c_unalias	ARGS((char **));
27 int 	c_let		ARGS((char **));
28 int 	c_jobs		ARGS((char **));
29 int 	c_fgbg		ARGS((char **));
30 int 	c_kill		ARGS((char **));
31 void	getopts_reset	ARGS((int));
32 int	c_getopts	ARGS((char **));
33 int 	c_bind		ARGS((char **));
34 /* c_sh.c */
35 int 	c_label		ARGS((char **));
36 int 	c_shift		ARGS((char **));
37 int 	c_umask		ARGS((char **));
38 int 	c_dot		ARGS((char **));
39 int 	c_wait		ARGS((char **));
40 int 	c_read		ARGS((char **));
41 int 	c_eval		ARGS((char **));
42 int 	c_trap		ARGS((char **));
43 int 	c_brkcont	ARGS((char **));
44 int 	c_exitreturn	ARGS((char **));
45 int 	c_set		ARGS((char **));
46 int 	c_unset		ARGS((char **));
47 int 	c_ulimit	ARGS((char **));
48 int 	c_times		ARGS((char **));
49 int 	timex		ARGS((struct op *, int));
50 void	timex_hook	ARGS((struct op *, char ** volatile *));
51 int 	c_exec		ARGS((char **));
52 int 	c_builtin	ARGS((char **));
53 /* c_test.c */
54 int 	c_test		ARGS((char **));
55 /* edit.c: most prototypes in edit.h */
56 void 	x_init		ARGS((void));
57 int 	x_read		ARGS((char *, size_t));
58 void	set_editmode	ARGS((const char *));
59 /* emacs.c: most prototypes in edit.h */
60 int 	x_bind		ARGS((const char *, const char *, int, int));
61 /* eval.c */
62 char *	substitute	ARGS((const char *, int));
63 char **	eval		ARGS((char **, int));
64 char *	evalstr		ARGS((char *, int));
65 char *	evalonestr	ARGS((char *, int));
66 char	*debunk		ARGS((char *, const char *, size_t));
67 void	expand		ARGS((char *, XPtrV *, int));
68 int glob_str		ARGS((char *, XPtrV *, int));
69 /* exec.c */
70 int	fd_clexec	ARGS((int));
71 int 	execute		ARGS((struct op * volatile, volatile int));
72 int 	shcomexec	ARGS((char **));
73 struct tbl * findfunc	ARGS((const char *, unsigned int, int));
74 int 	define		ARGS((const char *, struct op *));
75 void 	builtin		ARGS((const char *, int (*)(char **)));
76 struct tbl *	findcom	ARGS((const char *, int));
77 void 	flushcom	ARGS((int all));
78 char *	search		ARGS((const char *, const char *, int, int *));
79 int	search_access	ARGS((const char *, int, int *));
80 int	pr_menu		ARGS((char *const *));
81 int	pr_list		ARGS((char *const *));
82 /* expr.c */
83 int 	evaluate	ARGS((const char *, long *, int));
84 int	v_evaluate	ARGS((struct tbl *, const char *, volatile int));
85 /* history.c */
86 void	init_histvec	ARGS((void));
87 void 	hist_init	ARGS((Source *));
88 void 	hist_finish	ARGS((void));
89 void	histsave	ARGS((int, const char *, int));
90 #ifdef HISTORY
91 int 	c_fc	 	ARGS((char **));
92 void	sethistsize	ARGS((int));
93 void	sethistfile	ARGS((const char *));
94 # ifdef EASY_HISTORY
95 void 	histappend	ARGS((const char *, int));
96 # endif
97 char **	histpos	 	ARGS((void));
98 int 	histN	 	ARGS((void));
99 int 	histnum	 	ARGS((int));
100 int	findhist	ARGS((int, int, const char *, int));
101 #endif /* HISTORY */
102 /* io.c */
103 void 	errorf		ARGS((const char *, ...))
104 				GCC_FUNC_ATTR2(noreturn, format(printf, 1, 2));
105 void 	warningf	ARGS((int, const char *, ...))
106 				GCC_FUNC_ATTR(format(printf, 2, 3));
107 void 	bi_errorf	ARGS((const char *, ...))
108 				GCC_FUNC_ATTR(format(printf, 1, 2));
109 void 	internal_errorf	ARGS((int, const char *, ...))
110 				GCC_FUNC_ATTR(format(printf, 2, 3));
111 void	error_prefix	ARGS((int));
112 void 	shellf		ARGS((const char *, ...))
113 				GCC_FUNC_ATTR(format(printf, 1, 2));
114 void 	shprintf	ARGS((const char *, ...))
115 				GCC_FUNC_ATTR(format(printf, 1, 2));
116 #ifdef KSH_DEBUG
117 void 	kshdebug_init_	ARGS((void));
118 void 	kshdebug_printf_ ARGS((const char *, ...))
119 				GCC_FUNC_ATTR(format(printf, 1, 2));
120 void 	kshdebug_dump_	ARGS((const char *, const void *, int));
121 #endif /* KSH_DEBUG */
122 int	can_seek	ARGS((int));
123 void	initio		ARGS((void));
124 int	ksh_dup2	ARGS((int, int, int));
125 int 	savefd		ARGS((int, int));
126 void 	restfd		ARGS((int, int));
127 void 	openpipe	ARGS((int *));
128 void 	closepipe	ARGS((int *));
129 int	check_fd	ARGS((char *, int, const char **));
130 #ifdef KSH
131 void	coproc_init	ARGS((void));
132 void	coproc_read_close ARGS((int));
133 void	coproc_readw_close ARGS((int));
134 void	coproc_write_close ARGS((int));
135 int	coproc_getfd	ARGS((int, const char **));
136 void	coproc_cleanup	ARGS((int));
137 #endif /* KSH */
138 struct temp *maketemp	ARGS((Area *, Temp_type, struct temp **));
139 /* jobs.c */
140 void 	j_init		ARGS((int));
141 void 	j_exit		ARGS((void));
142 void 	j_change	ARGS((void));
143 int 	exchild		ARGS((struct op *, int, int));
144 void 	startlast	ARGS((void));
145 int 	waitlast	ARGS((void));
146 int 	waitfor		ARGS((const char *, int *));
147 int 	j_kill		ARGS((const char *, int));
148 int 	j_resume	ARGS((const char *, int));
149 int 	j_jobs		ARGS((const char *, int, int));
150 void 	j_notify	ARGS((void));
151 pid_t	j_async		ARGS((void));
152 int 	j_stopped_running	ARGS((void));
153 /* lex.c */
154 int 	yylex		ARGS((int));
155 void 	yyerror		ARGS((const char *, ...))
156 				GCC_FUNC_ATTR2(noreturn, format(printf, 1, 2));
157 Source * pushs		ARGS((int, Area *));
158 void	set_prompt	ARGS((int, Source *));
159 void 	pprompt		ARGS((const char *, int));
160 /* mail.c */
161 #ifdef KSH
162 void 	mcheck		ARGS((void));
163 void 	mcset		ARGS((long));
164 void 	mbset		ARGS((char *));
165 void 	mpset		ARGS((char *));
166 #endif /* KSH */
167 /* main.c */
168 int 	include		ARGS((const char *, int, char **, int));
169 int 	command		ARGS((const char *));
170 int 	shell		ARGS((Source *volatile, int volatile));
171 void 	unwind		ARGS((int)) GCC_FUNC_ATTR(noreturn);
172 void 	newenv		ARGS((int));
173 void 	quitenv		ARGS((void));
174 void	cleanup_parents_env ARGS((void));
175 void	cleanup_proc_env ARGS((void));
176 void 	aerror		ARGS((Area *, const char *))
177 				GCC_FUNC_ATTR(noreturn);
178 /* misc.c */
179 void 	setctypes	ARGS((const char *, int));
180 void 	initctypes	ARGS((void));
181 char *	ulton		ARGS((unsigned long, int));
182 char *	str_save	ARGS((const char *, Area *));
183 char *	str_nsave	ARGS((const char *, int, Area *));
184 int	option		ARGS((const char *));
185 char *	getoptions	ARGS((void));
186 void	change_flag	ARGS((enum sh_flag, int, int));
187 int	parse_args	ARGS((char **v, int what, int *));
188 int 	getn		ARGS((const char *, int *));
189 int 	bi_getn		ARGS((const char *, int *));
190 int 	gmatch		ARGS((const char *, const char *, int));
191 int	has_globbing	ARGS((const char *, const char *));
192 const unsigned char *pat_scan ARGS((const unsigned char *,
193 				const unsigned char *, int));
194 void 	qsortp		ARGS((void **, size_t, int (*)(void *, void *)));
195 int 	xstrcmp		ARGS((void *, void *));
196 void	ksh_getopt_reset ARGS((Getopt *, int));
197 int	ksh_getopt	ARGS((char **, Getopt *, const char *));
198 void	print_value_quoted ARGS((const char *));
199 void	print_columns	ARGS((struct shf *, int,
200 			      char *(*)(void *, int, char *, int),
201 			      void *, int, int));
202 int	strip_nuls	ARGS((char *, int));
203 char	*str_zcpy	ARGS((char *, const char *, int));
204 int	blocking_read	ARGS((int, char *, int));
205 int	reset_nonblock	ARGS((int));
206 char	*ksh_get_wd	ARGS((char *, int));
207 /* path.c */
208 int	make_path	ARGS((const char *, const char *,
209 			      char **, XString *, int *));
210 void	simplify_path	ARGS((char *));
211 char	*get_phys_path	ARGS((const char *));
212 void	set_current_wd	ARGS((char *));
213 /* syn.c */
214 void 	initkeywords	ARGS((void));
215 struct op * compile	ARGS((Source *));
216 /* table.c */
217 unsigned int 	hash	ARGS((const char *));
218 void 	tinit		ARGS((struct table *, Area *, int));
219 struct tbl *	mytsearch	ARGS((struct table *, const char *, unsigned int));
220 struct tbl *	tenter	ARGS((struct table *, const char *, unsigned int));
221 void 	mytdelete		ARGS((struct tbl *));
222 void 	ksh_twalk		ARGS((struct tstate *, struct table *));
223 struct tbl *	tnext	ARGS((struct tstate *));
224 struct tbl **	tsort	ARGS((struct table *));
225 /* trace.c */
226 /* trap.c */
227 void	inittraps	ARGS((void));
228 #ifdef KSH
229 void	alarm_init	ARGS((void));
230 #endif /* KSH */
231 Trap *	gettrap		ARGS((const char *, int));
232 RETSIGTYPE trapsig	ARGS((int));
233 void	intrcheck	ARGS((void));
234 int	fatal_trap_check ARGS((void));
235 int	trap_pending	ARGS((void));
236 void 	runtraps	ARGS((int));
237 void 	runtrap		ARGS((Trap *));
238 void 	cleartraps	ARGS((void));
239 void 	restoresigs	ARGS((void));
240 void	settrap		ARGS((Trap *, char *));
241 int	block_pipe	ARGS((void));
242 void	restore_pipe	ARGS((int));
243 int	setsig		ARGS((Trap *, handler_t, int));
244 void	setexecsig	ARGS((Trap *, int));
245 /* tree.c */
246 int 	fptreef		ARGS((struct shf *, int, const char *, ...));
247 char *	snptreef	ARGS((char *, int, const char *, ...));
248 struct op *	tcopy	ARGS((struct op *, Area *));
249 char *	wdcopy		ARGS((const char *, Area *));
250 char *	wdscan		ARGS((const char *, int));
251 char *	wdstrip		ARGS((const char *));
252 void 	tfree		ARGS((struct op *, Area *));
253 /* var.c */
254 void 	newblock	ARGS((void));
255 void 	popblock	ARGS((void));
256 void	initvar		ARGS((void));
257 struct tbl *	global	ARGS((const char *));
258 struct tbl *	local(const char *, bool);
259 char *	str_val		ARGS((struct tbl *));
260 long 	intval		ARGS((struct tbl *));
261 int 	setstr		ARGS((struct tbl *, const char *, int));
262 struct tbl *setint_v	ARGS((struct tbl *, struct tbl *));
263 void 	setint		ARGS((struct tbl *, long));
264 int	getint		ARGS((struct tbl *, long *));
265 struct tbl *	typeset	ARGS((const char *, Tflag, Tflag, int, int));
266 void 	unset		ARGS((struct tbl *, int));
267 char  * skip_varname	ARGS((const char *, int));
268 char	*skip_wdvarname ARGS((const char *, int));
269 int	is_wdvarname	ARGS((const char *, int));
270 int	is_wdvarassign	ARGS((const char *));
271 char **	makenv		ARGS((void));
272 void	change_random	ARGS((void));
273 int	array_ref_len	ARGS((const char *));
274 char *	arrayname	ARGS((const char *));
275 void    set_array	ARGS((const char *, int, char **));
276 /* version.c */
277 /* vi.c: see edit.h */
278