diff options
author | jilles <jilles@FreeBSD.org> | 2011-06-13 21:03:27 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2011-06-13 21:03:27 +0000 |
commit | 16addb86733d970dc3f900be1a0536276292efbe (patch) | |
tree | 007f3e31e27062e0bd6f94d06d03f38056fc4685 /bin | |
parent | 83fe27f2b389dab3f912243ac3e6a6b726ebed3a (diff) | |
download | FreeBSD-src-16addb86733d970dc3f900be1a0536276292efbe.zip FreeBSD-src-16addb86733d970dc3f900be1a0536276292efbe.tar.gz |
sh: Fix duplicate prototypes for builtins.
Have mkbuiltins write the prototypes for the *cmd functions to builtins.h
instead of builtins.c and include builtins.h in more .c files instead of
duplicating prototypes for *cmd functions in other headers.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sh/alias.c | 1 | ||||
-rw-r--r-- | bin/sh/alias.h | 2 | ||||
-rw-r--r-- | bin/sh/arith.h | 1 | ||||
-rw-r--r-- | bin/sh/bltin/bltin.h | 4 | ||||
-rw-r--r-- | bin/sh/cd.c | 1 | ||||
-rw-r--r-- | bin/sh/cd.h | 2 | ||||
-rw-r--r-- | bin/sh/eval.h | 9 | ||||
-rw-r--r-- | bin/sh/exec.h | 2 | ||||
-rw-r--r-- | bin/sh/expand.c | 1 | ||||
-rw-r--r-- | bin/sh/expand.h | 1 | ||||
-rw-r--r-- | bin/sh/histedit.c | 1 | ||||
-rw-r--r-- | bin/sh/jobs.c | 1 | ||||
-rw-r--r-- | bin/sh/jobs.h | 5 | ||||
-rw-r--r-- | bin/sh/main.c | 1 | ||||
-rw-r--r-- | bin/sh/main.h | 2 | ||||
-rwxr-xr-x | bin/sh/mkbuiltins | 8 | ||||
-rw-r--r-- | bin/sh/myhistedit.h | 2 | ||||
-rw-r--r-- | bin/sh/options.c | 1 | ||||
-rw-r--r-- | bin/sh/options.h | 3 | ||||
-rw-r--r-- | bin/sh/trap.c | 1 | ||||
-rw-r--r-- | bin/sh/trap.h | 1 | ||||
-rw-r--r-- | bin/sh/var.c | 1 | ||||
-rw-r--r-- | bin/sh/var.h | 4 |
23 files changed, 14 insertions, 41 deletions
diff --git a/bin/sh/alias.c b/bin/sh/alias.c index 929c68e..fb0e922 100644 --- a/bin/sh/alias.c +++ b/bin/sh/alias.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include "mystring.h" #include "alias.h" #include "options.h" /* XXX for argptr (should remove?) */ +#include "builtins.h" #define ATABSIZE 39 diff --git a/bin/sh/alias.h b/bin/sh/alias.h index 7983663..546e91a 100644 --- a/bin/sh/alias.h +++ b/bin/sh/alias.h @@ -43,5 +43,3 @@ struct alias { }; struct alias *lookupalias(const char *, int); -int aliascmd(int, char **); -int unaliascmd(int, char **); diff --git a/bin/sh/arith.h b/bin/sh/arith.h index 3a7db9e..5b18bd6 100644 --- a/bin/sh/arith.h +++ b/bin/sh/arith.h @@ -36,4 +36,3 @@ arith_t arith(const char *); void arith_lex_reset(void); -int expcmd(int, char **); diff --git a/bin/sh/bltin/bltin.h b/bin/sh/bltin/bltin.h index e449673..0143b6e 100644 --- a/bin/sh/bltin/bltin.h +++ b/bin/sh/bltin/bltin.h @@ -43,6 +43,7 @@ #include "../mystring.h" #ifdef SHELL #include "../output.h" +#include "builtins.h" #define FILE struct output #undef stdout #define stdout out1 @@ -75,7 +76,4 @@ pointer stalloc(int); void error(const char *, ...) __printf0like(1, 2); pid_t getjobpgrp(char *); -int echocmd(int, char **); -int testcmd(int, char **); - extern char *commandname; diff --git a/bin/sh/cd.c b/bin/sh/cd.c index b1b0fc0..6fb1039 100644 --- a/bin/sh/cd.c +++ b/bin/sh/cd.c @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include "mystring.h" #include "show.h" #include "cd.h" +#include "builtins.h" static int cdlogical(char *); static int cdphysical(char *); diff --git a/bin/sh/cd.h b/bin/sh/cd.h index f88ce26..91fbc2b 100644 --- a/bin/sh/cd.h +++ b/bin/sh/cd.h @@ -30,5 +30,3 @@ */ void pwd_init(int); -int cdcmd (int, char **); -int pwdcmd(int, char **); diff --git a/bin/sh/eval.h b/bin/sh/eval.h index bf98782..fba6f9a 100644 --- a/bin/sh/eval.h +++ b/bin/sh/eval.h @@ -51,19 +51,10 @@ struct backcmd { /* result of evalbackcmd */ #define EV_TESTED 02 /* exit status is checked; ignore -e flag */ #define EV_BACKCMD 04 /* command executing within back quotes */ -int evalcmd(int, char **); void evalstring(char *, int); union node; /* BLETCH for ansi C */ void evaltree(union node *, int); void evalbackcmd(union node *, struct backcmd *); -int bltincmd(int, char **); -int breakcmd(int, char **); -int returncmd(int, char **); -int falsecmd(int, char **); -int truecmd(int, char **); -int execcmd(int, char **); -int timescmd(int, char **); -int commandcmd(int, char **); /* in_function returns nonzero if we are currently evaluating a function */ #define in_function() funcnest diff --git a/bin/sh/exec.h b/bin/sh/exec.h index 392cc33..31f11c0 100644 --- a/bin/sh/exec.h +++ b/bin/sh/exec.h @@ -66,7 +66,6 @@ extern int exerrno; /* last exec error */ void shellexec(char **, char **, const char *, int) __dead2; char *padvance(const char **, const char *); -int hashcmd(int, char **); void find_command(const char *, struct cmdentry *, int, const char *); int find_builtin(const char *, int *); void hashcd(void); @@ -75,5 +74,4 @@ void addcmdentry(const char *, struct cmdentry *); void defun(const char *, union node *); int unsetfunc(const char *); int typecmd_impl(int, char **, int, const char *); -int typecmd(int, char **); void clearcmdentry(void); diff --git a/bin/sh/expand.c b/bin/sh/expand.c index c6c54ab..95a0d6a 100644 --- a/bin/sh/expand.c +++ b/bin/sh/expand.c @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include "mystring.h" #include "arith.h" #include "show.h" +#include "builtins.h" /* * Structure specifying which parts of the string should be searched diff --git a/bin/sh/expand.h b/bin/sh/expand.h index a4bb198..5029552 100644 --- a/bin/sh/expand.h +++ b/bin/sh/expand.h @@ -63,4 +63,3 @@ void expari(int); int patmatch(const char *, const char *, int); void rmescapes(char *); int casematch(union node *, const char *); -int wordexpcmd(int, char **); diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index 7ebe5d8..4619baf 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include "error.h" #include "eval.h" #include "memalloc.h" +#include "builtins.h" #define MAXHISTLOOPS 4 /* max recursions through fc */ #define DEFEDITOR "ed" /* default editor *should* be $EDITOR */ diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index cbc29f1..75b503e 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include "error.h" #include "mystring.h" #include "var.h" +#include "builtins.h" static struct job *jobtab; /* array of jobs */ diff --git a/bin/sh/jobs.h b/bin/sh/jobs.h index 8bc1082..5e9d70d 100644 --- a/bin/sh/jobs.h +++ b/bin/sh/jobs.h @@ -88,12 +88,7 @@ extern int in_dowait; /* are we in dowait()? */ extern volatile sig_atomic_t breakwaitcmd; /* break wait to process traps? */ void setjobctl(int); -int fgcmd(int, char **); -int bgcmd(int, char **); -int jobscmd(int, char **); void showjobs(int, int); -int waitcmd(int, char **); -int jobidcmd(int, char **); struct job *makejob(union node *, int); pid_t forkshell(struct job *, union node *, int); int waitforjob(struct job *, int *); diff --git a/bin/sh/main.c b/bin/sh/main.c index 2da5a15..e6c8a20 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include "mystring.h" #include "exec.h" #include "cd.h" +#include "builtins.h" int rootpid; int rootshell; diff --git a/bin/sh/main.h b/bin/sh/main.h index c5e8bfd3..6d4cc4a 100644 --- a/bin/sh/main.h +++ b/bin/sh/main.h @@ -39,5 +39,3 @@ extern struct jmploc main_handler; /* top level exception handler */ void readcmdfile(const char *); void cmdloop(int); -int dotcmd(int, char **); -int exitcmd(int, char **); diff --git a/bin/sh/mkbuiltins b/bin/sh/mkbuiltins index b78729a..49af058 100755 --- a/bin/sh/mkbuiltins +++ b/bin/sh/mkbuiltins @@ -58,9 +58,7 @@ cat <<\! ! awk '/^[^#]/ {if(('$havejobs' || $2 != "-j") && ('$havehist' || $2 != "-h")) \ print $0}' builtins.def | sed 's/-[hj]//' > $temp -awk '{ printf "int %s(int, char **);\n", $1}' $temp -echo ' -int (*const builtinfunc[])(int, char **) = {' +echo 'int (*const builtinfunc[])(int, char **) = {' awk '/^[^#]/ { printf "\t%s,\n", $1}' $temp echo '}; @@ -94,5 +92,7 @@ struct builtincmd { }; extern int (*const builtinfunc[])(int, char **); -extern const struct builtincmd builtincmd[];' +extern const struct builtincmd builtincmd[]; +' +awk '{ printf "int %s(int, char **);\n", $1}' $temp rm -f $temp diff --git a/bin/sh/myhistedit.h b/bin/sh/myhistedit.h index bc9fd4e..9a649ec 100644 --- a/bin/sh/myhistedit.h +++ b/bin/sh/myhistedit.h @@ -39,8 +39,6 @@ extern int displayhist; void histedit(void); void sethistsize(const char *); void setterm(const char *); -int histcmd(int, char **); int not_fcnumber(const char *); int str_to_event(const char *, int); -int bindcmd(int, char **); diff --git a/bin/sh/options.c b/bin/sh/options.c index 60c8852..9104e93 100644 --- a/bin/sh/options.c +++ b/bin/sh/options.c @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include "memalloc.h" #include "error.h" #include "mystring.h" +#include "builtins.h" #ifndef NO_HISTORY #include "myhistedit.h" #endif diff --git a/bin/sh/options.h b/bin/sh/options.h index 5004549..f3d3d3d 100644 --- a/bin/sh/options.h +++ b/bin/sh/options.h @@ -108,8 +108,5 @@ void procargs(int, char **); void optschanged(void); void setparam(char **); void freeparam(struct shparam *); -int shiftcmd(int, char **); -int setcmd(int, char **); -int getoptscmd(int, char **); int nextopt(const char *); void getoptsreset(const char *); diff --git a/bin/sh/trap.c b/bin/sh/trap.c index aaa4753..2b6d8a5 100644 --- a/bin/sh/trap.c +++ b/bin/sh/trap.c @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include "error.h" #include "trap.h" #include "mystring.h" +#include "builtins.h" #include "myhistedit.h" diff --git a/bin/sh/trap.h b/bin/sh/trap.h index d8686ce..bf1250a 100644 --- a/bin/sh/trap.h +++ b/bin/sh/trap.h @@ -37,7 +37,6 @@ extern int pendingsigs; extern int in_dotrap; extern volatile sig_atomic_t gotwinch; -int trapcmd(int, char **); void clear_traps(void); int have_traps(void); void setsignal(int); diff --git a/bin/sh/var.c b/bin/sh/var.c index e405b66..d5b2522 100644 --- a/bin/sh/var.c +++ b/bin/sh/var.c @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include "error.h" #include "mystring.h" #include "parser.h" +#include "builtins.h" #ifndef NO_HISTORY #include "myhistedit.h" #endif diff --git a/bin/sh/var.h b/bin/sh/var.h index f10bfcc..347c377 100644 --- a/bin/sh/var.h +++ b/bin/sh/var.h @@ -123,11 +123,7 @@ void updatecharset(void); void initcharset(void); char **environment(void); int showvarscmd(int, char **); -int exportcmd(int, char **); -int localcmd(int, char **); void mklocal(char *); void poplocalvars(void); -int setvarcmd(int, char **); -int unsetcmd(int, char **); int unsetvar(const char *); int setvarsafe(const char *, const char *, int); |