diff options
author | Eric Andersen | 2001-02-20 06:14:08 +0000 |
---|---|---|
committer | Eric Andersen | 2001-02-20 06:14:08 +0000 |
commit | cbe31dace5fb24304694d399b9eb267fbe752516 (patch) | |
tree | 49d1bb722d95eb1aded6b5d354ac86e56c481c10 | |
parent | 94456f598417f2f61edb97b5ab67ddfdc408ad10 (diff) | |
download | busybox-cbe31dace5fb24304694d399b9eb267fbe752516.zip busybox-cbe31dace5fb24304694d399b9eb267fbe752516.tar.gz |
It turns out that DODMALLOC was broken when I reorganized busybox.h
header file usage before the 0.49 release. To fix it, I had to move
the '#include "busybox.h"' to the end of the list of #include files.
-Erik
204 files changed, 362 insertions, 378 deletions
diff --git a/applets/busybox.c b/applets/busybox.c index 6c1070f..5fec3d5 100644 --- a/applets/busybox.c +++ b/applets/busybox.c @@ -1,10 +1,10 @@ /* vi: set sw=4 ts=4: */ -#include "busybox.h" #include <stdio.h> #include <string.h> #include <unistd.h> #include <errno.h> #include <stdlib.h> +#include "busybox.h" #undef APPLET #undef APPLET_NOUSAGE diff --git a/archival/gunzip.c b/archival/gunzip.c index bf8812d..8100003 100644 --- a/archival/gunzip.c +++ b/archival/gunzip.c @@ -57,7 +57,6 @@ static char *license_msg[] = { }; #endif -#include "busybox.h" #include <getopt.h> #include <ctype.h> #include <sys/types.h> @@ -71,6 +70,7 @@ static char *license_msg[] = { #include <stdlib.h> #include <time.h> #include <dirent.h> +#include "busybox.h" #define BB_DECLARE_EXTERN #define bb_need_memory_exhausted #define bb_need_name_too_long diff --git a/archival/gzip.c b/archival/gzip.c index 3cbef4e..6c058d2 100644 --- a/archival/gzip.c +++ b/archival/gzip.c @@ -29,11 +29,6 @@ * */ -#include "busybox.h" -#define BB_DECLARE_EXTERN -#define bb_need_memory_exhausted -#include "messages.c" - /* These defines are very important for BusyBox. Without these, * huge chunks of ram are pre-allocated making the BusyBox bss * size Freaking Huge(tm), which is a bad thing.*/ @@ -43,9 +38,15 @@ /* I don't like nested includes, but the string and io functions are used * too often */ +#include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h> +#include "busybox.h" +#define BB_DECLARE_EXTERN +#define bb_need_memory_exhausted +#include "messages.c" + #define memzero(s, n) memset ((void *)(s), 0, (n)) #ifndef RETSIGTYPE @@ -1628,12 +1629,6 @@ ulg deflate() # include <unistd.h> #endif -#if defined(STDC_HEADERS) || !defined(NO_STDLIB_H) -# include <stdlib.h> -#else -extern int errno; -#endif - #if defined(DIRENT) # include <dirent.h> typedef struct dirent dir_type; @@ -3098,12 +3093,6 @@ local void set_file_type() # include <fcntl.h> #endif -#if defined(STDC_HEADERS) || !defined(NO_STDLIB_H) -# include <stdlib.h> -#else -extern int errno; -#endif - /* =========================================================================== * Copy input to output unchanged: zcat == cat with --force. * IN assertion: insize bytes have already been read in inbuf. diff --git a/archival/tar.c b/archival/tar.c index 62f1b1d..a9363d5 100644 --- a/archival/tar.c +++ b/archival/tar.c @@ -36,11 +36,6 @@ */ -#include "busybox.h" -#define BB_DECLARE_EXTERN -#define bb_need_io_error -#define bb_need_name_longer_than_foo -#include "messages.c" #include <stdio.h> #include <dirent.h> #include <errno.h> @@ -55,6 +50,11 @@ #include <string.h> #include <stdlib.h> #include <unistd.h> +#include "busybox.h" +#define BB_DECLARE_EXTERN +#define bb_need_io_error +#define bb_need_name_longer_than_foo +#include "messages.c" #ifdef BB_FEATURE_TAR_GZIP extern int unzip(int in, int out); @@ -21,8 +21,8 @@ * */ -#include "busybox.h" #include <stdlib.h> +#include "busybox.h" #include <string.h> extern int basename_main(int argc, char **argv) @@ -1,10 +1,10 @@ /* vi: set sw=4 ts=4: */ -#include "busybox.h" #include <stdio.h> #include <string.h> #include <unistd.h> #include <errno.h> #include <stdlib.h> +#include "busybox.h" #undef APPLET #undef APPLET_NOUSAGE @@ -21,8 +21,8 @@ * */ -#include "busybox.h" #include <stdlib.h> +#include "busybox.h" extern int cat_main(int argc, char **argv) { diff --git a/chmod_chown_chgrp.c b/chmod_chown_chgrp.c index 9363bd7..a458cf7 100644 --- a/chmod_chown_chgrp.c +++ b/chmod_chown_chgrp.c @@ -22,16 +22,16 @@ * */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> #include "busybox.h" #define BB_DECLARE_EXTERN #define bb_need_invalid_option #define bb_need_too_few_args #include "messages.c" -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> static long uid = -1; @@ -22,11 +22,11 @@ * */ -#include "busybox.h" #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <errno.h> +#include "busybox.h" int chroot_main(int argc, char **argv) { @@ -4,12 +4,12 @@ * * busyboxed by Erik Andersen */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <sys/types.h> #include <sys/ioctl.h> +#include "busybox.h" /* From <linux/vt.h> */ static const int VT_ACTIVATE = 0x5606; /* make vt active */ @@ -22,9 +22,9 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> +#include "busybox.h" extern int clear_main(int argc, char **argv) @@ -32,6 +32,21 @@ //#define TEST +#include <stdio.h> +#include <errno.h> +#include <unistd.h> +#include <stdlib.h> +#include <string.h> +#include <sys/ioctl.h> +#include <ctype.h> +#include <signal.h> +#include <limits.h> + +#ifdef BB_FEATURE_SH_TAB_COMPLETION +#include <dirent.h> +#include <sys/stat.h> +#endif + #ifndef TEST @@ -62,21 +77,6 @@ #define BB_FEATURE_GETUSERNAME_AND_HOMEDIR #endif -#include <stdio.h> -#include <errno.h> -#include <unistd.h> -#include <stdlib.h> -#include <string.h> -#include <sys/ioctl.h> -#include <ctype.h> -#include <signal.h> -#include <limits.h> - -#ifdef BB_FEATURE_SH_TAB_COMPLETION -#include <dirent.h> -#include <sys/stat.h> -#endif - #ifdef BB_FEATURE_GETUSERNAME_AND_HOMEDIR #ifndef TEST #include "pwd_grp/pwd.h" @@ -22,11 +22,11 @@ * */ -#include "busybox.h" #include <stdio.h> #include <string.h> #include <errno.h> #include <stdlib.h> +#include "busybox.h" int cmp_main(int argc, char **argv) { diff --git a/console-tools/chvt.c b/console-tools/chvt.c index f2e6d5f..c4b3639 100644 --- a/console-tools/chvt.c +++ b/console-tools/chvt.c @@ -4,12 +4,12 @@ * * busyboxed by Erik Andersen */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <sys/types.h> #include <sys/ioctl.h> +#include "busybox.h" /* From <linux/vt.h> */ static const int VT_ACTIVATE = 0x5606; /* make vt active */ diff --git a/console-tools/clear.c b/console-tools/clear.c index dab4b05..503bafa 100644 --- a/console-tools/clear.c +++ b/console-tools/clear.c @@ -22,9 +22,9 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> +#include "busybox.h" extern int clear_main(int argc, char **argv) diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c index 8c390c2..15cd0c9 100644 --- a/console-tools/deallocvt.c +++ b/console-tools/deallocvt.c @@ -3,12 +3,12 @@ * disalloc.c - aeb - 940501 - Disallocate virtual terminal(s) * Renamed deallocvt. */ -#include "busybox.h" #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <sys/types.h> #include <sys/ioctl.h> +#include "busybox.h" /* From <linux/vt.h> */ static const int VT_DISALLOCATE = 0x5608; /* free memory associated to vt */ diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c index b9f1bd2..0da0186 100644 --- a/console-tools/dumpkmap.c +++ b/console-tools/dumpkmap.c @@ -20,7 +20,6 @@ * */ -#include "busybox.h" #include <errno.h> #include <fcntl.h> #include <stdio.h> @@ -28,6 +27,7 @@ #include <string.h> #include <stdlib.h> #include <sys/ioctl.h> +#include "busybox.h" /* From <linux/kd.h> */ struct kbentry { diff --git a/console-tools/loadacm.c b/console-tools/loadacm.c index 6422137..81b973b 100644 --- a/console-tools/loadacm.c +++ b/console-tools/loadacm.c @@ -7,7 +7,6 @@ * Peter Novodvorsky <petya@logic.ru> */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <memory.h> @@ -17,9 +16,10 @@ #include <assert.h> #include <errno.h> #include <signal.h> +#include <sys/kd.h> #include <sys/types.h> #include <sys/ioctl.h> -#include <sys/kd.h> +#include "busybox.h" typedef unsigned short unicode; diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c index d7bd7e8..1a724ca 100644 --- a/console-tools/loadfont.c +++ b/console-tools/loadfont.c @@ -7,7 +7,6 @@ * Loads the console font, and possibly the corresponding screen map(s). * (Adapted for busybox by Matej Vela.) */ -#include "busybox.h" #include <stdio.h> #include <string.h> #include <fcntl.h> @@ -20,6 +19,7 @@ #include <sys/ioctl.h> #include <sys/kd.h> #include <endian.h> +#include "busybox.h" static const int PSF_MAGIC1 = 0x36; static const int PSF_MAGIC2 = 0x04; diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c index 5ecd819..dcb5c1c 100644 --- a/console-tools/loadkmap.c +++ b/console-tools/loadkmap.c @@ -20,7 +20,6 @@ * */ -#include "busybox.h" #include <errno.h> #include <fcntl.h> #include <stdio.h> @@ -28,6 +27,7 @@ #include <stdlib.h> #include <unistd.h> #include <sys/ioctl.h> +#include "busybox.h" #define BINARY_KEYMAP_MAGIC "bkeymap" diff --git a/console-tools/reset.c b/console-tools/reset.c index 294cab3..755c4c3 100644 --- a/console-tools/reset.c +++ b/console-tools/reset.c @@ -23,9 +23,9 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> +#include "busybox.h" extern int reset_main(int argc, char **argv) { diff --git a/console-tools/setkeycodes.c b/console-tools/setkeycodes.c index 0be4724..c3c7e09 100644 --- a/console-tools/setkeycodes.c +++ b/console-tools/setkeycodes.c @@ -22,11 +22,11 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <sys/ioctl.h> +#include "busybox.h" /* From <linux/kd.h> */ diff --git a/coreutils/basename.c b/coreutils/basename.c index da59a86..da0b7ec 100644 --- a/coreutils/basename.c +++ b/coreutils/basename.c @@ -21,8 +21,8 @@ * */ -#include "busybox.h" #include <stdlib.h> +#include "busybox.h" #include <string.h> extern int basename_main(int argc, char **argv) diff --git a/coreutils/cat.c b/coreutils/cat.c index 134245c..3554008 100644 --- a/coreutils/cat.c +++ b/coreutils/cat.c @@ -21,8 +21,8 @@ * */ -#include "busybox.h" #include <stdlib.h> +#include "busybox.h" extern int cat_main(int argc, char **argv) { diff --git a/coreutils/chroot.c b/coreutils/chroot.c index e721e1f..bae9cd7 100644 --- a/coreutils/chroot.c +++ b/coreutils/chroot.c @@ -22,11 +22,11 @@ * */ -#include "busybox.h" #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <errno.h> +#include "busybox.h" int chroot_main(int argc, char **argv) { diff --git a/coreutils/cmp.c b/coreutils/cmp.c index c04b6e1..24b6c3f 100644 --- a/coreutils/cmp.c +++ b/coreutils/cmp.c @@ -22,11 +22,11 @@ * */ -#include "busybox.h" #include <stdio.h> #include <string.h> #include <errno.h> #include <stdlib.h> +#include "busybox.h" int cmp_main(int argc, char **argv) { diff --git a/coreutils/date.c b/coreutils/date.c index 21d31bb..878331f 100644 --- a/coreutils/date.c +++ b/coreutils/date.c @@ -20,11 +20,6 @@ * */ -#include "busybox.h" -#define BB_DECLARE_EXTERN -#define bb_need_invalid_date -#define bb_need_memory_exhausted -#include "messages.c" #include <stdlib.h> #include <errno.h> #include <sys/time.h> @@ -33,6 +28,11 @@ #include <stdio.h> #include <string.h> #include <getopt.h> +#include "busybox.h" +#define BB_DECLARE_EXTERN +#define bb_need_invalid_date +#define bb_need_memory_exhausted +#include "messages.c" /* This 'date' command supports only 2 time setting formats, diff --git a/coreutils/dd.c b/coreutils/dd.c index e445e04..1618dd1 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c @@ -21,14 +21,14 @@ * */ -#include "busybox.h" - #include <sys/types.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <fcntl.h> +#include "busybox.h" + static const struct suffix_mult dd_suffixes[] = { { "c", 1 }, diff --git a/coreutils/df.c b/coreutils/df.c index 692205a..ebee4d6 100644 --- a/coreutils/df.c +++ b/coreutils/df.c @@ -22,12 +22,12 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <mntent.h> #include <sys/vfs.h> #include <getopt.h> +#include "busybox.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 e34ecf8..7f191c1 100644 --- a/coreutils/dirname.c +++ b/coreutils/dirname.c @@ -20,10 +20,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -#include "busybox.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> +#include "busybox.h" extern int dirname_main(int argc, char **argv) { diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c index 3242361..222c8f6 100644 --- a/coreutils/dos2unix.c +++ b/coreutils/dos2unix.c @@ -22,9 +22,9 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> +#include "busybox.h" int dos2unix_main( int argc, char **argv ) { int c; diff --git a/coreutils/du.c b/coreutils/du.c index 516f4c9..6197b0b 100644 --- a/coreutils/du.c +++ b/coreutils/du.c @@ -22,11 +22,6 @@ * */ -#include "busybox.h" -#define BB_DECLARE_EXTERN -#define bb_need_name_too_long -#include "messages.c" - #include <sys/types.h> #include <fcntl.h> #include <dirent.h> @@ -34,6 +29,11 @@ #include <stdlib.h> #include <getopt.h> #include <errno.h> +#include "busybox.h" +#define BB_DECLARE_EXTERN +#define bb_need_name_too_long +#include "messages.c" + #ifdef BB_FEATURE_HUMAN_READABLE unsigned long du_disp_hr = KILOBYTE; @@ -187,7 +187,7 @@ int du_main(int argc, char **argv) return status; } -/* $Id: du.c,v 1.37 2001/02/14 21:23:05 andersen Exp $ */ +/* $Id: du.c,v 1.38 2001/02/20 06:14:07 andersen Exp $ */ /* Local Variables: c-file-style: "linux" diff --git a/coreutils/echo.c b/coreutils/echo.c index b3e01af..e9bc50a 100644 --- a/coreutils/echo.c +++ b/coreutils/echo.c @@ -22,10 +22,10 @@ * Original copyright notice is retained at the end of this file. */ -#include "busybox.h" #include <stdio.h> #include <string.h> #include <stdlib.h> +#include "busybox.h" extern int echo_main(int argc, char** argv) diff --git a/coreutils/expr.c b/coreutils/expr.c index 8ef5293..3b454bd 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c @@ -33,12 +33,12 @@ * One function can handle multiple operators all of equal precedence, * provided they all associate ((x op x) op x). */ -#include "busybox.h" #include <stdio.h> #include <string.h> #include <stdlib.h> #include <regex.h> #include <sys/types.h> +#include "busybox.h" /* The kinds of value we can have. */ diff --git a/coreutils/head.c b/coreutils/head.c index a2d7744..c683ec7 100644 --- a/coreutils/head.c +++ b/coreutils/head.c @@ -22,11 +22,11 @@ * */ -#include "busybox.h" #include <errno.h> #include <stdio.h> #include <getopt.h> #include <stdlib.h> +#include "busybox.h" int head(int len, FILE *fp) { diff --git a/coreutils/hostid.c b/coreutils/hostid.c index eed1a50..68a2cc6 100644 --- a/coreutils/hostid.c +++ b/coreutils/hostid.c @@ -20,10 +20,10 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include "busybox.h" extern int hostid_main(int argc, char **argv) { diff --git a/coreutils/length.c b/coreutils/length.c index 9119adc..73becd2 100644 --- a/coreutils/length.c +++ b/coreutils/length.c @@ -1,8 +1,8 @@ /* vi: set sw=4 ts=4: */ -#include "busybox.h" #include <stdlib.h> #include <string.h> #include <stdio.h> +#include "busybox.h" extern int length_main(int argc, char **argv) { diff --git a/coreutils/ln.c b/coreutils/ln.c index e35bf7a..6d41cce 100644 --- a/coreutils/ln.c +++ b/coreutils/ln.c @@ -21,17 +21,17 @@ * */ -#include "busybox.h" -#define BB_DECLARE_EXTERN -#define bb_need_not_a_directory -#include "messages.c" - #include <stdio.h> #include <dirent.h> #include <string.h> #include <stdlib.h> #include <errno.h> #include <unistd.h> +#include "busybox.h" +#define BB_DECLARE_EXTERN +#define bb_need_not_a_directory +#include "messages.c" + static const int LN_SYMLINK = 1; static const int LN_FORCE = 2; diff --git a/coreutils/logname.c b/coreutils/logname.c index a1887aa..0924b24 100644 --- a/coreutils/logname.c +++ b/coreutils/logname.c @@ -20,10 +20,10 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include "busybox.h" extern int logname_main(int argc, char **argv) { diff --git a/coreutils/ls.c b/coreutils/ls.c index dd38dd5..a619bb8 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c @@ -50,7 +50,6 @@ enum { /************************************************************************/ -#include "busybox.h" #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> @@ -67,6 +66,7 @@ enum { #include <fcntl.h> #include <signal.h> #include <sys/ioctl.h> +#include "busybox.h" #ifndef MAJOR #define MAJOR(dev) (((dev)>>8)&0xff) diff --git a/coreutils/md5sum.c b/coreutils/md5sum.c index 3decafd..fa11ee6 100644 --- a/coreutils/md5sum.c +++ b/coreutils/md5sum.c @@ -20,11 +20,11 @@ /* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu> */ /* Hacked to work with BusyBox by Alfred M. Szmidt <ams@trillian.itslinux.org> */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <ctype.h> #include <getopt.h> +#include "busybox.h" /* For some silly reason, this file uses backwards TRUE and FALSE conventions */ #undef TRUE diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c index 285d34f..902da7c 100644 --- a/coreutils/mkdir.c +++ b/coreutils/mkdir.c @@ -21,15 +21,15 @@ * */ +#include <stdio.h> +#include <errno.h> +#include <string.h> +#include <stdlib.h> #include "busybox.h" #define bb_need_name_too_long #define BB_DECLARE_EXTERN #include "messages.c" -#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 56a04f7..ca217fa 100644 --- a/coreutils/mkfifo.c +++ b/coreutils/mkfifo.c @@ -20,11 +20,11 @@ * */ -#include "busybox.h" #include <stdio.h> #include <sys/types.h> #include <errno.h> #include <stdlib.h> +#include "busybox.h" extern int mkfifo_main(int argc, char **argv) { diff --git a/coreutils/mknod.c b/coreutils/mknod.c index 73f6e06..b4d4b82 100644 --- a/coreutils/mknod.c +++ b/coreutils/mknod.c @@ -20,14 +20,14 @@ * */ -#include "busybox.h" #include <stdio.h> #include <errno.h> -#include <sys/types.h> #include <fcntl.h> #include <unistd.h> #include <string.h> #include <stdlib.h> +#include <sys/types.h> +#include "busybox.h" int mknod_main(int argc, char **argv) { diff --git a/coreutils/printf.c b/coreutils/printf.c index 26a200e..003423d 100644 --- a/coreutils/printf.c +++ b/coreutils/printf.c @@ -47,7 +47,6 @@ // 19990508 Busy Boxed! Dave Cinege -#include "busybox.h" #include <unistd.h> #include <stdio.h> #include <sys/types.h> @@ -56,6 +55,7 @@ #include <stdlib.h> #include <fcntl.h> #include <ctype.h> +#include "busybox.h" #ifndef S_IFMT diff --git a/coreutils/pwd.c b/coreutils/pwd.c index a9acbc7..a7a5f78 100644 --- a/coreutils/pwd.c +++ b/coreutils/pwd.c @@ -21,12 +21,12 @@ * */ -#include "busybox.h" #include <stdio.h> #include <dirent.h> #include <errno.h> #include <unistd.h> #include <stdlib.h> +#include "busybox.h" extern int pwd_main(int argc, char **argv) { diff --git a/coreutils/rm.c b/coreutils/rm.c index 5660767..a841632 100644 --- a/coreutils/rm.c +++ b/coreutils/rm.c @@ -22,7 +22,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <time.h> #include <utime.h> @@ -30,6 +29,7 @@ #include <errno.h> #include <unistd.h> #include <stdlib.h> +#include "busybox.h" static int recursiveFlag = FALSE; static int forceFlag = FALSE; diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c index 6266ce1..2c28037 100644 --- a/coreutils/rmdir.c +++ b/coreutils/rmdir.c @@ -22,11 +22,11 @@ * */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <unistd.h> #include <stdlib.h> +#include "busybox.h" extern int rmdir_main(int argc, char **argv) { diff --git a/coreutils/sleep.c b/coreutils/sleep.c index d21af19..3bcab88 100644 --- a/coreutils/sleep.c +++ b/coreutils/sleep.c @@ -21,10 +21,10 @@ * */ -#include "busybox.h" #include <stdio.h> #include <unistd.h> #include <stdlib.h> +#include "busybox.h" extern int sleep_main(int argc, char **argv) { diff --git a/coreutils/sort.c b/coreutils/sort.c index 4984f5d..ed68722 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c @@ -21,9 +21,9 @@ * */ -#include "busybox.h" #include <getopt.h> #include <stdlib.h> +#include "busybox.h" int compare_ascii(const void *x, const void *y) { diff --git a/coreutils/stty.c b/coreutils/stty.c index 4a5aecf..10e2825 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c @@ -28,7 +28,6 @@ */ -#include "busybox.h" #include <termios.h> #include <sys/ioctl.h> @@ -53,6 +52,7 @@ #include <limits.h> #include <memory.h> #include <fcntl.h> +#include "busybox.h" #define STREQ(a, b) (strcmp ((a), (b)) == 0) diff --git a/coreutils/sync.c b/coreutils/sync.c index 3d4686e..ee22ae1 100644 --- a/coreutils/sync.c +++ b/coreutils/sync.c @@ -21,10 +21,10 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include "busybox.h" extern int sync_main(int argc, char **argv) { diff --git a/coreutils/tail.c b/coreutils/tail.c index 778c2d1..a85256c 100644 --- a/coreutils/tail.c +++ b/coreutils/tail.c @@ -21,7 +21,6 @@ * */ -#include "busybox.h" #include <fcntl.h> #include <getopt.h> @@ -29,6 +28,7 @@ #include <stdlib.h> #include <unistd.h> #include <sys/types.h> +#include "busybox.h" static const struct suffix_mult tail_suffixes[] = { { "b", 512 }, diff --git a/coreutils/test.c b/coreutils/test.c index 6439e3a..ab9c23e 100644 --- a/coreutils/test.c +++ b/coreutils/test.c @@ -31,13 +31,13 @@ * "This program is in the Public Domain." */ -#include "busybox.h" #include <sys/types.h> #include <unistd.h> #include <ctype.h> #include <errno.h> #include <stdlib.h> #include <string.h> +#include "busybox.h" #define BB_DECLARE_EXTERN #define bb_need_help #include "messages.c" diff --git a/coreutils/touch.c b/coreutils/touch.c index a3256d5..1718da7 100644 --- a/coreutils/touch.c +++ b/coreutils/touch.c @@ -22,7 +22,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <sys/types.h> #include <fcntl.h> @@ -30,6 +29,7 @@ #include <errno.h> #include <unistd.h> #include <stdlib.h> +#include "busybox.h" extern int touch_main(int argc, char **argv) { diff --git a/coreutils/tr.c b/coreutils/tr.c index 92f399e..b7a6009 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c @@ -24,12 +24,12 @@ * Original copyright notice is retained at the end of this file. */ -#include "busybox.h" #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> +#include "busybox.h" #define BB_DECLARE_EXTERN #define bb_need_write_error #include "messages.c" diff --git a/coreutils/tty.c b/coreutils/tty.c index d71d8de..4510c29 100644 --- a/coreutils/tty.c +++ b/coreutils/tty.c @@ -20,11 +20,11 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> +#include "busybox.h" extern int tty_main(int argc, char **argv) { diff --git a/coreutils/uname.c b/coreutils/uname.c index 899da77..4931ff1 100644 --- a/coreutils/uname.c +++ b/coreutils/uname.c @@ -31,7 +31,6 @@ /* Busyboxed by Erik Andersen */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <sys/types.h> @@ -40,6 +39,7 @@ #if defined (HAVE_SYSINFO) && defined (HAVE_SYS_SYSTEMINFO_H) # include <sys/systeminfo.h> #endif +#include "busybox.h" static void print_element(unsigned int mask, char *element); diff --git a/coreutils/uniq.c b/coreutils/uniq.c index 84f1ed2..53e3c64 100644 --- a/coreutils/uniq.c +++ b/coreutils/uniq.c @@ -23,12 +23,12 @@ * */ -#include "busybox.h" #include <stdio.h> #include <string.h> #include <getopt.h> #include <errno.h> #include <stdlib.h> +#include "busybox.h" static int print_count; static int print_uniq = 1; diff --git a/coreutils/usleep.c b/coreutils/usleep.c index c67c365..92e4437 100644 --- a/coreutils/usleep.c +++ b/coreutils/usleep.c @@ -21,9 +21,9 @@ * */ -#include "busybox.h" #include <stdlib.h> #include <unistd.h> +#include "busybox.h" extern int usleep_main(int argc, char **argv) { diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index c0e8cea..6a3f78a 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c @@ -22,13 +22,13 @@ */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <getopt.h> #include <string.h> #include <stdlib.h> +#include "busybox.h" #include "pwd_grp/pwd.h" #include "pwd_grp/grp.h" diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c index 8d5af4a..41541de 100644 --- a/coreutils/uuencode.c +++ b/coreutils/uuencode.c @@ -22,12 +22,12 @@ /* Hacked to work with BusyBox by Alfred M. Szmidt */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <getopt.h> #include <stdlib.h> +#include "busybox.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 f416874..f2d33d6 100644 --- a/coreutils/wc.c +++ b/coreutils/wc.c @@ -20,10 +20,10 @@ * */ -#include "busybox.h" #include <stdio.h> #include <getopt.h> #include <stdlib.h> +#include "busybox.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 54df0bf..0bbb54b 100644 --- a/coreutils/whoami.c +++ b/coreutils/whoami.c @@ -20,10 +20,10 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include "busybox.h" extern int whoami_main(int argc, char **argv) { diff --git a/coreutils/yes.c b/coreutils/yes.c index 0a8ad83..ad7b98f 100644 --- a/coreutils/yes.c +++ b/coreutils/yes.c @@ -20,9 +20,9 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> +#include "busybox.h" extern int yes_main(int argc, char **argv) { @@ -25,13 +25,6 @@ * */ -#include "busybox.h" -#define BB_DECLARE_EXTERN -#define bb_need_name_too_long -#define bb_need_omitting_directory -#define bb_need_not_a_directory -#include "messages.c" - #include <stdio.h> #include <time.h> #include <utime.h> @@ -43,6 +36,13 @@ #include <errno.h> #include <getopt.h> #include <stdlib.h> +#include "busybox.h" +#define BB_DECLARE_EXTERN +#define bb_need_name_too_long +#define bb_need_omitting_directory +#define bb_need_not_a_directory +#include "messages.c" + static const int is_cp = 0; static const int is_mv = 1; @@ -20,11 +20,6 @@ * */ -#include "busybox.h" -#define BB_DECLARE_EXTERN -#define bb_need_invalid_date -#define bb_need_memory_exhausted -#include "messages.c" #include <stdlib.h> #include <errno.h> #include <sys/time.h> @@ -33,6 +28,11 @@ #include <stdio.h> #include <string.h> #include <getopt.h> +#include "busybox.h" +#define BB_DECLARE_EXTERN +#define bb_need_invalid_date +#define bb_need_memory_exhausted +#include "messages.c" /* This 'date' command supports only 2 time setting formats, @@ -1,10 +1,10 @@ /* vi: set sw=4 ts=4: */ -#include "busybox.h" #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <math.h> +#include "busybox.h" /* Tiny RPN calculator, because "expr" didn't give me bitwise operations. */ @@ -21,14 +21,14 @@ * */ -#include "busybox.h" - #include <sys/types.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <fcntl.h> +#include "busybox.h" + static const struct suffix_mult dd_suffixes[] = { { "c", 1 }, diff --git a/deallocvt.c b/deallocvt.c index 8c390c2..15cd0c9 100644 --- a/deallocvt.c +++ b/deallocvt.c @@ -3,12 +3,12 @@ * disalloc.c - aeb - 940501 - Disallocate virtual terminal(s) * Renamed deallocvt. */ -#include "busybox.h" #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <sys/types.h> #include <sys/ioctl.h> +#include "busybox.h" /* From <linux/vt.h> */ static const int VT_DISALLOCATE = 0x5608; /* free memory associated to vt */ @@ -22,12 +22,12 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <mntent.h> #include <sys/vfs.h> #include <getopt.h> +#include "busybox.h" extern const char mtab_file[]; /* Defined in utility.c */ #ifdef BB_FEATURE_HUMAN_READABLE @@ -20,10 +20,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -#include "busybox.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> +#include "busybox.h" extern int dirname_main(int argc, char **argv) { @@ -15,7 +15,6 @@ * Support, replaced getopt, added some gotos for redundant stuff. */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <getopt.h> @@ -33,6 +32,7 @@ static inline _syscall3(int, klogctl, int, type, char *, b, int, len); #else # include <sys/klog.h> #endif +#include "busybox.h" int dmesg_main(int argc, char **argv) { @@ -22,9 +22,9 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> +#include "busybox.h" int dos2unix_main( int argc, char **argv ) { int c; @@ -22,11 +22,6 @@ * */ -#include "busybox.h" -#define BB_DECLARE_EXTERN -#define bb_need_name_too_long -#include "messages.c" - #include <sys/types.h> #include <fcntl.h> #include <dirent.h> @@ -34,6 +29,11 @@ #include <stdlib.h> #include <getopt.h> #include <errno.h> +#include "busybox.h" +#define BB_DECLARE_EXTERN +#define bb_need_name_too_long +#include "messages.c" + #ifdef BB_FEATURE_HUMAN_READABLE unsigned long du_disp_hr = KILOBYTE; @@ -187,7 +187,7 @@ int du_main(int argc, char **argv) return status; } -/* $Id: du.c,v 1.37 2001/02/14 21:23:05 andersen Exp $ */ +/* $Id: du.c,v 1.38 2001/02/20 06:14:07 andersen Exp $ */ /* Local Variables: c-file-style: "linux" @@ -20,7 +20,6 @@ * */ -#include "busybox.h" #include <errno.h> #include <fcntl.h> #include <stdio.h> @@ -28,6 +27,7 @@ #include <string.h> #include <stdlib.h> #include <sys/ioctl.h> +#include "busybox.h" /* From <linux/kd.h> */ struct kbentry { @@ -12,17 +12,17 @@ * Erik Andersen <andersen@lineo.com> */ -#include "busybox.h" #include <sys/types.h> #include <fcntl.h> #include <errno.h> -#define BB_DECLARE_EXTERN -#define bb_need_io_error -#include "messages.c" #include <utmp.h> #include <stdlib.h> #include <unistd.h> +#include "busybox.h" +#define BB_DECLARE_EXTERN +#define bb_need_io_error +#include "messages.c" extern int dutmp_main(int argc, char **argv) { @@ -22,10 +22,10 @@ * Original copyright notice is retained at the end of this file. */ -#include "busybox.h" #include <stdio.h> #include <string.h> #include <stdlib.h> +#include "busybox.h" extern int echo_main(int argc, char** argv) @@ -33,12 +33,12 @@ * One function can handle multiple operators all of equal precedence, * provided they all associate ((x op x) op x). */ -#include "busybox.h" #include <stdio.h> #include <string.h> #include <stdlib.h> #include <regex.h> #include <sys/types.h> +#include "busybox.h" /* The kinds of value we can have. */ @@ -24,7 +24,6 @@ * Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be) */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -33,6 +32,7 @@ #include <ctype.h> #include <string.h> #include <sys/ioctl.h> +#include "busybox.h" #define DEFAULTFBDEV "/dev/fb0" #define DEFAULTFBMODE "/etc/fb.modes" @@ -21,11 +21,11 @@ * */ -#include "busybox.h" #include <stdio.h> #include <sys/ioctl.h> #include <fcntl.h> #include <stdlib.h> +#include "busybox.h" /* From <linux/fd.h> */ #define FDFLUSH _IO(2,0x4b) @@ -24,7 +24,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <unistd.h> #include <dirent.h> @@ -33,6 +32,7 @@ #include <fnmatch.h> #include <time.h> #include <ctype.h> +#include "busybox.h" static char *pattern; diff --git a/findutils/find.c b/findutils/find.c index a07dc8e..15e693a 100644 --- a/findutils/find.c +++ b/findutils/find.c @@ -24,7 +24,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <unistd.h> #include <dirent.h> @@ -33,6 +32,7 @@ #include <fnmatch.h> #include <time.h> #include <ctype.h> +#include "busybox.h" static char *pattern; diff --git a/findutils/which.c b/findutils/which.c index 1908db3..f9d51f2 100644 --- a/findutils/which.c +++ b/findutils/which.c @@ -21,10 +21,10 @@ * */ -#include "busybox.h" #include <string.h> #include <stdio.h> #include <stdlib.h> +#include "busybox.h" extern int which_main(int argc, char **argv) { diff --git a/findutils/xargs.c b/findutils/xargs.c index f05efd9..01aa5be 100644 --- a/findutils/xargs.c +++ b/findutils/xargs.c @@ -21,10 +21,10 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <string.h> +#include "busybox.h" int xargs_main(int argc, char **argv) { @@ -21,10 +21,10 @@ * */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <stdlib.h> +#include "busybox.h" extern int free_main(int argc, char **argv) { diff --git a/fsck_minix.c b/fsck_minix.c index 2b4c651..9a53a70 100644 --- a/fsck_minix.c +++ b/fsck_minix.c @@ -86,7 +86,6 @@ * enforced (but it's not much fun on a character device :-). */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <unistd.h> @@ -97,6 +96,7 @@ #include <termios.h> #include <mntent.h> #include <sys/param.h> +#include "busybox.h" typedef unsigned char u8; @@ -57,7 +57,6 @@ static char *license_msg[] = { }; #endif -#include "busybox.h" #include <getopt.h> #include <ctype.h> #include <sys/types.h> @@ -71,6 +70,7 @@ static char *license_msg[] = { #include <stdlib.h> #include <time.h> #include <dirent.h> +#include "busybox.h" #define BB_DECLARE_EXTERN #define bb_need_memory_exhausted #define bb_need_name_too_long @@ -29,11 +29,6 @@ * */ -#include "busybox.h" -#define BB_DECLARE_EXTERN -#define bb_need_memory_exhausted -#include "messages.c" - /* These defines are very important for BusyBox. Without these, * huge chunks of ram are pre-allocated making the BusyBox bss * size Freaking Huge(tm), which is a bad thing.*/ @@ -43,9 +38,15 @@ /* I don't like nested includes, but the string and io functions are used * too often */ +#include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h> +#include "busybox.h" +#define BB_DECLARE_EXTERN +#define bb_need_memory_exhausted +#include "messages.c" + #define memzero(s, n) memset ((void *)(s), 0, (n)) #ifndef RETSIGTYPE @@ -1628,12 +1629,6 @@ ulg deflate() # include <unistd.h> #endif -#if defined(STDC_HEADERS) || !defined(NO_STDLIB_H) -# include <stdlib.h> -#else -extern int errno; -#endif - #if defined(DIRENT) # include <dirent.h> typedef struct dirent dir_type; @@ -3098,12 +3093,6 @@ local void set_file_type() # include <fcntl.h> #endif -#if defined(STDC_HEADERS) || !defined(NO_STDLIB_H) -# include <stdlib.h> -#else -extern int errno; -#endif - /* =========================================================================== * Copy input to output unchanged: zcat == cat with --force. * IN assertion: insize bytes have already been read in inbuf. @@ -22,11 +22,11 @@ * */ -#include "busybox.h" #include <errno.h> #include <stdio.h> #include <getopt.h> #include <stdlib.h> +#include "busybox.h" int head(int len, FILE *fp) { @@ -20,10 +20,10 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include "busybox.h" extern int hostid_main(int argc, char **argv) { @@ -15,17 +15,16 @@ * Foundation; either version 2 of the License, or (at * your option) any later version. * - * $Id: ifconfig.c,v 1.2 2001/02/14 21:23:06 andersen Exp $ + * $Id: ifconfig.c,v 1.3 2001/02/20 06:14:07 andersen Exp $ * */ -#include "busybox.h" -#include <sys/types.h> #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> // strcmp and friends #include <ctype.h> // isdigit and friends +#include <sys/types.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <netinet/in.h> @@ -33,6 +32,7 @@ #include <net/if.h> #include <net/if_arp.h> #include <linux/if_ether.h> +#include "busybox.h" static int sockfd; /* socket fd we use to manipulate stuff with */ @@ -27,7 +27,6 @@ #define DEBUG_INIT */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <errno.h> @@ -43,13 +42,14 @@ #include <sys/mount.h> #include <sys/types.h> #include <sys/wait.h> +#include "busybox.h" +#define bb_need_full_version +#define BB_DECLARE_EXTERN +#include "messages.c" #ifdef BB_SYSLOGD # include <sys/syslog.h> #endif -#define bb_need_full_version -#define BB_DECLARE_EXTERN -#include "messages.c" /* From <linux/vt.h> */ struct vt_stat { diff --git a/init/init.c b/init/init.c index 9046a14..1332a10 100644 --- a/init/init.c +++ b/init/init.c @@ -27,7 +27,6 @@ #define DEBUG_INIT */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <errno.h> @@ -43,13 +42,14 @@ #include <sys/mount.h> #include <sys/types.h> #include <sys/wait.h> +#include "busybox.h" +#define bb_need_full_version +#define BB_DECLARE_EXTERN +#include "messages.c" #ifdef BB_SYSLOGD # include <sys/syslog.h> #endif -#define bb_need_full_version -#define BB_DECLARE_EXTERN -#include "messages.c" /* From <linux/vt.h> */ struct vt_stat { @@ -37,7 +37,6 @@ * */ -#include "busybox.h" #include <stdlib.h> #include <stdio.h> #include <stddef.h> @@ -51,6 +50,7 @@ #include <sys/utsname.h> #include <sys/syscall.h> #include <linux/unistd.h> +#include "busybox.h" //---------------------------------------------------------------------------- //--------modutils module.h, lines 45-242 @@ -81,7 +81,7 @@ #ifndef MODUTILS_MODULE_H static const int MODUTILS_MODULE_H = 1; -#ident "$Id: insmod.c,v 1.47 2001/02/15 19:07:43 andersen Exp $" +#ident "$Id: insmod.c,v 1.48 2001/02/20 06:14:07 andersen Exp $" /* This file contains the structures used by the 2.0 and 2.1 kernels. We do not use the kernel headers directly because we do not wish @@ -287,7 +287,7 @@ int delete_module(const char *); #ifndef MODUTILS_OBJ_H static const int MODUTILS_OBJ_H = 1; -#ident "$Id: insmod.c,v 1.47 2001/02/15 19:07:43 andersen Exp $" +#ident "$Id: insmod.c,v 1.48 2001/02/20 06:14:07 andersen Exp $" /* The relocatable object is manipulated using elfin types. */ @@ -21,7 +21,6 @@ */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <errno.h> @@ -30,6 +29,7 @@ #include <ctype.h> #include <string.h> #include <unistd.h> +#include "busybox.h" static const int KILL = 0; static const int KILLALL = 1; @@ -1,8 +1,8 @@ /* vi: set sw=4 ts=4: */ -#include "busybox.h" #include <stdlib.h> #include <string.h> #include <stdio.h> +#include "busybox.h" extern int length_main(int argc, char **argv) { @@ -21,17 +21,17 @@ * */ -#include "busybox.h" -#define BB_DECLARE_EXTERN -#define bb_need_not_a_directory -#include "messages.c" - #include <stdio.h> #include <dirent.h> #include <string.h> #include <stdlib.h> #include <errno.h> #include <unistd.h> +#include "busybox.h" +#define BB_DECLARE_EXTERN +#define bb_need_not_a_directory +#include "messages.c" + static const int LN_SYMLINK = 1; static const int LN_FORCE = 2; @@ -7,7 +7,6 @@ * Peter Novodvorsky <petya@logic.ru> */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <memory.h> @@ -17,9 +16,10 @@ #include <assert.h> #include <errno.h> #include <signal.h> +#include <sys/kd.h> #include <sys/types.h> #include <sys/ioctl.h> -#include <sys/kd.h> +#include "busybox.h" typedef unsigned short unicode; @@ -7,7 +7,6 @@ * Loads the console font, and possibly the corresponding screen map(s). * (Adapted for busybox by Matej Vela.) */ -#include "busybox.h" #include <stdio.h> #include <string.h> #include <fcntl.h> @@ -20,6 +19,7 @@ #include <sys/ioctl.h> #include <sys/kd.h> #include <endian.h> +#include "busybox.h" static const int PSF_MAGIC1 = 0x36; static const int PSF_MAGIC2 = 0x04; @@ -20,7 +20,6 @@ * */ -#include "busybox.h" #include <errno.h> #include <fcntl.h> #include <stdio.h> @@ -28,6 +27,7 @@ #include <stdlib.h> #include <unistd.h> #include <sys/ioctl.h> +#include "busybox.h" #define BINARY_KEYMAP_MAGIC "bkeymap" @@ -21,7 +21,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <unistd.h> #include <sys/types.h> @@ -30,6 +29,7 @@ #include <string.h> #include <stdlib.h> +#include "busybox.h" #if !defined BB_SYSLOGD #define SYSLOG_NAMES @@ -40,6 +40,7 @@ * structures. Argh.... bad libc, bad, bad... */ #include <sys/syslog.h> + typedef struct _code { char *c_name; int c_val; @@ -20,10 +20,10 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include "busybox.h" extern int logname_main(int argc, char **argv) { @@ -50,7 +50,6 @@ enum { /************************************************************************/ -#include "busybox.h" #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> @@ -67,6 +66,7 @@ enum { #include <fcntl.h> #include <signal.h> #include <sys/ioctl.h> +#include "busybox.h" #ifndef MAJOR #define MAJOR(dev) (((dev)>>8)&0xff) @@ -25,7 +25,6 @@ * */ -#include "busybox.h" #include <stdlib.h> #include <stdio.h> #include <stddef.h> @@ -37,6 +36,7 @@ #include <getopt.h> #include <sys/utsname.h> #include <sys/file.h> +#include "busybox.h" @@ -7,13 +7,13 @@ * known bugs: can't deal with alpha ranges */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <unistd.h> #include <sys/types.h> +#include "busybox.h" int makedevs_main(int argc, char **argv) { @@ -20,11 +20,11 @@ /* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu> */ /* Hacked to work with BusyBox by Alfred M. Szmidt <ams@trillian.itslinux.org> */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <ctype.h> #include <getopt.h> +#include "busybox.h" /* For some silly reason, this file uses backwards TRUE and FALSE conventions */ #undef TRUE diff --git a/miscutils/dc.c b/miscutils/dc.c index 1e34574..a422139 100644 --- a/miscutils/dc.c +++ b/miscutils/dc.c @@ -1,10 +1,10 @@ /* vi: set sw=4 ts=4: */ -#include "busybox.h" #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <math.h> +#include "busybox.h" /* Tiny RPN calculator, because "expr" didn't give me bitwise operations. */ diff --git a/miscutils/dutmp.c b/miscutils/dutmp.c index 2e6b3c0..a75a6e3 100644 --- a/miscutils/dutmp.c +++ b/miscutils/dutmp.c @@ -12,17 +12,17 @@ * Erik Andersen <andersen@lineo.com> */ -#include "busybox.h" #include <sys/types.h> #include <fcntl.h> #include <errno.h> -#define BB_DECLARE_EXTERN -#define bb_need_io_error -#include "messages.c" #include <utmp.h> #include <stdlib.h> #include <unistd.h> +#include "busybox.h" +#define BB_DECLARE_EXTERN +#define bb_need_io_error +#include "messages.c" extern int dutmp_main(int argc, char **argv) { diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c index eed3968..b8c6dd1 100644 --- a/miscutils/makedevs.c +++ b/miscutils/makedevs.c @@ -7,13 +7,13 @@ * known bugs: can't deal with alpha ranges */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <unistd.h> #include <sys/types.h> +#include "busybox.h" int makedevs_main(int argc, char **argv) { diff --git a/miscutils/mktemp.c b/miscutils/mktemp.c index b352202..31ab9e2 100644 --- a/miscutils/mktemp.c +++ b/miscutils/mktemp.c @@ -22,11 +22,11 @@ * */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <unistd.h> #include <stdlib.h> +#include "busybox.h" extern int mktemp_main(int argc, char **argv) { diff --git a/miscutils/mt.c b/miscutils/mt.c index eb93cb2..350d3ae 100644 --- a/miscutils/mt.c +++ b/miscutils/mt.c @@ -1,9 +1,9 @@ /* vi: set sw=4 ts=4: */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <sys/mtio.h> #include <sys/fcntl.h> +#include "busybox.h" struct mt_opcodes { char *name; diff --git a/miscutils/readlink.c b/miscutils/readlink.c index c82f640..74196e1 100644 --- a/miscutils/readlink.c +++ b/miscutils/readlink.c @@ -22,10 +22,10 @@ * */ -#include "busybox.h" #include <errno.h> #include <unistd.h> #include <stdlib.h> +#include "busybox.h" int readlink_main(int argc, char **argv) { diff --git a/miscutils/update.c b/miscutils/update.c index 2cf4a98..b282b9e 100644 --- a/miscutils/update.c +++ b/miscutils/update.c @@ -28,7 +28,6 @@ * earlier) kernel. 2.2.x and higher flush filesystem buffers automatically. */ -#include "busybox.h" #include <sys/param.h> #include <sys/syslog.h> #include <unistd.h> /* for getopt() */ @@ -42,6 +41,7 @@ #include <linux/unistd.h> static _syscall2(int, bdflush, int, func, int, data); #endif /* __GLIBC__ */ +#include "busybox.h" static unsigned int sync_duration = 30; static unsigned int flush_duration = 5; diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c index 65d0fc3..5b5fd69 100644 --- a/miscutils/watchdog.c +++ b/miscutils/watchdog.c @@ -20,11 +20,11 @@ * */ -#include "busybox.h" #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <stdlib.h> +#include "busybox.h" extern int watchdog_main(int argc, char **argv) { @@ -21,15 +21,15 @@ * */ +#include <stdio.h> +#include <errno.h> +#include <string.h> +#include <stdlib.h> #include "busybox.h" #define bb_need_name_too_long #define BB_DECLARE_EXTERN #include "messages.c" -#include <stdio.h> -#include <errno.h> -#include <string.h> -#include <stdlib.h> static int parentFlag = FALSE; static mode_t mode = 0777; @@ -20,11 +20,11 @@ * */ -#include "busybox.h" #include <stdio.h> #include <sys/types.h> #include <errno.h> #include <stdlib.h> +#include "busybox.h" extern int mkfifo_main(int argc, char **argv) { diff --git a/mkfs_minix.c b/mkfs_minix.c index 6b4a3e2..b666338 100644 --- a/mkfs_minix.c +++ b/mkfs_minix.c @@ -62,7 +62,6 @@ * removed getopt based parser and added a hand rolled one. */ -#include "busybox.h" #include <stdio.h> #include <time.h> #include <unistd.h> @@ -75,6 +74,7 @@ #include <sys/ioctl.h> #include <sys/param.h> #include <mntent.h> +#include "busybox.h" typedef unsigned char u8; @@ -20,14 +20,14 @@ * */ -#include "busybox.h" #include <stdio.h> #include <errno.h> -#include <sys/types.h> #include <fcntl.h> #include <unistd.h> #include <string.h> #include <stdlib.h> +#include <sys/types.h> +#include "busybox.h" int mknod_main(int argc, char **argv) { @@ -35,7 +35,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <unistd.h> #include <string.h> @@ -45,6 +44,7 @@ #include <sys/utsname.h> #include <asm/page.h> /* for PAGE_SIZE and PAGE_SHIFT */ /* we also get PAGE_SIZE via getpagesize() */ +#include "busybox.h" #ifndef _IO /* pre-1.3.45 */ @@ -22,11 +22,11 @@ * */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <unistd.h> #include <stdlib.h> +#include "busybox.h" extern int mktemp_main(int argc, char **argv) { diff --git a/modutils/insmod.c b/modutils/insmod.c index 5827352..166f0fc 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c @@ -37,7 +37,6 @@ * */ -#include "busybox.h" #include <stdlib.h> #include <stdio.h> #include <stddef.h> @@ -51,6 +50,7 @@ #include <sys/utsname.h> #include <sys/syscall.h> #include <linux/unistd.h> +#include "busybox.h" //---------------------------------------------------------------------------- //--------modutils module.h, lines 45-242 @@ -81,7 +81,7 @@ #ifndef MODUTILS_MODULE_H static const int MODUTILS_MODULE_H = 1; -#ident "$Id: insmod.c,v 1.47 2001/02/15 19:07:43 andersen Exp $" +#ident "$Id: insmod.c,v 1.48 2001/02/20 06:14:07 andersen Exp $" /* This file contains the structures used by the 2.0 and 2.1 kernels. We do not use the kernel headers directly because we do not wish @@ -287,7 +287,7 @@ int delete_module(const char *); #ifndef MODUTILS_OBJ_H static const int MODUTILS_OBJ_H = 1; -#ident "$Id: insmod.c,v 1.47 2001/02/15 19:07:43 andersen Exp $" +#ident "$Id: insmod.c,v 1.48 2001/02/20 06:14:07 andersen Exp $" /* The relocatable object is manipulated using elfin types. */ diff --git a/modutils/lsmod.c b/modutils/lsmod.c index f39cbc0..c97d199 100644 --- a/modutils/lsmod.c +++ b/modutils/lsmod.c @@ -25,7 +25,6 @@ * */ -#include "busybox.h" #include <stdlib.h> #include <stdio.h> #include <stddef.h> @@ -37,6 +36,7 @@ #include <getopt.h> #include <sys/utsname.h> #include <sys/file.h> +#include "busybox.h" diff --git a/modutils/rmmod.c b/modutils/rmmod.c index 7d4538e..aab3261 100644 --- a/modutils/rmmod.c +++ b/modutils/rmmod.c @@ -21,13 +21,13 @@ * */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <unistd.h> #include <stdlib.h> #include <sys/syscall.h> #include <linux/unistd.h> +#include "busybox.h" #define __LIBRARY__ @@ -25,12 +25,12 @@ * */ -#include "busybox.h" #include <stdio.h> #include <fcntl.h> #include <signal.h> #include <stdlib.h> #include <sys/ioctl.h> +#include "busybox.h" #define BB_DECLARE_EXTERN #define bb_need_help #include "messages.c" @@ -43,7 +43,6 @@ * */ -#include "busybox.h" #include <stdlib.h> #include <unistd.h> #include <errno.h> @@ -54,6 +53,7 @@ #if defined BB_FEATURE_USE_DEVPS_PATCH #include <linux/devmtab.h> /* For Erik's nifty devmtab device driver */ #endif +#include "busybox.h" enum { MS_MGC_VAL = 0xc0ed0000, /* Magic number indicatng "new" flags */ @@ -1,9 +1,9 @@ /* vi: set sw=4 ts=4: */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <sys/mtio.h> #include <sys/fcntl.h> +#include "busybox.h" struct mt_opcodes { char *name; @@ -1,5 +1,4 @@ /* vi: set sw=4 ts=4: */ -#include "busybox.h" #include <stdlib.h> #include <unistd.h> #include <errno.h> @@ -8,6 +7,7 @@ #include <mntent.h> #include <fstab.h> #include <sys/mount.h> +#include "busybox.h" extern const char mtab_file[]; /* Defined in utility.c */ @@ -26,7 +26,6 @@ */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -38,6 +37,7 @@ #include <netdb.h> #include <sys/time.h> #include <sys/ioctl.h> +#include "busybox.h" int nc_main(int argc, char **argv) { diff --git a/networking/ifconfig.c b/networking/ifconfig.c index 66615a2..a3e2c0f 100644 --- a/networking/ifconfig.c +++ b/networking/ifconfig.c @@ -15,17 +15,16 @@ * Foundation; either version 2 of the License, or (at * your option) any later version. * - * $Id: ifconfig.c,v 1.2 2001/02/14 21:23:06 andersen Exp $ + * $Id: ifconfig.c,v 1.3 2001/02/20 06:14:07 andersen Exp $ * */ -#include "busybox.h" -#include <sys/types.h> #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> // strcmp and friends #include <ctype.h> // isdigit and friends +#include <sys/types.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <netinet/in.h> @@ -33,6 +32,7 @@ #include <net/if.h> #include <net/if_arp.h> #include <linux/if_ether.h> +#include "busybox.h" static int sockfd; /* socket fd we use to manipulate stuff with */ diff --git a/networking/nc.c b/networking/nc.c index 8927103..e40d4b4 100644 --- a/networking/nc.c +++ b/networking/nc.c @@ -26,7 +26,6 @@ */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -38,6 +37,7 @@ #include <netdb.h> #include <sys/time.h> #include <sys/ioctl.h> +#include "busybox.h" int nc_main(int argc, char **argv) { diff --git a/networking/nslookup.c b/networking/nslookup.c index 33732de..8791b5e 100644 --- a/networking/nslookup.c +++ b/networking/nslookup.c @@ -21,7 +21,6 @@ * */ -#include "busybox.h" #include <ctype.h> #include <errno.h> #include <stdio.h> @@ -32,6 +31,7 @@ #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> +#include "busybox.h" /* | I'm only implementing non-interactive mode; @@ -170,4 +170,4 @@ int nslookup_main(int argc, char **argv) return EXIT_SUCCESS; } -/* $Id: nslookup.c,v 1.21 2001/02/14 21:23:06 andersen Exp $ */ +/* $Id: nslookup.c,v 1.22 2001/02/20 06:14:08 andersen Exp $ */ diff --git a/networking/ping.c b/networking/ping.c index c114fb0..50c7ce6 100644 --- a/networking/ping.c +++ b/networking/ping.c @@ -1,6 +1,6 @@ /* vi: set sw=4 ts=4: */ /* - * $Id: ping.c,v 1.37 2001/02/14 21:23:06 andersen Exp $ + * $Id: ping.c,v 1.38 2001/02/20 06:14:08 andersen Exp $ * Mini ping implementation for busybox * * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> @@ -31,7 +31,6 @@ * Original copyright notice is retained at the end of this file. */ -#include "busybox.h" #include <sys/param.h> #include <sys/socket.h> #include <sys/file.h> @@ -50,6 +49,7 @@ #include <unistd.h> #include <string.h> #include <stdlib.h> +#include "busybox.h" /* It turns out that libc5 doesn't have proper icmp support diff --git a/networking/route.c b/networking/route.c index d98d9a0..9be0027 100644 --- a/networking/route.c +++ b/networking/route.c @@ -15,14 +15,13 @@ * Foundation; either version 2 of the License, or (at * your option) any later version. * - * $Id: route.c,v 1.6 2001/02/18 20:12:25 andersen Exp $ + * $Id: route.c,v 1.7 2001/02/20 06:14:08 andersen Exp $ * * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru> * busybox style adjustments by Larry Doolittle <LRDoolittle@lbl.gov> * displayroute() format now matches net-tools-1.57/lib/inet_gr.c line 173. */ -#include "busybox.h" #include <sys/types.h> #include <sys/ioctl.h> #include <sys/socket.h> @@ -38,6 +37,7 @@ #include <getopt.h> #include <unistd.h> #include <ctype.h> +#include "busybox.h" #define _(x) x diff --git a/networking/telnet.c b/networking/telnet.c index ed92a84..fd1ace4 100644 --- a/networking/telnet.c +++ b/networking/telnet.c @@ -30,7 +30,6 @@ * */ -#include "busybox.h" #include <termios.h> #include <unistd.h> #include <errno.h> @@ -43,6 +42,7 @@ #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> +#include "busybox.h" #if 0 static const int DOTRACE = 1; diff --git a/networking/wget.c b/networking/wget.c index d1aacef..4b8392b 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -14,7 +14,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <stdlib.h> @@ -33,6 +32,8 @@ #include <arpa/inet.h> #include <netdb.h> +#include "busybox.h" + /* Stupid libc5 doesn't define this... */ #ifndef timersub #define timersub(a, b, result) \ @@ -533,7 +534,7 @@ progressmeter(int flag) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: wget.c,v 1.27 2001/02/14 21:23:06 andersen Exp $ + * $Id: wget.c,v 1.28 2001/02/20 06:14:08 andersen Exp $ */ @@ -33,25 +33,25 @@ * nfsmount.c,v 1.1.1.1 1993/11/18 08:40:51 jrs Exp */ -#include "busybox.h" -#undef FALSE -#undef TRUE #include <unistd.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <netdb.h> -#include <rpc/rpc.h> -#include <rpc/pmap_prot.h> -#include <rpc/pmap_clnt.h> #include <sys/socket.h> #include <time.h> #include <sys/utsname.h> #include <netinet/in.h> #include <arpa/inet.h> - -#include "nfsmount.h" +#include <stdlib.h> +#include "busybox.h" +#undef TRUE +#undef FALSE +#include <rpc/rpc.h> +#include <rpc/pmap_prot.h> +#include <rpc/pmap_clnt.h> #include <linux/nfs.h> /* For the kernels nfs stuff */ +#include "nfsmount.h" #ifndef NFS_FHSIZE static const int NFS_FHSIZE = 32; @@ -21,7 +21,6 @@ * */ -#include "busybox.h" #include <ctype.h> #include <errno.h> #include <stdio.h> @@ -32,6 +31,7 @@ #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> +#include "busybox.h" /* | I'm only implementing non-interactive mode; @@ -170,4 +170,4 @@ int nslookup_main(int argc, char **argv) return EXIT_SUCCESS; } -/* $Id: nslookup.c,v 1.21 2001/02/14 21:23:06 andersen Exp $ */ +/* $Id: nslookup.c,v 1.22 2001/02/20 06:14:08 andersen Exp $ */ @@ -1,6 +1,6 @@ /* vi: set sw=4 ts=4: */ /* - * $Id: ping.c,v 1.37 2001/02/14 21:23:06 andersen Exp $ + * $Id: ping.c,v 1.38 2001/02/20 06:14:08 andersen Exp $ * Mini ping implementation for busybox * * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> @@ -31,7 +31,6 @@ * Original copyright notice is retained at the end of this file. */ -#include "busybox.h" #include <sys/param.h> #include <sys/socket.h> #include <sys/file.h> @@ -50,6 +49,7 @@ #include <unistd.h> #include <string.h> #include <stdlib.h> +#include "busybox.h" /* It turns out that libc5 doesn't have proper icmp support diff --git a/pivot_root.c b/pivot_root.c index e007101..d7b80d7 100644 --- a/pivot_root.c +++ b/pivot_root.c @@ -4,11 +4,11 @@ * * busyboxed by Evin Robertson */ -#include "busybox.h" #include <stdlib.h> #include <stdio.h> #include <sys/syscall.h> #include <linux/unistd.h> +#include "busybox.h" #ifndef __NR_pivot_root #error Sorry, but this kernel does not support the pivot_root syscall @@ -47,7 +47,6 @@ // 19990508 Busy Boxed! Dave Cinege -#include "busybox.h" #include <unistd.h> #include <stdio.h> #include <sys/types.h> @@ -56,6 +55,7 @@ #include <stdlib.h> #include <fcntl.h> #include <ctype.h> +#include "busybox.h" #ifndef S_IFMT diff --git a/procps/free.c b/procps/free.c index d287c03..41e872d 100644 --- a/procps/free.c +++ b/procps/free.c @@ -21,10 +21,10 @@ * */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <stdlib.h> +#include "busybox.h" extern int free_main(int argc, char **argv) { diff --git a/procps/kill.c b/procps/kill.c index bdd22b5..e62503b 100644 --- a/procps/kill.c +++ b/procps/kill.c @@ -21,7 +21,6 @@ */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <errno.h> @@ -30,6 +29,7 @@ #include <ctype.h> #include <string.h> #include <unistd.h> +#include "busybox.h" static const int KILL = 0; static const int KILLALL = 1; diff --git a/procps/ps.c b/procps/ps.c index dd154af..4ce43c4 100644 --- a/procps/ps.c +++ b/procps/ps.c @@ -28,7 +28,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -38,6 +37,7 @@ #include <ctype.h> #include <string.h> #include <sys/ioctl.h> +#include "busybox.h" #define BB_DECLARE_EXTERN #define bb_need_help #include "messages.c" diff --git a/procps/renice.c b/procps/renice.c index 9180ebf..ec35bdc 100644 --- a/procps/renice.c +++ b/procps/renice.c @@ -20,12 +20,12 @@ * */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <stdlib.h> #include <sys/time.h> #include <sys/resource.h> +#include "busybox.h" extern int renice_main(int argc, char **argv) diff --git a/procps/uptime.c b/procps/uptime.c index 213a398..64df194 100644 --- a/procps/uptime.c +++ b/procps/uptime.c @@ -28,11 +28,11 @@ */ -#include "busybox.h" #include <stdio.h> #include <time.h> #include <errno.h> #include <stdlib.h> +#include "busybox.h" static const int FSHIFT = 16; /* nr of bits of precision */ #define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */ @@ -28,7 +28,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -38,6 +37,7 @@ #include <ctype.h> #include <string.h> #include <sys/ioctl.h> +#include "busybox.h" #define BB_DECLARE_EXTERN #define bb_need_help #include "messages.c" @@ -21,12 +21,12 @@ * */ -#include "busybox.h" #include <stdio.h> #include <dirent.h> #include <errno.h> #include <unistd.h> #include <stdlib.h> +#include "busybox.h" extern int pwd_main(int argc, char **argv) { @@ -21,9 +21,6 @@ * */ -#include "busybox.h" -#define BB_DECLARE_EXTERN -#include "messages.c" #include <sys/time.h> #include <sys/types.h> #include <sys/socket.h> @@ -33,6 +30,9 @@ #include <getopt.h> #include <stdlib.h> #include <unistd.h> +#include "busybox.h" +#define BB_DECLARE_EXTERN +#include "messages.c" static const int RFC_868_BIAS = 2208988800UL; @@ -22,10 +22,10 @@ * */ -#include "busybox.h" #include <errno.h> #include <unistd.h> #include <stdlib.h> +#include "busybox.h" int readlink_main(int argc, char **argv) { @@ -20,12 +20,12 @@ * */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <stdlib.h> #include <sys/time.h> #include <sys/resource.h> +#include "busybox.h" extern int renice_main(int argc, char **argv) @@ -23,9 +23,9 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> +#include "busybox.h" extern int reset_main(int argc, char **argv) { @@ -22,7 +22,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <time.h> #include <utime.h> @@ -30,6 +29,7 @@ #include <errno.h> #include <unistd.h> #include <stdlib.h> +#include "busybox.h" static int recursiveFlag = FALSE; static int forceFlag = FALSE; @@ -22,11 +22,11 @@ * */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <unistd.h> #include <stdlib.h> +#include "busybox.h" extern int rmdir_main(int argc, char **argv) { @@ -21,13 +21,13 @@ * */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <unistd.h> #include <stdlib.h> #include <sys/syscall.h> #include <linux/unistd.h> +#include "busybox.h" #define __LIBRARY__ @@ -15,14 +15,13 @@ * Foundation; either version 2 of the License, or (at * your option) any later version. * - * $Id: route.c,v 1.6 2001/02/18 20:12:25 andersen Exp $ + * $Id: route.c,v 1.7 2001/02/20 06:14:08 andersen Exp $ * * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru> * busybox style adjustments by Larry Doolittle <LRDoolittle@lbl.gov> * displayroute() format now matches net-tools-1.57/lib/inet_gr.c line 173. */ -#include "busybox.h" #include <sys/types.h> #include <sys/ioctl.h> #include <sys/socket.h> @@ -38,6 +37,7 @@ #include <getopt.h> #include <unistd.h> #include <ctype.h> +#include "busybox.h" #define _(x) x diff --git a/rpmunpack.c b/rpmunpack.c index 79971fa..12e9c71 100644 --- a/rpmunpack.c +++ b/rpmunpack.c @@ -13,11 +13,11 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ -#include "busybox.h" #include <fcntl.h> #include <unistd.h> #include <string.h> #include <stdlib.h> +#include "busybox.h" /* * Some general definitions diff --git a/setkeycodes.c b/setkeycodes.c index 0be4724..c3c7e09 100644 --- a/setkeycodes.c +++ b/setkeycodes.c @@ -22,11 +22,11 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <sys/ioctl.h> +#include "busybox.h" /* From <linux/kd.h> */ diff --git a/shell/cmdedit.c b/shell/cmdedit.c index 97ba831..9cb5352 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c @@ -32,6 +32,21 @@ //#define TEST +#include <stdio.h> +#include <errno.h> +#include <unistd.h> +#include <stdlib.h> +#include <string.h> +#include <sys/ioctl.h> +#include <ctype.h> +#include <signal.h> +#include <limits.h> + +#ifdef BB_FEATURE_SH_TAB_COMPLETION +#include <dirent.h> +#include <sys/stat.h> +#endif + #ifndef TEST @@ -62,21 +77,6 @@ #define BB_FEATURE_GETUSERNAME_AND_HOMEDIR #endif -#include <stdio.h> -#include <errno.h> -#include <unistd.h> -#include <stdlib.h> -#include <string.h> -#include <sys/ioctl.h> -#include <ctype.h> -#include <signal.h> -#include <limits.h> - -#ifdef BB_FEATURE_SH_TAB_COMPLETION -#include <dirent.h> -#include <sys/stat.h> -#endif - #ifdef BB_FEATURE_GETUSERNAME_AND_HOMEDIR #ifndef TEST #include "pwd_grp/pwd.h" @@ -21,10 +21,10 @@ * */ -#include "busybox.h" #include <stdio.h> #include <unistd.h> #include <stdlib.h> +#include "busybox.h" extern int sleep_main(int argc, char **argv) { @@ -21,9 +21,9 @@ * */ -#include "busybox.h" #include <getopt.h> #include <stdlib.h> +#include "busybox.h" int compare_ascii(const void *x, const void *y) { @@ -28,7 +28,6 @@ */ -#include "busybox.h" #include <termios.h> #include <sys/ioctl.h> @@ -53,6 +52,7 @@ #include <limits.h> #include <memory.h> #include <fcntl.h> +#include "busybox.h" #define STREQ(a, b) (strcmp ((a), (b)) == 0) diff --git a/swaponoff.c b/swaponoff.c index 8dda097..0613fa1 100644 --- a/swaponoff.c +++ b/swaponoff.c @@ -22,7 +22,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <mntent.h> #include <dirent.h> @@ -31,6 +30,7 @@ #include <sys/mount.h> #include <sys/syscall.h> #include <linux/unistd.h> +#include "busybox.h" _syscall2(int, swapon, const char *, path, int, flags); _syscall1(int, swapoff, const char *, path); @@ -21,10 +21,10 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include "busybox.h" extern int sync_main(int argc, char **argv) { diff --git a/sysklogd/logger.c b/sysklogd/logger.c index 352bde1..1218d8d 100644 --- a/sysklogd/logger.c +++ b/sysklogd/logger.c @@ -21,7 +21,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <unistd.h> #include <sys/types.h> @@ -30,6 +29,7 @@ #include <string.h> #include <stdlib.h> +#include "busybox.h" #if !defined BB_SYSLOGD #define SYSLOG_NAMES @@ -40,6 +40,7 @@ * structures. Argh.... bad libc, bad, bad... */ #include <sys/syslog.h> + typedef struct _code { char *c_name; int c_val; diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 872728b..8049fc5 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c @@ -23,7 +23,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <ctype.h> @@ -56,6 +55,7 @@ static inline _syscall3(int, klogctl, int, type, char *, b, int, len); #else # include <sys/klog.h> #endif +#include "busybox.h" @@ -23,7 +23,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <ctype.h> @@ -56,6 +55,7 @@ static inline _syscall3(int, klogctl, int, type, char *, b, int, len); #else # include <sys/klog.h> #endif +#include "busybox.h" @@ -21,7 +21,6 @@ * */ -#include "busybox.h" #include <fcntl.h> #include <getopt.h> @@ -29,6 +28,7 @@ #include <stdlib.h> #include <unistd.h> #include <sys/types.h> +#include "busybox.h" static const struct suffix_mult tail_suffixes[] = { { "b", 512 }, @@ -36,11 +36,6 @@ */ -#include "busybox.h" -#define BB_DECLARE_EXTERN -#define bb_need_io_error -#define bb_need_name_longer_than_foo -#include "messages.c" #include <stdio.h> #include <dirent.h> #include <errno.h> @@ -55,6 +50,11 @@ #include <string.h> #include <stdlib.h> #include <unistd.h> +#include "busybox.h" +#define BB_DECLARE_EXTERN +#define bb_need_io_error +#define bb_need_name_longer_than_foo +#include "messages.c" #ifdef BB_FEATURE_TAR_GZIP extern int unzip(int in, int out); @@ -30,7 +30,6 @@ * */ -#include "busybox.h" #include <termios.h> #include <unistd.h> #include <errno.h> @@ -43,6 +42,7 @@ #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> +#include "busybox.h" #if 0 static const int DOTRACE = 1; @@ -31,13 +31,13 @@ * "This program is in the Public Domain." */ -#include "busybox.h" #include <sys/types.h> #include <unistd.h> #include <ctype.h> #include <errno.h> #include <stdlib.h> #include <string.h> +#include "busybox.h" #define BB_DECLARE_EXTERN #define bb_need_help #include "messages.c" @@ -22,7 +22,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <sys/types.h> #include <fcntl.h> @@ -30,6 +29,7 @@ #include <errno.h> #include <unistd.h> #include <stdlib.h> +#include "busybox.h" extern int touch_main(int argc, char **argv) { @@ -24,12 +24,12 @@ * Original copyright notice is retained at the end of this file. */ -#include "busybox.h" #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> +#include "busybox.h" #define BB_DECLARE_EXTERN #define bb_need_write_error #include "messages.c" diff --git a/true_false.c b/true_false.c index 187f680..47d3bb1 100644 --- a/true_false.c +++ b/true_false.c @@ -22,8 +22,8 @@ * */ -#include "busybox.h" #include <stdlib.h> +#include "busybox.h" extern int true_main(int argc, char **argv) @@ -20,11 +20,11 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> +#include "busybox.h" extern int tty_main(int argc, char **argv) { @@ -22,12 +22,12 @@ * */ -#include "busybox.h" #include <stdio.h> #include <mntent.h> #include <errno.h> #include <string.h> #include <stdlib.h> +#include "busybox.h" static const int MNT_FORCE = 1; @@ -31,7 +31,6 @@ /* Busyboxed by Erik Andersen */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <sys/types.h> @@ -40,6 +39,7 @@ #if defined (HAVE_SYSINFO) && defined (HAVE_SYS_SYSTEMINFO_H) # include <sys/systeminfo.h> #endif +#include "busybox.h" static void print_element(unsigned int mask, char *element); @@ -23,12 +23,12 @@ * */ -#include "busybox.h" #include <stdio.h> #include <string.h> #include <getopt.h> #include <errno.h> #include <stdlib.h> +#include "busybox.h" static int print_count; static int print_uniq = 1; @@ -28,7 +28,6 @@ * earlier) kernel. 2.2.x and higher flush filesystem buffers automatically. */ -#include "busybox.h" #include <sys/param.h> #include <sys/syslog.h> #include <unistd.h> /* for getopt() */ @@ -42,6 +41,7 @@ #include <linux/unistd.h> static _syscall2(int, bdflush, int, func, int, data); #endif /* __GLIBC__ */ +#include "busybox.h" static unsigned int sync_duration = 30; static unsigned int flush_duration = 5; @@ -28,11 +28,11 @@ */ -#include "busybox.h" #include <stdio.h> #include <time.h> #include <errno.h> #include <stdlib.h> +#include "busybox.h" static const int FSHIFT = 16; /* nr of bits of precision */ #define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */ @@ -21,9 +21,9 @@ * */ -#include "busybox.h" #include <stdlib.h> #include <unistd.h> +#include "busybox.h" extern int usleep_main(int argc, char **argv) { diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c index 47f9f44..2c85ed3 100644 --- a/util-linux/dmesg.c +++ b/util-linux/dmesg.c @@ -15,7 +15,6 @@ * Support, replaced getopt, added some gotos for redundant stuff. */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <getopt.h> @@ -33,6 +32,7 @@ static inline _syscall3(int, klogctl, int, type, char *, b, int, len); #else # include <sys/klog.h> #endif +#include "busybox.h" int dmesg_main(int argc, char **argv) { diff --git a/util-linux/fbset.c b/util-linux/fbset.c index 9acabbe..72284a6 100644 --- a/util-linux/fbset.c +++ b/util-linux/fbset.c @@ -24,7 +24,6 @@ * Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be) */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -33,6 +32,7 @@ #include <ctype.h> #include <string.h> #include <sys/ioctl.h> +#include "busybox.h" #define DEFAULTFBDEV "/dev/fb0" #define DEFAULTFBMODE "/etc/fb.modes" diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c index f10ccea..28f5cb6 100644 --- a/util-linux/fdflush.c +++ b/util-linux/fdflush.c @@ -21,11 +21,11 @@ * */ -#include "busybox.h" #include <stdio.h> #include <sys/ioctl.h> #include <fcntl.h> #include <stdlib.h> +#include "busybox.h" /* From <linux/fd.h> */ #define FDFLUSH _IO(2,0x4b) diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index 2b4c651..9a53a70 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c @@ -86,7 +86,6 @@ * enforced (but it's not much fun on a character device :-). */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <unistd.h> @@ -97,6 +96,7 @@ #include <termios.h> #include <mntent.h> #include <sys/param.h> +#include "busybox.h" typedef unsigned char u8; diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index 6b4a3e2..b666338 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c @@ -62,7 +62,6 @@ * removed getopt based parser and added a hand rolled one. */ -#include "busybox.h" #include <stdio.h> #include <time.h> #include <unistd.h> @@ -75,6 +74,7 @@ #include <sys/ioctl.h> #include <sys/param.h> #include <mntent.h> +#include "busybox.h" typedef unsigned char u8; diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c index 48637e8..b5153f6 100644 --- a/util-linux/mkswap.c +++ b/util-linux/mkswap.c @@ -35,7 +35,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <unistd.h> #include <string.h> @@ -45,6 +44,7 @@ #include <sys/utsname.h> #include <asm/page.h> /* for PAGE_SIZE and PAGE_SHIFT */ /* we also get PAGE_SIZE via getpagesize() */ +#include "busybox.h" #ifndef _IO /* pre-1.3.45 */ diff --git a/util-linux/more.c b/util-linux/more.c index c4c74fe..298e1cf 100644 --- a/util-linux/more.c +++ b/util-linux/more.c @@ -25,12 +25,12 @@ * */ -#include "busybox.h" #include <stdio.h> #include <fcntl.h> #include <signal.h> #include <stdlib.h> #include <sys/ioctl.h> +#include "busybox.h" #define BB_DECLARE_EXTERN #define bb_need_help #include "messages.c" diff --git a/util-linux/mount.c b/util-linux/mount.c index 2f5bba5..7b0bf3e 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c @@ -43,7 +43,6 @@ * */ -#include "busybox.h" #include <stdlib.h> #include <unistd.h> #include <errno.h> @@ -54,6 +53,7 @@ #if defined BB_FEATURE_USE_DEVPS_PATCH #include <linux/devmtab.h> /* For Erik's nifty devmtab device driver */ #endif +#include "busybox.h" enum { MS_MGC_VAL = 0xc0ed0000, /* Magic number indicatng "new" flags */ diff --git a/util-linux/nfsmount.c b/util-linux/nfsmount.c index ae44f32..aee4969 100644 --- a/util-linux/nfsmount.c +++ b/util-linux/nfsmount.c @@ -33,25 +33,25 @@ * nfsmount.c,v 1.1.1.1 1993/11/18 08:40:51 jrs Exp */ -#include "busybox.h" -#undef FALSE -#undef TRUE #include <unistd.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <netdb.h> -#include <rpc/rpc.h> -#include <rpc/pmap_prot.h> -#include <rpc/pmap_clnt.h> #include <sys/socket.h> #include <time.h> #include <sys/utsname.h> #include <netinet/in.h> #include <arpa/inet.h> - -#include "nfsmount.h" +#include <stdlib.h> +#include "busybox.h" +#undef TRUE +#undef FALSE +#include <rpc/rpc.h> +#include <rpc/pmap_prot.h> +#include <rpc/pmap_clnt.h> #include <linux/nfs.h> /* For the kernels nfs stuff */ +#include "nfsmount.h" #ifndef NFS_FHSIZE static const int NFS_FHSIZE = 32; diff --git a/util-linux/pivot_root.c b/util-linux/pivot_root.c index e007101..d7b80d7 100644 --- a/util-linux/pivot_root.c +++ b/util-linux/pivot_root.c @@ -4,11 +4,11 @@ * * busyboxed by Evin Robertson */ -#include "busybox.h" #include <stdlib.h> #include <stdio.h> #include <sys/syscall.h> #include <linux/unistd.h> +#include "busybox.h" #ifndef __NR_pivot_root #error Sorry, but this kernel does not support the pivot_root syscall diff --git a/util-linux/rdate.c b/util-linux/rdate.c index 38a7689..a3ea3a8 100644 --- a/util-linux/rdate.c +++ b/util-linux/rdate.c @@ -21,9 +21,6 @@ * */ -#include "busybox.h" -#define BB_DECLARE_EXTERN -#include "messages.c" #include <sys/time.h> #include <sys/types.h> #include <sys/socket.h> @@ -33,6 +30,9 @@ #include <getopt.h> #include <stdlib.h> #include <unistd.h> +#include "busybox.h" +#define BB_DECLARE_EXTERN +#include "messages.c" static const int RFC_868_BIAS = 2208988800UL; diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index 8dda097..0613fa1 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c @@ -22,7 +22,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <mntent.h> #include <dirent.h> @@ -31,6 +30,7 @@ #include <sys/mount.h> #include <sys/syscall.h> #include <linux/unistd.h> +#include "busybox.h" _syscall2(int, swapon, const char *, path, int, flags); _syscall1(int, swapoff, const char *, path); diff --git a/util-linux/umount.c b/util-linux/umount.c index c160ec2..2868a1b 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c @@ -22,12 +22,12 @@ * */ -#include "busybox.h" #include <stdio.h> #include <mntent.h> #include <errno.h> #include <string.h> #include <stdlib.h> +#include "busybox.h" static const int MNT_FORCE = 1; @@ -25,6 +25,20 @@ * */ +#include <stdio.h> +#include <string.h> +#include <errno.h> +#include <fcntl.h> +#include <dirent.h> +#include <time.h> +#include <utime.h> +#include <unistd.h> +#include <ctype.h> +#include <stdlib.h> +#include <limits.h> +#include <sys/ioctl.h> +#include <sys/utsname.h> /* for uname(2) */ + #include "busybox.h" #if defined (BB_CHMOD_CHOWN_CHGRP) \ || defined (BB_CP_MV) \ @@ -42,20 +56,6 @@ #include "messages.c" #include "usage.h" -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <fcntl.h> -#include <dirent.h> -#include <time.h> -#include <utime.h> -#include <unistd.h> -#include <ctype.h> -#include <stdlib.h> -#include <limits.h> -#include <sys/ioctl.h> -#include <sys/utsname.h> /* for uname(2) */ - #include "pwd_grp/pwd.h" #include "pwd_grp/grp.h" @@ -22,13 +22,13 @@ */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <getopt.h> #include <string.h> #include <stdlib.h> +#include "busybox.h" #include "pwd_grp/pwd.h" #include "pwd_grp/grp.h" @@ -22,12 +22,12 @@ /* Hacked to work with BusyBox by Alfred M. Szmidt */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <getopt.h> #include <stdlib.h> +#include "busybox.h" #define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) @@ -20,11 +20,11 @@ * */ -#include "busybox.h" #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <stdlib.h> +#include "busybox.h" extern int watchdog_main(int argc, char **argv) { @@ -20,10 +20,10 @@ * */ -#include "busybox.h" #include <stdio.h> #include <getopt.h> #include <stdlib.h> +#include "busybox.h" static int total_lines, total_words, total_chars, max_length; static int print_lines, print_words, print_chars, print_length; @@ -14,7 +14,6 @@ * */ -#include "busybox.h" #include <stdio.h> #include <errno.h> #include <stdlib.h> @@ -33,6 +32,8 @@ #include <arpa/inet.h> #include <netdb.h> +#include "busybox.h" + /* Stupid libc5 doesn't define this... */ #ifndef timersub #define timersub(a, b, result) \ @@ -533,7 +534,7 @@ progressmeter(int flag) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: wget.c,v 1.27 2001/02/14 21:23:06 andersen Exp $ + * $Id: wget.c,v 1.28 2001/02/20 06:14:08 andersen Exp $ */ @@ -21,10 +21,10 @@ * */ -#include "busybox.h" #include <string.h> #include <stdio.h> #include <stdlib.h> +#include "busybox.h" extern int which_main(int argc, char **argv) { @@ -20,10 +20,10 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include "busybox.h" extern int whoami_main(int argc, char **argv) { @@ -21,10 +21,10 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> #include <string.h> +#include "busybox.h" int xargs_main(int argc, char **argv) { @@ -20,9 +20,9 @@ * */ -#include "busybox.h" #include <stdio.h> #include <stdlib.h> +#include "busybox.h" extern int yes_main(int argc, char **argv) { |