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