mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-30 15:38:06 +01:00
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.
This commit is contained in:
parent
8a8a3387fd
commit
454a02b372
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=223060
@ -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
|
||||
|
||||
|
@ -43,5 +43,3 @@ struct alias {
|
||||
};
|
||||
|
||||
struct alias *lookupalias(const char *, int);
|
||||
int aliascmd(int, char **);
|
||||
int unaliascmd(int, char **);
|
||||
|
@ -36,4 +36,3 @@
|
||||
|
||||
arith_t arith(const char *);
|
||||
void arith_lex_reset(void);
|
||||
int expcmd(int, char **);
|
||||
|
@ -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;
|
||||
|
@ -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 *);
|
||||
|
@ -30,5 +30,3 @@
|
||||
*/
|
||||
|
||||
void pwd_init(int);
|
||||
int cdcmd (int, char **);
|
||||
int pwdcmd(int, char **);
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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 **);
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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 *);
|
||||
|
@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include "mystring.h"
|
||||
#include "exec.h"
|
||||
#include "cd.h"
|
||||
#include "builtins.h"
|
||||
|
||||
int rootpid;
|
||||
int rootshell;
|
||||
|
@ -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 **);
|
||||
|
@ -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
|
||||
|
@ -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 **);
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 *);
|
||||
|
@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include "error.h"
|
||||
#include "trap.h"
|
||||
#include "mystring.h"
|
||||
#include "builtins.h"
|
||||
#include "myhistedit.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);
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user