diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-03-09 21:24:12 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-03-09 21:24:12 +0000 |
commit | 3e6ff9017f5aa4ea41de2520a3f6d29fb20e0332 (patch) | |
tree | c9e6d3d695cbb2449132428a32fb6c309aad870f | |
parent | dd91724aa089e344d0f05e40a338dcce481c1845 (diff) | |
download | busybox-w32-3e6ff9017f5aa4ea41de2520a3f6d29fb20e0332.tar.gz busybox-w32-3e6ff9017f5aa4ea41de2520a3f6d29fb20e0332.tar.bz2 busybox-w32-3e6ff9017f5aa4ea41de2520a3f6d29fb20e0332.zip |
A cleanup patch from Jeff Garzik to static-ify a number of
namespace polluting things that really should be static.
48 files changed, 156 insertions, 158 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c index 0e4fd8efc..4e53652e4 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c | |||
@@ -79,9 +79,9 @@ static const char *statuswords[][10] = { | |||
79 | "post-inst-failed", "removal-failed", 0 } | 79 | "post-inst-failed", "removal-failed", 0 } |
80 | }; | 80 | }; |
81 | 81 | ||
82 | const int color_white = 0; | 82 | static const int color_white = 0; |
83 | const int color_grey = 1; | 83 | static const int color_grey = 1; |
84 | const int color_black = 2; | 84 | static const int color_black = 2; |
85 | 85 | ||
86 | /* data structures */ | 86 | /* data structures */ |
87 | typedef struct package_s { | 87 | typedef struct package_s { |
diff --git a/archival/tar.c b/archival/tar.c index a9363d5ad..38a8d9a04 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -150,7 +150,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv, | |||
150 | 150 | ||
151 | #ifdef BB_FEATURE_TAR_GZIP | 151 | #ifdef BB_FEATURE_TAR_GZIP |
152 | /* Signal handler for when child gzip process dies... */ | 152 | /* Signal handler for when child gzip process dies... */ |
153 | void child_died() | 153 | static void child_died() |
154 | { | 154 | { |
155 | fflush(stdout); | 155 | fflush(stdout); |
156 | fflush(stderr); | 156 | fflush(stderr); |
@@ -186,7 +186,7 @@ extern int tar_unzip_init(int tarFd) | |||
186 | #endif | 186 | #endif |
187 | 187 | ||
188 | #if defined BB_FEATURE_TAR_EXCLUDE | 188 | #if defined BB_FEATURE_TAR_EXCLUDE |
189 | struct option longopts[] = { | 189 | static struct option longopts[] = { |
190 | { "exclude", 1, NULL, 'e' }, | 190 | { "exclude", 1, NULL, 'e' }, |
191 | { NULL, 0, NULL, 0 } | 191 | { NULL, 0, NULL, 0 } |
192 | }; | 192 | }; |
@@ -574,7 +574,7 @@ readTarHeader(struct TarHeader *rawHeader, struct TarInfo *header) | |||
574 | return( FALSE); | 574 | return( FALSE); |
575 | } | 575 | } |
576 | 576 | ||
577 | int exclude_file(char **excluded_files, const char *file) | 577 | static int exclude_file(char **excluded_files, const char *file) |
578 | { | 578 | { |
579 | int i; | 579 | int i; |
580 | 580 | ||
@@ -601,7 +601,7 @@ int exclude_file(char **excluded_files, const char *file) | |||
601 | return 0; | 601 | return 0; |
602 | } | 602 | } |
603 | 603 | ||
604 | int extract_file(char **extract_files, const char *file) | 604 | static int extract_file(char **extract_files, const char *file) |
605 | { | 605 | { |
606 | int i; | 606 | int i; |
607 | 607 | ||
diff --git a/coreutils/date.c b/coreutils/date.c index 878331f71..4b2f66add 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
@@ -46,7 +46,7 @@ | |||
46 | 46 | ||
47 | /* Default input handling to save suprising some people */ | 47 | /* Default input handling to save suprising some people */ |
48 | 48 | ||
49 | struct tm *date_conv_time(struct tm *tm_time, const char *t_string) | 49 | static struct tm *date_conv_time(struct tm *tm_time, const char *t_string) |
50 | { | 50 | { |
51 | int nr; | 51 | int nr; |
52 | 52 | ||
@@ -73,7 +73,7 @@ struct tm *date_conv_time(struct tm *tm_time, const char *t_string) | |||
73 | 73 | ||
74 | /* The new stuff for LRP */ | 74 | /* The new stuff for LRP */ |
75 | 75 | ||
76 | struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string) | 76 | static struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string) |
77 | { | 77 | { |
78 | struct tm t; | 78 | struct tm t; |
79 | 79 | ||
diff --git a/coreutils/head.c b/coreutils/head.c index fac9ec659..0c8ef3d59 100644 --- a/coreutils/head.c +++ b/coreutils/head.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <string.h> | 29 | #include <string.h> |
30 | #include "busybox.h" | 30 | #include "busybox.h" |
31 | 31 | ||
32 | int head(int len, FILE *fp) | 32 | static int head(int len, FILE *fp) |
33 | { | 33 | { |
34 | int i; | 34 | int i; |
35 | char *input; | 35 | char *input; |
diff --git a/coreutils/ls.c b/coreutils/ls.c index a8d7b182f..77de93a0c 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -156,9 +156,9 @@ struct dnode { /* the basic node */ | |||
156 | }; | 156 | }; |
157 | typedef struct dnode dnode_t; | 157 | typedef struct dnode dnode_t; |
158 | 158 | ||
159 | struct dnode **list_dir(char *); | 159 | static struct dnode **list_dir(char *); |
160 | struct dnode **dnalloc(int); | 160 | static struct dnode **dnalloc(int); |
161 | int list_single(struct dnode *); | 161 | static int list_single(struct dnode *); |
162 | 162 | ||
163 | static unsigned int disp_opts; | 163 | static unsigned int disp_opts; |
164 | static unsigned int style_fmt; | 164 | static unsigned int style_fmt; |
@@ -186,7 +186,7 @@ static unsigned short column_width = COLUMN_WIDTH; | |||
186 | static int status = EXIT_SUCCESS; | 186 | static int status = EXIT_SUCCESS; |
187 | 187 | ||
188 | #ifdef BB_FEATURE_HUMAN_READABLE | 188 | #ifdef BB_FEATURE_HUMAN_READABLE |
189 | unsigned long ls_disp_hr = 0; | 189 | static unsigned long ls_disp_hr = 0; |
190 | #endif | 190 | #endif |
191 | 191 | ||
192 | static int my_stat(struct dnode *cur) | 192 | static int my_stat(struct dnode *cur) |
@@ -256,7 +256,7 @@ static int is_subdir(struct dnode *dn) | |||
256 | strcmp(dn->name, "..") != 0); | 256 | strcmp(dn->name, "..") != 0); |
257 | } | 257 | } |
258 | 258 | ||
259 | int countdirs(struct dnode **dn, int nfiles) | 259 | static int countdirs(struct dnode **dn, int nfiles) |
260 | { | 260 | { |
261 | int i, dirs; | 261 | int i, dirs; |
262 | 262 | ||
@@ -268,7 +268,7 @@ int countdirs(struct dnode **dn, int nfiles) | |||
268 | return(dirs); | 268 | return(dirs); |
269 | } | 269 | } |
270 | 270 | ||
271 | int countsubdirs(struct dnode **dn, int nfiles) | 271 | static int countsubdirs(struct dnode **dn, int nfiles) |
272 | { | 272 | { |
273 | int i, subdirs; | 273 | int i, subdirs; |
274 | 274 | ||
@@ -280,7 +280,7 @@ int countsubdirs(struct dnode **dn, int nfiles) | |||
280 | return subdirs; | 280 | return subdirs; |
281 | } | 281 | } |
282 | 282 | ||
283 | int countfiles(struct dnode **dnp) | 283 | static int countfiles(struct dnode **dnp) |
284 | { | 284 | { |
285 | int nfiles; | 285 | int nfiles; |
286 | struct dnode *cur; | 286 | struct dnode *cur; |
@@ -293,7 +293,7 @@ int countfiles(struct dnode **dnp) | |||
293 | } | 293 | } |
294 | 294 | ||
295 | /* get memory to hold an array of pointers */ | 295 | /* get memory to hold an array of pointers */ |
296 | struct dnode **dnalloc(int num) | 296 | static struct dnode **dnalloc(int num) |
297 | { | 297 | { |
298 | struct dnode **p; | 298 | struct dnode **p; |
299 | 299 | ||
@@ -303,7 +303,7 @@ struct dnode **dnalloc(int num) | |||
303 | return(p); | 303 | return(p); |
304 | } | 304 | } |
305 | 305 | ||
306 | void dfree(struct dnode **dnp) | 306 | static void dfree(struct dnode **dnp) |
307 | { | 307 | { |
308 | struct dnode *cur, *next; | 308 | struct dnode *cur, *next; |
309 | 309 | ||
@@ -319,7 +319,7 @@ void dfree(struct dnode **dnp) | |||
319 | free(dnp); /* free the array holding the dnode pointers */ | 319 | free(dnp); /* free the array holding the dnode pointers */ |
320 | } | 320 | } |
321 | 321 | ||
322 | struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which) | 322 | static struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which) |
323 | { | 323 | { |
324 | int dncnt, i, d; | 324 | int dncnt, i, d; |
325 | struct dnode **dnp; | 325 | struct dnode **dnp; |
@@ -359,7 +359,7 @@ struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which) | |||
359 | 359 | ||
360 | /*----------------------------------------------------------------------*/ | 360 | /*----------------------------------------------------------------------*/ |
361 | #ifdef BB_FEATURE_LS_SORTFILES | 361 | #ifdef BB_FEATURE_LS_SORTFILES |
362 | int sortcmp(struct dnode *d1, struct dnode *d2) | 362 | static int sortcmp(struct dnode *d1, struct dnode *d2) |
363 | { | 363 | { |
364 | int cmp, dif; | 364 | int cmp, dif; |
365 | 365 | ||
@@ -396,7 +396,7 @@ int sortcmp(struct dnode *d1, struct dnode *d2) | |||
396 | } | 396 | } |
397 | 397 | ||
398 | /*----------------------------------------------------------------------*/ | 398 | /*----------------------------------------------------------------------*/ |
399 | void shellsort(struct dnode **dn, int size) | 399 | static void shellsort(struct dnode **dn, int size) |
400 | { | 400 | { |
401 | struct dnode *temp; | 401 | struct dnode *temp; |
402 | int gap, i, j; | 402 | int gap, i, j; |
@@ -420,7 +420,7 @@ void shellsort(struct dnode **dn, int size) | |||
420 | #endif | 420 | #endif |
421 | 421 | ||
422 | /*----------------------------------------------------------------------*/ | 422 | /*----------------------------------------------------------------------*/ |
423 | void showfiles(struct dnode **dn, int nfiles) | 423 | static void showfiles(struct dnode **dn, int nfiles) |
424 | { | 424 | { |
425 | int i, ncols, nrows, row, nc; | 425 | int i, ncols, nrows, row, nc; |
426 | #ifdef BB_FEATURE_AUTOWIDTH | 426 | #ifdef BB_FEATURE_AUTOWIDTH |
@@ -481,7 +481,7 @@ void showfiles(struct dnode **dn, int nfiles) | |||
481 | } | 481 | } |
482 | 482 | ||
483 | /*----------------------------------------------------------------------*/ | 483 | /*----------------------------------------------------------------------*/ |
484 | void showdirs(struct dnode **dn, int ndirs) | 484 | static void showdirs(struct dnode **dn, int ndirs) |
485 | { | 485 | { |
486 | int i, nfiles; | 486 | int i, nfiles; |
487 | struct dnode **subdnp; | 487 | struct dnode **subdnp; |
@@ -524,7 +524,7 @@ void showdirs(struct dnode **dn, int ndirs) | |||
524 | } | 524 | } |
525 | 525 | ||
526 | /*----------------------------------------------------------------------*/ | 526 | /*----------------------------------------------------------------------*/ |
527 | struct dnode **list_dir(char *path) | 527 | static struct dnode **list_dir(char *path) |
528 | { | 528 | { |
529 | struct dnode *dn, *cur, **dnp; | 529 | struct dnode *dn, *cur, **dnp; |
530 | struct dirent *entry; | 530 | struct dirent *entry; |
@@ -575,7 +575,7 @@ struct dnode **list_dir(char *path) | |||
575 | } | 575 | } |
576 | 576 | ||
577 | /*----------------------------------------------------------------------*/ | 577 | /*----------------------------------------------------------------------*/ |
578 | int list_single(struct dnode *dn) | 578 | static int list_single(struct dnode *dn) |
579 | { | 579 | { |
580 | int i, len; | 580 | int i, len; |
581 | char scratch[BUFSIZ + 1]; | 581 | char scratch[BUFSIZ + 1]; |
diff --git a/coreutils/sort.c b/coreutils/sort.c index 79e629c75..9707efa51 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c | |||
@@ -26,12 +26,12 @@ | |||
26 | #include <stdlib.h> | 26 | #include <stdlib.h> |
27 | #include "busybox.h" | 27 | #include "busybox.h" |
28 | 28 | ||
29 | int compare_ascii(const void *x, const void *y) | 29 | static int compare_ascii(const void *x, const void *y) |
30 | { | 30 | { |
31 | return strcmp(*(char **)x, *(char **)y); | 31 | return strcmp(*(char **)x, *(char **)y); |
32 | } | 32 | } |
33 | 33 | ||
34 | int compare_numeric(const void *x, const void *y) | 34 | static int compare_numeric(const void *x, const void *y) |
35 | { | 35 | { |
36 | return atoi(*(char **)x) - atoi(*(char **)y); | 36 | return atoi(*(char **)x) - atoi(*(char **)y); |
37 | } | 37 | } |
diff --git a/coreutils/tail.c b/coreutils/tail.c index a85256c80..ff77bde77 100644 --- a/coreutils/tail.c +++ b/coreutils/tail.c | |||
@@ -44,14 +44,14 @@ static char *tailbuf; | |||
44 | static int taillen; | 44 | static int taillen; |
45 | static int newline; | 45 | static int newline; |
46 | 46 | ||
47 | void tailbuf_append(char *buf, int len) | 47 | static void tailbuf_append(char *buf, int len) |
48 | { | 48 | { |
49 | tailbuf = xrealloc(tailbuf, taillen + len); | 49 | tailbuf = xrealloc(tailbuf, taillen + len); |
50 | memcpy(tailbuf + taillen, buf, len); | 50 | memcpy(tailbuf + taillen, buf, len); |
51 | taillen += len; | 51 | taillen += len; |
52 | } | 52 | } |
53 | 53 | ||
54 | void tailbuf_trunc() | 54 | static void tailbuf_trunc() |
55 | { | 55 | { |
56 | char *s; | 56 | char *s; |
57 | s = memchr(tailbuf, '\n', taillen); | 57 | s = memchr(tailbuf, '\n', taillen); |
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c index 41541defb..35a533309 100644 --- a/coreutils/uuencode.c +++ b/coreutils/uuencode.c | |||
@@ -34,11 +34,11 @@ | |||
34 | static void encode __P ((void)); | 34 | static void encode __P ((void)); |
35 | 35 | ||
36 | /* Pointer to the translation table we currently use. */ | 36 | /* Pointer to the translation table we currently use. */ |
37 | const char *trans_ptr; | 37 | static const char *trans_ptr; |
38 | 38 | ||
39 | /* The two currently defined translation tables. The first is the | 39 | /* The two currently defined translation tables. The first is the |
40 | standard uuencoding, the second is base64 encoding. */ | 40 | standard uuencoding, the second is base64 encoding. */ |
41 | const char uu_std[64] = { | 41 | static const char uu_std[64] = { |
42 | '`', '!', '"', '#', '$', '%', '&', '\'', | 42 | '`', '!', '"', '#', '$', '%', '&', '\'', |
43 | '(', ')', '*', '+', ',', '-', '.', '/', | 43 | '(', ')', '*', '+', ',', '-', '.', '/', |
44 | '0', '1', '2', '3', '4', '5', '6', '7', | 44 | '0', '1', '2', '3', '4', '5', '6', '7', |
@@ -49,7 +49,7 @@ const char uu_std[64] = { | |||
49 | 'X', 'Y', 'Z', '[', '\\', ']', '^', '_' | 49 | 'X', 'Y', 'Z', '[', '\\', ']', '^', '_' |
50 | }; | 50 | }; |
51 | 51 | ||
52 | const char uu_base64[64] = { | 52 | static const char uu_base64[64] = { |
53 | 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', | 53 | 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', |
54 | 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', | 54 | 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', |
55 | 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', | 55 | 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', |
diff --git a/coreutils/wc.c b/coreutils/wc.c index 5472c3070..695e7e7d4 100644 --- a/coreutils/wc.c +++ b/coreutils/wc.c | |||
@@ -29,8 +29,8 @@ | |||
29 | static int total_lines, total_words, total_chars, max_length; | 29 | static int total_lines, total_words, total_chars, max_length; |
30 | static int print_lines, print_words, print_chars, print_length; | 30 | static int print_lines, print_words, print_chars, print_length; |
31 | 31 | ||
32 | void print_counts(int lines, int words, int chars, int length, | 32 | static void print_counts(int lines, int words, int chars, int length, |
33 | const char *name) | 33 | const char *name) |
34 | { | 34 | { |
35 | char const *space = ""; | 35 | char const *space = ""; |
36 | 36 | ||
@@ -46,7 +46,7 @@ | |||
46 | 46 | ||
47 | /* Default input handling to save suprising some people */ | 47 | /* Default input handling to save suprising some people */ |
48 | 48 | ||
49 | struct tm *date_conv_time(struct tm *tm_time, const char *t_string) | 49 | static struct tm *date_conv_time(struct tm *tm_time, const char *t_string) |
50 | { | 50 | { |
51 | int nr; | 51 | int nr; |
52 | 52 | ||
@@ -73,7 +73,7 @@ struct tm *date_conv_time(struct tm *tm_time, const char *t_string) | |||
73 | 73 | ||
74 | /* The new stuff for LRP */ | 74 | /* The new stuff for LRP */ |
75 | 75 | ||
76 | struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string) | 76 | static struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string) |
77 | { | 77 | { |
78 | struct tm t; | 78 | struct tm t; |
79 | 79 | ||
@@ -79,9 +79,9 @@ static const char *statuswords[][10] = { | |||
79 | "post-inst-failed", "removal-failed", 0 } | 79 | "post-inst-failed", "removal-failed", 0 } |
80 | }; | 80 | }; |
81 | 81 | ||
82 | const int color_white = 0; | 82 | static const int color_white = 0; |
83 | const int color_grey = 1; | 83 | static const int color_grey = 1; |
84 | const int color_black = 2; | 84 | static const int color_black = 2; |
85 | 85 | ||
86 | /* data structures */ | 86 | /* data structures */ |
87 | typedef struct package_s { | 87 | typedef struct package_s { |
@@ -132,7 +132,7 @@ struct fb_var_screeninfo { | |||
132 | }; | 132 | }; |
133 | 133 | ||
134 | 134 | ||
135 | struct cmdoptions_t { | 135 | static struct cmdoptions_t { |
136 | char *name; | 136 | char *name; |
137 | unsigned char param_count; | 137 | unsigned char param_count; |
138 | unsigned char code; | 138 | unsigned char code; |
diff --git a/fsck_minix.c b/fsck_minix.c index 9a53a705e..bd0c8a61c 100644 --- a/fsck_minix.c +++ b/fsck_minix.c | |||
@@ -701,7 +701,7 @@ static void read_tables(void) | |||
701 | } | 701 | } |
702 | } | 702 | } |
703 | 703 | ||
704 | struct minix_inode *get_inode(unsigned int nr) | 704 | static struct minix_inode *get_inode(unsigned int nr) |
705 | { | 705 | { |
706 | struct minix_inode *inode; | 706 | struct minix_inode *inode; |
707 | 707 | ||
@@ -749,7 +749,7 @@ struct minix_inode *get_inode(unsigned int nr) | |||
749 | } | 749 | } |
750 | 750 | ||
751 | #ifdef BB_FEATURE_MINIX2 | 751 | #ifdef BB_FEATURE_MINIX2 |
752 | struct minix2_inode *get_inode2(unsigned int nr) | 752 | static struct minix2_inode *get_inode2(unsigned int nr) |
753 | { | 753 | { |
754 | struct minix2_inode *inode; | 754 | struct minix2_inode *inode; |
755 | 755 | ||
@@ -62,20 +62,19 @@ typedef enum {BASH,TCSH} shell_t; | |||
62 | 62 | ||
63 | 63 | ||
64 | /* Some global variables that tells us how to parse. */ | 64 | /* Some global variables that tells us how to parse. */ |
65 | shell_t shell=BASH; /* The shell we generate output for. */ | 65 | static shell_t shell=BASH; /* The shell we generate output for. */ |
66 | int quiet_errors=0; /* 0 is not quiet. */ | 66 | static int quiet_errors=0; /* 0 is not quiet. */ |
67 | int quiet_output=0; /* 0 is not quiet. */ | 67 | static int quiet_output=0; /* 0 is not quiet. */ |
68 | int quote=1; /* 1 is do quote. */ | 68 | static int quote=1; /* 1 is do quote. */ |
69 | int alternative=0; /* 0 is getopt_long, 1 is getopt_long_only */ | 69 | static int alternative=0; /* 0 is getopt_long, 1 is getopt_long_only */ |
70 | 70 | ||
71 | /* Function prototypes */ | 71 | /* Function prototypes */ |
72 | const char *normalize(const char *arg); | 72 | static const char *normalize(const char *arg); |
73 | int generate_output(char * argv[],int argc,const char *optstr, | 73 | static int generate_output(char * argv[],int argc,const char *optstr, |
74 | const struct option *longopts); | 74 | const struct option *longopts); |
75 | void add_long_options(char *options); | 75 | static void add_long_options(char *options); |
76 | void add_longopt(const char *name,int has_arg); | 76 | static void add_longopt(const char *name,int has_arg); |
77 | void set_shell(const char *new_shell); | 77 | static void set_shell(const char *new_shell); |
78 | void set_initial_shell(void); | ||
79 | 78 | ||
80 | 79 | ||
81 | /* | 80 | /* |
@@ -29,7 +29,7 @@ | |||
29 | #include <string.h> | 29 | #include <string.h> |
30 | #include "busybox.h" | 30 | #include "busybox.h" |
31 | 31 | ||
32 | int head(int len, FILE *fp) | 32 | static int head(int len, FILE *fp) |
33 | { | 33 | { |
34 | int i; | 34 | int i; |
35 | char *input; | 35 | char *input; |
diff --git a/hostname.c b/hostname.c index 8ea8fe107..a6e001d54 100644 --- a/hostname.c +++ b/hostname.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: hostname.c,v 1.25 2001/03/09 14:36:42 andersen Exp $ | 3 | * $Id: hostname.c,v 1.26 2001/03/09 21:24:12 andersen Exp $ |
4 | * Mini hostname implementation for busybox | 4 | * Mini hostname implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -32,7 +32,7 @@ | |||
32 | #include <stdio.h> | 32 | #include <stdio.h> |
33 | #include <stdlib.h> | 33 | #include <stdlib.h> |
34 | 34 | ||
35 | void do_sethostname(char *s, int isfile) | 35 | static void do_sethostname(char *s, int isfile) |
36 | { | 36 | { |
37 | FILE *f; | 37 | FILE *f; |
38 | char buf[255]; | 38 | char buf[255]; |
@@ -174,7 +174,7 @@ struct initActionTag { | |||
174 | initAction *nextPtr; | 174 | initAction *nextPtr; |
175 | initActionEnum action; | 175 | initActionEnum action; |
176 | }; | 176 | }; |
177 | initAction *initActionList = NULL; | 177 | static initAction *initActionList = NULL; |
178 | 178 | ||
179 | 179 | ||
180 | static char *secondConsole = VT_SECONDARY; | 180 | static char *secondConsole = VT_SECONDARY; |
@@ -255,7 +255,7 @@ static void message(int device, char *fmt, ...) | |||
255 | } | 255 | } |
256 | 256 | ||
257 | /* Set terminal settings to reasonable defaults */ | 257 | /* Set terminal settings to reasonable defaults */ |
258 | void set_term(int fd) | 258 | static void set_term(int fd) |
259 | { | 259 | { |
260 | struct termios tty; | 260 | struct termios tty; |
261 | 261 | ||
@@ -670,7 +670,7 @@ static void reboot_signal(int sig) | |||
670 | 670 | ||
671 | #endif /* ! DEBUG_INIT */ | 671 | #endif /* ! DEBUG_INIT */ |
672 | 672 | ||
673 | void new_initAction(initActionEnum action, char *process, char *cons) | 673 | static void new_initAction(initActionEnum action, char *process, char *cons) |
674 | { | 674 | { |
675 | initAction *newAction; | 675 | initAction *newAction; |
676 | 676 | ||
@@ -725,7 +725,7 @@ static void delete_initAction(initAction * action) | |||
725 | * _is_ defined, but /etc/inittab is missing, this | 725 | * _is_ defined, but /etc/inittab is missing, this |
726 | * results in the same set of default behaviors. | 726 | * results in the same set of default behaviors. |
727 | * */ | 727 | * */ |
728 | void parse_inittab(void) | 728 | static void parse_inittab(void) |
729 | { | 729 | { |
730 | #ifdef BB_FEATURE_USE_INITTAB | 730 | #ifdef BB_FEATURE_USE_INITTAB |
731 | FILE *file; | 731 | FILE *file; |
diff --git a/init/init.c b/init/init.c index 52ee6777a..a0f15b0ff 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -174,7 +174,7 @@ struct initActionTag { | |||
174 | initAction *nextPtr; | 174 | initAction *nextPtr; |
175 | initActionEnum action; | 175 | initActionEnum action; |
176 | }; | 176 | }; |
177 | initAction *initActionList = NULL; | 177 | static initAction *initActionList = NULL; |
178 | 178 | ||
179 | 179 | ||
180 | static char *secondConsole = VT_SECONDARY; | 180 | static char *secondConsole = VT_SECONDARY; |
@@ -255,7 +255,7 @@ static void message(int device, char *fmt, ...) | |||
255 | } | 255 | } |
256 | 256 | ||
257 | /* Set terminal settings to reasonable defaults */ | 257 | /* Set terminal settings to reasonable defaults */ |
258 | void set_term(int fd) | 258 | static void set_term(int fd) |
259 | { | 259 | { |
260 | struct termios tty; | 260 | struct termios tty; |
261 | 261 | ||
@@ -670,7 +670,7 @@ static void reboot_signal(int sig) | |||
670 | 670 | ||
671 | #endif /* ! DEBUG_INIT */ | 671 | #endif /* ! DEBUG_INIT */ |
672 | 672 | ||
673 | void new_initAction(initActionEnum action, char *process, char *cons) | 673 | static void new_initAction(initActionEnum action, char *process, char *cons) |
674 | { | 674 | { |
675 | initAction *newAction; | 675 | initAction *newAction; |
676 | 676 | ||
@@ -725,7 +725,7 @@ static void delete_initAction(initAction * action) | |||
725 | * _is_ defined, but /etc/inittab is missing, this | 725 | * _is_ defined, but /etc/inittab is missing, this |
726 | * results in the same set of default behaviors. | 726 | * results in the same set of default behaviors. |
727 | * */ | 727 | * */ |
728 | void parse_inittab(void) | 728 | static void parse_inittab(void) |
729 | { | 729 | { |
730 | #ifdef BB_FEATURE_USE_INITTAB | 730 | #ifdef BB_FEATURE_USE_INITTAB |
731 | FILE *file; | 731 | FILE *file; |
@@ -39,7 +39,7 @@ struct signal_name { | |||
39 | int number; | 39 | int number; |
40 | }; | 40 | }; |
41 | 41 | ||
42 | const struct signal_name signames[] = { | 42 | static const struct signal_name signames[] = { |
43 | /* POSIX signals */ | 43 | /* POSIX signals */ |
44 | { "HUP", SIGHUP }, /* 1 */ | 44 | { "HUP", SIGHUP }, /* 1 */ |
45 | { "INT", SIGINT }, /* 2 */ | 45 | { "INT", SIGINT }, /* 2 */ |
@@ -156,9 +156,9 @@ struct dnode { /* the basic node */ | |||
156 | }; | 156 | }; |
157 | typedef struct dnode dnode_t; | 157 | typedef struct dnode dnode_t; |
158 | 158 | ||
159 | struct dnode **list_dir(char *); | 159 | static struct dnode **list_dir(char *); |
160 | struct dnode **dnalloc(int); | 160 | static struct dnode **dnalloc(int); |
161 | int list_single(struct dnode *); | 161 | static int list_single(struct dnode *); |
162 | 162 | ||
163 | static unsigned int disp_opts; | 163 | static unsigned int disp_opts; |
164 | static unsigned int style_fmt; | 164 | static unsigned int style_fmt; |
@@ -186,7 +186,7 @@ static unsigned short column_width = COLUMN_WIDTH; | |||
186 | static int status = EXIT_SUCCESS; | 186 | static int status = EXIT_SUCCESS; |
187 | 187 | ||
188 | #ifdef BB_FEATURE_HUMAN_READABLE | 188 | #ifdef BB_FEATURE_HUMAN_READABLE |
189 | unsigned long ls_disp_hr = 0; | 189 | static unsigned long ls_disp_hr = 0; |
190 | #endif | 190 | #endif |
191 | 191 | ||
192 | static int my_stat(struct dnode *cur) | 192 | static int my_stat(struct dnode *cur) |
@@ -256,7 +256,7 @@ static int is_subdir(struct dnode *dn) | |||
256 | strcmp(dn->name, "..") != 0); | 256 | strcmp(dn->name, "..") != 0); |
257 | } | 257 | } |
258 | 258 | ||
259 | int countdirs(struct dnode **dn, int nfiles) | 259 | static int countdirs(struct dnode **dn, int nfiles) |
260 | { | 260 | { |
261 | int i, dirs; | 261 | int i, dirs; |
262 | 262 | ||
@@ -268,7 +268,7 @@ int countdirs(struct dnode **dn, int nfiles) | |||
268 | return(dirs); | 268 | return(dirs); |
269 | } | 269 | } |
270 | 270 | ||
271 | int countsubdirs(struct dnode **dn, int nfiles) | 271 | static int countsubdirs(struct dnode **dn, int nfiles) |
272 | { | 272 | { |
273 | int i, subdirs; | 273 | int i, subdirs; |
274 | 274 | ||
@@ -280,7 +280,7 @@ int countsubdirs(struct dnode **dn, int nfiles) | |||
280 | return subdirs; | 280 | return subdirs; |
281 | } | 281 | } |
282 | 282 | ||
283 | int countfiles(struct dnode **dnp) | 283 | static int countfiles(struct dnode **dnp) |
284 | { | 284 | { |
285 | int nfiles; | 285 | int nfiles; |
286 | struct dnode *cur; | 286 | struct dnode *cur; |
@@ -293,7 +293,7 @@ int countfiles(struct dnode **dnp) | |||
293 | } | 293 | } |
294 | 294 | ||
295 | /* get memory to hold an array of pointers */ | 295 | /* get memory to hold an array of pointers */ |
296 | struct dnode **dnalloc(int num) | 296 | static struct dnode **dnalloc(int num) |
297 | { | 297 | { |
298 | struct dnode **p; | 298 | struct dnode **p; |
299 | 299 | ||
@@ -303,7 +303,7 @@ struct dnode **dnalloc(int num) | |||
303 | return(p); | 303 | return(p); |
304 | } | 304 | } |
305 | 305 | ||
306 | void dfree(struct dnode **dnp) | 306 | static void dfree(struct dnode **dnp) |
307 | { | 307 | { |
308 | struct dnode *cur, *next; | 308 | struct dnode *cur, *next; |
309 | 309 | ||
@@ -319,7 +319,7 @@ void dfree(struct dnode **dnp) | |||
319 | free(dnp); /* free the array holding the dnode pointers */ | 319 | free(dnp); /* free the array holding the dnode pointers */ |
320 | } | 320 | } |
321 | 321 | ||
322 | struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which) | 322 | static struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which) |
323 | { | 323 | { |
324 | int dncnt, i, d; | 324 | int dncnt, i, d; |
325 | struct dnode **dnp; | 325 | struct dnode **dnp; |
@@ -359,7 +359,7 @@ struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which) | |||
359 | 359 | ||
360 | /*----------------------------------------------------------------------*/ | 360 | /*----------------------------------------------------------------------*/ |
361 | #ifdef BB_FEATURE_LS_SORTFILES | 361 | #ifdef BB_FEATURE_LS_SORTFILES |
362 | int sortcmp(struct dnode *d1, struct dnode *d2) | 362 | static int sortcmp(struct dnode *d1, struct dnode *d2) |
363 | { | 363 | { |
364 | int cmp, dif; | 364 | int cmp, dif; |
365 | 365 | ||
@@ -396,7 +396,7 @@ int sortcmp(struct dnode *d1, struct dnode *d2) | |||
396 | } | 396 | } |
397 | 397 | ||
398 | /*----------------------------------------------------------------------*/ | 398 | /*----------------------------------------------------------------------*/ |
399 | void shellsort(struct dnode **dn, int size) | 399 | static void shellsort(struct dnode **dn, int size) |
400 | { | 400 | { |
401 | struct dnode *temp; | 401 | struct dnode *temp; |
402 | int gap, i, j; | 402 | int gap, i, j; |
@@ -420,7 +420,7 @@ void shellsort(struct dnode **dn, int size) | |||
420 | #endif | 420 | #endif |
421 | 421 | ||
422 | /*----------------------------------------------------------------------*/ | 422 | /*----------------------------------------------------------------------*/ |
423 | void showfiles(struct dnode **dn, int nfiles) | 423 | static void showfiles(struct dnode **dn, int nfiles) |
424 | { | 424 | { |
425 | int i, ncols, nrows, row, nc; | 425 | int i, ncols, nrows, row, nc; |
426 | #ifdef BB_FEATURE_AUTOWIDTH | 426 | #ifdef BB_FEATURE_AUTOWIDTH |
@@ -481,7 +481,7 @@ void showfiles(struct dnode **dn, int nfiles) | |||
481 | } | 481 | } |
482 | 482 | ||
483 | /*----------------------------------------------------------------------*/ | 483 | /*----------------------------------------------------------------------*/ |
484 | void showdirs(struct dnode **dn, int ndirs) | 484 | static void showdirs(struct dnode **dn, int ndirs) |
485 | { | 485 | { |
486 | int i, nfiles; | 486 | int i, nfiles; |
487 | struct dnode **subdnp; | 487 | struct dnode **subdnp; |
@@ -524,7 +524,7 @@ void showdirs(struct dnode **dn, int ndirs) | |||
524 | } | 524 | } |
525 | 525 | ||
526 | /*----------------------------------------------------------------------*/ | 526 | /*----------------------------------------------------------------------*/ |
527 | struct dnode **list_dir(char *path) | 527 | static struct dnode **list_dir(char *path) |
528 | { | 528 | { |
529 | struct dnode *dn, *cur, **dnp; | 529 | struct dnode *dn, *cur, **dnp; |
530 | struct dirent *entry; | 530 | struct dirent *entry; |
@@ -575,7 +575,7 @@ struct dnode **list_dir(char *path) | |||
575 | } | 575 | } |
576 | 576 | ||
577 | /*----------------------------------------------------------------------*/ | 577 | /*----------------------------------------------------------------------*/ |
578 | int list_single(struct dnode *dn) | 578 | static int list_single(struct dnode *dn) |
579 | { | 579 | { |
580 | int i, len; | 580 | int i, len; |
581 | char scratch[BUFSIZ + 1]; | 581 | char scratch[BUFSIZ + 1]; |
diff --git a/mkfs_minix.c b/mkfs_minix.c index 928a49674..a83fa7961 100644 --- a/mkfs_minix.c +++ b/mkfs_minix.c | |||
@@ -609,7 +609,7 @@ static void setup_tables(void) | |||
609 | * Perform a test of a block; return the number of | 609 | * Perform a test of a block; return the number of |
610 | * blocks readable/writeable. | 610 | * blocks readable/writeable. |
611 | */ | 611 | */ |
612 | long do_check(char *buffer, int try, unsigned int current_block) | 612 | static long do_check(char *buffer, int try, unsigned int current_block) |
613 | { | 613 | { |
614 | long got; | 614 | long got; |
615 | 615 | ||
@@ -72,7 +72,7 @@ static int version = -1; | |||
72 | static int pagesize; | 72 | static int pagesize; |
73 | static int *signature_page; | 73 | static int *signature_page; |
74 | 74 | ||
75 | struct swap_header_v1 { | 75 | static struct swap_header_v1 { |
76 | char bootbits[1024]; /* Space for disklabel etc. */ | 76 | char bootbits[1024]; /* Space for disklabel etc. */ |
77 | unsigned int version; | 77 | unsigned int version; |
78 | unsigned int last_page; | 78 | unsigned int last_page; |
@@ -231,7 +231,7 @@ parse_mount_options(char *options, int *flags, char *strflags) | |||
231 | } | 231 | } |
232 | } | 232 | } |
233 | 233 | ||
234 | int | 234 | static int |
235 | mount_one(char *blockDevice, char *directory, char *filesystemType, | 235 | mount_one(char *blockDevice, char *directory, char *filesystemType, |
236 | unsigned long flags, char *string_flags, int useMtab, int fakeIt, | 236 | unsigned long flags, char *string_flags, int useMtab, int fakeIt, |
237 | char *mtab_opts, int whineOnErrors) | 237 | char *mtab_opts, int whineOnErrors) |
diff --git a/networking/hostname.c b/networking/hostname.c index 8ea8fe107..a6e001d54 100644 --- a/networking/hostname.c +++ b/networking/hostname.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: hostname.c,v 1.25 2001/03/09 14:36:42 andersen Exp $ | 3 | * $Id: hostname.c,v 1.26 2001/03/09 21:24:12 andersen Exp $ |
4 | * Mini hostname implementation for busybox | 4 | * Mini hostname implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -32,7 +32,7 @@ | |||
32 | #include <stdio.h> | 32 | #include <stdio.h> |
33 | #include <stdlib.h> | 33 | #include <stdlib.h> |
34 | 34 | ||
35 | void do_sethostname(char *s, int isfile) | 35 | static void do_sethostname(char *s, int isfile) |
36 | { | 36 | { |
37 | FILE *f; | 37 | FILE *f; |
38 | char buf[255]; | 38 | char buf[255]; |
diff --git a/networking/route.c b/networking/route.c index b1152ca9d..337b35825 100644 --- a/networking/route.c +++ b/networking/route.c | |||
@@ -15,7 +15,7 @@ | |||
15 | * Foundation; either version 2 of the License, or (at | 15 | * Foundation; either version 2 of the License, or (at |
16 | * your option) any later version. | 16 | * your option) any later version. |
17 | * | 17 | * |
18 | * $Id: route.c,v 1.8 2001/03/07 06:33:01 andersen Exp $ | 18 | * $Id: route.c,v 1.9 2001/03/09 21:24:12 andersen Exp $ |
19 | * | 19 | * |
20 | * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru> | 20 | * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru> |
21 | * adjustments by Larry Doolittle <LRDoolittle@lbl.gov> | 21 | * adjustments by Larry Doolittle <LRDoolittle@lbl.gov> |
@@ -346,7 +346,7 @@ INET_setroute(int action, int options, char **args) | |||
346 | return EXIT_SUCCESS; | 346 | return EXIT_SUCCESS; |
347 | } | 347 | } |
348 | 348 | ||
349 | void displayroutes(void) | 349 | static void displayroutes(void) |
350 | { | 350 | { |
351 | char buff[256]; | 351 | char buff[256]; |
352 | int nl = 0 ; | 352 | int nl = 0 ; |
diff --git a/networking/telnet.c b/networking/telnet.c index fd1ace41d..758cce8b1 100644 --- a/networking/telnet.c +++ b/networking/telnet.c | |||
@@ -325,7 +325,7 @@ static void putiac1(byte c) | |||
325 | 325 | ||
326 | /* ******************************* */ | 326 | /* ******************************* */ |
327 | 327 | ||
328 | char const escapecharis[] = "\r\nEscape character is "; | 328 | static char const escapecharis[] = "\r\nEscape character is "; |
329 | 329 | ||
330 | static void setConMode() | 330 | static void setConMode() |
331 | { | 331 | { |
diff --git a/networking/wget.c b/networking/wget.c index 4b8392ba5..85023f977 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -47,22 +47,22 @@ | |||
47 | } while (0) | 47 | } while (0) |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path); | 50 | static void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path); |
51 | FILE *open_socket(char *host, int port); | 51 | static FILE *open_socket(char *host, int port); |
52 | char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc); | 52 | static char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc); |
53 | void progressmeter(int flag); | 53 | static void progressmeter(int flag); |
54 | 54 | ||
55 | /* Globals (can be accessed from signal handlers */ | 55 | /* Globals (can be accessed from signal handlers */ |
56 | static off_t filesize = 0; /* content-length of the file */ | 56 | static off_t filesize = 0; /* content-length of the file */ |
57 | #ifdef BB_FEATURE_WGET_STATUSBAR | 57 | #ifdef BB_FEATURE_WGET_STATUSBAR |
58 | static char *curfile; /* Name of current file being transferred. */ | 58 | static char *curfile; /* Name of current file being transferred. */ |
59 | static struct timeval start; /* Time a transfer started. */ | 59 | static struct timeval start; /* Time a transfer started. */ |
60 | volatile unsigned long statbytes; /* Number of bytes transferred so far. */ | 60 | static volatile unsigned long statbytes; /* Number of bytes transferred so far. */ |
61 | /* For progressmeter() -- number of seconds before xfer considered "stalled" */ | 61 | /* For progressmeter() -- number of seconds before xfer considered "stalled" */ |
62 | static const int STALLTIME = 5; | 62 | static const int STALLTIME = 5; |
63 | #endif | 63 | #endif |
64 | 64 | ||
65 | void close_and_delete_outfile(FILE* output, char *fname_out, int do_continue) | 65 | static void close_and_delete_outfile(FILE* output, char *fname_out, int do_continue) |
66 | { | 66 | { |
67 | if (output != stdout && do_continue==0) { | 67 | if (output != stdout && do_continue==0) { |
68 | fclose(output); | 68 | fclose(output); |
@@ -371,7 +371,7 @@ char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc) | |||
371 | */ | 371 | */ |
372 | 372 | ||
373 | 373 | ||
374 | int | 374 | static int |
375 | getttywidth(void) | 375 | getttywidth(void) |
376 | { | 376 | { |
377 | struct winsize winsize; | 377 | struct winsize winsize; |
@@ -382,7 +382,7 @@ getttywidth(void) | |||
382 | return (80); | 382 | return (80); |
383 | } | 383 | } |
384 | 384 | ||
385 | void | 385 | static void |
386 | updateprogressmeter(int ignore) | 386 | updateprogressmeter(int ignore) |
387 | { | 387 | { |
388 | int save_errno = errno; | 388 | int save_errno = errno; |
@@ -391,7 +391,7 @@ updateprogressmeter(int ignore) | |||
391 | errno = save_errno; | 391 | errno = save_errno; |
392 | } | 392 | } |
393 | 393 | ||
394 | void | 394 | static void |
395 | alarmtimer(int wait) | 395 | alarmtimer(int wait) |
396 | { | 396 | { |
397 | struct itimerval itv; | 397 | struct itimerval itv; |
@@ -403,7 +403,7 @@ alarmtimer(int wait) | |||
403 | } | 403 | } |
404 | 404 | ||
405 | 405 | ||
406 | void | 406 | static void |
407 | progressmeter(int flag) | 407 | progressmeter(int flag) |
408 | { | 408 | { |
409 | static const char prefixes[] = " KMGTP"; | 409 | static const char prefixes[] = " KMGTP"; |
@@ -534,7 +534,7 @@ progressmeter(int flag) | |||
534 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 534 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
535 | * SUCH DAMAGE. | 535 | * SUCH DAMAGE. |
536 | * | 536 | * |
537 | * $Id: wget.c,v 1.28 2001/02/20 06:14:08 andersen Exp $ | 537 | * $Id: wget.c,v 1.29 2001/03/09 21:24:12 andersen Exp $ |
538 | */ | 538 | */ |
539 | 539 | ||
540 | 540 | ||
diff --git a/nfsmount.c b/nfsmount.c index aee496980..cd815102c 100644 --- a/nfsmount.c +++ b/nfsmount.c | |||
@@ -886,7 +886,7 @@ static char *nfs_strerror(int stat) | |||
886 | return buf; | 886 | return buf; |
887 | } | 887 | } |
888 | 888 | ||
889 | bool_t | 889 | static bool_t |
890 | xdr_fhandle (XDR *xdrs, fhandle objp) | 890 | xdr_fhandle (XDR *xdrs, fhandle objp) |
891 | { | 891 | { |
892 | //register int32_t *buf; | 892 | //register int32_t *buf; |
diff --git a/procps/kill.c b/procps/kill.c index e62503b3c..fb3d72213 100644 --- a/procps/kill.c +++ b/procps/kill.c | |||
@@ -39,7 +39,7 @@ struct signal_name { | |||
39 | int number; | 39 | int number; |
40 | }; | 40 | }; |
41 | 41 | ||
42 | const struct signal_name signames[] = { | 42 | static const struct signal_name signames[] = { |
43 | /* POSIX signals */ | 43 | /* POSIX signals */ |
44 | { "HUP", SIGHUP }, /* 1 */ | 44 | { "HUP", SIGHUP }, /* 1 */ |
45 | { "INT", SIGINT }, /* 2 */ | 45 | { "INT", SIGINT }, /* 2 */ |
@@ -39,10 +39,10 @@ | |||
39 | 39 | ||
40 | static const int RFC_868_BIAS = 2208988800UL; | 40 | static const int RFC_868_BIAS = 2208988800UL; |
41 | 41 | ||
42 | int setdate= 0; | 42 | static int setdate= 0; |
43 | int printdate= 0; | 43 | static int printdate= 0; |
44 | 44 | ||
45 | time_t askremotedate(char *host) | 45 | static time_t askremotedate(char *host) |
46 | { | 46 | { |
47 | struct hostent *h; | 47 | struct hostent *h; |
48 | struct sockaddr_in sin; | 48 | struct sockaddr_in sin; |
@@ -15,7 +15,7 @@ | |||
15 | * Foundation; either version 2 of the License, or (at | 15 | * Foundation; either version 2 of the License, or (at |
16 | * your option) any later version. | 16 | * your option) any later version. |
17 | * | 17 | * |
18 | * $Id: route.c,v 1.8 2001/03/07 06:33:01 andersen Exp $ | 18 | * $Id: route.c,v 1.9 2001/03/09 21:24:12 andersen Exp $ |
19 | * | 19 | * |
20 | * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru> | 20 | * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru> |
21 | * adjustments by Larry Doolittle <LRDoolittle@lbl.gov> | 21 | * adjustments by Larry Doolittle <LRDoolittle@lbl.gov> |
@@ -346,7 +346,7 @@ INET_setroute(int action, int options, char **args) | |||
346 | return EXIT_SUCCESS; | 346 | return EXIT_SUCCESS; |
347 | } | 347 | } |
348 | 348 | ||
349 | void displayroutes(void) | 349 | static void displayroutes(void) |
350 | { | 350 | { |
351 | char buff[256]; | 351 | char buff[256]; |
352 | int nl = 0 ; | 352 | int nl = 0 ; |
@@ -26,12 +26,12 @@ | |||
26 | #include <stdlib.h> | 26 | #include <stdlib.h> |
27 | #include "busybox.h" | 27 | #include "busybox.h" |
28 | 28 | ||
29 | int compare_ascii(const void *x, const void *y) | 29 | static int compare_ascii(const void *x, const void *y) |
30 | { | 30 | { |
31 | return strcmp(*(char **)x, *(char **)y); | 31 | return strcmp(*(char **)x, *(char **)y); |
32 | } | 32 | } |
33 | 33 | ||
34 | int compare_numeric(const void *x, const void *y) | 34 | static int compare_numeric(const void *x, const void *y) |
35 | { | 35 | { |
36 | return atoi(*(char **)x) - atoi(*(char **)y); | 36 | return atoi(*(char **)x) - atoi(*(char **)y); |
37 | } | 37 | } |
diff --git a/swaponoff.c b/swaponoff.c index 9deb13a28..55022ae3b 100644 --- a/swaponoff.c +++ b/swaponoff.c | |||
@@ -33,8 +33,8 @@ | |||
33 | #include <linux/unistd.h> | 33 | #include <linux/unistd.h> |
34 | #include "busybox.h" | 34 | #include "busybox.h" |
35 | 35 | ||
36 | _syscall2(int, swapon, const char *, path, int, flags); | 36 | static _syscall2(int, swapon, const char *, path, int, flags); |
37 | _syscall1(int, swapoff, const char *, path); | 37 | static _syscall1(int, swapoff, const char *, path); |
38 | 38 | ||
39 | 39 | ||
40 | static int whichApp; | 40 | static int whichApp; |
@@ -44,14 +44,14 @@ static char *tailbuf; | |||
44 | static int taillen; | 44 | static int taillen; |
45 | static int newline; | 45 | static int newline; |
46 | 46 | ||
47 | void tailbuf_append(char *buf, int len) | 47 | static void tailbuf_append(char *buf, int len) |
48 | { | 48 | { |
49 | tailbuf = xrealloc(tailbuf, taillen + len); | 49 | tailbuf = xrealloc(tailbuf, taillen + len); |
50 | memcpy(tailbuf + taillen, buf, len); | 50 | memcpy(tailbuf + taillen, buf, len); |
51 | taillen += len; | 51 | taillen += len; |
52 | } | 52 | } |
53 | 53 | ||
54 | void tailbuf_trunc() | 54 | static void tailbuf_trunc() |
55 | { | 55 | { |
56 | char *s; | 56 | char *s; |
57 | s = memchr(tailbuf, '\n', taillen); | 57 | s = memchr(tailbuf, '\n', taillen); |
@@ -150,7 +150,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv, | |||
150 | 150 | ||
151 | #ifdef BB_FEATURE_TAR_GZIP | 151 | #ifdef BB_FEATURE_TAR_GZIP |
152 | /* Signal handler for when child gzip process dies... */ | 152 | /* Signal handler for when child gzip process dies... */ |
153 | void child_died() | 153 | static void child_died() |
154 | { | 154 | { |
155 | fflush(stdout); | 155 | fflush(stdout); |
156 | fflush(stderr); | 156 | fflush(stderr); |
@@ -186,7 +186,7 @@ extern int tar_unzip_init(int tarFd) | |||
186 | #endif | 186 | #endif |
187 | 187 | ||
188 | #if defined BB_FEATURE_TAR_EXCLUDE | 188 | #if defined BB_FEATURE_TAR_EXCLUDE |
189 | struct option longopts[] = { | 189 | static struct option longopts[] = { |
190 | { "exclude", 1, NULL, 'e' }, | 190 | { "exclude", 1, NULL, 'e' }, |
191 | { NULL, 0, NULL, 0 } | 191 | { NULL, 0, NULL, 0 } |
192 | }; | 192 | }; |
@@ -574,7 +574,7 @@ readTarHeader(struct TarHeader *rawHeader, struct TarInfo *header) | |||
574 | return( FALSE); | 574 | return( FALSE); |
575 | } | 575 | } |
576 | 576 | ||
577 | int exclude_file(char **excluded_files, const char *file) | 577 | static int exclude_file(char **excluded_files, const char *file) |
578 | { | 578 | { |
579 | int i; | 579 | int i; |
580 | 580 | ||
@@ -601,7 +601,7 @@ int exclude_file(char **excluded_files, const char *file) | |||
601 | return 0; | 601 | return 0; |
602 | } | 602 | } |
603 | 603 | ||
604 | int extract_file(char **extract_files, const char *file) | 604 | static int extract_file(char **extract_files, const char *file) |
605 | { | 605 | { |
606 | int i; | 606 | int i; |
607 | 607 | ||
@@ -325,7 +325,7 @@ static void putiac1(byte c) | |||
325 | 325 | ||
326 | /* ******************************* */ | 326 | /* ******************************* */ |
327 | 327 | ||
328 | char const escapecharis[] = "\r\nEscape character is "; | 328 | static char const escapecharis[] = "\r\nEscape character is "; |
329 | 329 | ||
330 | static void setConMode() | 330 | static void setConMode() |
331 | { | 331 | { |
diff --git a/util-linux/fbset.c b/util-linux/fbset.c index be1e3c3f1..80711ec9f 100644 --- a/util-linux/fbset.c +++ b/util-linux/fbset.c | |||
@@ -132,7 +132,7 @@ struct fb_var_screeninfo { | |||
132 | }; | 132 | }; |
133 | 133 | ||
134 | 134 | ||
135 | struct cmdoptions_t { | 135 | static struct cmdoptions_t { |
136 | char *name; | 136 | char *name; |
137 | unsigned char param_count; | 137 | unsigned char param_count; |
138 | unsigned char code; | 138 | unsigned char code; |
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index 9a53a705e..bd0c8a61c 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c | |||
@@ -701,7 +701,7 @@ static void read_tables(void) | |||
701 | } | 701 | } |
702 | } | 702 | } |
703 | 703 | ||
704 | struct minix_inode *get_inode(unsigned int nr) | 704 | static struct minix_inode *get_inode(unsigned int nr) |
705 | { | 705 | { |
706 | struct minix_inode *inode; | 706 | struct minix_inode *inode; |
707 | 707 | ||
@@ -749,7 +749,7 @@ struct minix_inode *get_inode(unsigned int nr) | |||
749 | } | 749 | } |
750 | 750 | ||
751 | #ifdef BB_FEATURE_MINIX2 | 751 | #ifdef BB_FEATURE_MINIX2 |
752 | struct minix2_inode *get_inode2(unsigned int nr) | 752 | static struct minix2_inode *get_inode2(unsigned int nr) |
753 | { | 753 | { |
754 | struct minix2_inode *inode; | 754 | struct minix2_inode *inode; |
755 | 755 | ||
diff --git a/util-linux/getopt.c b/util-linux/getopt.c index eb28d5d07..b74dd65a1 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c | |||
@@ -62,20 +62,19 @@ typedef enum {BASH,TCSH} shell_t; | |||
62 | 62 | ||
63 | 63 | ||
64 | /* Some global variables that tells us how to parse. */ | 64 | /* Some global variables that tells us how to parse. */ |
65 | shell_t shell=BASH; /* The shell we generate output for. */ | 65 | static shell_t shell=BASH; /* The shell we generate output for. */ |
66 | int quiet_errors=0; /* 0 is not quiet. */ | 66 | static int quiet_errors=0; /* 0 is not quiet. */ |
67 | int quiet_output=0; /* 0 is not quiet. */ | 67 | static int quiet_output=0; /* 0 is not quiet. */ |
68 | int quote=1; /* 1 is do quote. */ | 68 | static int quote=1; /* 1 is do quote. */ |
69 | int alternative=0; /* 0 is getopt_long, 1 is getopt_long_only */ | 69 | static int alternative=0; /* 0 is getopt_long, 1 is getopt_long_only */ |
70 | 70 | ||
71 | /* Function prototypes */ | 71 | /* Function prototypes */ |
72 | const char *normalize(const char *arg); | 72 | static const char *normalize(const char *arg); |
73 | int generate_output(char * argv[],int argc,const char *optstr, | 73 | static int generate_output(char * argv[],int argc,const char *optstr, |
74 | const struct option *longopts); | 74 | const struct option *longopts); |
75 | void add_long_options(char *options); | 75 | static void add_long_options(char *options); |
76 | void add_longopt(const char *name,int has_arg); | 76 | static void add_longopt(const char *name,int has_arg); |
77 | void set_shell(const char *new_shell); | 77 | static void set_shell(const char *new_shell); |
78 | void set_initial_shell(void); | ||
79 | 78 | ||
80 | 79 | ||
81 | /* | 80 | /* |
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index 928a49674..a83fa7961 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c | |||
@@ -609,7 +609,7 @@ static void setup_tables(void) | |||
609 | * Perform a test of a block; return the number of | 609 | * Perform a test of a block; return the number of |
610 | * blocks readable/writeable. | 610 | * blocks readable/writeable. |
611 | */ | 611 | */ |
612 | long do_check(char *buffer, int try, unsigned int current_block) | 612 | static long do_check(char *buffer, int try, unsigned int current_block) |
613 | { | 613 | { |
614 | long got; | 614 | long got; |
615 | 615 | ||
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c index b5153f623..f72c7009a 100644 --- a/util-linux/mkswap.c +++ b/util-linux/mkswap.c | |||
@@ -72,7 +72,7 @@ static int version = -1; | |||
72 | static int pagesize; | 72 | static int pagesize; |
73 | static int *signature_page; | 73 | static int *signature_page; |
74 | 74 | ||
75 | struct swap_header_v1 { | 75 | static struct swap_header_v1 { |
76 | char bootbits[1024]; /* Space for disklabel etc. */ | 76 | char bootbits[1024]; /* Space for disklabel etc. */ |
77 | unsigned int version; | 77 | unsigned int version; |
78 | unsigned int last_page; | 78 | unsigned int last_page; |
diff --git a/util-linux/mount.c b/util-linux/mount.c index fd68dafd6..a2d6053c0 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -231,7 +231,7 @@ parse_mount_options(char *options, int *flags, char *strflags) | |||
231 | } | 231 | } |
232 | } | 232 | } |
233 | 233 | ||
234 | int | 234 | static int |
235 | mount_one(char *blockDevice, char *directory, char *filesystemType, | 235 | mount_one(char *blockDevice, char *directory, char *filesystemType, |
236 | unsigned long flags, char *string_flags, int useMtab, int fakeIt, | 236 | unsigned long flags, char *string_flags, int useMtab, int fakeIt, |
237 | char *mtab_opts, int whineOnErrors) | 237 | char *mtab_opts, int whineOnErrors) |
diff --git a/util-linux/nfsmount.c b/util-linux/nfsmount.c index aee496980..cd815102c 100644 --- a/util-linux/nfsmount.c +++ b/util-linux/nfsmount.c | |||
@@ -886,7 +886,7 @@ static char *nfs_strerror(int stat) | |||
886 | return buf; | 886 | return buf; |
887 | } | 887 | } |
888 | 888 | ||
889 | bool_t | 889 | static bool_t |
890 | xdr_fhandle (XDR *xdrs, fhandle objp) | 890 | xdr_fhandle (XDR *xdrs, fhandle objp) |
891 | { | 891 | { |
892 | //register int32_t *buf; | 892 | //register int32_t *buf; |
diff --git a/util-linux/rdate.c b/util-linux/rdate.c index ed7121a75..28e87323d 100644 --- a/util-linux/rdate.c +++ b/util-linux/rdate.c | |||
@@ -39,10 +39,10 @@ | |||
39 | 39 | ||
40 | static const int RFC_868_BIAS = 2208988800UL; | 40 | static const int RFC_868_BIAS = 2208988800UL; |
41 | 41 | ||
42 | int setdate= 0; | 42 | static int setdate= 0; |
43 | int printdate= 0; | 43 | static int printdate= 0; |
44 | 44 | ||
45 | time_t askremotedate(char *host) | 45 | static time_t askremotedate(char *host) |
46 | { | 46 | { |
47 | struct hostent *h; | 47 | struct hostent *h; |
48 | struct sockaddr_in sin; | 48 | struct sockaddr_in sin; |
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index 9deb13a28..55022ae3b 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c | |||
@@ -33,8 +33,8 @@ | |||
33 | #include <linux/unistd.h> | 33 | #include <linux/unistd.h> |
34 | #include "busybox.h" | 34 | #include "busybox.h" |
35 | 35 | ||
36 | _syscall2(int, swapon, const char *, path, int, flags); | 36 | static _syscall2(int, swapon, const char *, path, int, flags); |
37 | _syscall1(int, swapoff, const char *, path); | 37 | static _syscall1(int, swapoff, const char *, path); |
38 | 38 | ||
39 | 39 | ||
40 | static int whichApp; | 40 | static int whichApp; |
diff --git a/uuencode.c b/uuencode.c index 41541defb..35a533309 100644 --- a/uuencode.c +++ b/uuencode.c | |||
@@ -34,11 +34,11 @@ | |||
34 | static void encode __P ((void)); | 34 | static void encode __P ((void)); |
35 | 35 | ||
36 | /* Pointer to the translation table we currently use. */ | 36 | /* Pointer to the translation table we currently use. */ |
37 | const char *trans_ptr; | 37 | static const char *trans_ptr; |
38 | 38 | ||
39 | /* The two currently defined translation tables. The first is the | 39 | /* The two currently defined translation tables. The first is the |
40 | standard uuencoding, the second is base64 encoding. */ | 40 | standard uuencoding, the second is base64 encoding. */ |
41 | const char uu_std[64] = { | 41 | static const char uu_std[64] = { |
42 | '`', '!', '"', '#', '$', '%', '&', '\'', | 42 | '`', '!', '"', '#', '$', '%', '&', '\'', |
43 | '(', ')', '*', '+', ',', '-', '.', '/', | 43 | '(', ')', '*', '+', ',', '-', '.', '/', |
44 | '0', '1', '2', '3', '4', '5', '6', '7', | 44 | '0', '1', '2', '3', '4', '5', '6', '7', |
@@ -49,7 +49,7 @@ const char uu_std[64] = { | |||
49 | 'X', 'Y', 'Z', '[', '\\', ']', '^', '_' | 49 | 'X', 'Y', 'Z', '[', '\\', ']', '^', '_' |
50 | }; | 50 | }; |
51 | 51 | ||
52 | const char uu_base64[64] = { | 52 | static const char uu_base64[64] = { |
53 | 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', | 53 | 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', |
54 | 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', | 54 | 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', |
55 | 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', | 55 | 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', |
@@ -29,8 +29,8 @@ | |||
29 | static int total_lines, total_words, total_chars, max_length; | 29 | static int total_lines, total_words, total_chars, max_length; |
30 | static int print_lines, print_words, print_chars, print_length; | 30 | static int print_lines, print_words, print_chars, print_length; |
31 | 31 | ||
32 | void print_counts(int lines, int words, int chars, int length, | 32 | static void print_counts(int lines, int words, int chars, int length, |
33 | const char *name) | 33 | const char *name) |
34 | { | 34 | { |
35 | char const *space = ""; | 35 | char const *space = ""; |
36 | 36 | ||
@@ -47,22 +47,22 @@ | |||
47 | } while (0) | 47 | } while (0) |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path); | 50 | static void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path); |
51 | FILE *open_socket(char *host, int port); | 51 | static FILE *open_socket(char *host, int port); |
52 | char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc); | 52 | static char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc); |
53 | void progressmeter(int flag); | 53 | static void progressmeter(int flag); |
54 | 54 | ||
55 | /* Globals (can be accessed from signal handlers */ | 55 | /* Globals (can be accessed from signal handlers */ |
56 | static off_t filesize = 0; /* content-length of the file */ | 56 | static off_t filesize = 0; /* content-length of the file */ |
57 | #ifdef BB_FEATURE_WGET_STATUSBAR | 57 | #ifdef BB_FEATURE_WGET_STATUSBAR |
58 | static char *curfile; /* Name of current file being transferred. */ | 58 | static char *curfile; /* Name of current file being transferred. */ |
59 | static struct timeval start; /* Time a transfer started. */ | 59 | static struct timeval start; /* Time a transfer started. */ |
60 | volatile unsigned long statbytes; /* Number of bytes transferred so far. */ | 60 | static volatile unsigned long statbytes; /* Number of bytes transferred so far. */ |
61 | /* For progressmeter() -- number of seconds before xfer considered "stalled" */ | 61 | /* For progressmeter() -- number of seconds before xfer considered "stalled" */ |
62 | static const int STALLTIME = 5; | 62 | static const int STALLTIME = 5; |
63 | #endif | 63 | #endif |
64 | 64 | ||
65 | void close_and_delete_outfile(FILE* output, char *fname_out, int do_continue) | 65 | static void close_and_delete_outfile(FILE* output, char *fname_out, int do_continue) |
66 | { | 66 | { |
67 | if (output != stdout && do_continue==0) { | 67 | if (output != stdout && do_continue==0) { |
68 | fclose(output); | 68 | fclose(output); |
@@ -371,7 +371,7 @@ char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc) | |||
371 | */ | 371 | */ |
372 | 372 | ||
373 | 373 | ||
374 | int | 374 | static int |
375 | getttywidth(void) | 375 | getttywidth(void) |
376 | { | 376 | { |
377 | struct winsize winsize; | 377 | struct winsize winsize; |
@@ -382,7 +382,7 @@ getttywidth(void) | |||
382 | return (80); | 382 | return (80); |
383 | } | 383 | } |
384 | 384 | ||
385 | void | 385 | static void |
386 | updateprogressmeter(int ignore) | 386 | updateprogressmeter(int ignore) |
387 | { | 387 | { |
388 | int save_errno = errno; | 388 | int save_errno = errno; |
@@ -391,7 +391,7 @@ updateprogressmeter(int ignore) | |||
391 | errno = save_errno; | 391 | errno = save_errno; |
392 | } | 392 | } |
393 | 393 | ||
394 | void | 394 | static void |
395 | alarmtimer(int wait) | 395 | alarmtimer(int wait) |
396 | { | 396 | { |
397 | struct itimerval itv; | 397 | struct itimerval itv; |
@@ -403,7 +403,7 @@ alarmtimer(int wait) | |||
403 | } | 403 | } |
404 | 404 | ||
405 | 405 | ||
406 | void | 406 | static void |
407 | progressmeter(int flag) | 407 | progressmeter(int flag) |
408 | { | 408 | { |
409 | static const char prefixes[] = " KMGTP"; | 409 | static const char prefixes[] = " KMGTP"; |
@@ -534,7 +534,7 @@ progressmeter(int flag) | |||
534 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 534 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
535 | * SUCH DAMAGE. | 535 | * SUCH DAMAGE. |
536 | * | 536 | * |
537 | * $Id: wget.c,v 1.28 2001/02/20 06:14:08 andersen Exp $ | 537 | * $Id: wget.c,v 1.29 2001/03/09 21:24:12 andersen Exp $ |
538 | */ | 538 | */ |
539 | 539 | ||
540 | 540 | ||