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