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