summaryrefslogtreecommitdiff
path: root/navit/support/gettext_intl/dgettext.c
diff options
context:
space:
mode:
authorsleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-09-27 21:31:22 +0000
committersleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-09-27 21:31:22 +0000
commitd94f702e75e7f212a5f8a880febfb530d6a618b2 (patch)
tree7c2ebb8c6d301e162b81ade36fe510b8010158b4 /navit/support/gettext_intl/dgettext.c
parentd0e9029183cff09ddfa18d17fe8309f73927204b (diff)
downloadnavit-svn-d94f702e75e7f212a5f8a880febfb530d6a618b2.tar.gz
Refactor:build/cmake:Rename dir intl_cmake to support/gettext_intl for consistency.|Fixes #1119.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5648 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/support/gettext_intl/dgettext.c')
-rw-r--r--navit/support/gettext_intl/dgettext.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/navit/support/gettext_intl/dgettext.c b/navit/support/gettext_intl/dgettext.c
new file mode 100644
index 00000000..b64b0f5d
--- /dev/null
+++ b/navit/support/gettext_intl/dgettext.c
@@ -0,0 +1,58 @@
+/* Implementation of the dgettext(3) function.
+ Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "gettextP.h"
+
+#include <locale.h>
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DGETTEXT __dgettext
+# define DCGETTEXT INTUSE(__dcgettext)
+#else
+# define DGETTEXT libintl_dgettext
+# define DCGETTEXT libintl_dcgettext
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog of the current
+ LC_MESSAGES locale. */
+char *
+DGETTEXT (const char *domainname, const char *msgid)
+{
+ return DCGETTEXT (domainname, msgid, LC_MESSAGES);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__dgettext, dgettext);
+#endif