New message added to messages.c: full_version
authorPavel Roskin <proski@gnu.org>
Mon, 17 Jul 2000 23:45:12 +0000 (23:45 -0000)
committerPavel Roskin <proski@gnu.org>
Mon, 17 Jul 2000 23:45:12 +0000 (23:45 -0000)
Used where possible

applets/busybox.c
busybox.c
editors/sed.c
init.c
init/init.c
lash.c
messages.c
sed.c
sh.c
shell/lash.c
utility.c

index 041cdeb01d3e17eca4471f8f9768ddbccd0fe6bd..a88761aa2d33a767a2b3aa44a67883828d00305f 100644 (file)
@@ -4,6 +4,10 @@
 #include <string.h>
 #include <errno.h>
 
+#define bb_need_full_version
+#define BB_DECLARE_EXTERN
+#include "messages.c"
+
 static int been_there_done_that = 0;
 
 /* It has been alledged that doing such things can
@@ -504,14 +508,14 @@ int busybox_main(int argc, char **argv)
        if (been_there_done_that == 1 || argc < 1) {
                const struct BB_applet *a = applets;
 
-               fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n"
+               fprintf(stderr, "%s\n\n"
                                "Usage: busybox [function] [arguments]...\n"
                                "   or: [function] [arguments]...\n\n"
                                "\tBusyBox is a multi-call binary that combines many common Unix\n"
                                "\tutilities into a single executable.  Most people will create a\n"
                                "\tlink to busybox for each function they wish to use, and BusyBox\n"
                                "\twill act like whatever it was invoked as.\n" 
-                               "\nCurrently defined functions:\n", BB_VER, BB_BT);
+                               "\nCurrently defined functions:\n", full_version);
 
                while (a->name != 0) {
                        col +=
index 041cdeb01d3e17eca4471f8f9768ddbccd0fe6bd..a88761aa2d33a767a2b3aa44a67883828d00305f 100644 (file)
--- a/busybox.c
+++ b/busybox.c
@@ -4,6 +4,10 @@
 #include <string.h>
 #include <errno.h>
 
+#define bb_need_full_version
+#define BB_DECLARE_EXTERN
+#include "messages.c"
+
 static int been_there_done_that = 0;
 
 /* It has been alledged that doing such things can
@@ -504,14 +508,14 @@ int busybox_main(int argc, char **argv)
        if (been_there_done_that == 1 || argc < 1) {
                const struct BB_applet *a = applets;
 
-               fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n"
+               fprintf(stderr, "%s\n\n"
                                "Usage: busybox [function] [arguments]...\n"
                                "   or: [function] [arguments]...\n\n"
                                "\tBusyBox is a multi-call binary that combines many common Unix\n"
                                "\tutilities into a single executable.  Most people will create a\n"
                                "\tlink to busybox for each function they wish to use, and BusyBox\n"
                                "\twill act like whatever it was invoked as.\n" 
-                               "\nCurrently defined functions:\n", BB_VER, BB_BT);
+                               "\nCurrently defined functions:\n", full_version);
 
                while (a->name != 0) {
                        col +=
index 195175e8872edf8bd0967f2ef7d03c8423e7523c..3973d212df539b34ff67002d9a1dc70bdad709a1 100644 (file)
@@ -52,6 +52,9 @@
 #include <ctype.h> /* for isspace() */
 #include "internal.h"
 
+#define bb_need_full_version
+#define BB_DECLARE_EXTERN
+#include "messages.c"
 
 /* externs */
 extern int optind; /* in unistd.h */
@@ -676,7 +679,7 @@ extern int sed_main(int argc, char **argv)
        while ((opt = getopt(argc, argv, "Vhne:f:")) > 0) {
                switch (opt) {
                        case 'V':
-                               printf("BusyBox v%s (%s)\n", BB_VER, BB_BT);
+                               printf("%s\n", full_version);
                                exit(0);
                                break;
                        case 'h':
diff --git a/init.c b/init.c
index 5a894392b2d4a1745766d23882ca547be0578c47..ab4ad56519f2085ebd46226be8cddba1fa5bde87 100644 (file)
--- a/init.c
+++ b/init.c
 # include <sys/syslog.h>
 #endif
 
+#define bb_need_full_version
+#define BB_DECLARE_EXTERN
+#include "messages.c"
+
 /* From <linux/vt.h> */
 struct vt_stat {
        unsigned short v_active;        /* active vt */
@@ -938,16 +942,14 @@ extern int init_main(int argc, char **argv)
                        CONSOLE|
 #endif
                        LOG,
-                       "init started:  BusyBox v%s (%s) multi-call binary\r\n",
-                       BB_VER, BB_BT);
+                       "init started:  %s\r\n", full_version);
 #else
        message(
 #if ! defined BB_FEATURE_EXTRA_QUIET
                        CONSOLE|
 #endif
                        LOG,
-                       "init(%d) started:  BusyBox v%s (%s) multi-call binary\r\n",
-                       getpid(), BB_VER, BB_BT);
+                       "init(%d) started:  %s\r\n", getpid(), full_version);
 #endif
 
 
index 5a894392b2d4a1745766d23882ca547be0578c47..ab4ad56519f2085ebd46226be8cddba1fa5bde87 100644 (file)
 # include <sys/syslog.h>
 #endif
 
