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