summaryrefslogtreecommitdiff
path: root/proto.h
blob: f7ef3c174492454e5741fd27211620c50c31cc47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
/*	$NetBSD: proto.h,v 1.13 2018/06/03 12:18:29 kamil Exp $	*/

/*
 * prototypes for PD-KSH
 * originally generated using "cproto.c 3.5 92/04/11 19:28:01 cthuang "
 * $Id: proto.h,v 1.13 2018/06/03 12:18:29 kamil Exp $
 */

#include <stdbool.h>

/* alloc.c */
Area *	ainit		ARGS((Area *));
void 	afreeall	ARGS((Area *));
void *	alloc		ARGS((size_t, Area *));
void *	aresize		ARGS((void *, size_t, Area *));
void 	afree		ARGS((void *, Area *));
/* c_ksh.c */
int 	c_hash		ARGS((char **));
int 	c_cd		ARGS((char **));
int 	c_pwd		ARGS((char **));
int 	c_print		ARGS((char **));
int 	c_whence	ARGS((char **));
int 	c_command	ARGS((char **));
int 	c_typeset	ARGS((char **));
int 	c_alias		ARGS((char **));
int 	c_unalias	ARGS((char **));
int 	c_let		ARGS((char **));
int 	c_jobs		ARGS((char **));
int 	c_fgbg		ARGS((char **));
int 	c_kill		ARGS((char **));
void	getopts_reset	ARGS((int));
int	c_getopts	ARGS((char **));
int 	c_bind		ARGS((char **));
/* c_sh.c */
int 	c_label		ARGS((char **));
int 	c_shift		ARGS((char **));
int 	c_umask		ARGS((char **));
int 	c_dot		ARGS((char **));
int 	c_wait		ARGS((char **));
int 	c_read		ARGS((char **));
int 	c_eval		ARGS((char **));
int 	c_trap		ARGS((char **));
int 	c_brkcont	ARGS((char **));
int 	c_exitreturn	ARGS((char **));
int 	c_set		ARGS((char **));
int 	c_unset		ARGS((char **));
int 	c_ulimit	ARGS((char **));
int 	c_times		ARGS((char **));
int 	timex		ARGS((struct op *, int));
void	timex_hook	ARGS((struct op *, char ** volatile *));
int 	c_exec		ARGS((char **));
int 	c_builtin	ARGS((char **));
/* c_test.c */
int 	c_test		ARGS((char **));
/* edit.c: most prototypes in edit.h */
void 	x_init		ARGS((void));
int 	x_read		ARGS((char *, size_t));
void	set_editmode	ARGS((const char *));
/* emacs.c: most prototypes in edit.h */
int 	x_bind		ARGS((const char *, const char *, int, int));
/* eval.c */
char *	substitute	ARGS((const char *, int));
char **	eval		ARGS((char **, int));
char *	evalstr		ARGS((char *, int));
char *	evalonestr	ARGS((char *, int));
char	*debunk		ARGS((char *, const char *, size_t));
void	expand		ARGS((char *, XPtrV *, int));
int glob_str		ARGS((char *, XPtrV *, int));
/* exec.c */
int	fd_clexec	ARGS((int));
int 	execute		ARGS((struct op * volatile, volatile int));
int 	shcomexec	ARGS((char **));
struct tbl * findfunc	ARGS((const char *, unsigned int, int));
int 	define		ARGS((const char *, struct op *));
void 	builtin		ARGS((const char *, int (*)(char **)));
struct tbl *	findcom	ARGS((const char *, int));
void 	flushcom	ARGS((int all));
char *	search		ARGS((const char *, const char *, int, int *));
int	search_access	ARGS((const char *, int, int *));
int	pr_menu		ARGS((char *const *));
int	pr_list		ARGS((char *const *));
/* expr.c */
int 	evaluate	ARGS((const char *, long *, int));
int	v_evaluate	ARGS((struct tbl *, const char *, volatile int));
/* history.c */
void	init_histvec	ARGS((void));
void 	hist_init	ARGS((Source *));
void 	hist_finish	ARGS((void));
void	histsave	ARGS((int, const char *, int));
#ifdef HISTORY
int 	c_fc	 	ARGS((char **));
void	sethistsize	ARGS((int));
void	sethistfile	ARGS((const char *));
# ifdef EASY_HISTORY
void 	histappend	ARGS((const char *, int));
# endif
char **	histpos	 	ARGS((void));
int 	histN	 	ARGS((void));
int 	histnum	 	ARGS((int));
int	findhist	ARGS((int, int, const char *, int));
#endif /* HISTORY */
/* io.c */
void 	errorf		ARGS((const char *, ...))
				GCC_FUNC_ATTR2(noreturn, format(printf, 1, 2));
