summaryrefslogtreecommitdiffstats
path: root/storage/connect/rcmsg.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:07:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:07:14 +0000
commita175314c3e5827eb193872241446f2f8f5c9d33c (patch)
treecd3d60ca99ae00829c52a6ca79150a5b6e62528b /storage/connect/rcmsg.c
parentInitial commit. (diff)
downloadmariadb-10.5-9e4947182e0b875da38088fdd168e775f473b8ad.tar.xz
mariadb-10.5-9e4947182e0b875da38088fdd168e775f473b8ad.zip
Adding upstream version 1:10.5.12.upstream/1%10.5.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'storage/connect/rcmsg.c')
-rw-r--r--storage/connect/rcmsg.c69
1 files changed, 69 insertions, 0 deletions
diff --git a/storage/connect/rcmsg.c b/storage/connect/rcmsg.c
new file mode 100644
index 00000000..4cd443d8
--- /dev/null
+++ b/storage/connect/rcmsg.c
@@ -0,0 +1,69 @@
+/**************** RCMsg C Program Source Code File (.C) ****************/
+/* PROGRAM NAME: RCMSG */
+/* ------------- */
+/* Version 1.3 */
+/* */
+/* COPYRIGHT */
+/* ---------- */
+/* (C) Copyright to the author Olivier BERTRAND: 2005 - 2014 */
+/* */
+/* WHAT THIS PROGRAM DOES */
+/* ----------------------- */
+/* This program simulates LoadString. */
+/* */
+/***********************************************************************/
+#if !defined(XMSG)
+#include <stdio.h>
+#include <string.h>
+#include "resource.h"
+#include "rcmsg.h"
+#if defined(NEWMSG)
+#include "msgid.h"
+#endif // NEWMSG
+
+#if !defined(_WIN32)
+#define stricmp strcasecmp
+#endif // !_WIN32
+
+char *msglang(void);
+
+const char *GetMsgid(int id)
+ {
+ const char *p = NULL;
+
+ // This conditional until a real fix is found for MDEV-7304
+#if defined(FRENCH)
+ if (!stricmp(msglang(), "french"))
+ switch (id) {
+#include "frids.h"
+#if defined(NEWMSG)
+#include "frcas.h"
+#endif // NEWMSG
+ } // endswitch(id)
+
+ else // English
+#endif // FRENCH
+ switch (id) {
+#include "enids.h"
+#if defined(NEWMSG)
+#include "encas.h"
+#endif // NEWMSG
+ } // endswitch(id)
+
+ return p;
+ } // end of GetMsgid
+
+int GetRcString(int id, char *buf, int bufsize)
+ {
+ const char *p = NULL;
+ char msg[32];
+
+ if (!(p = GetMsgid(id))) {
+ sprintf(msg, "ID=%d unknown", id);
+ p = msg;
+ } // endif p
+
+ return sprintf(buf, "%.*s", bufsize-1, p);
+ } // end of GetRcString
+
+#endif // !XMSG