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