blob: 73d64276d94a7add18fda8dcc5d46685f13b916d [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
30// TO use, do something like this
31//
32//#define BB_DECLARE_EXTERN
33//#define bb_need_memory_exhausted
34//#include "messages.c"
35//
Erik Andersenfac10d72000-02-07 05:29:42 +000036#ifndef _BB_MESSAGES_C
37#define _BB_MESSAGES_C
38
39#define _BB_DEF_MESSAGE_PROTO(symbol) extern const char *symbol;
40#define _BB_DEF_MESSAGE_INITIALIZE(symbol, string_const) const char *symbol = string_const;
41
42#ifdef BB_DECLARE_EXTERN
43# define BB_DEF_MESSAGE(symbol, string_const) _BB_DEF_MESSAGE_PROTO(symbol)
44#else
45# define BB_DEF_MESSAGE(symbol, string_const) _BB_DEF_MESSAGE_INITIALIZE(symbol, string_const)
46#endif
47
48#if defined bb_need_name_too_long || ! defined BB_DECLARE_EXTERN
49BB_DEF_MESSAGE(name_too_long, "%s: file name too long\n")
50#endif
Erik Andersenfac10d72000-02-07 05:29:42 +000051#if defined bb_need_omitting_directory || ! defined BB_DECLARE_EXTERN
Erik Andersene49d5ec2000-02-08 19:58:47 +000052 BB_DEF_MESSAGE(omitting_directory, "%s: %s: omitting directory\n")
Erik Andersenfac10d72000-02-07 05:29:42 +000053#endif
Erik Andersenfac10d72000-02-07 05:29:42 +000054#if defined bb_need_not_a_directory || ! defined BB_DECLARE_EXTERN
Erik Andersene49d5ec2000-02-08 19:58:47 +000055 BB_DEF_MESSAGE(not_a_directory, "%s: %s: not a directory\n")
Erik Andersenfac10d72000-02-07 05:29:42 +000056#endif
Erik Andersenfac10d72000-02-07 05:29:42 +000057#if defined bb_need_memory_exhausted || ! defined BB_DECLARE_EXTERN
Erik Andersene49d5ec2000-02-08 19:58:47 +000058 BB_DEF_MESSAGE(memory_exhausted, "%s: memory exhausted\n")
Erik Andersenfac10d72000-02-07 05:29:42 +000059#endif
Erik Andersenfac10d72000-02-07 05:29:42 +000060#if defined bb_need_invalid_date || ! defined BB_DECLARE_EXTERN
Erik Andersene49d5ec2000-02-08 19:58:47 +000061 BB_DEF_MESSAGE(invalid_date, "%s: invalid date `%s'\n")
Erik Andersenfac10d72000-02-07 05:29:42 +000062#endif
Erik Andersenfac10d72000-02-07 05:29:42 +000063#if defined bb_need_invalid_option || ! defined BB_DECLARE_EXTERN
Erik Andersene49d5ec2000-02-08 19:58:47 +000064 BB_DEF_MESSAGE(invalid_option, "%s: invalid option -- %c\n")
Erik Andersenfac10d72000-02-07 05:29:42 +000065#endif
Erik Andersen1ad302a2000-03-24 00:54:46 +000066#if defined bb_need_io_error || ! defined BB_DECLARE_EXTERN
67 BB_DEF_MESSAGE(io_error, "%s: input/output error -- %s\n")
68#endif
Erik Andersen7ab9c7e2000-05-12 19:41:47 +000069#if defined bb_need_help || ! defined BB_DECLARE_EXTERN
70 BB_DEF_MESSAGE(dash_dash_help, "--help")
71#endif
72
Erik Andersene49d5ec2000-02-08 19:58:47 +000073#endif /* _BB_MESSAGES_C */
Erik Andersen7ab9c7e2000-05-12 19:41:47 +000074