X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=messages.c;h=34b39f258e7eb247cfcdd96cb494a73a18c0435f;hb=79565b6c910e76c19cd5c0729659d6e96472c785;hp=bfbf3175bf780a4a5039656e3d8e2c159a81bf59;hpb=fac10d7c59f7db0facd5fb94de273310b9ec86e6;p=oweals%2Fbusybox.git diff --git a/messages.c b/messages.c index bfbf3175b..34b39f258 100644 --- a/messages.c +++ b/messages.c @@ -1,3 +1,4 @@ +/* vi: set sw=4 ts=4: */ /* * Copyright (C) 2000 by BitterSweet Enterprises, LLC. * Written by Karl M. Hegbloom @@ -25,40 +26,65 @@ * Perhaps this will make it simpler to internationalize also, and * may make the binary slightly smaller. */ + +// To use this header file, include something like this: +// +//#define BB_DECLARE_EXTERN +//#define bb_need_memory_exhausted +//#include "messages.c" +// +//Then just use the string memory_exhausted when it is needed. +// + +#include "internal.h" #ifndef _BB_MESSAGES_C #define _BB_MESSAGES_C -#define _BB_DEF_MESSAGE_PROTO(symbol) extern const char *symbol; -#define _BB_DEF_MESSAGE_INITIALIZE(symbol, string_const) const char *symbol = string_const; - #ifdef BB_DECLARE_EXTERN -# define BB_DEF_MESSAGE(symbol, string_const) _BB_DEF_MESSAGE_PROTO(symbol) +# define BB_DEF_MESSAGE(symbol, string_const) extern const char *symbol; #else -# define BB_DEF_MESSAGE(symbol, string_const) _BB_DEF_MESSAGE_INITIALIZE(symbol, string_const) +# define BB_DEF_MESSAGE(symbol, string_const) const char *symbol = string_const; #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, "%s: file name too long\n") + BB_DEF_MESSAGE(name_too_long, "file name too long\n") #endif - #if defined bb_need_omitting_directory || ! defined BB_DECLARE_EXTERN -BB_DEF_MESSAGE(omitting_directory, "%s: %s: omitting directory\n") + BB_DEF_MESSAGE(omitting_directory, "%s: omitting directory\n") #endif - #if defined bb_need_not_a_directory || ! defined BB_DECLARE_EXTERN -BB_DEF_MESSAGE(not_a_directory, "%s: %s: not a directory\n") + BB_DEF_MESSAGE(not_a_directory, "%s: not a directory\n") #endif - #if defined bb_need_memory_exhausted || ! defined BB_DECLARE_EXTERN -BB_DEF_MESSAGE(memory_exhausted, "%s: memory exhausted\n") + BB_DEF_MESSAGE(memory_exhausted, "memory exhausted\n") #endif - #if defined bb_need_invalid_date || ! defined BB_DECLARE_EXTERN -BB_DEF_MESSAGE(invalid_date, "%s: invalid date `%s'\n") + BB_DEF_MESSAGE(invalid_date, "invalid date `%s'\n") #endif - #if defined bb_need_invalid_option || ! defined BB_DECLARE_EXTERN -BB_DEF_MESSAGE(invalid_option, "%s: invalid option -- %c\n") + BB_DEF_MESSAGE(invalid_option, "invalid option -- %c\n") #endif +#if defined bb_need_io_error || ! defined BB_DECLARE_EXTERN + BB_DEF_MESSAGE(io_error, "%s: input/output error -- %s\n") +#endif +#if defined bb_need_help || ! defined BB_DECLARE_EXTERN + BB_DEF_MESSAGE(dash_dash_help, "--help") +#endif +#if defined bb_need_write_error || ! defined BB_DECLARE_EXTERN + BB_DEF_MESSAGE(write_error, "Write Error\n") +#endif +#if defined bb_need_too_few_args || ! defined BB_DECLARE_EXTERN + BB_DEF_MESSAGE(too_few_args, "too few arguments\n") +#endif + + + + #endif /* _BB_MESSAGES_C */ +