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
This commit is contained in:
@ -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__ */
|
||||
|
61
libbb/messages.c
Normal file
61
libbb/messages.c
Normal file
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user