blob: 57630a8020cba8441de4643e7ae9f100b9881cd0 [file] [log] [blame]
Erik Andersene49d5ec2000-02-08 19:58:47 +00001/* vi: set sw=4 ts=4: */
Erik Andersenfac10d72000-02-07 05:29:42 +00002/*
3 * Copyright (C) 2000 by BitterSweet Enterprises, LLC.
4 * Written by Karl M. Hegbloom <karlheg@debian.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21
22/*
23 * Let's put all of these messages in one place, and link this in as
24 * a separate object module, so that there are not going to be
25 * multiple non-unique but very similar strings in the binary.
26 * Perhaps this will make it simpler to internationalize also, and
27 * may make the binary slightly smaller.
28 */
Erik Andersen7ab9c7e2000-05-12 19:41:47 +000029
Erik Andersen330fd2b2000-05-19 05:35:19 +000030// To use this header file, include something like this:
Erik Andersen7ab9c7e2000-05-12 19:41:47 +000031//
32//#define BB_DECLARE_EXTERN
33//#define bb_need_memory_exhausted
34//#include "messages.c"
35//
Erik Andersen330fd2b2000-05-19 05:35:19 +000036//Then just use the string memory_exhausted when it is needed.
37//
38
Eric Andersen3570a342000-09-25 21:45:58 +000039#include "busybox.h"
Erik Andersenfac10d72000-02-07 05:29:42 +000040#ifndef _BB_MESSAGES_C
41#define _BB_MESSAGES_C
42
Erik Andersenfac10d72000-02-07 05:29:42 +000043#ifdef BB_DECLARE_EXTERN
Erik Andersen330fd2b2000-05-19 05:35:19 +000044# define BB_DEF_MESSAGE(symbol, string_const) extern const char *symbol;
Erik Andersenfac10d72000-02-07 05:29:42 +000045#else
Erik Andersen330fd2b2000-05-19 05:35:19 +000046# define BB_DEF_MESSAGE(symbol, string_const) const char *symbol = string_const;
Erik Andersenfac10d72000-02-07 05:29:42 +000047#endif
48
Erik Andersen330fd2b2000-05-19 05:35:19 +000049
Pavel Roskin9c5fcc32000-07-17 23:45:12 +000050#if defined bb_need_full_version || ! defined BB_DECLARE_EXTERN
Matt Kraai6ba1a802001-04-12 20:11:55 +000051 BB_DEF_MESSAGE(full_version, BB_BANNER " multi-call binary")
Pavel Roskin9c5fcc32000-07-17 23:45:12 +000052#endif
Erik Andersenfac10d72000-02-07 05:29:42 +000053#if defined bb_need_name_too_long || ! defined BB_DECLARE_EXTERN
Matt Kraaidd19c692001-01-31 19:00:21 +000054 BB_DEF_MESSAGE(name_too_long, "file name too long")
Erik Andersenfac10d72000-02-07 05:29:42 +000055#endif
Erik Andersenfac10d72000-02-07 05:29:42 +000056#if defined bb_need_omitting_directory || ! defined BB_DECLARE_EXTERN
Matt Kraaidd19c692001-01-31 19:00:21 +000057 BB_DEF_MESSAGE(omitting_directory, "%s: omitting directory")
Erik Andersenfac10d72000-02-07 05:29:42 +000058#endif
Erik Andersenfac10d72000-02-07 05:29:42 +000059#if defined bb_need_not_a_directory || ! defined BB_DECLARE_EXTERN
Matt Kraaidd19c692001-01-31 19:00:21 +000060 BB_DEF_MESSAGE(not_a_directory, "%s: not a directory")
Erik Andersenfac10d72000-02-07 05:29:42 +000061#endif
Erik Andersenfac10d72000-02-07 05:29:42 +000062#if defined bb_need_memory_exhausted || ! defined BB_DECLARE_EXTERN
Matt Kraaidd19c692001-01-31 19:00:21 +000063 BB_DEF_MESSAGE(memory_exhausted, "memory exhausted")
Erik Andersenfac10d72000-02-07 05:29:42 +000064#endif
Erik Andersenfac10d72000-02-07 05:29:42 +000065#if defined bb_need_invalid_date || ! defined BB_DECLARE_EXTERN
Matt Kraaidd19c692001-01-31 19:00:21 +000066 BB_DEF_MESSAGE(invalid_date, "invalid date `%s'")
Erik Andersenfac10d72000-02-07 05:29:42 +000067#endif
Erik Andersenfac10d72000-02-07 05:29:42 +000068#if defined bb_need_invalid_option || ! defined BB_DECLARE_EXTERN
Matt Kraaidd19c692001-01-31 19:00:21 +000069 BB_DEF_MESSAGE(invalid_option, "invalid option -- %c")
Erik Andersenfac10d72000-02-07 05:29:42 +000070#endif
Erik Andersen1ad302a2000-03-24 00:54:46 +000071#if defined bb_need_io_error || ! defined BB_DECLARE_EXTERN
Matt Kraaidd19c692001-01-31 19:00:21 +000072 BB_DEF_MESSAGE(io_error, "%s: input/output error -- %s")
Erik Andersen1ad302a2000-03-24 00:54:46 +000073#endif
Erik Andersen7ab9c7e2000-05-12 19:41:47 +000074#if defined bb_need_help || ! defined BB_DECLARE_EXTERN
75 BB_DEF_MESSAGE(dash_dash_help, "--help")
76#endif
Erik Andersen330fd2b2000-05-19 05:35:19 +000077#if defined bb_need_write_error || ! defined BB_DECLARE_EXTERN
Matt Kraaidd19c692001-01-31 19:00:21 +000078 BB_DEF_MESSAGE(write_error, "Write Error")
Erik Andersen330fd2b2000-05-19 05:35:19 +000079#endif
Mark Whitleyeec2f632000-06-06 18:11:46 +000080#if defined bb_need_too_few_args || ! defined BB_DECLARE_EXTERN
Matt Kraaidd19c692001-01-31 19:00:21 +000081 BB_DEF_MESSAGE(too_few_args, "too few arguments")
Mark Whitleyeec2f632000-06-06 18:11:46 +000082#endif
Eric Andersen3c5ee9a2000-11-14 22:15:48 +000083#if defined bb_need_name_longer_than_foo || ! defined BB_DECLARE_EXTERN
Matt Kraaidd19c692001-01-31 19:00:21 +000084 BB_DEF_MESSAGE(name_longer_than_foo, "Names longer than %d chars not supported.")
Eric Andersen1b1cfde2000-09-24 00:54:37 +000085#endif
Erik Andersen330fd2b2000-05-19 05:35:19 +000086
87
88#endif /* _BB_MESSAGES_C */
Erik Andersen7ab9c7e2000-05-12 19:41:47 +000089