summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
author"Vladimir N. Oleynik" <dzo@simtreas.ru>2005-09-22 14:33:15 +0000
committer"Vladimir N. Oleynik" <dzo@simtreas.ru>2005-09-22 14:33:15 +0000
commit19c370167a4c2286dbb944ae2d558f7c20e16291 (patch)
tree4e1ffcea46e274d12561a0bea1d94ab1f620b12c /shell
parentb8fa7e88f22c2392684d9f5e3cb590bde3fb741e (diff)
downloadbusybox-w32-19c370167a4c2286dbb944ae2d558f7c20e16291.tar.gz
busybox-w32-19c370167a4c2286dbb944ae2d558f7c20e16291.tar.bz2
busybox-w32-19c370167a4c2286dbb944ae2d558f7c20e16291.zip
Reduce exported from hush applet
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 49e2397ad..87b9412b3 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -133,7 +133,7 @@ typedef enum {
133 133
134/* The descrip member of this structure is only used to make debugging 134/* The descrip member of this structure is only used to make debugging
135 * output pretty */ 135 * output pretty */
136struct {int mode; int default_fd; char *descrip;} redir_table[] = { 136static struct {int mode; int default_fd; char *descrip;} redir_table[] = {
137 { 0, 0, "()" }, 137 { 0, 0, "()" },
138 { O_RDONLY, 0, "<" }, 138 { O_RDONLY, 0, "<" },
139 { O_CREAT|O_TRUNC|O_WRONLY, 1, ">" }, 139 { O_CREAT|O_TRUNC|O_WRONLY, 1, ">" },
@@ -244,9 +244,9 @@ struct variables {
244 244
245/* globals, connect us to the outside world 245/* globals, connect us to the outside world
246 * the first three support $?, $#, and $1 */ 246 * the first three support $?, $#, and $1 */
247char **global_argv; 247static char **global_argv;
248unsigned int global_argc; 248static unsigned int global_argc;
249unsigned int last_return_code; 249static unsigned int last_return_code;
250extern char **environ; /* This is in <unistd.h>, but protected with __USE_GNU */ 250extern char **environ; /* This is in <unistd.h>, but protected with __USE_GNU */
251 251
252/* "globals" within this file */ 252/* "globals" within this file */
@@ -262,8 +262,8 @@ static unsigned int last_jobid;
262static unsigned int shell_terminal; 262static unsigned int shell_terminal;
263static char *PS1; 263static char *PS1;
264static char *PS2; 264static char *PS2;
265struct variables shell_ver = { "HUSH_VERSION", "0.01", 1, 1, 0 }; 265static struct variables shell_ver = { "HUSH_VERSION", "0.01", 1, 1, 0 };
266struct variables *top_vars = &shell_ver; 266static struct variables *top_vars = &shell_ver;
267 267
268 268
269#define B_CHUNK (100) 269#define B_CHUNK (100)
@@ -831,7 +831,7 @@ static int b_addqchr(o_string *o, int ch, int quote)
831} 831}
832 832
833/* belongs in utility.c */ 833/* belongs in utility.c */
834char *simple_itoa(unsigned int i) 834static char *simple_itoa(unsigned int i)
835{ 835{
836 /* 21 digits plus null terminator, good for 64-bit or smaller ints */ 836 /* 21 digits plus null terminator, good for 64-bit or smaller ints */
837 static char local[22]; 837 static char local[22];
@@ -1295,7 +1295,8 @@ static int checkjobs(struct pipe* fg_pipe)
1295 * we belong to the foreground process group associated with 1295 * we belong to the foreground process group associated with
1296 * that tty. The value of shell_terminal is needed in order to call 1296 * that tty. The value of shell_terminal is needed in order to call
1297 * tcsetpgrp(shell_terminal, ...); */ 1297 * tcsetpgrp(shell_terminal, ...); */
1298void controlling_tty(int check_pgrp) 1298#if 0
1299static void controlling_tty(int check_pgrp)
1299{ 1300{
1300 pid_t curpgrp; 1301 pid_t curpgrp;
1301 1302
@@ -1313,6 +1314,7 @@ shell_terminal_error:
1313 shell_terminal = -1; 1314 shell_terminal = -1;
1314 return; 1315 return;
1315} 1316}
1317#endif
1316 1318
1317/* run_pipe_real() starts all the jobs, but doesn't wait for anything 1319/* run_pipe_real() starts all the jobs, but doesn't wait for anything
1318 * to finish. See checkjobs(). 1320 * to finish. See checkjobs().
@@ -1998,7 +2000,7 @@ static int setup_redirect(struct p_context *ctx, int fd, redir_type style,
1998 return 0; 2000 return 0;
1999} 2001}
2000 2002
2001struct pipe *new_pipe(void) { 2003static struct pipe *new_pipe(void) {
2002 struct pipe *pi; 2004 struct pipe *pi;
2003 pi = xmalloc(sizeof(struct pipe)); 2005 pi = xmalloc(sizeof(struct pipe));
2004 pi->num_progs = 0; 2006 pi->num_progs = 0;
@@ -2026,7 +2028,7 @@ static void initialize_context(struct p_context *ctx)
2026 * should handle if, then, elif, else, fi, for, while, until, do, done. 2028 * should handle if, then, elif, else, fi, for, while, until, do, done.
2027 * case, function, and select are obnoxious, save those for later. 2029 * case, function, and select are obnoxious, save those for later.
2028 */ 2030 */
2029int reserved_word(o_string *dest, struct p_context *ctx) 2031static int reserved_word(o_string *dest, struct p_context *ctx)
2030{ 2032{
2031 struct reserved_combo { 2033 struct reserved_combo {
2032 char *literal; 2034 char *literal;
@@ -2252,7 +2254,7 @@ static int redirect_opt_num(o_string *o)
2252 return num; 2254 return num;
2253} 2255}
2254 2256
2255FILE *generate_stream_from_list(struct pipe *head) 2257static FILE *generate_stream_from_list(struct pipe *head)
2256{ 2258{
2257 FILE *pf; 2259 FILE *pf;
2258#if 1 2260#if 1
@@ -2623,13 +2625,13 @@ int parse_stream(o_string *dest, struct p_context *ctx,
2623 return 0; 2625 return 0;
2624} 2626}
2625 2627
2626void mapset(const unsigned char *set, int code) 2628static void mapset(const unsigned char *set, int code)
2627{ 2629{
2628 const unsigned char *s; 2630 const unsigned char *s;
2629 for (s=set; *s; s++) map[*s] = code; 2631 for (s=set; *s; s++) map[*s] = code;
2630} 2632}
2631 2633
2632void update_ifs_map(void) 2634static void update_ifs_map(void)
2633{ 2635{
2634 /* char *ifs and char map[256] are both globals. */ 2636 /* char *ifs and char map[256] are both globals. */
2635 ifs = getenv("IFS"); 2637 ifs = getenv("IFS");