aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-25 05:39:18 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-25 05:39:18 +0000
commit04095e58fb4d3a083f77962714080ffe8139b39c (patch)
treeaa3580587822774ffed9831aacee11d977d0a5f9 /libbb
parent3676374915866fb06224a19e2274afe026eb9377 (diff)
downloadbusybox-04095e58fb4d3a083f77962714080ffe8139b39c.tar.gz
Move messages.c to libbb. Make each string in messages.c be its own .o file.
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
Diffstat (limited to 'libbb')
-rw-r--r--libbb/libbb.h12
-rw-r--r--libbb/messages.c61
-rw-r--r--libbb/recursive_action.c6
-rw-r--r--libbb/unzip.c4
-rw-r--r--libbb/xfuncs.c5
5 files changed, 73 insertions, 15 deletions
diff --git a/libbb/libbb.h b/libbb/libbb.h
index bbfffda6d..cbc1436fc 100644
--- a/libbb/libbb.h
+++ b/libbb/libbb.h
@@ -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
index 000000000..16ac63f69
--- /dev/null
+++ b/libbb/messages.c
@@ -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
+
diff --git a/libbb/recursive_action.c b/libbb/recursive_action.c
index 510080b83..6672db17f 100644
--- a/libbb/recursive_action.c
+++ b/libbb/recursive_action.c
@@ -32,12 +32,6 @@
#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
diff --git a/libbb/unzip.c b/libbb/unzip.c
index 9568c2870..7de28930a 100644
--- a/libbb/unzip.c
+++ b/libbb/unzip.c
@@ -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;
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index e7f41aae2..f3b294be2 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -31,11 +31,6 @@
#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)