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
This commit is contained in:
Eric Andersen
2001-01-27 08:24:39 +00:00
parent ab050f5522
commit ed3ef50c23
167 changed files with 388 additions and 156 deletions

View File

@@ -22,7 +22,8 @@
*/
#include "busybox.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
extern int basename_main(int argc, char **argv)
{

View File

@@ -22,7 +22,7 @@
*/
#include "busybox.h"
#include <stdio.h>
#include <stdlib.h>
extern int cat_main(int argc, char **argv)
{

View File

@@ -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)

View File

@@ -26,6 +26,7 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
int cmp_main(int argc, char **argv)
{

View File

@@ -31,6 +31,7 @@
#include <unistd.h>
#include <time.h>
#include <stdio.h>
#include <string.h>
#include <getopt.h>

View File

@@ -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[] = {

View File

@@ -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

View File

@@ -22,6 +22,8 @@
*/
#include "busybox.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
extern int dirname_main(int argc, char **argv)
{

View File

@@ -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"

View File

@@ -24,6 +24,8 @@
#include "busybox.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
extern int
echo_main(int argc, char** argv)

View File

@@ -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 {

View File

@@ -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)
{

View File

@@ -22,6 +22,8 @@
#include "busybox.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
extern int hostid_main(int argc, char **argv)
{

View File

@@ -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)

View File

@@ -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;

View File

@@ -22,6 +22,8 @@
#include "busybox.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
extern int logname_main(int argc, char **argv)
{

View File

@@ -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>

View File

@@ -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;

View File

@@ -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)
{

View File

@@ -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)
{

View File

@@ -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)
{

View File

@@ -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;

View File

@@ -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)
{

View File

@@ -23,6 +23,8 @@
#include "busybox.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
extern int sleep_main(int argc, char **argv)
{

View File

@@ -22,6 +22,8 @@
*/
#include "busybox.h"
#include <getopt.h>
#include <stdlib.h>
int compare_ascii(const void *x, const void *y)
{

View File

@@ -23,6 +23,7 @@
#include "busybox.h"
#include <stdio.h>
#include <unistd.h>
extern int sync_main(int argc, char **argv)
{

View File

@@ -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 },

View File

@@ -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)
{

View File

@@ -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);

View File

@@ -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)

View File

@@ -33,6 +33,7 @@
#include "busybox.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/utsname.h>

View File

@@ -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;

View File

@@ -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();*/

View File

@@ -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)

View File

@@ -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;

View File

@@ -22,6 +22,8 @@
#include "busybox.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
extern int whoami_main(int argc, char **argv)
{

View File

@@ -22,6 +22,7 @@
#include "busybox.h"
#include <stdio.h>
#include <stdlib.h>
extern int yes_main(int argc, char **argv)
{