diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-01-27 08:24:39 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-01-27 08:24:39 +0000 |
commit | ed3ef50c233ffb1b50ea0e7382a8e60b86491009 (patch) | |
tree | ecb05ce51890c2cf84ad036543a972ac812320c3 /coreutils | |
parent | ab050f5522e843bf08994685134adaaac7ffd392 (diff) | |
download | busybox-ed3ef50c233ffb1b50ea0e7382a8e60b86491009.tar.gz |
Fix header file usage -- there were many unnecessary header files included in
busybox.h which slowed compiles. I left only what was needed and then fixed up
all the apps to include their own header files. I also fixed naming for pwd.h
and grp.h functions. Tested to compile and run with libc5, glibc, and uClibc.
-Erik
Diffstat (limited to 'coreutils')
37 files changed, 72 insertions, 7 deletions
diff --git a/coreutils/basename.c b/coreutils/basename.c index fcc7d4619..0caae39a4 100644 --- a/coreutils/basename.c +++ b/coreutils/basename.c @@ -22,7 +22,8 @@ */ #include "busybox.h" -#include <stdio.h> +#include <stdlib.h> +#include <string.h> extern int basename_main(int argc, char **argv) { diff --git a/coreutils/cat.c b/coreutils/cat.c index 151ce4e61..a1b878258 100644 --- a/coreutils/cat.c +++ b/coreutils/cat.c @@ -22,7 +22,7 @@ */ #include "busybox.h" -#include <stdio.h> +#include <stdlib.h> extern int cat_main(int argc, char **argv) { diff --git a/coreutils/chroot.c b/coreutils/chroot.c index 91d3407f2..e6f1d034b 100644 --- a/coreutils/chroot.c +++ b/coreutils/chroot.c @@ -25,6 +25,7 @@ #include "busybox.h" #include <stdlib.h> #include <stdio.h> +#include <unistd.h> #include <errno.h> int chroot_main(int argc, char **argv) diff --git a/coreutils/cmp.c b/coreutils/cmp.c index 6b955447c..a4b6c7d49 100644 --- a/coreutils/cmp.c +++ b/coreutils/cmp.c @@ -26,6 +26,7 @@ #include <stdio.h> #include <string.h> #include <errno.h> +#include <stdlib.h> int cmp_main(int argc, char **argv) { diff --git a/coreutils/date.c b/coreutils/date.c index 73fc70511..8b6a0620d 100644 --- a/coreutils/date.c +++ b/coreutils/date.c @@ -31,6 +31,7 @@ #include <unistd.h> #include <time.h> #include <stdio.h> +#include <string.h> #include <getopt.h> diff --git a/coreutils/dd.c b/coreutils/dd.c index 32eeb661c..dac9ccdf3 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c @@ -24,6 +24,10 @@ #include "busybox.h" #include <sys/types.h> +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> #include <fcntl.h> static struct suffix_mult dd_suffixes[] = { diff --git a/coreutils/df.c b/coreutils/df.c index 22797fbae..0408f9f54 100644 --- a/coreutils/df.c +++ b/coreutils/df.c @@ -24,8 +24,10 @@ #include "busybox.h" #include <stdio.h> +#include <stdlib.h> #include <mntent.h> #include <sys/vfs.h> +#include <getopt.h> extern const char mtab_file[]; /* Defined in utility.c */ #ifdef BB_FEATURE_HUMAN_READABLE diff --git a/coreutils/dirname.c b/coreutils/dirname.c index 63c557a29..333f08d41 100644 --- a/coreutils/dirname.c +++ b/coreutils/dirname.c @@ -22,6 +22,8 @@ */ #include "busybox.h" #include <stdio.h> +#include <stdlib.h> +#include <string.h> extern int dirname_main(int argc, char **argv) { diff --git a/coreutils/du.c b/coreutils/du.c index 56a7a9a0c..9cc2a673d 100644 --- a/coreutils/du.c +++ b/coreutils/du.c @@ -31,6 +31,8 @@ #include <fcntl.h> #include <dirent.h> #include <stdio.h> +#include <stdlib.h> +#include <getopt.h> #include <errno.h> #ifdef BB_FEATURE_HUMAN_READABLE @@ -185,7 +187,7 @@ int du_main(int argc, char **argv) return status; } -/* $Id: du.c,v 1.34 2001/01/22 22:35:38 rjune Exp $ */ +/* $Id: du.c,v 1.35 2001/01/27 08:24:37 andersen Exp $ */ /* Local Variables: c-file-style: "linux" diff --git a/coreutils/echo.c b/coreutils/echo.c index 393f4425f..b3e01afec 100644 --- a/coreutils/echo.c +++ b/coreutils/echo.c @@ -24,6 +24,8 @@ #include "busybox.h" #include <stdio.h> +#include <string.h> +#include <stdlib.h> extern int echo_main(int argc, char** argv) diff --git a/coreutils/expr.c b/coreutils/expr.c index eed2637f2..71bd22417 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c @@ -35,9 +35,11 @@ #include "busybox.h" #include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <regex.h> #include <sys/types.h> -#include <regex.h> /* The kinds of value we can have. */ enum valtype { diff --git a/coreutils/head.c b/coreutils/head.c index a0ca453de..71aa8258c 100644 --- a/coreutils/head.c +++ b/coreutils/head.c @@ -25,6 +25,8 @@ #include "busybox.h" #include <errno.h> #include <stdio.h> +#include <getopt.h> +#include <stdlib.h> int head(int len, FILE *fp) { diff --git a/coreutils/hostid.c b/coreutils/hostid.c index 35a5859c4..eed1a50ec 100644 --- a/coreutils/hostid.c +++ b/coreutils/hostid.c @@ -22,6 +22,8 @@ #include "busybox.h" #include <stdio.h> +#include <stdlib.h> +#include <unistd.h> extern int hostid_main(int argc, char **argv) { diff --git a/coreutils/id.c b/coreutils/id.c index d50de4775..e91ac7585 100644 --- a/coreutils/id.c +++ b/coreutils/id.c @@ -24,6 +24,7 @@ #include <stdio.h> #include <unistd.h> #include <getopt.h> +#include <string.h> #include <sys/types.h> extern int id_main(int argc, char **argv) diff --git a/coreutils/ln.c b/coreutils/ln.c index e69cb024a..d6bf6443a 100644 --- a/coreutils/ln.c +++ b/coreutils/ln.c @@ -28,7 +28,10 @@ #include <stdio.h> #include <dirent.h> +#include <string.h> +#include <stdlib.h> #include <errno.h> +#include <unistd.h> static const int LN_SYMLINK = 1; static const int LN_FORCE = 2; diff --git a/coreutils/logname.c b/coreutils/logname.c index d614e85f1..edec016e6 100644 --- a/coreutils/logname.c +++ b/coreutils/logname.c @@ -22,6 +22,8 @@ #include "busybox.h" #include <stdio.h> +#include <stdlib.h> +#include <unistd.h> extern int logname_main(int argc, char **argv) { diff --git a/coreutils/ls.c b/coreutils/ls.c index 4b225d6f8..affa48c12 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c @@ -59,6 +59,7 @@ static const int COLUMN_GAP = 2; /* includes the file type char, if present */ #include <time.h> #endif #include <string.h> +#include <stdlib.h> #include <fcntl.h> #include <signal.h> diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c index 92357a665..eb6e7db7d 100644 --- a/coreutils/mkdir.c +++ b/coreutils/mkdir.c @@ -28,6 +28,8 @@ #include <stdio.h> #include <errno.h> +#include <string.h> +#include <stdlib.h> static int parentFlag = FALSE; static mode_t mode = 0777; diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c index 728e1ec2f..b31e6f172 100644 --- a/coreutils/mkfifo.c +++ b/coreutils/mkfifo.c @@ -24,6 +24,7 @@ #include <stdio.h> #include <sys/types.h> #include <errno.h> +#include <stdlib.h> extern int mkfifo_main(int argc, char **argv) { diff --git a/coreutils/mknod.c b/coreutils/mknod.c index 4d8c598ea..c761aea6f 100644 --- a/coreutils/mknod.c +++ b/coreutils/mknod.c @@ -26,6 +26,8 @@ #include <sys/types.h> #include <fcntl.h> #include <unistd.h> +#include <string.h> +#include <stdlib.h> int mknod_main(int argc, char **argv) { diff --git a/coreutils/pwd.c b/coreutils/pwd.c index da089f37c..a9acbc721 100644 --- a/coreutils/pwd.c +++ b/coreutils/pwd.c @@ -25,6 +25,8 @@ #include <stdio.h> #include <dirent.h> #include <errno.h> +#include <unistd.h> +#include <stdlib.h> extern int pwd_main(int argc, char **argv) { diff --git a/coreutils/rm.c b/coreutils/rm.c index a9501ec7f..302599ec0 100644 --- a/coreutils/rm.c +++ b/coreutils/rm.c @@ -28,6 +28,8 @@ #include <utime.h> #include <dirent.h> #include <errno.h> +#include <unistd.h> +#include <stdlib.h> static int recursiveFlag = FALSE; static int forceFlag = FALSE; diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c index f9f82bba4..8c2165e6b 100644 --- a/coreutils/rmdir.c +++ b/coreutils/rmdir.c @@ -25,6 +25,8 @@ #include "busybox.h" #include <stdio.h> #include <errno.h> +#include <unistd.h> +#include <stdlib.h> extern int rmdir_main(int argc, char **argv) { diff --git a/coreutils/sleep.c b/coreutils/sleep.c index 10eca593e..61b7ce404 100644 --- a/coreutils/sleep.c +++ b/coreutils/sleep.c @@ -23,6 +23,8 @@ #include "busybox.h" #include <stdio.h> +#include <unistd.h> +#include <stdlib.h> extern int sleep_main(int argc, char **argv) { diff --git a/coreutils/sort.c b/coreutils/sort.c index efff6b653..2aef2d955 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c @@ -22,6 +22,8 @@ */ #include "busybox.h" +#include <getopt.h> +#include <stdlib.h> int compare_ascii(const void *x, const void *y) { diff --git a/coreutils/sync.c b/coreutils/sync.c index 8f101cf17..f95c24c6c 100644 --- a/coreutils/sync.c +++ b/coreutils/sync.c @@ -23,6 +23,7 @@ #include "busybox.h" #include <stdio.h> +#include <unistd.h> extern int sync_main(int argc, char **argv) { diff --git a/coreutils/tail.c b/coreutils/tail.c index dc5918d6b..40511aa7b 100644 --- a/coreutils/tail.c +++ b/coreutils/tail.c @@ -23,8 +23,12 @@ #include "busybox.h" -#include <sys/types.h> #include <fcntl.h> +#include <getopt.h> +#include <string.h> +#include <stdlib.h> +#include <unistd.h> +#include <sys/types.h> static struct suffix_mult tail_suffixes[] = { { "b", 512 }, diff --git a/coreutils/touch.c b/coreutils/touch.c index 1b03075e8..fa2f3b609 100644 --- a/coreutils/touch.c +++ b/coreutils/touch.c @@ -28,6 +28,8 @@ #include <fcntl.h> #include <utime.h> #include <errno.h> +#include <unistd.h> +#include <stdlib.h> extern int touch_main(int argc, char **argv) { diff --git a/coreutils/tr.c b/coreutils/tr.c index 15e3709bb..2717a92db 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c @@ -191,9 +191,9 @@ extern int tr_main(int argc, char **argv) map(input, input_length, output, output_length); } for (i = 0; i < input_length; i++) - invec[input[i]] = TRUE; + invec[(int)input[i]] = TRUE; for (i = 0; i < output_length; i++) - outvec[output[i]] = TRUE; + outvec[(int)output[i]] = TRUE; } convert(); return (0); diff --git a/coreutils/tty.c b/coreutils/tty.c index 46201d3e6..2a64b149d 100644 --- a/coreutils/tty.c +++ b/coreutils/tty.c @@ -22,6 +22,8 @@ #include "busybox.h" #include <stdio.h> +#include <stdlib.h> +#include <unistd.h> #include <sys/types.h> extern int tty_main(int argc, char **argv) diff --git a/coreutils/uname.c b/coreutils/uname.c index 4f7c643f9..deaffd700 100644 --- a/coreutils/uname.c +++ b/coreutils/uname.c @@ -33,6 +33,7 @@ #include "busybox.h" #include <stdio.h> +#include <stdlib.h> #include <sys/types.h> #include <sys/utsname.h> diff --git a/coreutils/uniq.c b/coreutils/uniq.c index c0229aecb..228855962 100644 --- a/coreutils/uniq.c +++ b/coreutils/uniq.c @@ -26,7 +26,9 @@ #include "busybox.h" #include <stdio.h> #include <string.h> +#include <getopt.h> #include <errno.h> +#include <stdlib.h> static int print_count; static int print_uniq = 1; diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index 7b26d2dad..fcfcfd903 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c @@ -27,6 +27,10 @@ #include <stdio.h> #include <errno.h> #include <getopt.h> +#include <string.h> +#include <stdlib.h> +#include "pwd_grp/pwd.h" +#include "pwd_grp/grp.h" /*struct passwd *getpwnam();*/ diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c index 24aabd373..5df49026b 100644 --- a/coreutils/uuencode.c +++ b/coreutils/uuencode.c @@ -27,6 +27,7 @@ #include <stdio.h> #include <errno.h> #include <getopt.h> +#include <stdlib.h> #define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) diff --git a/coreutils/wc.c b/coreutils/wc.c index e6f753435..619c161a7 100644 --- a/coreutils/wc.c +++ b/coreutils/wc.c @@ -23,6 +23,7 @@ #include "busybox.h" #include <stdio.h> #include <getopt.h> +#include <stdlib.h> static int total_lines, total_words, total_chars, max_length; static int print_lines, print_words, print_chars, print_length; diff --git a/coreutils/whoami.c b/coreutils/whoami.c index d7f0a177c..870ede43e 100644 --- a/coreutils/whoami.c +++ b/coreutils/whoami.c @@ -22,6 +22,8 @@ #include "busybox.h" #include <stdio.h> +#include <stdlib.h> +#include <unistd.h> extern int whoami_main(int argc, char **argv) { diff --git a/coreutils/yes.c b/coreutils/yes.c index 46873f3f9..0ce49499f 100644 --- a/coreutils/yes.c +++ b/coreutils/yes.c @@ -22,6 +22,7 @@ #include "busybox.h" #include <stdio.h> +#include <stdlib.h> extern int yes_main(int argc, char **argv) { |