void 	warningf	ARGS((int, const char *, ...))
				GCC_FUNC_ATTR(format(printf, 2, 3));
void 	bi_errorf	ARGS((const char *, ...))
				GCC_FUNC_ATTR(format(printf, 1, 2));
void 	internal_errorf	ARGS((int, const char *, ...))
				GCC_FUNC_ATTR(format(printf, 2, 3));
void	error_prefix	ARGS((int));
void 	shellf		ARGS((const char *, ...))
				GCC_FUNC_ATTR(format(printf, 1, 2));
void 	shprintf	ARGS((const char *, ...))
				GCC_FUNC_ATTR(format(printf, 1, 2));
#ifdef KSH_DEBUG
void 	kshdebug_init_	ARGS((void));
void 	kshdebug_printf_ ARGS((const char *, ...))
				GCC_FUNC_ATTR(format(printf, 1, 2));
void 	kshdebug_dump_	ARGS((const char *, const void *, int));
#endif /* KSH_DEBUG */
int	can_seek	ARGS((int));
void	initio		ARGS((void));
int	ksh_dup2	ARGS((int, int, int));
int 	savefd		ARGS((int, int));
void 	restfd		ARGS((int, int));
void 	openpipe	ARGS((int *));
void 	closepipe	ARGS((int *));
int	check_fd	ARGS((char *, int, const char **));
#ifdef KSH
void	coproc_init	ARGS((void));
void	coproc_read_close ARGS((int));
void	coproc_readw_close ARGS((int));
void	coproc_write_close ARGS((int));
int	coproc_getfd	ARGS((int, const char **));
void	coproc_cleanup	ARGS((int));
#endif /* KSH */
struct temp *maketemp	ARGS((Area *, Temp_type, struct temp **));
/* jobs.c */
void 	j_init		ARGS((int));
void 	j_exit		ARGS((void));
void 	j_change	ARGS((void));
int 	exchild		ARGS((struct op *, int, int));
void 	startlast	ARGS((void));
int 	waitlast	ARGS((void));
int 	waitfor		ARGS((const char *, int *));
int 	j_kill		ARGS((const char *, int));
int 	j_resume	ARGS((const char *, int));
int 	j_jobs		ARGS((const char *, int, int));
void 	j_notify	ARGS((void));
pid_t	j_async		ARGS((void));
int 	j_stopped_running	ARGS((void));
/* lex.c */
int 	yylex		ARGS((int));
void 	yyerror		ARGS((const char *, ...))
				GCC_FUNC_ATTR2(noreturn, format(printf, 1, 2));
Source * pushs		ARGS((int, Area *));
void	set_prompt	ARGS((int, Source *));
void 	pprompt		ARGS((const char *, int));
/* mail.c */
#ifdef KSH
void 	mcheck		ARGS((void));
void 	mcset		ARGS((long));
void 	mbset		ARGS((char *));
void 	mpset		ARGS((char *));
#endif /* KSH */
/* main.c */
int 	include		ARGS((const char *, int, char **, int));
int 	command		ARGS((const char *));
int 	shell		ARGS((Source *volatile, int volatile));
void 	unwind		ARGS((int)) GCC_FUNC_ATTR(noreturn);
void 	newenv		ARGS((int));
void 	quitenv		ARGS((void));
void	cleanup_parents_env ARGS((void));
void	cleanup_proc_env ARGS((void));
void 	aerror		ARGS((Area *, const char *))
				GCC_FUNC_ATTR(noreturn);
/* misc.c */
void 	setctypes	ARGS((const char *, int));
void 	initctypes	ARGS((void));
char *	ulton		ARGS((unsigned long, int));
char *	str_save	ARGS((const char *, Area *));
char *	str_nsave	ARGS((const char *, int, Area *));
int	option		ARGS((const char *));
char *	getoptions	ARGS((void));
void	change_flag	ARGS((enum sh_flag, int, int));
int	parse_args	ARGS((char **v, int what, int *));
int 	getn		ARGS((const char *, int *));
int 	bi_getn		ARGS((const char *, int *));
int 	gmatch		ARGS((const char *, const char *, int));
int	has_globbing	ARGS((const char *, const char *));
const unsigned char *pat_scan ARGS((const unsigned char *,
				const unsigned char *, int));
