ctf-intl.h revision 1.1.1.1
1/* ctf-intl.h - libctf specific header for gettext code. 2 Copyright (C) 1998-2022 Free Software Foundation, Inc. 3 4 Written by Tom Tromey <tromey@cygnus.com> 5 6 This file is part of libctf. 7 8 This library is free software; you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 3, or (at your option) 11 any later version. 12 13 It is distributed in the hope that it will be useful, but WITHOUT 14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this file; see the file COPYING. If not, write to the 20 Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, 21 MA 02110-1301, USA. */ 22 23#ifndef _CTF_INTL_H 24#define _CTF_INTL_H 25 26#ifdef ENABLE_NLS 27# include <libintl.h> 28/* Note the redefinition of gettext and ngettext here to use PACKAGE. 29 30 This is because the code in this directory is used to build a 31 library which will be linked with code in other directories to form 32 programs. We want to maintain a separate translation file for this 33 directory however, rather than being forced to merge it with that 34 of any program linked to libopcodes. This is a library, so it 35 cannot depend on the catalog currently loaded. 36 37 In order to do this, we have to make sure that when we extract 38 messages we use the LIBCTF domain rather than the domain of the 39 program that included the opcodes library, (eg OBJDUMP). Hence we 40 use dgettext (PACKAGE, String) and define PACKAGE to be 'libctf'. 41 (See the code in configure). */ 42# undef gettext 43# define gettext(Msgid) dgettext (PACKAGE, Msgid) 44# undef ngettext 45# define ngettext(Msgid1, Msgid2, n) dngettext (PACKAGE, Msgid1, Msgid2, n) 46# define _(String) gettext (String) 47# ifdef gettext_noop 48# define N_(String) gettext_noop (String) 49# else 50# define N_(String) String 51# endif 52#else 53# define gettext(Msgid) (Msgid) 54# define dgettext(Domainname, Msgid) (Msgid) 55# define dcgettext(Domainname, Msgid, Category) (Msgid) 56# define ngettext(Msgid1, Msgid2, n) \ 57 (n == 1 ? Msgid1 : Msgid2) 58# define dngettext(Domainname, Msgid1, Msgid2, n) \ 59 (n == 1 ? Msgid1 : Msgid2) 60# define dcngettext(Domainname, Msgid1, Msgid2, n, Category) \ 61 (n == 1 ? Msgid1 : Msgid2) 62# define textdomain(Domainname) do {} while (0) 63# define bindtextdomain(Domainname, Dirname) do {} while (0) 64# define _(String) (String) 65# define N_(String) String 66#endif 67 68#endif /* _CTF_INTL_H */ 69