2020-04-23 10:54:53 +03:00
|
|
|
/* $NetBSD: extern.h,v 1.32 2020/04/23 07:54:53 simonb Exp $ */
|
1995-03-21 12:01:59 +03:00
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
/*-
|
1994-09-21 04:10:23 +04:00
|
|
|
* Copyright (c) 1991, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
1993-03-21 12:45:37 +03:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2003-08-07 13:05:01 +04:00
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
1993-03-21 12:45:37 +03:00
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
1995-03-21 12:01:59 +03:00
|
|
|
* @(#)extern.h 8.1 (Berkeley) 5/31/93
|
1993-03-21 12:45:37 +03:00
|
|
|
*/
|
|
|
|
|
2001-09-14 18:03:59 +04:00
|
|
|
#ifndef _EXTERN_H_
|
|
|
|
#define _EXTERN_H_
|
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* csh.c
|
|
|
|
*/
|
2001-09-14 18:03:59 +04:00
|
|
|
int gethdir(Char *);
|
|
|
|
void dosource(Char **, struct command *);
|
2007-12-24 19:11:50 +03:00
|
|
|
__dead void exitstat(void);
|
2011-08-29 18:51:17 +04:00
|
|
|
__dead void goodbye(void);
|
2001-09-14 18:03:59 +04:00
|
|
|
void importpath(Char *);
|
|
|
|
void initdesc(void);
|
2011-08-29 18:51:17 +04:00
|
|
|
__dead void pintr(int);
|
2007-12-24 19:11:50 +03:00
|
|
|
__dead void pintr1(int);
|
2001-09-14 18:03:59 +04:00
|
|
|
void printprompt(void);
|
2013-01-23 00:35:29 +04:00
|
|
|
#ifdef EDIT
|
|
|
|
char *printpromptstr(EditLine *);
|
|
|
|
#endif
|
2007-07-16 22:26:09 +04:00
|
|
|
void process(int);
|
2001-09-14 18:03:59 +04:00
|
|
|
void rechist(void);
|
|
|
|
void untty(void);
|
|
|
|
int vis_fputc(int, FILE *);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
#ifdef PROF
|
2007-12-24 19:11:50 +03:00
|
|
|
__dead void done(int);
|
1993-03-21 12:45:37 +03:00
|
|
|
#else
|
2007-12-24 19:11:50 +03:00
|
|
|
__dead void xexit(int);
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* dir.c
|
|
|
|
*/
|
2001-09-14 18:03:59 +04:00
|
|
|
void dinit(Char *);
|
|
|
|
void dodirs(Char **, struct command *);
|
|
|
|
Char *dcanon(Char *, Char *);
|
|
|
|
void dtildepr(Char *, Char *);
|
|
|
|
void dtilde(void);
|
|
|
|
void dochngd(Char **, struct command *);
|
|
|
|
Char *dnormalize(Char *);
|
|
|
|
void dopushd(Char **, struct command *);
|
|
|
|
void dopopd(Char **, struct command *);
|
1993-03-21 12:45:37 +03:00
|
|
|
struct directory;
|
2001-09-14 18:03:59 +04:00
|
|
|
void dfree(struct directory *);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* dol.c
|
|
|
|
*/
|
2001-09-14 18:03:59 +04:00
|
|
|
void Dfix(struct command *);
|
|
|
|
Char *Dfix1(Char *);
|
|
|
|
void heredoc(Char *);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* err.c
|
|
|
|
*/
|
2001-09-14 18:03:59 +04:00
|
|
|
void seterror(int, ...);
|
2007-12-24 19:11:50 +03:00
|
|
|
__dead void stderror(int, ...);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* exec.c
|
|
|
|
*/
|
2007-12-24 19:11:50 +03:00
|
|
|
__dead void doexec(Char **, struct command *);
|
2001-09-14 18:03:59 +04:00
|
|
|
void dohash(Char **, struct command *);
|
|
|
|
void dounhash(Char **, struct command *);
|
|
|
|
void dowhich(Char **, struct command *);
|
|
|
|
void execash(Char **, struct command *);
|
|
|
|
void hashstat(Char **, struct command *);
|
|
|
|
void xechoit(Char **);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* exp.c
|
|
|
|
*/
|
2001-09-14 18:03:59 +04:00
|
|
|
int expr(Char ***);
|
2007-07-16 22:26:09 +04:00
|
|
|
int exp0(Char ***, int);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* file.c
|
|
|
|
*/
|
|
|
|
#ifdef FILEC
|
2013-07-16 21:47:43 +04:00
|
|
|
ssize_t tenex(Char *, size_t);
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* func.c
|
|
|
|
*/
|
2001-09-14 18:03:59 +04:00
|
|
|
void Setenv(Char *, Char *);
|
|
|
|
void doalias(Char **, struct command *);
|
|
|
|
void dobreak(Char **, struct command *);
|
|
|
|
void docontin(Char **, struct command *);
|
|
|
|
void doecho(Char **, struct command *);
|
|
|
|
void doelse(Char **, struct command *);
|
|
|
|
void doend(Char **, struct command *);
|
|
|
|
void doeval(Char **, struct command *);
|
|
|
|
void doexit(Char **, struct command *);
|
|
|
|
void doforeach(Char **, struct command *);
|
|
|
|
void doglob(Char **, struct command *);
|
|
|
|
void dogoto(Char **, struct command *);
|
|
|
|
void doif(Char **, struct command *);
|
|
|
|
void dolimit(Char **, struct command *);
|
2011-08-29 18:51:17 +04:00
|
|
|
__dead void dologin(Char **, struct command *);
|
|
|
|
__dead void dologout(Char **, struct command *);
|
2001-09-14 18:03:59 +04:00
|
|
|
void donohup(Char **, struct command *);
|
|
|
|
void doonintr(Char **, struct command *);
|
|
|
|
void doprintf(Char **, struct command *);
|
|
|
|
void dorepeat(Char **, struct command *);
|
|
|
|
void dosetenv(Char **, struct command *);
|
|
|
|
void dosuspend(Char **, struct command *);
|
|
|
|
void doswbrk(Char **, struct command *);
|
|
|
|
void doswitch(Char **, struct command *);
|
|
|
|
void doumask(Char **, struct command *);
|
|
|
|
void dounlimit(Char **, struct command *);
|
|
|
|
void dounsetenv(Char **, struct command *);
|
|
|
|
void dowhile(Char **, struct command *);
|
|
|
|
void dozip(Char **, struct command *);
|
|
|
|
void func(struct command *, struct biltins *);
|
|
|
|
struct biltins *isbfunc(struct command *);
|
|
|
|
void prvars(void);
|
|
|
|
void gotolab(Char *);
|
|
|
|
int srchx(Char *);
|
|
|
|
void unalias(Char **, struct command *);
|
|
|
|
void wfree(void);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* glob.c
|
|
|
|
*/
|
2007-07-16 22:26:09 +04:00
|
|
|
Char **dobackp(Char *, int);
|
2001-09-14 18:03:59 +04:00
|
|
|
void Gcat(Char *, Char *);
|
|
|
|
Char *globone(Char *, int);
|
|
|
|
int Gmatch(Char *, Char *);
|
|
|
|
void ginit(void);
|
|
|
|
Char **globall(Char **);
|
|
|
|
void rscan(Char **, void (*)(int));
|
|
|
|
void tglob(Char **);
|
|
|
|
void trim(Char **);
|
1993-03-21 12:45:37 +03:00
|
|
|
#ifdef FILEC
|
2019-01-05 19:54:00 +03:00
|
|
|
int sortscmp(const void *, const void *);
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif /* FILEC */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* hist.c
|
|
|
|
*/
|
2001-09-14 18:03:59 +04:00
|
|
|
void dohist(Char **, struct command *);
|
2007-07-16 22:26:09 +04:00
|
|
|
struct Hist *enthist(int, struct wordent *, int);
|
2013-01-23 20:39:03 +04:00
|
|
|
#ifdef EDIT
|
|
|
|
void loadhist(struct Hist *);
|
|
|
|
#endif
|
2001-09-14 18:03:59 +04:00
|
|
|
void savehist(struct wordent *);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* lex.c
|
|
|
|
*/
|
2001-09-14 18:03:59 +04:00
|
|
|
void addla(Char *);
|
|
|
|
void bseek(struct Ain *);
|
|
|
|
void btell(struct Ain *);
|
|
|
|
void btoeof(void);
|
|
|
|
void copylex(struct wordent *, struct wordent *);
|
|
|
|
Char *domod(Char *, int);
|
|
|
|
void freelex(struct wordent *);
|
|
|
|
int lex(struct wordent *);
|
|
|
|
void prlex(FILE *, struct wordent *);
|
2013-01-23 20:39:03 +04:00
|
|
|
#ifdef EDIT
|
|
|
|
int sprlex(char **, struct wordent *);
|
|
|
|
#endif
|
2007-07-16 22:26:09 +04:00
|
|
|
int readc(int);
|
2001-09-14 18:03:59 +04:00
|
|
|
void settell(void);
|
|
|
|
void unreadc(int);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* misc.c
|
|
|
|
*/
|
2005-06-26 23:10:48 +04:00
|
|
|
int any(const char *, int);
|
2001-09-14 18:03:59 +04:00
|
|
|
Char **blkcat(Char **, Char **);
|
|
|
|
Char **blkcpy(Char **, Char **);
|
|
|
|
Char **blkend(Char **);
|
|
|
|
void blkfree(Char **);
|
|
|
|
int blklen(Char **);
|
|
|
|
void blkpr(FILE *, Char **);
|
|
|
|
Char **blkspl(Char **, Char **);
|
|
|
|
void closem(void);
|
|
|
|
Char **copyblk(Char **);
|
|
|
|
int dcopy(int, int);
|
|
|
|
int dmove(int, int);
|
|
|
|
void donefds(void);
|
|
|
|
Char lastchr(Char *);
|
2013-07-16 21:47:43 +04:00
|
|
|
void lshift(Char **, size_t);
|
2001-09-14 18:03:59 +04:00
|
|
|
int number(Char *);
|
|
|
|
int prefix(Char *, Char *);
|
|
|
|
Char **saveblk(Char **);
|
|
|
|
Char *strip(Char *);
|
|
|
|
Char *quote(Char *);
|
2005-06-26 23:10:48 +04:00
|
|
|
char *strsave(const char *);
|
2001-09-14 18:03:59 +04:00
|
|
|
char *strspl(char *, char *);
|
2007-12-24 19:11:50 +03:00
|
|
|
__dead void udvar(Char *);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
#ifndef SHORT_STRINGS
|
1994-09-21 04:10:23 +04:00
|
|
|
# ifdef NOTUSED
|
2001-09-14 18:03:59 +04:00
|
|
|
char *strstr(const char *, const char *);
|
1994-09-21 04:10:23 +04:00
|
|
|
# endif /* NOTUSED */
|
2001-09-14 18:03:59 +04:00
|
|
|
char *strend(char *);
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* parse.c
|
|
|
|
*/
|
2001-09-14 18:03:59 +04:00
|
|
|
void alias(struct wordent *);
|
|
|
|
void freesyn(struct command *);
|
|
|
|
struct command *syntax(struct wordent *, struct wordent *, int);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* proc.c
|
|
|
|
*/
|
2001-09-14 18:03:59 +04:00
|
|
|
void dobg(Char **, struct command *);
|
|
|
|
void dobg1(Char **, struct command *);
|
|
|
|
void dofg(Char **, struct command *);
|
|
|
|
void dofg1(Char **, struct command *);
|
|
|
|
void dojobs(Char **, struct command *);
|
|
|
|
void dokill(Char **, struct command *);
|
|
|
|
void donotify(Char **, struct command *);
|
|
|
|
void dostop(Char **, struct command *);
|
|
|
|
void dowait(Char **, struct command *);
|
|
|
|
void palloc(int, struct command *);
|
2007-07-16 22:26:09 +04:00
|
|
|
void panystop(int);
|
2001-09-14 18:03:59 +04:00
|
|
|
void pchild(int);
|
|
|
|
void pendjob(void);
|
|
|
|
struct process *pfind(Char *);
|
|
|
|
int pfork(struct command *, int);
|
|
|
|
void pgetty(int, int);
|
|
|
|
void pjwait(struct process *);
|
|
|
|
void pnote(void);
|
|
|
|
void prestjob(void);
|
|
|
|
void psavejob(void);
|
|
|
|
void pstart(struct process *, int);
|
|
|
|
void pwait(void);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* sem.c
|
|
|
|
*/
|
2001-09-14 18:03:59 +04:00
|
|
|
void execute(struct command *, int, int *, int *);
|
|
|
|
void mypipe(int *);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* set.c
|
|
|
|
*/
|
2001-09-14 18:03:59 +04:00
|
|
|
struct varent*adrof1(Char *, struct varent *);
|
|
|
|
void doset(Char **, struct command *);
|
|
|
|
void dolet(Char **, struct command *);
|
|
|
|
Char *putn(int);
|
|
|
|
int getn(Char *);
|
|
|
|
Char *value1(Char *, struct varent *);
|
|
|
|
void set(Char *, Char *);
|
|
|
|
void set1(Char *, Char **, struct varent *);
|
|
|
|
void setq(Char *, Char **, struct varent *);
|
|
|
|
void unset(Char **, struct command *);
|
|
|
|
void unset1(Char *[], struct varent *);
|
|
|
|
void unsetv(Char *);
|
|
|
|
void setNS(Char *);
|
|
|
|
void shift(Char **, struct command *);
|
|
|
|
void plist(struct varent *);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* time.c
|
|
|
|
*/
|
2001-09-14 18:03:59 +04:00
|
|
|
void donice(Char **, struct command *);
|
|
|
|
void dotime(Char **, struct command *);
|
2020-04-23 10:54:53 +03:00
|
|
|
void prusage1(FILE *, const char *, int, struct rusage *, struct rusage *,
|
2017-07-15 17:35:55 +03:00
|
|
|
struct timespec *, struct timespec *);
|
2011-11-09 23:16:00 +04:00
|
|
|
void prusage(FILE *, struct rusage *, struct rusage *, struct timespec *,
|
|
|
|
struct timespec *);
|
2001-09-14 18:03:59 +04:00
|
|
|
void ruadd(struct rusage *, struct rusage *);
|
|
|
|
void settimes(void);
|
|
|
|
void psecs(long);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* alloc.c
|
|
|
|
*/
|
2019-01-05 19:54:00 +03:00
|
|
|
void Free(void *);
|
|
|
|
void * Malloc(size_t);
|
|
|
|
void *Realloc(void *, size_t);
|
|
|
|
void *Calloc(size_t, size_t);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* str.c:
|
|
|
|
*/
|
|
|
|
#ifdef SHORT_STRINGS
|
2012-12-28 01:19:20 +04:00
|
|
|
Char *s_strchr(const Char *, int);
|
|
|
|
Char *s_strrchr(const Char *, int);
|
|
|
|
Char *s_strcat(Char *, const Char *);
|
1993-03-21 12:45:37 +03:00
|
|
|
#ifdef NOTUSED
|
2012-12-28 01:19:20 +04:00
|
|
|
Char *s_strncat(Char *, const Char *, size_t);
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif
|
2012-12-28 01:19:20 +04:00
|
|
|
Char *s_strcpy(Char *, const Char *);
|
|
|
|
Char *s_strncpy(Char *, const Char *, size_t);
|
|
|
|
Char *s_strspl(const Char *, const Char *);
|
|
|
|
size_t s_strlen(const Char *);
|
|
|
|
int s_strcmp(const Char *, const Char *);
|
|
|
|
int s_strncmp(const Char *, const Char *, size_t);
|
|
|
|
Char *s_strsave(const Char *);
|
|
|
|
Char *s_strend(const Char *);
|
|
|
|
Char *s_strstr(const Char *, const Char *);
|
2001-09-14 18:03:59 +04:00
|
|
|
Char *str2short(const char *);
|
|
|
|
Char **blk2short(char **);
|
2012-12-28 01:19:20 +04:00
|
|
|
char *short2str(const Char *);
|
|
|
|
char **short2blk(Char * const *);
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif
|
2012-12-28 01:19:20 +04:00
|
|
|
char *short2qstr(const Char *);
|
|
|
|
char *vis_str(const Char *);
|
2001-09-14 18:03:59 +04:00
|
|
|
|
|
|
|
#endif /* !_EXTERN_H_ */
|