diff options
Diffstat (limited to 'coreutils')
72 files changed, 73 insertions, 2 deletions
diff --git a/coreutils/basename.c b/coreutils/basename.c index 30f76dc12..46f7122c8 100644 --- a/coreutils/basename.c +++ b/coreutils/basename.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <string.h> | 25 | #include <string.h> |
26 | #include "busybox.h" | 26 | #include "busybox.h" |
27 | 27 | ||
28 | int basename_main(int argc, char **argv); | ||
28 | int basename_main(int argc, char **argv) | 29 | int basename_main(int argc, char **argv) |
29 | { | 30 | { |
30 | size_t m, n; | 31 | size_t m, n; |
diff --git a/coreutils/cal.c b/coreutils/cal.c index 82ebf143a..3d617916e 100644 --- a/coreutils/cal.c +++ b/coreutils/cal.c | |||
@@ -77,6 +77,7 @@ static char *build_row(char *p, int *dp); | |||
77 | #define J_WEEK_LEN (WEEK_LEN + 7) | 77 | #define J_WEEK_LEN (WEEK_LEN + 7) |
78 | #define HEAD_SEP 2 /* spaces between day headings */ | 78 | #define HEAD_SEP 2 /* spaces between day headings */ |
79 | 79 | ||
80 | int cal_main(int argc, char **argv); | ||
80 | int cal_main(int argc, char **argv) | 81 | int cal_main(int argc, char **argv) |
81 | { | 82 | { |
82 | struct tm *local_time; | 83 | struct tm *local_time; |
diff --git a/coreutils/cat.c b/coreutils/cat.c index 7a34891e8..7bab325ef 100644 --- a/coreutils/cat.c +++ b/coreutils/cat.c | |||
@@ -34,6 +34,7 @@ int bb_cat(char **argv) | |||
34 | return retval; | 34 | return retval; |
35 | } | 35 | } |
36 | 36 | ||
37 | int cat_main(int argc, char **argv); | ||
37 | int cat_main(int argc, char **argv) | 38 | int cat_main(int argc, char **argv) |
38 | { | 39 | { |
39 | getopt32(argc, argv, "u"); | 40 | getopt32(argc, argv, "u"); |
diff --git a/coreutils/catv.c b/coreutils/catv.c index 66f30693a..826e0e9a6 100644 --- a/coreutils/catv.c +++ b/coreutils/catv.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include "busybox.h" | 13 | #include "busybox.h" |
14 | 14 | ||
15 | int catv_main(int argc, char **argv); | ||
15 | int catv_main(int argc, char **argv) | 16 | int catv_main(int argc, char **argv) |
16 | { | 17 | { |
17 | int retval = EXIT_SUCCESS, fd; | 18 | int retval = EXIT_SUCCESS, fd; |
diff --git a/coreutils/chgrp.c b/coreutils/chgrp.c index 465ea0ccf..eaa29cbc6 100644 --- a/coreutils/chgrp.c +++ b/coreutils/chgrp.c | |||
@@ -16,6 +16,7 @@ | |||
16 | /* FIXME - move to .h */ | 16 | /* FIXME - move to .h */ |
17 | extern int chown_main(int argc, char **argv); | 17 | extern int chown_main(int argc, char **argv); |
18 | 18 | ||
19 | int chgrp_main(int argc, char **argv); | ||
19 | int chgrp_main(int argc, char **argv) | 20 | int chgrp_main(int argc, char **argv) |
20 | { | 21 | { |
21 | /* "chgrp [opts] abc file(s)" == "chown [opts] :abc file(s)" */ | 22 | /* "chgrp [opts] abc file(s)" == "chown [opts] :abc file(s)" */ |
diff --git a/coreutils/chmod.c b/coreutils/chmod.c index f298d0967..74788bbbe 100644 --- a/coreutils/chmod.c +++ b/coreutils/chmod.c | |||
@@ -64,6 +64,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* param, i | |||
64 | return FALSE; | 64 | return FALSE; |
65 | } | 65 | } |
66 | 66 | ||
67 | int chmod_main(int argc, char **argv); | ||
67 | int chmod_main(int argc, char **argv) | 68 | int chmod_main(int argc, char **argv) |
68 | { | 69 | { |
69 | int retval = EXIT_SUCCESS; | 70 | int retval = EXIT_SUCCESS; |
diff --git a/coreutils/chown.c b/coreutils/chown.c index 09cf73f04..dad5ce063 100644 --- a/coreutils/chown.c +++ b/coreutils/chown.c | |||
@@ -53,6 +53,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, | |||
53 | return FALSE; | 53 | return FALSE; |
54 | } | 54 | } |
55 | 55 | ||
56 | int chown_main(int argc, char **argv); | ||
56 | int chown_main(int argc, char **argv) | 57 | int chown_main(int argc, char **argv) |
57 | { | 58 | { |
58 | char *groupName; | 59 | char *groupName; |
diff --git a/coreutils/chroot.c b/coreutils/chroot.c index 62cfdc244..16c743fef 100644 --- a/coreutils/chroot.c +++ b/coreutils/chroot.c | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include "busybox.h" | 12 | #include "busybox.h" |
13 | 13 | ||
14 | int chroot_main(int argc, char **argv); | ||
14 | int chroot_main(int argc, char **argv) | 15 | int chroot_main(int argc, char **argv) |
15 | { | 16 | { |
16 | if (argc < 2) { | 17 | if (argc < 2) { |
diff --git a/coreutils/cksum.c b/coreutils/cksum.c index 52213328c..66a255c4e 100644 --- a/coreutils/cksum.c +++ b/coreutils/cksum.c | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include "busybox.h" | 9 | #include "busybox.h" |
10 | 10 | ||
11 | int cksum_main(int argc, char **argv); | ||
11 | int cksum_main(int argc, char **argv) | 12 | int cksum_main(int argc, char **argv) |
12 | { | 13 | { |
13 | 14 | ||
diff --git a/coreutils/cmp.c b/coreutils/cmp.c index 71007eac1..0aebd4b4d 100644 --- a/coreutils/cmp.c +++ b/coreutils/cmp.c | |||
@@ -42,6 +42,7 @@ static const char opt_chars[] = "sl"; | |||
42 | #define CMP_OPT_s (1<<0) | 42 | #define CMP_OPT_s (1<<0) |
43 | #define CMP_OPT_l (1<<1) | 43 | #define CMP_OPT_l (1<<1) |
44 | 44 | ||
45 | int cmp_main(int argc, char **argv); | ||
45 | int cmp_main(int argc, char **argv) | 46 | int cmp_main(int argc, char **argv) |
46 | { | 47 | { |
47 | FILE *fp1, *fp2, *outfile = stdout; | 48 | FILE *fp1, *fp2, *outfile = stdout; |
diff --git a/coreutils/comm.c b/coreutils/comm.c index 91f017753..b6412968d 100644 --- a/coreutils/comm.c +++ b/coreutils/comm.c | |||
@@ -108,6 +108,7 @@ static void cmp_files(char **infiles) | |||
108 | fclose(streams[1]); | 108 | fclose(streams[1]); |
109 | } | 109 | } |
110 | 110 | ||
111 | int comm_main(int argc, char **argv); | ||
111 | int comm_main(int argc, char **argv) | 112 | int comm_main(int argc, char **argv) |
112 | { | 113 | { |
113 | unsigned long flags; | 114 | unsigned long flags; |
diff --git a/coreutils/cp.c b/coreutils/cp.c index 47ad85ecf..7b0de477b 100644 --- a/coreutils/cp.c +++ b/coreutils/cp.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include "busybox.h" | 17 | #include "busybox.h" |
18 | #include "libcoreutils/coreutils.h" | 18 | #include "libcoreutils/coreutils.h" |
19 | 19 | ||
20 | int cp_main(int argc, char **argv); | ||
20 | int cp_main(int argc, char **argv) | 21 | int cp_main(int argc, char **argv) |
21 | { | 22 | { |
22 | struct stat source_stat; | 23 | struct stat source_stat; |
diff --git a/coreutils/cut.c b/coreutils/cut.c index a72b2c29a..22014fcfb 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c | |||
@@ -162,6 +162,7 @@ static void cut_file(FILE * file) | |||
162 | 162 | ||
163 | static const char _op_on_field[] = " only when operating on fields"; | 163 | static const char _op_on_field[] = " only when operating on fields"; |
164 | 164 | ||
165 | int cut_main(int argc, char **argv); | ||
165 | int cut_main(int argc, char **argv) | 166 | int cut_main(int argc, char **argv) |
166 | { | 167 | { |
167 | char *sopt, *ltok; | 168 | char *sopt, *ltok; |
diff --git a/coreutils/date.c b/coreutils/date.c index 034a18b98..dfc8b2f40 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
@@ -44,6 +44,7 @@ static void maybe_set_utc(int opt) | |||
44 | xputenv((char*)"TZ=UTC0"); | 44 | xputenv((char*)"TZ=UTC0"); |
45 | } | 45 | } |
46 | 46 | ||
47 | int date_main(int argc, char **argv); | ||
47 | int date_main(int argc, char **argv) | 48 | int date_main(int argc, char **argv) |
48 | { | 49 | { |
49 | time_t tm; | 50 | time_t tm; |
diff --git a/coreutils/dd.c b/coreutils/dd.c index 01f37abeb..4a094e81a 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
@@ -50,6 +50,7 @@ static ssize_t full_write_or_warn(int fd, const void *buf, size_t len, | |||
50 | #define XATOU_SFX xatoul_sfx | 50 | #define XATOU_SFX xatoul_sfx |
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | int dd_main(int argc, char **argv); | ||
53 | int dd_main(int argc, char **argv) | 54 | int dd_main(int argc, char **argv) |
54 | { | 55 | { |
55 | enum { | 56 | enum { |
diff --git a/coreutils/df.c b/coreutils/df.c index 3b3292590..484cabb37 100644 --- a/coreutils/df.c +++ b/coreutils/df.c | |||
@@ -33,6 +33,7 @@ static long kscale(long b, long bs) | |||
33 | } | 33 | } |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | int df_main(int argc, char **argv); | ||
36 | int df_main(int argc, char **argv) | 37 | int df_main(int argc, char **argv) |
37 | { | 38 | { |
38 | long blocks_used; | 39 | long blocks_used; |
diff --git a/coreutils/diff.c b/coreutils/diff.c index c846e2b69..31c20f052 100644 --- a/coreutils/diff.c +++ b/coreutils/diff.c | |||
@@ -1170,6 +1170,7 @@ static void diffdir(char *p1, char *p2) | |||
1170 | #endif | 1170 | #endif |
1171 | 1171 | ||
1172 | 1172 | ||
1173 | int diff_main(int argc, char **argv); | ||
1173 | int diff_main(int argc, char **argv) | 1174 | int diff_main(int argc, char **argv) |
1174 | { | 1175 | { |
1175 | bool gotstdin = 0; | 1176 | bool gotstdin = 0; |
diff --git a/coreutils/dirname.c b/coreutils/dirname.c index e986a9701..4ecde3147 100644 --- a/coreutils/dirname.c +++ b/coreutils/dirname.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <stdlib.h> | 14 | #include <stdlib.h> |
15 | #include "busybox.h" | 15 | #include "busybox.h" |
16 | 16 | ||
17 | int dirname_main(int argc, char **argv); | ||
17 | int dirname_main(int argc, char **argv) | 18 | int dirname_main(int argc, char **argv) |
18 | { | 19 | { |
19 | if (argc != 2) { | 20 | if (argc != 2) { |
diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c index 1ed8771c0..62c1361b2 100644 --- a/coreutils/dos2unix.c +++ b/coreutils/dos2unix.c | |||
@@ -82,6 +82,7 @@ static int convert(char *fn) | |||
82 | return 0; | 82 | return 0; |
83 | } | 83 | } |
84 | 84 | ||
85 | int dos2unix_main(int argc, char *argv[]); | ||
85 | int dos2unix_main(int argc, char *argv[]) | 86 | int dos2unix_main(int argc, char *argv[]) |
86 | { | 87 | { |
87 | int o; | 88 | int o; |
diff --git a/coreutils/du.c b/coreutils/du.c index a4b3c817e..eceb646d1 100644 --- a/coreutils/du.c +++ b/coreutils/du.c | |||
@@ -143,6 +143,7 @@ static long du(const char * const filename) | |||
143 | return sum; | 143 | return sum; |
144 | } | 144 | } |
145 | 145 | ||
146 | int du_main(int argc, char **argv); | ||
146 | int du_main(int argc, char **argv) | 147 | int du_main(int argc, char **argv) |
147 | { | 148 | { |
148 | long total; | 149 | long total; |
diff --git a/coreutils/echo.c b/coreutils/echo.c index 0c8eac3bc..8270fc006 100644 --- a/coreutils/echo.c +++ b/coreutils/echo.c | |||
@@ -112,6 +112,7 @@ just_echo: | |||
112 | return 0; | 112 | return 0; |
113 | } | 113 | } |
114 | 114 | ||
115 | int echo_main(int argc, char** argv); | ||
115 | int echo_main(int argc, char** argv) | 116 | int echo_main(int argc, char** argv) |
116 | { | 117 | { |
117 | (void)bb_echo(argv); | 118 | (void)bb_echo(argv); |
diff --git a/coreutils/env.c b/coreutils/env.c index e4cad271b..04279f3e0 100644 --- a/coreutils/env.c +++ b/coreutils/env.c | |||
@@ -41,6 +41,7 @@ static const struct option env_long_options[] = { | |||
41 | }; | 41 | }; |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | int env_main(int argc, char** argv); | ||
44 | int env_main(int argc, char** argv) | 45 | int env_main(int argc, char** argv) |
45 | { | 46 | { |
46 | static char *cleanenv[1] = { NULL }; | 47 | static char *cleanenv[1] = { NULL }; |
diff --git a/coreutils/expr.c b/coreutils/expr.c index 469d467bf..62d1f3a8f 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c | |||
@@ -74,6 +74,7 @@ static int toarith(VALUE * v); | |||
74 | static void freev(VALUE * v); | 74 | static void freev(VALUE * v); |
75 | static void tostring(VALUE * v); | 75 | static void tostring(VALUE * v); |
76 | 76 | ||
77 | int expr_main(int argc, char **argv); | ||
77 | int expr_main(int argc, char **argv) | 78 | int expr_main(int argc, char **argv) |
78 | { | 79 | { |
79 | VALUE *v; | 80 | VALUE *v; |
diff --git a/coreutils/false.c b/coreutils/false.c index 084bc0c1e..2a26e0e28 100644 --- a/coreutils/false.c +++ b/coreutils/false.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <stdlib.h> | 13 | #include <stdlib.h> |
14 | #include "busybox.h" | 14 | #include "busybox.h" |
15 | 15 | ||
16 | int false_main(int ATTRIBUTE_UNUSED argc, char ATTRIBUTE_UNUSED **argv); | ||
16 | int false_main(int ATTRIBUTE_UNUSED argc, char ATTRIBUTE_UNUSED **argv) | 17 | int false_main(int ATTRIBUTE_UNUSED argc, char ATTRIBUTE_UNUSED **argv) |
17 | { | 18 | { |
18 | return EXIT_FAILURE; | 19 | return EXIT_FAILURE; |
diff --git a/coreutils/fold.c b/coreutils/fold.c index 490882f6d..4ce52cf0b 100644 --- a/coreutils/fold.c +++ b/coreutils/fold.c | |||
@@ -38,6 +38,7 @@ static int adjust_column(int column, char c) | |||
38 | return column; | 38 | return column; |
39 | } | 39 | } |
40 | 40 | ||
41 | int fold_main(int argc, char **argv); | ||
41 | int fold_main(int argc, char **argv) | 42 | int fold_main(int argc, char **argv) |
42 | { | 43 | { |
43 | char *w_opt; | 44 | char *w_opt; |
diff --git a/coreutils/head.c b/coreutils/head.c index 59b4d552c..ed1d01d52 100644 --- a/coreutils/head.c +++ b/coreutils/head.c | |||
@@ -31,6 +31,7 @@ static const struct suffix_mult head_suffixes[] = { | |||
31 | 31 | ||
32 | static const char header_fmt_str[] = "\n==> %s <==\n"; | 32 | static const char header_fmt_str[] = "\n==> %s <==\n"; |
33 | 33 | ||
34 | int head_main(int argc, char **argv); | ||
34 | int head_main(int argc, char **argv) | 35 | int head_main(int argc, char **argv) |
35 | { | 36 | { |
36 | unsigned long count = 10; | 37 | unsigned long count = 10; |
diff --git a/coreutils/hostid.c b/coreutils/hostid.c index 65447aa63..51a76c631 100644 --- a/coreutils/hostid.c +++ b/coreutils/hostid.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <unistd.h> | 13 | #include <unistd.h> |
14 | #include "busybox.h" | 14 | #include "busybox.h" |
15 | 15 | ||
16 | int hostid_main(int argc, char ATTRIBUTE_UNUSED **argv); | ||
16 | int hostid_main(int argc, char ATTRIBUTE_UNUSED **argv) | 17 | int hostid_main(int argc, char ATTRIBUTE_UNUSED **argv) |
17 | { | 18 | { |
18 | if (argc > 1) { | 19 | if (argc > 1) { |
diff --git a/coreutils/id.c b/coreutils/id.c index 36007ae55..963ee0566 100644 --- a/coreutils/id.c +++ b/coreutils/id.c | |||
@@ -39,6 +39,7 @@ static short printf_full(unsigned int id, const char *arg, const char prefix) | |||
39 | return status; | 39 | return status; |
40 | } | 40 | } |
41 | 41 | ||
42 | int id_main(int argc, char **argv); | ||
42 | int id_main(int argc, char **argv) | 43 | int id_main(int argc, char **argv) |
43 | { | 44 | { |
44 | struct passwd *p; | 45 | struct passwd *p; |
diff --git a/coreutils/install.c b/coreutils/install.c index c899158aa..dd73fb693 100644 --- a/coreutils/install.c +++ b/coreutils/install.c | |||
@@ -25,6 +25,7 @@ static const struct option install_long_options[] = { | |||
25 | }; | 25 | }; |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | int install_main(int argc, char **argv); | ||
28 | int install_main(int argc, char **argv) | 29 | int install_main(int argc, char **argv) |
29 | { | 30 | { |
30 | struct stat statbuf; | 31 | struct stat statbuf; |
diff --git a/coreutils/length.c b/coreutils/length.c index 6413be007..1dc122cc1 100644 --- a/coreutils/length.c +++ b/coreutils/length.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <stdio.h> | 7 | #include <stdio.h> |
8 | #include "busybox.h" | 8 | #include "busybox.h" |
9 | 9 | ||
10 | int length_main(int argc, char **argv); | ||
10 | int length_main(int argc, char **argv) | 11 | int length_main(int argc, char **argv) |
11 | { | 12 | { |
12 | if ((argc != 2) || (**(++argv) == '-')) { | 13 | if ((argc != 2) || (**(++argv) == '-')) { |
diff --git a/coreutils/ln.c b/coreutils/ln.c index a307e5579..720713475 100644 --- a/coreutils/ln.c +++ b/coreutils/ln.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #define LN_BACKUP 8 | 19 | #define LN_BACKUP 8 |
20 | #define LN_SUFFIX 16 | 20 | #define LN_SUFFIX 16 |
21 | 21 | ||
22 | int ln_main(int argc, char **argv); | ||
22 | int ln_main(int argc, char **argv) | 23 | int ln_main(int argc, char **argv) |
23 | { | 24 | { |
24 | int status = EXIT_SUCCESS; | 25 | int status = EXIT_SUCCESS; |
diff --git a/coreutils/logname.c b/coreutils/logname.c index 695a736c6..743e2291c 100644 --- a/coreutils/logname.c +++ b/coreutils/logname.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <unistd.h> | 25 | #include <unistd.h> |
26 | #include "busybox.h" | 26 | #include "busybox.h" |
27 | 27 | ||
28 | int logname_main(int argc, char ATTRIBUTE_UNUSED **argv); | ||
28 | int logname_main(int argc, char ATTRIBUTE_UNUSED **argv) | 29 | int logname_main(int argc, char ATTRIBUTE_UNUSED **argv) |
29 | { | 30 | { |
30 | const char *p; | 31 | const char *p; |
diff --git a/coreutils/ls.c b/coreutils/ls.c index 067e463ee..798bc8201 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -773,6 +773,7 @@ static const unsigned opt_flags[] = { | |||
773 | }; | 773 | }; |
774 | 774 | ||
775 | 775 | ||
776 | int ls_main(int argc, char **argv); | ||
776 | int ls_main(int argc, char **argv) | 777 | int ls_main(int argc, char **argv) |
777 | { | 778 | { |
778 | struct dnode **dnd; | 779 | struct dnode **dnd; |
diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c index d945ce7e0..417e90b00 100644 --- a/coreutils/md5_sha1_sum.c +++ b/coreutils/md5_sha1_sum.c | |||
@@ -78,6 +78,7 @@ static uint8_t *hash_file(const char *filename, hash_algo_t hash_algo) | |||
78 | return hash_value; | 78 | return hash_value; |
79 | } | 79 | } |
80 | 80 | ||
81 | int md5_sha1_sum_main(int argc, char **argv); | ||
81 | int md5_sha1_sum_main(int argc, char **argv) | 82 | int md5_sha1_sum_main(int argc, char **argv) |
82 | { | 83 | { |
83 | int return_value = EXIT_SUCCESS; | 84 | int return_value = EXIT_SUCCESS; |
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c index 2cc9c7a4c..67819e784 100644 --- a/coreutils/mkdir.c +++ b/coreutils/mkdir.c | |||
@@ -29,6 +29,7 @@ static const struct option mkdir_long_options[] = { | |||
29 | }; | 29 | }; |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | int mkdir_main(int argc, char **argv); | ||
32 | int mkdir_main(int argc, char **argv) | 33 | int mkdir_main(int argc, char **argv) |
33 | { | 34 | { |
34 | mode_t mode = (mode_t)(-1); | 35 | mode_t mode = (mode_t)(-1); |
diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c index 24d27e7c0..6d8aa413e 100644 --- a/coreutils/mkfifo.c +++ b/coreutils/mkfifo.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include "busybox.h" | 16 | #include "busybox.h" |
17 | #include "libcoreutils/coreutils.h" | 17 | #include "libcoreutils/coreutils.h" |
18 | 18 | ||
19 | int mkfifo_main(int argc, char **argv); | ||
19 | int mkfifo_main(int argc, char **argv) | 20 | int mkfifo_main(int argc, char **argv) |
20 | { | 21 | { |
21 | mode_t mode; | 22 | mode_t mode; |
diff --git a/coreutils/mknod.c b/coreutils/mknod.c index 8ca511cd5..6fa6d8353 100644 --- a/coreutils/mknod.c +++ b/coreutils/mknod.c | |||
@@ -17,6 +17,7 @@ | |||
17 | static const char modes_chars[] = { 'p', 'c', 'u', 'b', 0, 1, 1, 2 }; | 17 | static const char modes_chars[] = { 'p', 'c', 'u', 'b', 0, 1, 1, 2 }; |
18 | static const mode_t modes_cubp[] = { S_IFIFO, S_IFCHR, S_IFBLK }; | 18 | static const mode_t modes_cubp[] = { S_IFIFO, S_IFCHR, S_IFBLK }; |
19 | 19 | ||
20 | int mknod_main(int argc, char **argv); | ||
20 | int mknod_main(int argc, char **argv) | 21 | int mknod_main(int argc, char **argv) |
21 | { | 22 | { |
22 | mode_t mode; | 23 | mode_t mode; |
diff --git a/coreutils/mv.c b/coreutils/mv.c index 353124b35..7d4905fc9 100644 --- a/coreutils/mv.c +++ b/coreutils/mv.c | |||
@@ -35,6 +35,7 @@ static const struct option mv_long_options[] = { | |||
35 | 35 | ||
36 | static const char fmt[] = "cannot overwrite %sdirectory with %sdirectory"; | 36 | static const char fmt[] = "cannot overwrite %sdirectory with %sdirectory"; |
37 | 37 | ||
38 | int mv_main(int argc, char **argv); | ||
38 | int mv_main(int argc, char **argv) | 39 | int mv_main(int argc, char **argv) |
39 | { | 40 | { |
40 | struct stat dest_stat; | 41 | struct stat dest_stat; |
diff --git a/coreutils/nice.c b/coreutils/nice.c index 293861842..b7bff6a52 100644 --- a/coreutils/nice.c +++ b/coreutils/nice.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <sys/resource.h> | 10 | #include <sys/resource.h> |
11 | #include "busybox.h" | 11 | #include "busybox.h" |
12 | 12 | ||
13 | int nice_main(int argc, char **argv); | ||
13 | int nice_main(int argc, char **argv) | 14 | int nice_main(int argc, char **argv) |
14 | { | 15 | { |
15 | int old_priority, adjustment; | 16 | int old_priority, adjustment; |
diff --git a/coreutils/nohup.c b/coreutils/nohup.c index 317d2a8ae..a9944b7f4 100644 --- a/coreutils/nohup.c +++ b/coreutils/nohup.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include "busybox.h" | 13 | #include "busybox.h" |
14 | 14 | ||
15 | int nohup_main(int argc, char **argv); | ||
15 | int nohup_main(int argc, char **argv) | 16 | int nohup_main(int argc, char **argv) |
16 | { | 17 | { |
17 | int nullfd; | 18 | int nullfd; |
diff --git a/coreutils/od.c b/coreutils/od.c index ab92dacbb..0de9def5a 100644 --- a/coreutils/od.c +++ b/coreutils/od.c | |||
@@ -156,6 +156,7 @@ static const char od_o2si[] = { | |||
156 | 0xb, 1, 8, 9, | 156 | 0xb, 1, 8, 9, |
157 | }; | 157 | }; |
158 | 158 | ||
159 | int od_main(int argc, char **argv); | ||
159 | int od_main(int argc, char **argv) | 160 | int od_main(int argc, char **argv) |
160 | { | 161 | { |
161 | int ch; | 162 | int ch; |
diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c index fae41afae..f060c0ace 100644 --- a/coreutils/od_bloaty.c +++ b/coreutils/od_bloaty.c | |||
@@ -1207,8 +1207,8 @@ dump_strings(void) | |||
1207 | check_and_close(); | 1207 | check_and_close(); |
1208 | } | 1208 | } |
1209 | 1209 | ||
1210 | int | 1210 | int od_main(int argc, char **argv); |
1211 | od_main(int argc, char **argv) | 1211 | int od_main(int argc, char **argv) |
1212 | { | 1212 | { |
1213 | static const struct suffix_mult bkm[] = { | 1213 | static const struct suffix_mult bkm[] = { |
1214 | { "b", 512 }, | 1214 | { "b", 512 }, |
diff --git a/coreutils/printenv.c b/coreutils/printenv.c index ec50f7151..1d41eeb7b 100644 --- a/coreutils/printenv.c +++ b/coreutils/printenv.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <stdlib.h> | 13 | #include <stdlib.h> |
14 | #include "busybox.h" | 14 | #include "busybox.h" |
15 | 15 | ||
16 | int printenv_main(int argc, char **argv); | ||
16 | int printenv_main(int argc, char **argv) | 17 | int printenv_main(int argc, char **argv) |
17 | { | 18 | { |
18 | extern char **environ; | 19 | extern char **environ; |
diff --git a/coreutils/printf.c b/coreutils/printf.c index 924499b29..0180d0e5a 100644 --- a/coreutils/printf.c +++ b/coreutils/printf.c | |||
@@ -109,6 +109,7 @@ static void print_esc_string(char *str) | |||
109 | } | 109 | } |
110 | } | 110 | } |
111 | 111 | ||
112 | int printf_main(int argc, char **argv); | ||
112 | int printf_main(int argc, char **argv) | 113 | int printf_main(int argc, char **argv) |
113 | { | 114 | { |
114 | char *format; | 115 | char *format; |
diff --git a/coreutils/pwd.c b/coreutils/pwd.c index bd36d627e..b4599b4f3 100644 --- a/coreutils/pwd.c +++ b/coreutils/pwd.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <stdlib.h> | 11 | #include <stdlib.h> |
12 | #include "busybox.h" | 12 | #include "busybox.h" |
13 | 13 | ||
14 | int pwd_main(int argc, char **argv); | ||
14 | int pwd_main(int argc, char **argv) | 15 | int pwd_main(int argc, char **argv) |
15 | { | 16 | { |
16 | char *buf; | 17 | char *buf; |
diff --git a/coreutils/realpath.c b/coreutils/realpath.c index 7fac471eb..b3f7e4957 100644 --- a/coreutils/realpath.c +++ b/coreutils/realpath.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include "busybox.h" | 13 | #include "busybox.h" |
14 | 14 | ||
15 | int realpath_main(int argc, char **argv); | ||
15 | int realpath_main(int argc, char **argv) | 16 | int realpath_main(int argc, char **argv) |
16 | { | 17 | { |
17 | int retval = EXIT_SUCCESS; | 18 | int retval = EXIT_SUCCESS; |
diff --git a/coreutils/rm.c b/coreutils/rm.c index 5df7d5f65..1883feed8 100644 --- a/coreutils/rm.c +++ b/coreutils/rm.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <unistd.h> | 18 | #include <unistd.h> |
19 | #include "busybox.h" | 19 | #include "busybox.h" |
20 | 20 | ||
21 | int rm_main(int argc, char **argv); | ||
21 | int rm_main(int argc, char **argv) | 22 | int rm_main(int argc, char **argv) |
22 | { | 23 | { |
23 | int status = 0; | 24 | int status = 0; |
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c index c61bae795..8cbd6f1fa 100644 --- a/coreutils/rmdir.c +++ b/coreutils/rmdir.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <libgen.h> | 15 | #include <libgen.h> |
16 | #include "busybox.h" | 16 | #include "busybox.h" |
17 | 17 | ||
18 | int rmdir_main(int argc, char **argv); | ||
18 | int rmdir_main(int argc, char **argv) | 19 | int rmdir_main(int argc, char **argv) |
19 | { | 20 | { |
20 | int status = EXIT_SUCCESS; | 21 | int status = EXIT_SUCCESS; |
diff --git a/coreutils/seq.c b/coreutils/seq.c index f2b4706f2..e81a4660a 100644 --- a/coreutils/seq.c +++ b/coreutils/seq.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <stdlib.h> | 11 | #include <stdlib.h> |
12 | #include "busybox.h" | 12 | #include "busybox.h" |
13 | 13 | ||
14 | int seq_main(int argc, char **argv); | ||
14 | int seq_main(int argc, char **argv) | 15 | int seq_main(int argc, char **argv) |
15 | { | 16 | { |
16 | double last, first, increment, i; | 17 | double last, first, increment, i; |
diff --git a/coreutils/sleep.c b/coreutils/sleep.c index e32e2157d..b89b0fe9c 100644 --- a/coreutils/sleep.c +++ b/coreutils/sleep.c | |||
@@ -33,6 +33,7 @@ static const struct suffix_mult sfx[] = { | |||
33 | }; | 33 | }; |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | int sleep_main(int argc, char **argv); | ||
36 | int sleep_main(int argc, char **argv) | 37 | int sleep_main(int argc, char **argv) |
37 | { | 38 | { |
38 | unsigned int duration; | 39 | unsigned int duration; |
diff --git a/coreutils/sort.c b/coreutils/sort.c index 29cadf5f6..e2c7b1dbf 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c | |||
@@ -271,6 +271,7 @@ static unsigned str2u(char **str) | |||
271 | } | 271 | } |
272 | #endif | 272 | #endif |
273 | 273 | ||
274 | int sort_main(int argc, char **argv); | ||
274 | int sort_main(int argc, char **argv) | 275 | int sort_main(int argc, char **argv) |
275 | { | 276 | { |
276 | FILE *fp, *outfile = stdout; | 277 | FILE *fp, *outfile = stdout; |
diff --git a/coreutils/stat.c b/coreutils/stat.c index 31dd6624e..ff14a1599 100644 --- a/coreutils/stat.c +++ b/coreutils/stat.c | |||
@@ -515,6 +515,7 @@ static int do_stat(char const *filename, char const *format) | |||
515 | return 1; | 515 | return 1; |
516 | } | 516 | } |
517 | 517 | ||
518 | int stat_main(int argc, char **argv); | ||
518 | int stat_main(int argc, char **argv) | 519 | int stat_main(int argc, char **argv) |
519 | { | 520 | { |
520 | int i; | 521 | int i; |
diff --git a/coreutils/stty.c b/coreutils/stty.c index 4e665bcb7..c354aac9c 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c | |||
@@ -907,6 +907,7 @@ static void set_control_char_or_die(const struct control_info *info, | |||
907 | #define STTY_verbose_output (1<<2) | 907 | #define STTY_verbose_output (1<<2) |
908 | #define STTY_recoverable_output (1<<3) | 908 | #define STTY_recoverable_output (1<<3) |
909 | #define STTY_noargs (1<<4) | 909 | #define STTY_noargs (1<<4) |
910 | int stty_main(int argc, char **argv); | ||
910 | int stty_main(int argc, char **argv) | 911 | int stty_main(int argc, char **argv) |
911 | { | 912 | { |
912 | struct termios mode; | 913 | struct termios mode; |
diff --git a/coreutils/sum.c b/coreutils/sum.c index d62f2cfde..9327ca55e 100644 --- a/coreutils/sum.c +++ b/coreutils/sum.c | |||
@@ -74,6 +74,7 @@ static unsigned sum_file(const char *file, const unsigned type) | |||
74 | #undef buf | 74 | #undef buf |
75 | } | 75 | } |
76 | 76 | ||
77 | int sum_main(int argc, char **argv); | ||
77 | int sum_main(int argc, char **argv) | 78 | int sum_main(int argc, char **argv) |
78 | { | 79 | { |
79 | unsigned n; | 80 | unsigned n; |
diff --git a/coreutils/sync.c b/coreutils/sync.c index 59f0b504a..536c57a17 100644 --- a/coreutils/sync.c +++ b/coreutils/sync.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <unistd.h> | 13 | #include <unistd.h> |
14 | #include "busybox.h" | 14 | #include "busybox.h" |
15 | 15 | ||
16 | int sync_main(int argc, char **argv); | ||
16 | int sync_main(int argc, char **argv) | 17 | int sync_main(int argc, char **argv) |
17 | { | 18 | { |
18 | bb_warn_ignoring_args(argc - 1); | 19 | bb_warn_ignoring_args(argc - 1); |
diff --git a/coreutils/tail.c b/coreutils/tail.c index 2a1645309..52bacb7ed 100644 --- a/coreutils/tail.c +++ b/coreutils/tail.c | |||
@@ -68,6 +68,7 @@ static unsigned eat_num(const char *p) { | |||
68 | return xatou_sfx(p, tail_suffixes); | 68 | return xatou_sfx(p, tail_suffixes); |
69 | } | 69 | } |
70 | 70 | ||
71 | int tail_main(int argc, char **argv); | ||
71 | int tail_main(int argc, char **argv) | 72 | int tail_main(int argc, char **argv) |
72 | { | 73 | { |
73 | unsigned count = 10; | 74 | unsigned count = 10; |
diff --git a/coreutils/tee.c b/coreutils/tee.c index 248fd1445..338232ce9 100644 --- a/coreutils/tee.c +++ b/coreutils/tee.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include "busybox.h" | 13 | #include "busybox.h" |
14 | #include <signal.h> | 14 | #include <signal.h> |
15 | 15 | ||
16 | int tee_main(int argc, char **argv); | ||
16 | int tee_main(int argc, char **argv) | 17 | int tee_main(int argc, char **argv) |
17 | { | 18 | { |
18 | const char *mode = "w\0a"; | 19 | const char *mode = "w\0a"; |
diff --git a/coreutils/test.c b/coreutils/test.c index d3d760467..6e0d5d38e 100644 --- a/coreutils/test.c +++ b/coreutils/test.c | |||
@@ -578,6 +578,7 @@ static int is_a_group_member(gid_t gid) | |||
578 | 578 | ||
579 | /* applet entry point */ | 579 | /* applet entry point */ |
580 | 580 | ||
581 | int test_main(int argc, char **argv); | ||
581 | int test_main(int argc, char **argv) | 582 | int test_main(int argc, char **argv) |
582 | { | 583 | { |
583 | return bb_test(argc, argv); | 584 | return bb_test(argc, argv); |
diff --git a/coreutils/touch.c b/coreutils/touch.c index 72bf904f8..ae4e689f1 100644 --- a/coreutils/touch.c +++ b/coreutils/touch.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <stdlib.h> | 26 | #include <stdlib.h> |
27 | #include "busybox.h" | 27 | #include "busybox.h" |
28 | 28 | ||
29 | int touch_main(int argc, char **argv); | ||
29 | int touch_main(int argc, char **argv) | 30 | int touch_main(int argc, char **argv) |
30 | { | 31 | { |
31 | int fd; | 32 | int fd; |
diff --git a/coreutils/tr.c b/coreutils/tr.c index 237ade047..cea3b05b6 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c | |||
@@ -193,6 +193,7 @@ static int complement(char *buffer, int buffer_len) | |||
193 | return ix; | 193 | return ix; |
194 | } | 194 | } |
195 | 195 | ||
196 | int tr_main(int argc, char **argv); | ||
196 | int tr_main(int argc, char **argv) | 197 | int tr_main(int argc, char **argv) |
197 | { | 198 | { |
198 | unsigned char *ptr; | 199 | unsigned char *ptr; |
diff --git a/coreutils/true.c b/coreutils/true.c index 388e897c0..b2f3a9bad 100644 --- a/coreutils/true.c +++ b/coreutils/true.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <stdlib.h> | 13 | #include <stdlib.h> |
14 | #include "busybox.h" | 14 | #include "busybox.h" |
15 | 15 | ||
16 | int true_main(int argc, char **argv); | ||
16 | int true_main(int argc, char **argv) | 17 | int true_main(int argc, char **argv) |
17 | { | 18 | { |
18 | return EXIT_SUCCESS; | 19 | return EXIT_SUCCESS; |
diff --git a/coreutils/tty.c b/coreutils/tty.c index fee4b8b9f..c28aa33d7 100644 --- a/coreutils/tty.c +++ b/coreutils/tty.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <unistd.h> | 15 | #include <unistd.h> |
16 | #include "busybox.h" | 16 | #include "busybox.h" |
17 | 17 | ||
18 | int tty_main(int argc, char **argv); | ||
18 | int tty_main(int argc, char **argv) | 19 | int tty_main(int argc, char **argv) |
19 | { | 20 | { |
20 | const char *s; | 21 | const char *s; |
diff --git a/coreutils/uname.c b/coreutils/uname.c index 5a3eafe92..2faa89321 100644 --- a/coreutils/uname.c +++ b/coreutils/uname.c | |||
@@ -54,6 +54,7 @@ static const unsigned short int utsname_offset[] = { | |||
54 | offsetof(uname_info_t,processor) | 54 | offsetof(uname_info_t,processor) |
55 | }; | 55 | }; |
56 | 56 | ||
57 | int uname_main(int argc, char **argv); | ||
57 | int uname_main(int argc, char **argv) | 58 | int uname_main(int argc, char **argv) |
58 | { | 59 | { |
59 | uname_info_t uname_info; | 60 | uname_info_t uname_info; |
diff --git a/coreutils/uniq.c b/coreutils/uniq.c index 100f2be00..0cc0c83b3 100644 --- a/coreutils/uniq.c +++ b/coreutils/uniq.c | |||
@@ -26,6 +26,7 @@ static FILE *xgetoptfile_uniq_s(char **argv, int read0write2) | |||
26 | return (read0write2) ? stdout : stdin; | 26 | return (read0write2) ? stdout : stdin; |
27 | } | 27 | } |
28 | 28 | ||
29 | int uniq_main(int argc, char **argv); | ||
29 | int uniq_main(int argc, char **argv) | 30 | int uniq_main(int argc, char **argv) |
30 | { | 31 | { |
31 | FILE *in, *out; | 32 | FILE *in, *out; |
diff --git a/coreutils/usleep.c b/coreutils/usleep.c index de473a7b2..7dd914638 100644 --- a/coreutils/usleep.c +++ b/coreutils/usleep.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <unistd.h> | 14 | #include <unistd.h> |
15 | #include "busybox.h" | 15 | #include "busybox.h" |
16 | 16 | ||
17 | int usleep_main(int argc, char **argv); | ||
17 | int usleep_main(int argc, char **argv) | 18 | int usleep_main(int argc, char **argv) |
18 | { | 19 | { |
19 | if (argc != 2) { | 20 | if (argc != 2) { |
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index 92272a967..c195a3e6f 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c | |||
@@ -123,6 +123,7 @@ static void read_base64(FILE *src_stream, FILE *dst_stream) | |||
123 | } | 123 | } |
124 | } | 124 | } |
125 | 125 | ||
126 | int uudecode_main(int argc, char **argv); | ||
126 | int uudecode_main(int argc, char **argv) | 127 | int uudecode_main(int argc, char **argv) |
127 | { | 128 | { |
128 | FILE *src_stream; | 129 | FILE *src_stream; |
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c index e8f8d541c..3207d7296 100644 --- a/coreutils/uuencode.c +++ b/coreutils/uuencode.c | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #define SRC_BUF_SIZE 45 // This *MUST* be a multiple of 3 | 14 | #define SRC_BUF_SIZE 45 // This *MUST* be a multiple of 3 |
15 | #define DST_BUF_SIZE 4 * ((SRC_BUF_SIZE + 2) / 3) | 15 | #define DST_BUF_SIZE 4 * ((SRC_BUF_SIZE + 2) / 3) |
16 | int uuencode_main(int argc, char **argv); | ||
16 | int uuencode_main(int argc, char **argv) | 17 | int uuencode_main(int argc, char **argv) |
17 | { | 18 | { |
18 | const size_t src_buf_size = SRC_BUF_SIZE; | 19 | const size_t src_buf_size = SRC_BUF_SIZE; |
diff --git a/coreutils/watch.c b/coreutils/watch.c index 81856c867..60a4a71ce 100644 --- a/coreutils/watch.c +++ b/coreutils/watch.c | |||
@@ -23,6 +23,7 @@ | |||
23 | // | 23 | // |
24 | // (procps 3.x and procps 2.x are forks, not newer/older versions of the same) | 24 | // (procps 3.x and procps 2.x are forks, not newer/older versions of the same) |
25 | 25 | ||
26 | int watch_main(int argc, char **argv); | ||
26 | int watch_main(int argc, char **argv) | 27 | int watch_main(int argc, char **argv) |
27 | { | 28 | { |
28 | unsigned opt; | 29 | unsigned opt; |
diff --git a/coreutils/wc.c b/coreutils/wc.c index d89cb45f6..926b3ac19 100644 --- a/coreutils/wc.c +++ b/coreutils/wc.c | |||
@@ -68,6 +68,7 @@ enum { | |||
68 | WC_LENGTH = 3 | 68 | WC_LENGTH = 3 |
69 | }; | 69 | }; |
70 | 70 | ||
71 | int wc_main(int argc, char **argv); | ||
71 | int wc_main(int argc, char **argv) | 72 | int wc_main(int argc, char **argv) |
72 | { | 73 | { |
73 | FILE *fp; | 74 | FILE *fp; |
diff --git a/coreutils/who.c b/coreutils/who.c index 4cd42652b..25d35fad9 100644 --- a/coreutils/who.c +++ b/coreutils/who.c | |||
@@ -38,6 +38,7 @@ static const char * idle_string (time_t t) | |||
38 | return "old"; | 38 | return "old"; |
39 | } | 39 | } |
40 | 40 | ||
41 | int who_main(int argc, char **argv); | ||
41 | int who_main(int argc, char **argv) | 42 | int who_main(int argc, char **argv) |
42 | { | 43 | { |
43 | struct utmp *ut; | 44 | struct utmp *ut; |
diff --git a/coreutils/whoami.c b/coreutils/whoami.c index df714f22c..3185817b6 100644 --- a/coreutils/whoami.c +++ b/coreutils/whoami.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <unistd.h> | 14 | #include <unistd.h> |
15 | #include "busybox.h" | 15 | #include "busybox.h" |
16 | 16 | ||
17 | int whoami_main(int argc, char **argv); | ||
17 | int whoami_main(int argc, char **argv) | 18 | int whoami_main(int argc, char **argv) |
18 | { | 19 | { |
19 | if (argc > 1) | 20 | if (argc > 1) |
diff --git a/coreutils/yes.c b/coreutils/yes.c index fc6e611e6..2611c3e82 100644 --- a/coreutils/yes.c +++ b/coreutils/yes.c | |||
@@ -16,6 +16,7 @@ | |||
16 | 16 | ||
17 | #include "busybox.h" | 17 | #include "busybox.h" |
18 | 18 | ||
19 | int yes_main(int argc, char **argv); | ||
19 | int yes_main(int argc, char **argv) | 20 | int yes_main(int argc, char **argv) |
20 | { | 21 | { |
21 | static const char fmt_str[] = " %s"; | 22 | static const char fmt_str[] = " %s"; |