iUse gettext.h instead of own libintl.h include. - enscript - GNU Enscript Err thinkerwim.openbsd.amsterdam 70 hgit clone git://thinkerwim.org/enscript.git URL:git://thinkerwim.org/enscript.git thinkerwim.org 70 1Log /git/enscript/log.gph thinkerwim.org 70 1Files /git/enscript/files.gph thinkerwim.org 70 1Refs /git/enscript/refs.gph thinkerwim.org 70 1README /git/enscript/file/README.gph thinkerwim.org 70 1LICENSE /git/enscript/file/COPYING.gph thinkerwim.org 70 i--- Err thinkerwim.openbsd.amsterdam 70 1commit 1571efb807e6575e83d674b453b5e4fb28b38c9c /git/enscript/commit/1571efb807e6575e83d674b453b5e4fb28b38c9c.gph thinkerwim.org 70 1parent 81e4a71922b79d7dcbc4d2365ae0bc08812eca89 /git/enscript/commit/81e4a71922b79d7dcbc4d2365ae0bc08812eca89.gph thinkerwim.org 70 hAuthor: Tim Retout URL:mailto:diocles@gnu.org thinkerwim.org 70 iDate: Sun, 10 Jul 2011 13:56:03 +0100 Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 iUse gettext.h instead of own libintl.h include. Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 iSigned-off-by: Tim Retout Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 iDiffstat: Err thinkerwim.openbsd.amsterdam 70 i M ChangeLog | 6 ++++++ Err thinkerwim.openbsd.amsterdam 70 i M compat/Makefile.am | 2 +- Err thinkerwim.openbsd.amsterdam 70 i A compat/gettext.h | 280 +++++++++++++++++++++++++++++++ Err thinkerwim.openbsd.amsterdam 70 i M src/gsint.h | 6 +----- Err thinkerwim.openbsd.amsterdam 70 i M src/mkafmmap.c | 6 +----- Err thinkerwim.openbsd.amsterdam 70 i M states/defs.h | 6 +----- Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i6 files changed, 290 insertions(+), 16 deletions(-) Err thinkerwim.openbsd.amsterdam 70 i--- Err thinkerwim.openbsd.amsterdam 70 1diff --git a/ChangeLog b/ChangeLog /git/enscript/file/ChangeLog.gph thinkerwim.org 70 i@@ -1,5 +1,11 @@ Err thinkerwim.openbsd.amsterdam 70 i 2011-07-10 Tim Retout Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i+ * compat/gettext.h: New file. Err thinkerwim.openbsd.amsterdam 70 i+ * compat/Makefile.am (EXTRA_DIST): Add gettext.h. Err thinkerwim.openbsd.amsterdam 70 i+ * src/gsint.h: Use gettext.h instead of own libintl.h include. Err thinkerwim.openbsd.amsterdam 70 i+ * src/mkafmmap.c: Likewise. Err thinkerwim.openbsd.amsterdam 70 i+ * states/defs.h: Likewise. Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i * src/main.c (main): Join ENSCRIPT_LIBRARY error string together Err thinkerwim.openbsd.amsterdam 70 i for the benefit of translators. Err thinkerwim.openbsd.amsterdam 70 i Use ngettext when printing number of pages/copies. Err thinkerwim.openbsd.amsterdam 70 1diff --git a/compat/Makefile.am b/compat/Makefile.am /git/enscript/file/compat/Makefile.am.gph thinkerwim.org 70 i@@ -37,7 +37,7 @@ libcompat_a_SOURCES_windelta = \ Err thinkerwim.openbsd.amsterdam 70 i noinst_HEADERS = getopt.h regex.h xalloc.h Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i EXTRA_DIST = ChangeLog.old strerror.c memmove.c memcpy.c strtol.c \ Err thinkerwim.openbsd.amsterdam 70 i- strtoul.c Err thinkerwim.openbsd.amsterdam 70 i+ strtoul.c gettext.h Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i INCLUDES = -I$(srcdir)/../intl -I../intl Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 1diff --git a/compat/gettext.h b/compat/gettext.h /git/enscript/file/compat/gettext.h.gph thinkerwim.org 70 i@@ -0,0 +1,280 @@ Err thinkerwim.openbsd.amsterdam 70 i+/* Convenience header for conditional use of GNU . Err thinkerwim.openbsd.amsterdam 70 i+ Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009 Free Software Foundation, Inc. Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+ This program is free software; you can redistribute it and/or modify it Err thinkerwim.openbsd.amsterdam 70 i+ under the terms of the GNU General Public License as published Err thinkerwim.openbsd.amsterdam 70 i+ by the Free Software Foundation; either version 3, or (at your option) Err thinkerwim.openbsd.amsterdam 70 i+ any later version. Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+ This program is distributed in the hope that it will be useful, Err thinkerwim.openbsd.amsterdam 70 i+ but WITHOUT ANY WARRANTY; without even the implied warranty of Err thinkerwim.openbsd.amsterdam 70 i+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Err thinkerwim.openbsd.amsterdam 70 i+ Library General Public License for more details. Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+ You should have received a copy of the GNU General Public Err thinkerwim.openbsd.amsterdam 70 i+ License along with this program; if not, write to the Free Software Err thinkerwim.openbsd.amsterdam 70 i+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, Err thinkerwim.openbsd.amsterdam 70 i+ USA. */ Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+#ifndef _LIBGETTEXT_H Err thinkerwim.openbsd.amsterdam 70 i+#define _LIBGETTEXT_H 1 Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+/* NLS can be disabled through the configure --disable-nls option. */ Err thinkerwim.openbsd.amsterdam 70 i+#if ENABLE_NLS Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+/* Get declarations of GNU message catalog functions. */ Err thinkerwim.openbsd.amsterdam 70 i+# include Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by Err thinkerwim.openbsd.amsterdam 70 i+ the gettext() and ngettext() macros. This is an alternative to calling Err thinkerwim.openbsd.amsterdam 70 i+ textdomain(), and is useful for libraries. */ Err thinkerwim.openbsd.amsterdam 70 i+# ifdef DEFAULT_TEXT_DOMAIN Err thinkerwim.openbsd.amsterdam 70 i+# undef gettext Err thinkerwim.openbsd.amsterdam 70 i+# define gettext(Msgid) \ Err thinkerwim.openbsd.amsterdam 70 i+ dgettext (DEFAULT_TEXT_DOMAIN, Msgid) Err thinkerwim.openbsd.amsterdam 70 i+# undef ngettext Err thinkerwim.openbsd.amsterdam 70 i+# define ngettext(Msgid1, Msgid2, N) \ Err thinkerwim.openbsd.amsterdam 70 i+ dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) Err thinkerwim.openbsd.amsterdam 70 i+# endif Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+#else Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which Err thinkerwim.openbsd.amsterdam 70 i+ chokes if dcgettext is defined as a macro. So include it now, to make Err thinkerwim.openbsd.amsterdam 70 i+ later inclusions of a NOP. We don't include Err thinkerwim.openbsd.amsterdam 70 i+ as well because people using "gettext.h" will not include , Err thinkerwim.openbsd.amsterdam 70 i+ and also including would fail on SunOS 4, whereas Err thinkerwim.openbsd.amsterdam 70 i+ is OK. */ Err thinkerwim.openbsd.amsterdam 70 i+#if defined(__sun) Err thinkerwim.openbsd.amsterdam 70 i+# include Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+/* Many header files from the libstdc++ coming with g++ 3.3 or newer include Err thinkerwim.openbsd.amsterdam 70 i+ , which chokes if dcgettext is defined as a macro. So include Err thinkerwim.openbsd.amsterdam 70 i+ it now, to make later inclusions of a NOP. */ Err thinkerwim.openbsd.amsterdam 70 i+#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) Err thinkerwim.openbsd.amsterdam 70 i+# include Err thinkerwim.openbsd.amsterdam 70 i+# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H Err thinkerwim.openbsd.amsterdam 70 i+# include Err thinkerwim.openbsd.amsterdam 70 i+# endif Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+/* Disabled NLS. Err thinkerwim.openbsd.amsterdam 70 i+ The casts to 'const char *' serve the purpose of producing warnings Err thinkerwim.openbsd.amsterdam 70 i+ for invalid uses of the value returned from these functions. Err thinkerwim.openbsd.amsterdam 70 i+ On pre-ANSI systems without 'const', the config.h file is supposed to Err thinkerwim.openbsd.amsterdam 70 i+ contain "#define const". */ Err thinkerwim.openbsd.amsterdam 70 i+# undef gettext Err thinkerwim.openbsd.amsterdam 70 i+# define gettext(Msgid) ((const char *) (Msgid)) Err thinkerwim.openbsd.amsterdam 70 i+# undef dgettext Err thinkerwim.openbsd.amsterdam 70 i+# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) Err thinkerwim.openbsd.amsterdam 70 i+# undef dcgettext Err thinkerwim.openbsd.amsterdam 70 i+# define dcgettext(Domainname, Msgid, Category) \ Err thinkerwim.openbsd.amsterdam 70 i+ ((void) (Category), dgettext (Domainname, Msgid)) Err thinkerwim.openbsd.amsterdam 70 i+# undef ngettext Err thinkerwim.openbsd.amsterdam 70 i+# define ngettext(Msgid1, Msgid2, N) \ Err thinkerwim.openbsd.amsterdam 70 i+ ((N) == 1 \ Err thinkerwim.openbsd.amsterdam 70 i+ ? ((void) (Msgid2), (const char *) (Msgid1)) \ Err thinkerwim.openbsd.amsterdam 70 i+ : ((void) (Msgid1), (const char *) (Msgid2))) Err thinkerwim.openbsd.amsterdam 70 i+# undef dngettext Err thinkerwim.openbsd.amsterdam 70 i+# define dngettext(Domainname, Msgid1, Msgid2, N) \ Err thinkerwim.openbsd.amsterdam 70 i+ ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) Err thinkerwim.openbsd.amsterdam 70 i+# undef dcngettext Err thinkerwim.openbsd.amsterdam 70 i+# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ Err thinkerwim.openbsd.amsterdam 70 i+ ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N)) Err thinkerwim.openbsd.amsterdam 70 i+# undef textdomain Err thinkerwim.openbsd.amsterdam 70 i+# define textdomain(Domainname) ((const char *) (Domainname)) Err thinkerwim.openbsd.amsterdam 70 i+# undef bindtextdomain Err thinkerwim.openbsd.amsterdam 70 i+# define bindtextdomain(Domainname, Dirname) \ Err thinkerwim.openbsd.amsterdam 70 i+ ((void) (Domainname), (const char *) (Dirname)) Err thinkerwim.openbsd.amsterdam 70 i+# undef bind_textdomain_codeset Err thinkerwim.openbsd.amsterdam 70 i+# define bind_textdomain_codeset(Domainname, Codeset) \ Err thinkerwim.openbsd.amsterdam 70 i+ ((void) (Domainname), (const char *) (Codeset)) Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+/* A pseudo function call that serves as a marker for the automated Err thinkerwim.openbsd.amsterdam 70 i+ extraction of messages, but does not call gettext(). The run-time Err thinkerwim.openbsd.amsterdam 70 i+ translation is done at a different place in the code. Err thinkerwim.openbsd.amsterdam 70 i+ The argument, String, should be a literal string. Concatenated strings Err thinkerwim.openbsd.amsterdam 70 i+ and other string expressions won't work. Err thinkerwim.openbsd.amsterdam 70 i+ The macro's expansion is not parenthesized, so that it is suitable as Err thinkerwim.openbsd.amsterdam 70 i+ initializer for static 'char[]' or 'const char[]' variables. */ Err thinkerwim.openbsd.amsterdam 70 i+#define gettext_noop(String) String Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+/* The separator between msgctxt and msgid in a .mo file. */ Err thinkerwim.openbsd.amsterdam 70 i+#define GETTEXT_CONTEXT_GLUE "\004" Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a Err thinkerwim.openbsd.amsterdam 70 i+ MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be Err thinkerwim.openbsd.amsterdam 70 i+ short and rarely need to change. Err thinkerwim.openbsd.amsterdam 70 i+ The letter 'p' stands for 'particular' or 'special'. */ Err thinkerwim.openbsd.amsterdam 70 i+#ifdef DEFAULT_TEXT_DOMAIN Err thinkerwim.openbsd.amsterdam 70 i+# define pgettext(Msgctxt, Msgid) \ Err thinkerwim.openbsd.amsterdam 70 i+ pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) Err thinkerwim.openbsd.amsterdam 70 i+#else Err thinkerwim.openbsd.amsterdam 70 i+# define pgettext(Msgctxt, Msgid) \ Err thinkerwim.openbsd.amsterdam 70 i+ pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+#define dpgettext(Domainname, Msgctxt, Msgid) \ Err thinkerwim.openbsd.amsterdam 70 i+ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) Err thinkerwim.openbsd.amsterdam 70 i+#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ Err thinkerwim.openbsd.amsterdam 70 i+ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) Err thinkerwim.openbsd.amsterdam 70 i+#ifdef DEFAULT_TEXT_DOMAIN Err thinkerwim.openbsd.amsterdam 70 i+# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ Err thinkerwim.openbsd.amsterdam 70 i+ npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) Err thinkerwim.openbsd.amsterdam 70 i+#else Err thinkerwim.openbsd.amsterdam 70 i+# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ Err thinkerwim.openbsd.amsterdam 70 i+ npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ Err thinkerwim.openbsd.amsterdam 70 i+ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) Err thinkerwim.openbsd.amsterdam 70 i+#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ Err thinkerwim.openbsd.amsterdam 70 i+ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+#ifdef __GNUC__ Err thinkerwim.openbsd.amsterdam 70 i+__inline Err thinkerwim.openbsd.amsterdam 70 i+#else Err thinkerwim.openbsd.amsterdam 70 i+#ifdef __cplusplus Err thinkerwim.openbsd.amsterdam 70 i+inline Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+static const char * Err thinkerwim.openbsd.amsterdam 70 i+pgettext_aux (const char *domain, Err thinkerwim.openbsd.amsterdam 70 i+ const char *msg_ctxt_id, const char *msgid, Err thinkerwim.openbsd.amsterdam 70 i+ int category) Err thinkerwim.openbsd.amsterdam 70 i+{ Err thinkerwim.openbsd.amsterdam 70 i+ const char *translation = dcgettext (domain, msg_ctxt_id, category); Err thinkerwim.openbsd.amsterdam 70 i+ if (translation == msg_ctxt_id) Err thinkerwim.openbsd.amsterdam 70 i+ return msgid; Err thinkerwim.openbsd.amsterdam 70 i+ else Err thinkerwim.openbsd.amsterdam 70 i+ return translation; Err thinkerwim.openbsd.amsterdam 70 i+} Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+#ifdef __GNUC__ Err thinkerwim.openbsd.amsterdam 70 i+__inline Err thinkerwim.openbsd.amsterdam 70 i+#else Err thinkerwim.openbsd.amsterdam 70 i+#ifdef __cplusplus Err thinkerwim.openbsd.amsterdam 70 i+inline Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+static const char * Err thinkerwim.openbsd.amsterdam 70 i+npgettext_aux (const char *domain, Err thinkerwim.openbsd.amsterdam 70 i+ const char *msg_ctxt_id, const char *msgid, Err thinkerwim.openbsd.amsterdam 70 i+ const char *msgid_plural, unsigned long int n, Err thinkerwim.openbsd.amsterdam 70 i+ int category) Err thinkerwim.openbsd.amsterdam 70 i+{ Err thinkerwim.openbsd.amsterdam 70 i+ const char *translation = Err thinkerwim.openbsd.amsterdam 70 i+ dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); Err thinkerwim.openbsd.amsterdam 70 i+ if (translation == msg_ctxt_id || translation == msgid_plural) Err thinkerwim.openbsd.amsterdam 70 i+ return (n == 1 ? msgid : msgid_plural); Err thinkerwim.openbsd.amsterdam 70 i+ else Err thinkerwim.openbsd.amsterdam 70 i+ return translation; Err thinkerwim.openbsd.amsterdam 70 i+} Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID Err thinkerwim.openbsd.amsterdam 70 i+ can be arbitrary expressions. But for string literals these macros are Err thinkerwim.openbsd.amsterdam 70 i+ less efficient than those above. */ Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+#include Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ Err thinkerwim.openbsd.amsterdam 70 i+ (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \ Err thinkerwim.openbsd.amsterdam 70 i+ /* || __STDC_VERSION__ >= 199901L */ ) Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS Err thinkerwim.openbsd.amsterdam 70 i+#include Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+#define pgettext_expr(Msgctxt, Msgid) \ Err thinkerwim.openbsd.amsterdam 70 i+ dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) Err thinkerwim.openbsd.amsterdam 70 i+#define dpgettext_expr(Domainname, Msgctxt, Msgid) \ Err thinkerwim.openbsd.amsterdam 70 i+ dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+#ifdef __GNUC__ Err thinkerwim.openbsd.amsterdam 70 i+__inline Err thinkerwim.openbsd.amsterdam 70 i+#else Err thinkerwim.openbsd.amsterdam 70 i+#ifdef __cplusplus Err thinkerwim.openbsd.amsterdam 70 i+inline Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+static const char * Err thinkerwim.openbsd.amsterdam 70 i+dcpgettext_expr (const char *domain, Err thinkerwim.openbsd.amsterdam 70 i+ const char *msgctxt, const char *msgid, Err thinkerwim.openbsd.amsterdam 70 i+ int category) Err thinkerwim.openbsd.amsterdam 70 i+{ Err thinkerwim.openbsd.amsterdam 70 i+ size_t msgctxt_len = strlen (msgctxt) + 1; Err thinkerwim.openbsd.amsterdam 70 i+ size_t msgid_len = strlen (msgid) + 1; Err thinkerwim.openbsd.amsterdam 70 i+ const char *translation; Err thinkerwim.openbsd.amsterdam 70 i+#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS Err thinkerwim.openbsd.amsterdam 70 i+ char msg_ctxt_id[msgctxt_len + msgid_len]; Err thinkerwim.openbsd.amsterdam 70 i+#else Err thinkerwim.openbsd.amsterdam 70 i+ char buf[1024]; Err thinkerwim.openbsd.amsterdam 70 i+ char *msg_ctxt_id = Err thinkerwim.openbsd.amsterdam 70 i+ (msgctxt_len + msgid_len <= sizeof (buf) Err thinkerwim.openbsd.amsterdam 70 i+ ? buf Err thinkerwim.openbsd.amsterdam 70 i+ : (char *) malloc (msgctxt_len + msgid_len)); Err thinkerwim.openbsd.amsterdam 70 i+ if (msg_ctxt_id != NULL) Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+ { Err thinkerwim.openbsd.amsterdam 70 i+ memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); Err thinkerwim.openbsd.amsterdam 70 i+ msg_ctxt_id[msgctxt_len - 1] = '\004'; Err thinkerwim.openbsd.amsterdam 70 i+ memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); Err thinkerwim.openbsd.amsterdam 70 i+ translation = dcgettext (domain, msg_ctxt_id, category); Err thinkerwim.openbsd.amsterdam 70 i+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS Err thinkerwim.openbsd.amsterdam 70 i+ if (msg_ctxt_id != buf) Err thinkerwim.openbsd.amsterdam 70 i+ free (msg_ctxt_id); Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+ if (translation != msg_ctxt_id) Err thinkerwim.openbsd.amsterdam 70 i+ return translation; Err thinkerwim.openbsd.amsterdam 70 i+ } Err thinkerwim.openbsd.amsterdam 70 i+ return msgid; Err thinkerwim.openbsd.amsterdam 70 i+} Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ Err thinkerwim.openbsd.amsterdam 70 i+ dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) Err thinkerwim.openbsd.amsterdam 70 i+#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ Err thinkerwim.openbsd.amsterdam 70 i+ dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+#ifdef __GNUC__ Err thinkerwim.openbsd.amsterdam 70 i+__inline Err thinkerwim.openbsd.amsterdam 70 i+#else Err thinkerwim.openbsd.amsterdam 70 i+#ifdef __cplusplus Err thinkerwim.openbsd.amsterdam 70 i+inline Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+static const char * Err thinkerwim.openbsd.amsterdam 70 i+dcnpgettext_expr (const char *domain, Err thinkerwim.openbsd.amsterdam 70 i+ const char *msgctxt, const char *msgid, Err thinkerwim.openbsd.amsterdam 70 i+ const char *msgid_plural, unsigned long int n, Err thinkerwim.openbsd.amsterdam 70 i+ int category) Err thinkerwim.openbsd.amsterdam 70 i+{ Err thinkerwim.openbsd.amsterdam 70 i+ size_t msgctxt_len = strlen (msgctxt) + 1; Err thinkerwim.openbsd.amsterdam 70 i+ size_t msgid_len = strlen (msgid) + 1; Err thinkerwim.openbsd.amsterdam 70 i+ const char *translation; Err thinkerwim.openbsd.amsterdam 70 i+#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS Err thinkerwim.openbsd.amsterdam 70 i+ char msg_ctxt_id[msgctxt_len + msgid_len]; Err thinkerwim.openbsd.amsterdam 70 i+#else Err thinkerwim.openbsd.amsterdam 70 i+ char buf[1024]; Err thinkerwim.openbsd.amsterdam 70 i+ char *msg_ctxt_id = Err thinkerwim.openbsd.amsterdam 70 i+ (msgctxt_len + msgid_len <= sizeof (buf) Err thinkerwim.openbsd.amsterdam 70 i+ ? buf Err thinkerwim.openbsd.amsterdam 70 i+ : (char *) malloc (msgctxt_len + msgid_len)); Err thinkerwim.openbsd.amsterdam 70 i+ if (msg_ctxt_id != NULL) Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+ { Err thinkerwim.openbsd.amsterdam 70 i+ memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); Err thinkerwim.openbsd.amsterdam 70 i+ msg_ctxt_id[msgctxt_len - 1] = '\004'; Err thinkerwim.openbsd.amsterdam 70 i+ memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); Err thinkerwim.openbsd.amsterdam 70 i+ translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); Err thinkerwim.openbsd.amsterdam 70 i+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS Err thinkerwim.openbsd.amsterdam 70 i+ if (msg_ctxt_id != buf) Err thinkerwim.openbsd.amsterdam 70 i+ free (msg_ctxt_id); Err thinkerwim.openbsd.amsterdam 70 i+#endif Err thinkerwim.openbsd.amsterdam 70 i+ if (!(translation == msg_ctxt_id || translation == msgid_plural)) Err thinkerwim.openbsd.amsterdam 70 i+ return translation; Err thinkerwim.openbsd.amsterdam 70 i+ } Err thinkerwim.openbsd.amsterdam 70 i+ return (n == 1 ? msgid : msgid_plural); Err thinkerwim.openbsd.amsterdam 70 i+} Err thinkerwim.openbsd.amsterdam 70 i+ Err thinkerwim.openbsd.amsterdam 70 i+#endif /* _LIBGETTEXT_H */ Err thinkerwim.openbsd.amsterdam 70 1diff --git a/src/gsint.h b/src/gsint.h /git/enscript/file/src/gsint.h.gph thinkerwim.org 70 i@@ -103,12 +103,8 @@ extern double atan2 ___P ((double, double)); Err thinkerwim.openbsd.amsterdam 70 i #include "dummypwd.h" Err thinkerwim.openbsd.amsterdam 70 i #endif Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i-#if ENABLE_NLS Err thinkerwim.openbsd.amsterdam 70 i-#include Err thinkerwim.openbsd.amsterdam 70 i+#include "gettext.h" Err thinkerwim.openbsd.amsterdam 70 i #define _(String) gettext (String) Err thinkerwim.openbsd.amsterdam 70 i-#else Err thinkerwim.openbsd.amsterdam 70 i-#define _(String) String Err thinkerwim.openbsd.amsterdam 70 i-#endif Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i #if HAVE_LC_MESSAGES Err thinkerwim.openbsd.amsterdam 70 i #include Err thinkerwim.openbsd.amsterdam 70 1diff --git a/src/mkafmmap.c b/src/mkafmmap.c /git/enscript/file/src/mkafmmap.c.gph thinkerwim.org 70 i@@ -36,12 +36,8 @@ Err thinkerwim.openbsd.amsterdam 70 i #include Err thinkerwim.openbsd.amsterdam 70 i #endif Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i-#if ENABLE_NLS Err thinkerwim.openbsd.amsterdam 70 i-#include Err thinkerwim.openbsd.amsterdam 70 i+#include "gettext.h" Err thinkerwim.openbsd.amsterdam 70 i #define _(String) gettext (String) Err thinkerwim.openbsd.amsterdam 70 i-#else Err thinkerwim.openbsd.amsterdam 70 i-#define _(String) String Err thinkerwim.openbsd.amsterdam 70 i-#endif Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i #if HAVE_LC_MESSAGES Err thinkerwim.openbsd.amsterdam 70 i #include Err thinkerwim.openbsd.amsterdam 70 1diff --git a/states/defs.h b/states/defs.h /git/enscript/file/states/defs.h.gph thinkerwim.org 70 i@@ -94,12 +94,8 @@ extern void *memcpy ___P ((void *, void *, size_t)); Err thinkerwim.openbsd.amsterdam 70 i #include Err thinkerwim.openbsd.amsterdam 70 i #endif Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i-#if ENABLE_NLS Err thinkerwim.openbsd.amsterdam 70 i-#include Err thinkerwim.openbsd.amsterdam 70 i+#include "gettext.h" Err thinkerwim.openbsd.amsterdam 70 i #define _(String) gettext (String) Err thinkerwim.openbsd.amsterdam 70 i-#else Err thinkerwim.openbsd.amsterdam 70 i-#define _(String) String Err thinkerwim.openbsd.amsterdam 70 i-#endif Err thinkerwim.openbsd.amsterdam 70 i Err thinkerwim.openbsd.amsterdam 70 i #if HAVE_LC_MESSAGES Err thinkerwim.openbsd.amsterdam 70 i #include Err thinkerwim.openbsd.amsterdam 70 .