/* i18n.h
* Copyright (C) 1998, 2001 Free Software Foundation, Inc.
*
- * This file is part of GnuPG.
+ * This file is free software; as a special exception the author gives
+ * unlimited permission to copy and/or distribute it, with or without
+ * modifications, as long as this notice is preserved.
*
- * GnuPG is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GnuPG 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 General Public License for more details.
- *
- * You should have received a copy of the GNU 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
+ * This file is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY, to the extent permitted by law; without even
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.
*/
#ifndef GNUPG_COMMON_I18N_H
#define GNUPG_COMMON_I18N_H
+
#ifdef USE_SIMPLE_GETTEXT
- int set_gettext_file( const char *filename );
- const char *gettext( const char *msgid );
+# include "../common/w32help.h"
# define _(a) gettext (a)
# define N_(a) (a)
#else
# ifdef HAVE_LOCALE_H
-# include <locale.h>
+# include <locale.h>
# endif
# ifdef ENABLE_NLS
# include <libintl.h>
# else
# define _(a) (a)
# define N_(a) (a)
+# define ngettext(a,b,c) ((c)==1? (a):(b))
# endif
#endif /*!USE_SIMPLE_GETTEXT*/
+#ifndef GNUPG_GCC_ATTR_FORMAT_ARG
+#if __GNUC__ >= 3 /* Actually 2.8 but testing the major is easier. */
+# define GNUPG_GCC_ATTR_FORMAT_ARG(a) __attribute__ ((__format_arg__ (a)))
+#else
+# define GNUPG_GCC_ATTR_FORMAT_ARG(a)
+#endif
+#endif
+
+void i18n_init (void);
+char *i18n_switchto_utf8 (void);
+void i18n_switchback (char *saved_codeset);
+const char *i18n_utf8 (const char *string);
+const char *i18n_localegettext (const char *lc_messages, const char *string)
+ GNUPG_GCC_ATTR_FORMAT_ARG(2);
+
+/* If a module wants a local L_() function we define it here. */
+#ifdef LunderscoreIMPL
+LunderscorePROTO
+LunderscoreIMPL
+#endif
+
+
#endif /*GNUPG_COMMON_I18N_H*/