void 	qsortp		ARGS((void **, size_t, int (*)(void *, void *)));
int 	xstrcmp		ARGS((void *, void *));
void	ksh_getopt_reset ARGS((Getopt *, int));
int	ksh_getopt	ARGS((char **, Getopt *, const char *));
void	print_value_quoted ARGS((const char *));
void	print_columns	ARGS((struct shf *, int,
			      char *(*)(void *, int, char *, int),
			      void *, int, int));
int	strip_nuls	ARGS((char *, int));
char	*str_zcpy	ARGS((char *, const char *, int));
int	blocking_read	ARGS((int, char *, int));
int	reset_nonblock	ARGS((int));
char	*ksh_get_wd	ARGS((char *, int));
/* path.c */
int	make_path	ARGS((const char *, const char *,
			      char **, XString *, int *));
void	simplify_path	ARGS((char *));
char	*get_phys_path	ARGS((const char *));
void	set_current_wd	ARGS((char *));
/* syn.c */
void 	initkeywords	ARGS((void));
struct op * compile	ARGS((Source *));
/* table.c */
unsigned int 	hash	ARGS((const char *));
void 	tinit		ARGS((struct table *, Area *, int));
struct tbl *	mytsearch	ARGS((struct table *, const char *, unsigned int));
struct tbl *	tenter	ARGS((struct table *, const char *, unsigned int));
void 	mytdelete		ARGS((struct tbl *));
void 	ksh_twalk		ARGS((struct tstate *, struct table *));
struct tbl *	tnext	ARGS((struct tstate *));
struct tbl **	tsort	ARGS((struct table *));
/* trace.c */
/* trap.c */
void	inittraps	ARGS((void));
#ifdef KSH
void	alarm_init	ARGS((void));
#endif /* KSH */
Trap *	gettrap		ARGS((const char *, int));
RETSIGTYPE trapsig	ARGS((int));
void	intrcheck	ARGS((void));
int	fatal_trap_check ARGS((void));
int	trap_pending	ARGS((void));
void 	runtraps	ARGS((int));
void 	runtrap		ARGS((Trap *));
void 	cleartraps	ARGS((void));
void 	restoresigs	ARGS((void));
void	settrap		ARGS((Trap *, char *));
int	block_pipe	ARGS((void));
void	restore_pipe	ARGS((int));
int	setsig		ARGS((Trap *, handler_t, int));
void	setexecsig	ARGS((Trap *, int));
/* tree.c */
int 	fptreef		ARGS((struct shf *, int, const char *, ...));
char *	snptreef	ARGS((char *, int, const char *, ...));
struct op *	tcopy	ARGS((struct op *, Area *));
char *	wdcopy		ARGS((const char *, Area *));
char *	wdscan		ARGS((const char *, int));
char *	wdstrip		ARGS((const char *));
void 	tfree		ARGS((struct op *, Area *));
/* var.c */
void 	newblock	ARGS((void));
void 	popblock	ARGS((void));
void	initvar		ARGS((void));
struct tbl *	global	ARGS((const char *));
struct tbl *	local(const char *, bool);
char *	str_val		ARGS((struct tbl *));
long 	intval		ARGS((struct tbl *));
int 	setstr		ARGS((struct tbl *, const char *, int));
struct tbl *setint_v	ARGS((struct tbl *, struct tbl *));
void 	setint		ARGS((struct tbl *, long));
int	getint		ARGS((struct tbl *, long *));
struct tbl *	typeset	ARGS((const char *, Tflag, Tflag, int, int));
void 	unset		ARGS((struct tbl *, int));
char  * skip_varname	ARGS((const char *, int));
char	*skip_wdvarname ARGS((const char *, int));
int	is_wdvarname	ARGS((const char *, int));
int	is_wdvarassign	ARGS((const char *));
char **	makenv		ARGS((void));
void	change_random	ARGS((void));
int	array_ref_len	ARGS((const char *));
char *	arrayname	ARGS((const char *));
void    set_array	ARGS((const char *, int, char **));
/* version.c */
/* vi.c: see edit.h */