Move messages.c to libbb. Make each string in messages.c be its own .o file.
authorEric Andersen <andersen@codepoet.org>
Wed, 25 Apr 2001 05:39:18 +0000 (05:39 -0000)
committerEric Andersen <andersen@codepoet.org>
Wed, 25 Apr 2001 05:39:18 +0000 (05:39 -0000)
This way, we can new get rid of all that tedious #define rubbish we used to
need to enable specific messages.  This way is enormously simpler, and as a
bonus also ends up saving us 96 bytes.
 -Erik

46 files changed:
Makefile
applets.c
applets/applets.c
applets/busybox.c
archival/gunzip.c
archival/gzip.c
archival/libunarchive/decompress_unzip.c
archival/libunarchive/unzip.c
archival/tar.c
busybox.c
chgrp.c
chmod.c
chown.c
coreutils/chgrp.c
coreutils/chmod.c
coreutils/chown.c
coreutils/date.c
coreutils/du.c
coreutils/ln.c
coreutils/mkdir.c
coreutils/test.c
coreutils/tr.c
date.c
du.c
dutmp.c
gunzip.c
gzip.c
include/libbb.h
init.c
init/init.c
libbb/libbb.h
libbb/messages.c [new file with mode: 0644]
libbb/recursive_action.c
libbb/unzip.c
libbb/xfuncs.c
ln.c
messages.c [deleted file]
miscutils/dutmp.c
mkdir.c
more.c
procps/ps.c
ps.c
tar.c
test.c
tr.c
util-linux/more.c

index 005fb4de5d72144f664c69750545b7b257e24763..d6a1cd90c3501ec5212ff98d96c6e685ebcca924 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -212,7 +212,7 @@ endif
 # And option 4:
 -include applet_source_list
 
-OBJECTS   = $(APPLET_SOURCES:.c=.o) busybox.o messages.o usage.o applets.o
+OBJECTS   = $(APPLET_SOURCES:.c=.o) busybox.o usage.o applets.o
 CFLAGS    += $(CROSS_CFLAGS)
 CFLAGS    += -DBB_VER='"$(VERSION)"'
 CFLAGS    += -DBB_BT='"$(BUILDTIME)"'
@@ -249,13 +249,18 @@ recursive_action.c safe_read.c safe_strncpy.c seek_ared_file.c syscalls.c \
 syslog_msg_with_name.c time_string.c trim.c untar.c unzip.c vdprintf.c \
 verror_msg.c vperror_msg.c wfopen.c xfuncs.c xgetcwd.c xregcomp.c interface.c \
 remove_file.c
-
 LIBBB_OBJS=$(patsubst %.c,$(LIBBB)/%.o, $(LIBBB_CSRC))
 LIBBB_CFLAGS = -I$(LIBBB)
 ifneq ($(strip $(BB_SRC_DIR)),)
     LIBBB_CFLAGS += -I$(BB_SRC_DIR)/$(LIBBB)
 endif
 
+LIBBB_MSRC=libbb/messages.c
+LIBBB_MESSAGES= full_version name_too_long omitting_directory not_a_directory \
+memory_exhausted invalid_date invalid_option io_error dash_dash_help \
+write_error too_few_args name_longer_than_foo
+LIBBB_MOBJ=$(patsubst %,$(LIBBB)/%.o, $(LIBBB_MESSAGES))
+
 
 # Put user-supplied flags at the end, where they
 # have a chance of winning.
@@ -352,10 +357,13 @@ $(LIBBB_OBJS): %.o: %.c Config.h busybox.h applets.h Makefile libbb/libbb.h
        - mkdir -p $(LIBBB)
        $(CC) $(CFLAGS) $(LIBBB_CFLAGS) -c $< -o $*.o
 
+$(LIBBB_MOBJ): $(LIBBB_MSRC)
+       $(CC) $(CFLAGS) $(LIBBB_CFLAGS) -DL_$(patsubst libbb/%,%,$*) -c $< -o $*.o
+
 libpwd.a: $(PWD_OBJS)
        $(AR) $(ARFLAGS) $@ $^
 
-libbb.a: $(LIBBB_OBJS)
+libbb.a:  $(LIBBB_MOBJ) $(LIBBB_OBJS)
        $(AR) $(ARFLAGS) $@ $^
 
 usage.o: usage.h
