From: Peter Avalos Date: Sun, 5 Feb 2012 19:42:22 +0000 (-0800) Subject: sh: Make various functions static. X-Git-Tag: v3.4.0rc~1275 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/b6bd99f63ba9b8eeb9dcfd0f5b11ea363199cd9a sh: Make various functions static. Obtained-from: FreeBSD 229220 --- diff --git a/bin/sh/exec.c b/bin/sh/exec.c index d9b32a3ffd..bf252fbacd 100644 --- a/bin/sh/exec.c +++ b/bin/sh/exec.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)exec.c 8.4 (Berkeley) 6/8/95 - * $FreeBSD: src/bin/sh/exec.c,v 1.52 2011/02/05 14:08:51 jilles Exp $ + * $FreeBSD: src/bin/sh/exec.c,v 1.53 2012/01/01 22:17:12 jilles Exp $ */ #include @@ -99,6 +99,7 @@ static void tryexec(char *, char **, char **); static void printentry(struct tblentry *, int); static struct tblentry *cmdlookup(const char *, int); static void delete_cmd_entry(void); +static void addcmdentry(const char *, struct cmdentry *); /* * Exec a program. Never returns. If you change this routine, you may @@ -593,7 +594,7 @@ delete_cmd_entry(void) * the same name. */ -void +static void addcmdentry(const char *name, struct cmdentry *entry) { struct tblentry *cmdp; diff --git a/bin/sh/exec.h b/bin/sh/exec.h index d8cc3893f4..721e20b91d 100644 --- a/bin/sh/exec.h +++ b/bin/sh/exec.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)exec.h 8.3 (Berkeley) 6/8/95 - * $FreeBSD: src/bin/sh/exec.h,v 1.23 2011/06/13 21:03:27 jilles Exp $ + * $FreeBSD: src/bin/sh/exec.h,v 1.24 2012/01/01 22:17:12 jilles Exp $ */ /* values of cmdtype */ @@ -74,7 +74,6 @@ void find_command(const char *, struct cmdentry *, int, const char *); int find_builtin(const char *, int *); void hashcd(void); void changepath(const char *); -void addcmdentry(const char *, struct cmdentry *); void defun(const char *, union node *); int unsetfunc(const char *); int typecmd_impl(int, char **, int, const char *); diff --git a/bin/sh/expand.c b/bin/sh/expand.c index cbf75bea8b..52fc78ffae 100644 --- a/bin/sh/expand.c +++ b/bin/sh/expand.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)expand.c 8.5 (Berkeley) 5/15/95 - * $FreeBSD: src/bin/sh/expand.c,v 1.94 2012/01/01 20:50:19 jilles Exp $ + * $FreeBSD: src/bin/sh/expand.c,v 1.95 2012/01/01 22:17:12 jilles Exp $ */ #include @@ -112,6 +112,7 @@ static void expmeta(char *, char *); static void addfname(char *); static struct strlist *expsort(struct strlist *); static struct strlist *msort(struct strlist *, int); +static int patmatch(const char *, const char *, int); static char *cvtnum(int, char *); static int collate_range_cmp(wchar_t, wchar_t); @@ -1440,7 +1441,7 @@ match_charclass(const char *p, wchar_t chr, const char **end) * Returns true if the pattern matches the string. */ -int +static int patmatch(const char *pattern, const char *string, int squoted) { const char *p, *q, *end; diff --git a/bin/sh/expand.h b/bin/sh/expand.h index 42640a8d10..778c9d8d0a 100644 --- a/bin/sh/expand.h +++ b/bin/sh/expand.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)expand.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: src/bin/sh/expand.h,v 1.17 2011/06/13 21:03:27 jilles Exp $ + * $FreeBSD: src/bin/sh/expand.h,v 1.18 2012/01/01 22:17:12 jilles Exp $ */ struct strlist { @@ -64,6 +64,5 @@ union node; void expandhere(union node *, int); void expandarg(union node *, struct arglist *, int); void expari(int); -int patmatch(const char *, const char *, int); void rmescapes(char *); int casematch(union node *, const char *); diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index d56d57f10b..54053173d2 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)histedit.c 8.2 (Berkeley) 5/4/95 - * $FreeBSD: src/bin/sh/histedit.c,v 1.43 2011/06/13 21:03:27 jilles Exp $ + * $FreeBSD: src/bin/sh/histedit.c,v 1.44 2012/01/01 22:17:12 jilles Exp $ */ #include @@ -69,6 +69,8 @@ int displayhist; static FILE *el_in, *el_out, *el_err; static char *fc_replace(const char *, char *, char *); +static int not_fcnumber(const char *); +static int str_to_event(const char *, int); /* * Set history and editing status. Called whenever the status may @@ -427,7 +429,7 @@ fc_replace(const char *s, char *p, char *r) return (dest); } -int +static int not_fcnumber(const char *s) { if (s == NULL) @@ -437,7 +439,7 @@ not_fcnumber(const char *s) return (!is_number(s)); } -int +static int str_to_event(const char *str, int last) { HistEvent he; diff --git a/bin/sh/input.c b/bin/sh/input.c index 2c3908d887..38b31f9c68 100644 --- a/bin/sh/input.c +++ b/bin/sh/input.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)input.c 8.3 (Berkeley) 6/9/95 - * $FreeBSD: src/bin/sh/input.c,v 1.33 2011/06/04 15:05:52 jilles Exp $ + * $FreeBSD: src/bin/sh/input.c,v 1.34 2012/01/01 22:17:12 jilles Exp $ */ #include /* defines BUFSIZ */ @@ -105,6 +105,7 @@ EditLine *el; /* cookie for editline package */ static void pushfile(void); static int preadfd(void); +static void popstring(void); #ifdef mkinit INCLUDE @@ -370,7 +371,7 @@ pushstring(char *s, int len, void *ap) INTON; } -void +static void popstring(void) { struct strpush *sp = parsefile->strpush; diff --git a/bin/sh/input.h b/bin/sh/input.h index d0deb33e6e..97cbb4619f 100644 --- a/bin/sh/input.h +++ b/bin/sh/input.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)input.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: src/bin/sh/input.h,v 1.12 2009/12/24 18:41:14 jilles Exp $ + * $FreeBSD: src/bin/sh/input.h,v 1.13 2012/01/01 22:17:12 jilles Exp $ */ /* PEOF (the end of file marker) is defined in syntax.h */ @@ -57,7 +57,6 @@ int preadbuffer(void); int preadateof(void); void pungetc(void); void pushstring(char *, int, void *); -void popstring(void); void setinputfile(const char *, int); void setinputfd(int, int); void setinputstring(char *, int); diff --git a/bin/sh/main.c b/bin/sh/main.c index fc544096a9..c478f711a4 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -35,7 +35,7 @@ * * @(#) Copyright (c) 1991, 1993 The Regents of the University of California. All rights reserved. * @(#)main.c 8.6 (Berkeley) 5/28/95 - * $FreeBSD: src/bin/sh/main.c,v 1.52 2011/06/13 21:03:27 jilles Exp $ + * $FreeBSD: src/bin/sh/main.c,v 1.53 2012/01/01 22:17:12 jilles Exp $ */ #include @@ -73,6 +73,7 @@ int rootshell; struct jmploc main_handler; int localeisutf8, initial_localeisutf8; +static void cmdloop(int); static void read_profile(const char *); static const char *find_dot_file(const char *); @@ -178,7 +179,7 @@ state4: /* XXX ??? - why isn't this before the "if" statement */ * loop; it turns on prompting if the shell is interactive. */ -void +static void cmdloop(int top) { union node *n; diff --git a/bin/sh/main.h b/bin/sh/main.h index 32d0a56431..ede4722795 100644 --- a/bin/sh/main.h +++ b/bin/sh/main.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)main.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: src/bin/sh/main.h,v 1.11 2011/06/13 21:03:27 jilles Exp $ + * $FreeBSD: src/bin/sh/main.h,v 1.12 2012/01/01 22:17:12 jilles Exp $ */ extern int rootpid; /* pid of main shell */ @@ -42,4 +42,3 @@ extern int rootshell; /* true if we aren't a child of the main shell */ extern struct jmploc main_handler; /* top level exception handler */ void readcmdfile(const char *); -void cmdloop(int); diff --git a/bin/sh/myhistedit.h b/bin/sh/myhistedit.h index b2f1229174..a8c5305931 100644 --- a/bin/sh/myhistedit.h +++ b/bin/sh/myhistedit.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)myhistedit.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: src/bin/sh/myhistedit.h,v 1.13 2011/06/13 21:03:27 jilles Exp $ + * $FreeBSD: src/bin/sh/myhistedit.h,v 1.14 2012/01/01 22:17:12 jilles Exp $ */ #include @@ -43,6 +43,4 @@ extern int displayhist; void histedit(void); void sethistsize(const char *); void setterm(const char *); -int not_fcnumber(const char *); -int str_to_event(const char *, int);