diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-02-20 06:14:08 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-02-20 06:14:08 +0000 |
commit | cbe31dace5fb24304694d399b9eb267fbe752516 (patch) | |
tree | 49d1bb722d95eb1aded6b5d354ac86e56c481c10 | |
parent | 94456f598417f2f61edb97b5ab67ddfdc408ad10 (diff) | |
download | 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 6c1070fc8..5fec3d5ec 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 bf8812dbd..8100003ec 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 3cbef4ec1..6c058d2b6 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 62f1b1d35..a9363d5ad 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); diff --git a/basename.c b/basename.c index da59a8672..da0b7ecc3 100644 --- a/basename.c +++ b/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) @@ -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 9363bd757..a458cf77a 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 f2e6d5f17..c4b3639df 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 dab4b05a7..503bafa16 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 8c390c261..15cd0c9b9 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 b9f1bd233..0da01868b 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 6422137a1..81b973b02 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 d7bd7e8f5..1a724ca85 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 5ecd819f9..dcb5c1caa 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 294cab3c4..755c4c335 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 0be4724ca..c3c7e09aa 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 da59a8672..da0b7ecc3 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 134245cdc..3554008f8 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 e721e1ffa..bae9cd757 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 c04b6e1c9..24b6c3f92 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 21d31bb25..878331f71 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 e445e0435..1618dd102 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 692205a0e..ebee4d607 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 e34ecf8a9..7f191c1b9 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 32423611c..222c8f6a4 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 516f4c92b..6197b0bc1 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 b3e01afec..e9bc50a15 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 8ef5293c1..3b454bd3a 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 a2d774437..c683ec78a 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 eed1a50ec..68a2cc659 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 9119adca8..73becd28a 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 e35bf7a03..6d41cce62 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 a1887aaf9..0924b2471 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 dd38dd5f3..a619bb8b2 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 3decafdf4..fa11ee61d 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 285d34f12..902da7c99 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 56a04f772..ca217fa23 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 73f6e06f1..b4d4b82a1 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 26a200e85..003423d56 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 a9acbc721..a7a5f78a1 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 566076707..a84163272 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 6266ce1ef..2c280376f 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 d21af19b3..3bcab88ee 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 4984f5dfe..ed6872218 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 4a5aecf1d..10e28254d 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 3d4686efa..ee22ae109 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 778c2d18b..a85256c80 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 6439e3a8a..ab9c23e4b 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 a3256d559..1718da71e 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 92f399e14..b7a6009c8 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 d71d8dedb..4510c2996 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 899da7792..4931ff1d8 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 84f1ed231..53e3c64f2 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 c67c365b8..92e4437c5 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 c0e8cea8c..6a3f78a42 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 8d5af4a8a..41541defb 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 f41687422..f2d33d6f3 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 54df0bf12..0bbb54b7b 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 0a8ad83a7..ad7b98f84 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 8c390c261..15cd0c9b9 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) { diff --git a/dos2unix.c b/dos2unix.c index 32423611c..222c8f6a4 100644 --- a/dos2unix.c +++ b/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; @@ -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/dumpkmap.c b/dumpkmap.c index b9f1bd233..0da01868b 100644 --- a/dumpkmap.c +++ b/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 { @@ -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 a07dc8ecb..15e693ab9 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 1908db30a..f9d51f2f3 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 f05efd917..01aa5be69 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 2b4c65144..9a53a705e 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) { diff --git a/ifconfig.c b/ifconfig.c index 66615a2fd..a3e2c0fdb 100644 --- a/ifconfig.c +++ b/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 */ @@ -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 9046a14a8..1332a1064 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; diff --git a/loadfont.c b/loadfont.c index d7bd7e8f5..1a724ca85 100644 --- a/loadfont.c +++ b/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/loadkmap.c b/loadkmap.c index 5ecd819f9..dcb5c1caa 100644 --- a/loadkmap.c +++ b/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" @@ -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" diff --git a/makedevs.c b/makedevs.c index eed3968c8..b8c6dd1d8 100644 --- a/makedevs.c +++ b/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) { @@ -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 1e34574ed..a422139b1 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 2e6b3c056..a75a6e392 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 eed3968c8..b8c6dd1d8 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 b3522026e..31ab9e228 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 eb93cb234..350d3ae5a 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 c82f64027..74196e11d 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 2cf4a98b2..b282b9e18 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 65d0fc35f..5b5fd6953 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 6b4a3e2d1..b666338dc 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 58273521f..166f0fc4b 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 f39cbc08f..c97d199a6 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 7d4538e6e..aab326123 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 66615a2fd..a3e2c0fdb 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 8927103e0..e40d4b459 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 33732de68..8791b5efe 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 c114fb0b3..50c7ce6e6 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 d98d9a0b6..9be002792 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 ed92a8403..fd1ace41d 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 d1aacefa6..4b8392ba5 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 $ */ diff --git a/nfsmount.c b/nfsmount.c index ae44f3207..aee496980 100644 --- a/nfsmount.c +++ b/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/nslookup.c b/nslookup.c index 33732de68..8791b5efe 100644 --- a/nslookup.c +++ b/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 $ */ @@ -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 e00710148..d7b80d749 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 d287c03f5..41e872d12 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 bdd22b52d..e62503b3c 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 dd154af9d..4ce43c47f 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 9180ebf81..ec35bdcde 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 213a39851..64df194f4 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; diff --git a/readlink.c b/readlink.c index c82f64027..74196e11d 100644 --- a/readlink.c +++ b/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) { @@ -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 79971faf3..12e9c71de 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 0be4724ca..c3c7e09aa 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 97ba8316d..9cb53522f 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 8dda0972a..0613fa1e9 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 352bde158..1218d8d2e 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 872728b5b..8049fc5d1 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 187f68072..47d3bb1e4 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 47f9f4474..2c85ed3e9 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 9acabbecb..72284a6c5 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 f10cceae0..28f5cb68a 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 2b4c65144..9a53a705e 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 6b4a3e2d1..b666338dc 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 48637e889..b5153f623 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 c4c74fe4a..298e1cfb1 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 2f5bba59d..7b0bf3e21 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 ae44f3207..aee496980 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 e00710148..d7b80d749 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 38a7689e9..a3ea3a85b 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 8dda0972a..0613fa1e9 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 c160ec284..2868a1bc3 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" diff --git a/uudecode.c b/uudecode.c index c0e8cea8c..6a3f78a42 100644 --- a/uudecode.c +++ b/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/uuencode.c b/uuencode.c index 8d5af4a8a..41541defb 100644 --- a/uuencode.c +++ b/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/watchdog.c b/watchdog.c index 65d0fc35f..5b5fd6953 100644 --- a/watchdog.c +++ b/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) { @@ -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) { |