New message added to messages.c: full_version

Used where possible
This commit is contained in:
Pavel Roskin 2000-07-17 23:45:12 +00:00
parent cc8a66b113
commit 9c5fcc3408
11 changed files with 53 additions and 19 deletions

View File

@ -4,6 +4,10 @@
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#define bb_need_full_version
#define BB_DECLARE_EXTERN
#include "messages.c"
static int been_there_done_that = 0; static int been_there_done_that = 0;
/* It has been alledged that doing such things can /* 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) { if (been_there_done_that == 1 || argc < 1) {
const struct BB_applet *a = applets; 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" "Usage: busybox [function] [arguments]...\n"
" or: [function] [arguments]...\n\n" " or: [function] [arguments]...\n\n"
"\tBusyBox is a multi-call binary that combines many common Unix\n" "\tBusyBox is a multi-call binary that combines many common Unix\n"
"\tutilities into a single executable. Most people will create a\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" "\tlink to busybox for each function they wish to use, and BusyBox\n"
"\twill act like whatever it was invoked as.\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) { while (a->name != 0) {
col += col +=

View File

@ -4,6 +4,10 @@
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#define bb_need_full_version
#define BB_DECLARE_EXTERN
#include "messages.c"
static int been_there_done_that = 0; static int been_there_done_that = 0;
/* It has been alledged that doing such things can /* 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) { if (been_there_done_that == 1 || argc < 1) {
const struct BB_applet *a = applets; 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" "Usage: busybox [function] [arguments]...\n"
" or: [function] [arguments]...\n\n" " or: [function] [arguments]...\n\n"
"\tBusyBox is a multi-call binary that combines many common Unix\n" "\tBusyBox is a multi-call binary that combines many common Unix\n"
"\tutilities into a single executable. Most people will create a\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" "\tlink to busybox for each function they wish to use, and BusyBox\n"
"\twill act like whatever it was invoked as.\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) { while (a->name != 0) {
col += col +=

View File

@ -52,6 +52,9 @@
#include <ctype.h> /* for isspace() */ #include <ctype.h> /* for isspace() */
#include "internal.h" #include "internal.h"
#define bb_need_full_version
#define BB_DECLARE_EXTERN
#include "messages.c"
/* externs */ /* externs */
extern int optind; /* in unistd.h */ 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) { while ((opt = getopt(argc, argv, "Vhne:f:")) > 0) {
switch (opt) { switch (opt) {
case 'V': case 'V':
printf("BusyBox v%s (%s)\n", BB_VER, BB_BT); printf("%s\n", full_version);
exit(0); exit(0);
break; break;
case 'h': case 'h':

10
init.c
View File

@ -46,6 +46,10 @@
# include <sys/syslog.h> # include <sys/syslog.h>
#endif #endif
#define bb_need_full_version
#define BB_DECLARE_EXTERN
#include "messages.c"
/* From <linux/vt.h> */ /* From <linux/vt.h> */
struct vt_stat { struct vt_stat {
unsigned short v_active; /* active vt */ unsigned short v_active; /* active vt */
@ -938,16 +942,14 @@ extern int init_main(int argc, char **argv)
CONSOLE| CONSOLE|
#endif #endif
LOG, LOG,
"init started: BusyBox v%s (%s) multi-call binary\r\n", "init started: %s\r\n", full_version);
BB_VER, BB_BT);
#else #else
message( message(
#if ! defined BB_FEATURE_EXTRA_QUIET #if ! defined BB_FEATURE_EXTRA_QUIET
CONSOLE| CONSOLE|
#endif #endif
LOG, LOG,
"init(%d) started: BusyBox v%s (%s) multi-call binary\r\n", "init(%d) started: %s\r\n", getpid(), full_version);
getpid(), BB_VER, BB_BT);
#endif #endif

View File

@ -46,6 +46,10 @@
# include <sys/syslog.h> # include <sys/syslog.h>
#endif #endif
#define bb_need_full_version
#define BB_DECLARE_EXTERN
#include "messages.c"
/* From <linux/vt.h> */ /* From <linux/vt.h> */
struct vt_stat { struct vt_stat {
unsigned short v_active; /* active vt */ unsigned short v_active; /* active vt */
@ -938,16 +942,14 @@ extern int init_main(int argc, char **argv)
CONSOLE| CONSOLE|
#endif #endif
LOG, LOG,
"init started: BusyBox v%s (%s) multi-call binary\r\n", "init started: %s\r\n", full_version);
BB_VER, BB_BT);
#else #else
message( message(
#if ! defined BB_FEATURE_EXTRA_QUIET #if ! defined BB_FEATURE_EXTRA_QUIET
CONSOLE| CONSOLE|
#endif #endif
LOG, LOG,
"init(%d) started: BusyBox v%s (%s) multi-call binary\r\n", "init(%d) started: %s\r\n", getpid(), full_version);
getpid(), BB_VER, BB_BT);
#endif #endif

6
lash.c
View File

@ -46,6 +46,10 @@
#include "cmdedit.h" #include "cmdedit.h"
#endif #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 MAX_READ 128 /* size of input buffer for `read' builtin */
#define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n" #define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n"
@ -1141,7 +1145,7 @@ int shell_main(int argc, char **argv)
//} //}
if (argc < 2) { 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"); fprintf(stdout, "Enter 'help' for a list of built-in commands.\n\n");
} else { } else {
if (argv[1][0]=='-' && argv[1][1]=='c') { if (argv[1][0]=='-' && argv[1][1]=='c') {

View File

@ -47,6 +47,10 @@
#endif #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 #if defined bb_need_name_too_long || ! defined BB_DECLARE_EXTERN
BB_DEF_MESSAGE(name_too_long, "file name too long\n") BB_DEF_MESSAGE(name_too_long, "file name too long\n")
#endif #endif

5
sed.c
View File

@ -52,6 +52,9 @@
#include <ctype.h> /* for isspace() */ #include <ctype.h> /* for isspace() */
#include "internal.h" #include "internal.h"
#define bb_need_full_version
#define BB_DECLARE_EXTERN
#include "messages.c"
/* externs */ /* externs */
extern int optind; /* in unistd.h */ 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) { while ((opt = getopt(argc, argv, "Vhne:f:")) > 0) {
switch (opt) { switch (opt) {
case 'V': case 'V':
printf("BusyBox v%s (%s)\n", BB_VER, BB_BT); printf("%s\n", full_version);
exit(0); exit(0);
break; break;
case 'h': case 'h':

6
sh.c
View File

@ -46,6 +46,10 @@
#include "cmdedit.h" #include "cmdedit.h"
#endif #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 MAX_READ 128 /* size of input buffer for `read' builtin */
#define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n" #define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n"
@ -1141,7 +1145,7 @@ int shell_main(int argc, char **argv)
//} //}
if (argc < 2) { 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"); fprintf(stdout, "Enter 'help' for a list of built-in commands.\n\n");
} else { } else {
if (argv[1][0]=='-' && argv[1][1]=='c') { if (argv[1][0]=='-' && argv[1][1]=='c') {

View File

@ -46,6 +46,10 @@
#include "cmdedit.h" #include "cmdedit.h"
#endif #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 MAX_READ 128 /* size of input buffer for `read' builtin */
#define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n" #define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n"
@ -1141,7 +1145,7 @@ int shell_main(int argc, char **argv)
//} //}
if (argc < 2) { 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"); fprintf(stdout, "Enter 'help' for a list of built-in commands.\n\n");
} else { } else {
if (argv[1][0]=='-' && argv[1][1]=='c') { if (argv[1][0]=='-' && argv[1][1]=='c') {

View File

@ -37,6 +37,7 @@
#define bb_need_name_too_long #define bb_need_name_too_long
#endif #endif
#define bb_need_memory_exhausted #define bb_need_memory_exhausted
#define bb_need_full_version
#define BB_DECLARE_EXTERN #define BB_DECLARE_EXTERN
#include "messages.c" #include "messages.c"
@ -84,8 +85,7 @@ const char mtab_file[] = "/dev/mtab";
extern void usage(const char *usage) extern void usage(const char *usage)
{ {
fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n", fprintf(stderr, "%s\n\n", full_version);
BB_VER, BB_BT);
fprintf(stderr, "Usage: %s\n", usage); fprintf(stderr, "Usage: %s\n", usage);
exit FALSE; exit FALSE;
} }