index 10b44a5fc7250a930869e685df13bf31e5daed4e..c1575c70d3220919ae6986f9eec3ca323fd6c385 100644 (file)
--- a/applets.c
+++ b/applets.c
 #undef PROTOTYPES
 #include "applets.h"
 
-#define bb_need_full_version
-#define BB_DECLARE_EXTERN
-#include "messages.c"
-
 struct BB_applet *applet_using;
 
 /* The -1 arises because of the {0,NULL,0,-1} entry above. */
index 10b44a5fc7250a930869e685df13bf31e5daed4e..c1575c70d3220919ae6986f9eec3ca323fd6c385 100644 (file)
 #undef PROTOTYPES
 #include "applets.h"
 
-#define bb_need_full_version
-#define BB_DECLARE_EXTERN
-#include "messages.c"
-
 struct BB_applet *applet_using;
 
 /* The -1 arises because of the {0,NULL,0,-1} entry above. */
index 9db26df271858d6f1fa070b26a2d8bb1bc39feae..b4939e19d319a5dea4a3fbea596e7317921ec70f 100644 (file)
@@ -5,11 +5,6 @@
 #include <errno.h>
 #include <stdlib.h>
 #include "busybox.h"
-
-#define bb_need_full_version
-#define BB_DECLARE_EXTERN
-#include "messages.c"
-
 #ifdef BB_LOCALE_SUPPORT
 #include <locale.h>
 #endif
