rc_message.h
_RC_MESSAGE( MSG_YES, "Да", "Yes", "Ja" )
_RC_MESSAGE( MSG_NO, "Нет", "No", "Nain" )
....
message.h
#define _RC_MESSAGE(label, ...) label,
enum _msg_id
{
#include "rc_message.h"
_MSG_COUNT_
};
#undef _RC_MESSAGE
message.c
#define _RC_MESSAGE(label, l_ru, l_en, l_de) static uint8_t const ru_##label[] = l_ru;
#include "rc_message.h"
#undef _RC_MESSAGE
#define _RC_MESSAGE(label, l_ru, l_en, l_de) static uint8_t const en_##label[] = l_en;
#include "rc_message.h"
#undef _RC_MESSAGE
#define _RC_MESSAGE(label, l_ru, l_en, l_de) static uint8_t const de_##label[] = l_de;
#include "rc_message.h"
#undef _RC_MESSAGE
#define _RC_MESSAGE(label, ...) ru_##label, en_##label, de_##label,
static uint8_t const *msg_base[_MSG_COUNT_ * 3] =
{
#include "rc_message.h"
};#undef _RC_MESSAGE
uint8_t const *GetMessage(enum _msg_id message_id, uint8_t lang_id)
{
return msg_base[message_id * 3 + lang_id];
}