From 5dc6ddc46b1416e0a4b70933eb0a93ee308d09c9 Mon Sep 17 00:00:00 2001 From: bernie Date: Tue, 1 Mar 2005 23:31:02 +0000 Subject: [PATCH] String table and localization stuff. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@391 38d2e660-2303-0410-9eaa-f027e97ec537 --- mware/msg.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ mware/msg.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100755 mware/msg.c create mode 100755 mware/msg.h diff --git a/mware/msg.c b/mware/msg.c new file mode 100755 index 00000000..76c66437 --- /dev/null +++ b/mware/msg.c @@ -0,0 +1,50 @@ +/*! + * \file + * + * + * \brief Messages for LCD. + * + * \version $Id$ + * + * \author Bernardo Innocenti + * \author Stefano Fedrigo + */ + +/*#* + *#* $Log$ + *#* Revision 1.1 2005/03/01 23:31:02 bernie + *#* String table and localization stuff. + *#* + *#*/ + +#include "msg.h" + +/*! + * Array of pointers to localized strings. Should be filled + * by localization stuff, but not for now. + */ +const char *msg_strings[MSG_COUNT] = { + 0, + // TODO: add your strings here +}; + +/* Buffer for catalog file */ +/* char msg_buf[MSG_BUFSIZE]; */ + + +/* The following does not work (move string tables into the DMSG/CMSG segments) + * #pragma memory=dataseg(DMSG) + * #pragma memory=constseg(CMSG) + */ + + +/*! + * Untranslated constant strings used more than once are + * grouped here to save ROM space. + */ +const char + str_empty[] = ""; + diff --git a/mware/msg.h b/mware/msg.h new file mode 100755 index 00000000..f8d5b770 --- /dev/null +++ b/mware/msg.h @@ -0,0 +1,47 @@ +/** + * \file + * + * + * \brief Definitions of constant string messages. + * + * \version $Id$ + * + * \author Bernardo Innocenti + * \author Stefano Fedrigo + */ + +/*#* + *#* $Log$ + *#* Revision 1.1 2005/03/01 23:31:02 bernie + *#* String table and localization stuff. + *#* + *#*/ +#ifndef MWARE_MSG_H +#define MWARE_MSG_H + +enum +{ + MSG_NULL, + + // TODO: add your labels here. + + MSG_COUNT +}; + + +#define MSG_BUFSIZE 6144 /* FIXME: how much? */ + +/* String tables */ +extern const char *msg_strings[MSG_COUNT]; +/* extern char msg_buf[MSG_BUFSIZE]; */ + + +/* Macros to access translated messages */ +#define MSG(x) msg_strings[x] +#define PTRMSG(x) ((unsigned int)(x) < 256 ? msg_strings[(unsigned int)(x)] : (const char *)(x)) + + +#endif /* MWARE_MSG_H */ -- 2.25.1