index b4edb25ac19fb502fcf727919bf7673406c11b54..db5f6ee556dbb79a5cf8666c94ea68e700d34c88 100644 (file)
@@ -65,10 +65,6 @@ static char *license_msg[] = {
 #include <unistd.h>
 #include <getopt.h>
 #include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_memory_exhausted
-#define bb_need_name_too_long
-#include "messages.c"
 
 extern int gunzip_main(int argc, char **argv)
 {
index f05ef95d02d089df9f07aabcebc1ff2b02ca14eb..6d46926ee1b6c7ba75df06372fb77ba6474a72ea 100644 (file)
@@ -44,9 +44,6 @@
 #include <unistd.h>
 #include <errno.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))
 
index 9568c2870591f0fa97169d93ba52f52df3aabb0d..7de28930ae2f9828cf546355f3ed2fb362e371bc 100644 (file)
@@ -65,10 +65,6 @@ static char *license_msg[] = {
 #include <signal.h>
 #include <stdlib.h>
 #include "libbb.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_memory_exhausted
-#define bb_need_name_too_long
-#include "../messages.c"
 
 FILE *in_file, *out_file;
 
index 9568c2870591f0fa97169d93ba52f52df3aabb0d..7de28930ae2f9828cf546355f3ed2fb362e371bc 100644 (file)
@@ -65,10 +65,6 @@ static char *license_msg[] = {
 #include <signal.h>
 #include <stdlib.h>
 #include "libbb.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_memory_exhausted
-#define bb_need_name_too_long
-#include "../messages.c"
 
 FILE *in_file, *out_file;
 
index 7cfad72b513de3a9c8d9dc31ea5e4fb87ed21222..48284c00abf87f3a28b4edcfb3701158a9e823af 100644 (file)
 #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"
 
 /* Tar file constants  */
 #ifndef MAJOR
index 9db26df271858d6f1fa070b26a2d8bb1bc39feae..b4939e19d319a5dea4a3fbea596e7317921ec70f 100644 (file)
--- a/busybox.c
+++ b/busybox.c
@@ -5,11 +5,6 @@
 #include <errno.h>
 #include <stdlib.h>
 #include "busybox.h"
-
-#define bb_need_full_version
-#define BB_DECLARE_EXTERN
-#include "messages.c"
-
 #ifdef BB_LOCALE_SUPPORT
 #include <locale.h>
 #endif
diff --git a/chgrp.c b/chgrp.c
index 739d09fb66ce8cccc8b88e885f5a4baf0172a9e1..c6312a7e496cff4a0d60f4a22b6ea9eabb303b6a 100644 (file)
--- a/chgrp.c
+++ b/chgrp.c
 #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"
 
 /* Don't use lchown for libc5 or glibc older then 2.1.x */
 #if (__GLIBC__ < 2) && (__GLIBC_MINOR__ < 1)
diff --git a/chmod.c b/chmod.c
index c3bef4ebe4b915d9a3363fd042bb5cbe08cc8951..5e12e76b9823c937cf6749fa2bc1b9635d970203 100644 (file)
--- a/chmod.c
+++ b/chmod.c
@@ -28,9 +28,6 @@
 #include <unistd.h>
 #include <getopt.h>
 #include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_too_few_args
-#include "messages.c"
 
 
 struct stat *theMode;
diff --git a/chown.c b/chown.c
index f044a752732aa01deee35131f64dc148f9869602..b6059d048286a0f3ac7ae54059177b4568dd0da9 100644 (file)
--- a/chown.c
+++ b/chown.c
 #include <string.h>
 #include <unistd.h>
 #include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_too_few_args
-#include "messages.c"
-
 
 /* Don't use lchown for libc5 or glibc older then 2.1.x */
 #if (__GLIBC__ < 2) && (__GLIBC_MINOR__ < 1)
index 739d09fb66ce8cccc8b88e885f5a4baf0172a9e1..c6312a7e496cff4a0d60f4a22b6ea9eabb303b6a 100644 (file)
 #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"
 
 /* Don't use lchown for libc5 or glibc older then 2.1.x */
 #if (__GLIBC__ < 2) && (__GLIBC_MINOR__ < 1)
index c3bef4ebe4b915d9a3363fd042bb5cbe08cc8951..5e12e76b9823c937cf6749fa2bc1b9635d970203 100644 (file)
@@ -28,9 +28,6 @@
 #include <unistd.h>
 #include <getopt.h>
 #include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_too_few_args
-#include "messages.c"
 
 
 struct stat *theMode;
index f044a752732aa01deee35131f64dc148f9869602..b6059d048286a0f3ac7ae54059177b4568dd0da9 100644 (file)
 #include <string.h>
 #include <unistd.h>
 #include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_too_few_args
-#include "messages.c"
-
 
 /* Don't use lchown for libc5 or glibc older then 2.1.x */
 #if (__GLIBC__ < 2) && (__GLIBC_MINOR__ < 1)
index 4b2f66add384cfc87b32eaf3d3bbb0922547df26..22a1304d5aae8718394805c97ccf527cf95514ed 100644 (file)
 #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, 
index 119895e491b2d5647636e419d8b80d2ad5e64a41..3f7621b3de2ac1972cb8502bd183a0e7b64fa526 100644 (file)
@@ -31,9 +31,6 @@
 #include <string.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
@@ -192,7 +189,7 @@ int du_main(int argc, char **argv)
        return status;
 }
 
-/* $Id: du.c,v 1.44 2001/04/09 22:48:11 andersen Exp $ */
+/* $Id: du.c,v 1.45 2001/04/25 05:39:18 andersen Exp $ */
 /*
 Local Variables:
 c-file-style: "linux"
index 6d41cce62c67dd07602379ebaf7f697d971b2997..7412a86fd124dd7a581a0227efa03e1d0c231f86 100644 (file)
@@ -28,9 +28,6 @@
 #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;
index 902da7c9982e852d44643718da01fa7f8d76b112..d78f57e2bb4786288d729528189416d62d27ea86 100644 (file)
@@ -26,9 +26,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include "busybox.h"
-#define bb_need_name_too_long
-#define BB_DECLARE_EXTERN
-#include "messages.c"
 
 
 static int parentFlag = FALSE;
index 79db8cbb62c65306c79d33b614fd6abd2fcea5e4..9c66cbb87150544fd391c70580b04aeeb75816ab 100644 (file)
@@ -38,9 +38,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_help
-#include "messages.c"
 
 /* test(1) accepts the following grammar:
        oexpr   ::= aexpr | aexpr "-o" oexpr ;
index ce15cfdf8bad1341568a74286889ed676f745c7f..ff0f331ffbb565260d96f1a2da7d8aaa37925436 100644 (file)
@@ -30,9 +30,6 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_write_error
-#include "messages.c"
 
 static const int ASCII = 0377;
 
diff --git a/date.c b/date.c
index 4b2f66add384cfc87b32eaf3d3bbb0922547df26..22a1304d5aae8718394805c97ccf527cf95514ed 100644 (file)
--- a/date.c
+++ b/date.c
 #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/du.c b/du.c
index 119895e491b2d5647636e419d8b80d2ad5e64a41..3f7621b3de2ac1972cb8502bd183a0e7b64fa526 100644 (file)
--- a/du.c
+++ b/du.c
@@ -31,9 +31,6 @@
 #include <string.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
@@ -192,7 +189,7 @@ int du_main(int argc, char **argv)
        return status;
 }
 
-/* $Id: du.c,v 1.44 2001/04/09 22:48:11 andersen Exp $ */
+/* $Id: du.c,v 1.45 2001/04/25 05:39:18 andersen Exp $ */
 /*
 Local Variables:
 c-file-style: "linux"
diff --git a/dutmp.c b/dutmp.c
index df5ee13fb59e5faa2a578ec3e1749db569d41c4d..5732539d23f9e6b7c0c19065dcb61d37b8279476 100644 (file)
--- a/dutmp.c
+++ b/dutmp.c
@@ -20,9 +20,6 @@
 #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)
 {
index b4edb25ac19fb502fcf727919bf7673406c11b54..db5f6ee556dbb79a5cf8666c94ea68e700d34c88 100644 (file)
--- a/gunzip.c
+++ b/gunzip.c
@@ -65,10 +65,6 @@ static char *license_msg[] = {
 #include <unistd.h>
 #include <getopt.h>
 #include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_memory_exhausted
-#define bb_need_name_too_long
-#include "messages.c"
 
 extern int gunzip_main(int argc, char **argv)
 {
diff --git a/gzip.c b/gzip.c
index f05ef95d02d089df9f07aabcebc1ff2b02ca14eb..6d46926ee1b6c7ba75df06372fb77ba6474a72ea 100644 (file)
--- a/gzip.c
+++ b/gzip.c
@@ -44,9 +44,6 @@
 #include <unistd.h>
 #include <errno.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))
 
index bbfffda6d0eefaef42a03cef677a17124f8f4553..cbc1436fce7055953d3daae457dde1aaac1a13d2 100644 (file)
@@ -264,5 +264,17 @@ enum {
 };
 
 extern const char *applet_name;
+extern const char *full_version;
+extern const char *name_too_long;
+extern const char *omitting_directory;
+extern const char *not_a_directory;
+extern const char *memory_exhausted;
+extern const char *invalid_date;
+extern const char *invalid_option;
+extern const char *io_error;
+extern const char *dash_dash_help;
+extern const char *write_error;
+extern const char *too_few_args;
+extern const char *name_longer_than_foo;
 
 #endif /* __LIBBB_H__ */
diff --git a/init.c b/init.c
index d65220cdd97df72ba4c5649c853b7377a578f705..e7c096d49b397d8b7b863bb1a99b277dbfa60c56 100644 (file)
--- a/init.c
+++ b/init.c
@@ -43,9 +43,6 @@
 #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
index d65220cdd97df72ba4c5649c853b7377a578f705..e7c096d49b397d8b7b863bb1a99b277dbfa60c56 100644 (file)
@@ -43,9 +43,6 @@
 #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
index bbfffda6d0eefaef42a03cef677a17124f8f4553..cbc1436fce7055953d3daae457dde1aaac1a13d2 100644 (file)
@@ -264,5 +264,17 @@ enum {
 };
 
 extern const char *applet_name;
+extern const char *full_version;
+extern const char *name_too_long;
+extern const char *omitting_directory;
+extern const char *not_a_directory;
+extern const char *memory_exhausted;
+extern const char *invalid_date;
+extern const char *invalid_option;
+extern const char *io_error;
+extern const char *dash_dash_help;
+extern const char *write_error;
+extern const char *too_few_args;
+extern const char *name_longer_than_foo;
 
 #endif /* __LIBBB_H__ */
diff --git a/libbb/messages.c b/libbb/messages.c
new file mode 100644 (file)
index 0000000..16ac63f
--- /dev/null
@@ -0,0 +1,61 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 2001 by Lineo, inc.
+ * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include "../busybox.h"
+
+#ifdef L_full_version
+       const char *full_version = BB_BANNER " multi-call binary";
+#endif
+#ifdef L_name_too_long
+       const char *name_too_long = "file name too long";
+#endif
+
+#ifdef L_omitting_directory
+       const char *omitting_directory = "%s: omitting directory";
+#endif
+#ifdef L_not_a_directory
+       const char *not_a_directory = "%s: not a directory";
+#endif
+#ifdef L_memory_exhausted
+       const char *memory_exhausted = "memory exhausted";
+#endif
+#ifdef L_invalid_date
+       const char *invalid_date = "invalid date `%s'";
+#endif
+#ifdef L_invalid_option
+       const char *invalid_option = "invalid option -- %c";
+#endif
+#ifdef L_io_error
+       const char *io_error = "%s: input/output error -- %s";
+#endif
+#ifdef L_dash_dash_help
+       const char *dash_dash_help = "--help";
+#endif
+#ifdef L_write_error
+       const char *write_error = "Write Error";
+#endif
+#ifdef L_too_few_args
+       const char *too_few_args = "too few arguments";
+#endif
+#ifdef L_name_longer_than_foo
+       const char *name_longer_than_foo = "Names longer than %d chars not supported.";
+#endif
+
index 510080b8360d2350c014565c6d010716b6f2a0db..6672db17fe9966b424bc720c1e7c3c1be0df1ee9 100644 (file)
 #include <stdlib.h>    /* free() */
 #include "libbb.h"
 
-
-/* same conditions as recursive_action */
-#define bb_need_name_too_long
-#define BB_DECLARE_EXTERN
-#include "../messages.c"
-
 #undef DEBUG_RECURS_ACTION
 
 
index 9568c2870591f0fa97169d93ba52f52df3aabb0d..7de28930ae2f9828cf546355f3ed2fb362e371bc 100644 (file)
@@ -65,10 +65,6 @@ static char *license_msg[] = {
 #include <signal.h>
 #include <stdlib.h>
 #include "libbb.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_memory_exhausted
-#define bb_need_name_too_long
-#include "../messages.c"
 
 FILE *in_file, *out_file;
 
index e7f41aae2b0e070e0bd8a0abc36606cba039854d..f3b294be2ad0592eb2f0d1059590dc712b567c02 100644 (file)
 #include <unistd.h>
 #include "libbb.h"
 
-/* same conditions as recursive_action */
-#define bb_need_memory_exhausted
-#define BB_DECLARE_EXTERN
-#include "../messages.c"
-
 
 #ifndef DMALLOC
 extern void *xmalloc(size_t size)
diff --git a/ln.c b/ln.c
index 6d41cce62c67dd07602379ebaf7f697d971b2997..7412a86fd124dd7a581a0227efa03e1d0c231f86 100644 (file)
--- a/ln.c
+++ b/ln.c
@@ -28,9 +28,6 @@
 #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;
diff --git a/messages.c b/messages.c
deleted file mode 100644 (file)
index 57630a8..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/* vi: set sw=4 ts=4: */
-/*
- * Copyright (C) 2000 by BitterSweet Enterprises, LLC.
- * Written by Karl M. Hegbloom <karlheg@debian.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- *  Let's put all of these messages in one place, and link this in as
- *  a separate object module, so that there are not going to be
- *  multiple non-unique but very similar strings in the binary.
- *  Perhaps this will make it simpler to internationalize also, and
- *  may make the binary slightly smaller.
- */
-
-// To use this header file, include something like this:
-//
-//#define BB_DECLARE_EXTERN
-//#define bb_need_memory_exhausted
-//#include "messages.c"
-//
-//Then just use the string memory_exhausted when it is needed.
-//
-
-#include "busybox.h"
-#ifndef _BB_MESSAGES_C
-#define _BB_MESSAGES_C
-
-#ifdef BB_DECLARE_EXTERN
-#  define BB_DEF_MESSAGE(symbol, string_const) extern const char *symbol;
-#else
-#  define BB_DEF_MESSAGE(symbol, string_const) const char *symbol = string_const;
-#endif
-
-
-#if defined bb_need_full_version || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(full_version, BB_BANNER " multi-call binary")
-#endif
-#if defined bb_need_name_too_long || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(name_too_long, "file name too long")
-#endif
-#if defined bb_need_omitting_directory || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(omitting_directory, "%s: omitting directory")
-#endif
-#if defined bb_need_not_a_directory || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(not_a_directory, "%s: not a directory")
-#endif
-#if defined bb_need_memory_exhausted || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(memory_exhausted, "memory exhausted")
-#endif
-#if defined bb_need_invalid_date || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(invalid_date, "invalid date `%s'")
-#endif
-#if defined bb_need_invalid_option || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(invalid_option, "invalid option -- %c")
-#endif
-#if defined bb_need_io_error || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(io_error, "%s: input/output error -- %s")
-#endif
-#if defined bb_need_help || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(dash_dash_help, "--help")
-#endif
-#if defined bb_need_write_error || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(write_error, "Write Error")
-#endif
-#if defined bb_need_too_few_args || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(too_few_args, "too few arguments")
-#endif
-#if defined bb_need_name_longer_than_foo || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(name_longer_than_foo, "Names longer than %d chars not supported.")
-#endif
-
-
-#endif /* _BB_MESSAGES_C */
-
index df5ee13fb59e5faa2a578ec3e1749db569d41c4d..5732539d23f9e6b7c0c19065dcb61d37b8279476 100644 (file)
@@ -20,9 +20,6 @@
 #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/mkdir.c b/mkdir.c
index 902da7c9982e852d44643718da01fa7f8d76b112..d78f57e2bb4786288d729528189416d62d27ea86 100644 (file)
--- a/mkdir.c
+++ b/mkdir.c
@@ -26,9 +26,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include "busybox.h"
-#define bb_need_name_too_long
-#define BB_DECLARE_EXTERN
-#include "messages.c"
 
 
 static int parentFlag = FALSE;
diff --git a/more.c b/more.c
index ffc79b179c98c569c45b75630fdbc5cb341f27b8..8ae2661ab64bf7e9c45247e254cd910be9431135 100644 (file)
--- a/more.c
+++ b/more.c
@@ -31,9 +31,6 @@
 #include <stdlib.h>
 #include <sys/ioctl.h>
 #include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_help
-#include "messages.c"
 
 /* ED: sparc termios is broken: revert back to old termio handling. */
 #ifdef BB_FEATURE_USE_TERMIOS
index 4ce43c47f9f0242d55d57fcb79f41c2776f2f7bb..24f806c4b35d3e5dc45bd23c18e6b1883efa4d88 100644 (file)
@@ -38,9 +38,6 @@
 #include <string.h>
 #include <sys/ioctl.h>
 #include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_help
-#include "messages.c"
 
 static const int TERMINAL_WIDTH = 79;      /* not 80 in case terminal has linefold bug */
 
diff --git a/ps.c b/ps.c
index 4ce43c47f9f0242d55d57fcb79f41c2776f2f7bb..24f806c4b35d3e5dc45bd23c18e6b1883efa4d88 100644 (file)
--- a/ps.c
+++ b/ps.c
@@ -38,9 +38,6 @@
 #include <string.h>
 #include <sys/ioctl.h>
 #include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_help
-#include "messages.c"
 
 static const int TERMINAL_WIDTH = 79;      /* not 80 in case terminal has linefold bug */
 
diff --git a/tar.c b/tar.c
index 7cfad72b513de3a9c8d9dc31ea5e4fb87ed21222..48284c00abf87f3a28b4edcfb3701158a9e823af 100644 (file)
--- a/tar.c
+++ b/tar.c
 #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"
 
 /* Tar file constants  */
 #ifndef MAJOR
diff --git a/test.c b/test.c
index 79db8cbb62c65306c79d33b614fd6abd2fcea5e4..9c66cbb87150544fd391c70580b04aeeb75816ab 100644 (file)
--- a/test.c
+++ b/test.c
@@ -38,9 +38,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_help
-#include "messages.c"
 
 /* test(1) accepts the following grammar:
        oexpr   ::= aexpr | aexpr "-o" oexpr ;
diff --git a/tr.c b/tr.c
index ce15cfdf8bad1341568a74286889ed676f745c7f..ff0f331ffbb565260d96f1a2da7d8aaa37925436 100644 (file)
--- a/tr.c
+++ b/tr.c
@@ -30,9 +30,6 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_write_error
-#include "messages.c"
 
 static const int ASCII = 0377;
 
index ffc79b179c98c569c45b75630fdbc5cb341f27b8..8ae2661ab64bf7e9c45247e254cd910be9431135 100644 (file)
@@ -31,9 +31,6 @@
 #include <stdlib.h>
 #include <sys/ioctl.h>
 #include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_help
-#include "messages.c"
 
 /* ED: sparc termios is broken: revert back to old termio handling. */
 #ifdef BB_FEATURE_USE_TERMIOS