+#define bb_need_full_version
+#define BB_DECLARE_EXTERN
+#include "messages.c"
+
 /* From <linux/vt.h> */
 struct vt_stat {
        unsigned short v_active;        /* active vt */
@@ -938,16 +942,14 @@ extern int init_main(int argc, char **argv)
                        CONSOLE|
 #endif
                        LOG,
-                       "init started:  BusyBox v%s (%s) multi-call binary\r\n",
-                       BB_VER, BB_BT);
+                       "init started:  %s\r\n", full_version);
 #else
        message(
 #if ! defined BB_FEATURE_EXTRA_QUIET
                        CONSOLE|
 #endif
                        LOG,
-                       "init(%d) started:  BusyBox v%s (%s) multi-call binary\r\n",
-                       getpid(), BB_VER, BB_BT);
+                       "init(%d) started:  %s\r\n", getpid(), full_version);
 #endif
 
 
diff --git a/lash.c b/lash.c
index 1dfce9e776ddfd997f7750ec005014bd8e294164..c9ef39f491d75f07d0da0d60a03e959c69b3ac56 100644 (file)
--- a/lash.c
+++ b/lash.c
 #include "cmdedit.h"
 #endif
 
+#define bb_need_full_version
+#define BB_DECLARE_EXTERN
+#include "messages.c"
+
 #define MAX_READ       128     /* size of input buffer for `read' builtin */
 #define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n"
 
@@ -1141,7 +1145,7 @@ int shell_main(int argc, char **argv)
        //}
 
        if (argc < 2) {
-               fprintf(stdout, "\n\nBusyBox v%s (%s) Built-in shell\n", BB_VER, BB_BT);
+               fprintf(stdout, "\n\n%s Built-in shell\n", full_version);
                fprintf(stdout, "Enter 'help' for a list of built-in commands.\n\n");
        } else {
                if (argv[1][0]=='-' && argv[1][1]=='c') {
index 428db9eaaa49a03ed2f2133f266727b417afe4cf..34b39f258e7eb247cfcdd96cb494a73a18c0435f 100644 (file)
 #endif
 
 
+#if defined bb_need_full_version || ! defined BB_DECLARE_EXTERN
+       BB_DEF_MESSAGE(full_version,
+        "BusyBox v" BB_VER " (" BB_BT ") multi-call binary -- GPL2")
+#endif
 #if defined bb_need_name_too_long || ! defined BB_DECLARE_EXTERN
        BB_DEF_MESSAGE(name_too_long, "file name too long\n")
 #endif
diff --git a/sed.c b/sed.c
index 195175e8872edf8bd0967f2ef7d03c8423e7523c..3973d212df539b34ff67002d9a1dc70bdad709a1 100644 (file)
--- a/sed.c
+++ b/sed.c
@@ -52,6 +52,9 @@
 #include <ctype.h> /* for isspace() */
 #include "internal.h"
 
+#define bb_need_full_version
+#define BB_DECLARE_EXTERN
+#include "messages.c"
 
 /* externs */
 extern int optind; /* in unistd.h */
@@ -676,7 +679,7 @@ extern int sed_main(int argc, char **argv)
        while ((opt = getopt(argc, argv, "Vhne:f:")) > 0) {
                switch (opt) {
                        case 'V':
-                               printf("BusyBox v%s (%s)\n", BB_VER, BB_BT);
+                               printf("%s\n", full_version);
                                exit(0);
                                break;
                        case 'h':
diff --git a/sh.c b/sh.c
index 1dfce9e776ddfd997f7750ec005014bd8e294164..c9ef39f491d75f07d0da0d60a03e959c69b3ac56 100644 (file)
--- a/sh.c
+++ b/sh.c
 #include "cmdedit.h"
 #endif
 
+#define bb_need_full_version
+#define BB_DECLARE_EXTERN
+#include "messages.c"
+
 #define MAX_READ       128     /* size of input buffer for `read' builtin */
 #define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n"
 
@@ -1141,7 +1145,7 @@ int shell_main(int argc, char **argv)
        //}
 
        if (argc < 2) {
-               fprintf(stdout, "\n\nBusyBox v%s (%s) Built-in shell\n", BB_VER, BB_BT);
+               fprintf(stdout, "\n\n%s Built-in shell\n", full_version);
                fprintf(stdout, "Enter 'help' for a list of built-in commands.\n\n");
        } else {
                if (argv[1][0]=='-' && argv[1][1]=='c') {
index 1dfce9e776ddfd997f7750ec005014bd8e294164..c9ef39f491d75f07d0da0d60a03e959c69b3ac56 100644 (file)
 #include "cmdedit.h"
 #endif
 
+#define bb_need_full_version
+#define BB_DECLARE_EXTERN
+#include "messages.c"
+
 #define MAX_READ       128     /* size of input buffer for `read' builtin */
 #define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n"
 
@@ -1141,7 +1145,7 @@ int shell_main(int argc, char **argv)
        //}
 
        if (argc < 2) {
-               fprintf(stdout, "\n\nBusyBox v%s (%s) Built-in shell\n", BB_VER, BB_BT);
+               fprintf(stdout, "\n\n%s Built-in shell\n", full_version);
                fprintf(stdout, "Enter 'help' for a list of built-in commands.\n\n");
        } else {
                if (argv[1][0]=='-' && argv[1][1]=='c') {
index 5f890c0ea9c06ff51a4cb02aae7da2c00484c190..18d3c14401efa775a957c9b708d89845c8fe268a 100644 (file)
--- a/utility.c
+++ b/utility.c
@@ -37,6 +37,7 @@
 #define bb_need_name_too_long
 #endif
 #define bb_need_memory_exhausted
+#define bb_need_full_version
 #define BB_DECLARE_EXTERN
 #include "messages.c"
 
@@ -84,8 +85,7 @@ const char mtab_file[] = "/dev/mtab";
 
 extern void usage(const char *usage)
 {
-       fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n",
-                       BB_VER, BB_BT);
+       fprintf(stderr, "%s\n\n", full_version);
        fprintf(stderr, "Usage: %s\n", usage);
        exit FALSE;
 }