]> git.ipfire.org Git - thirdparty/glibc.git/blame - intl/libintl.h
Remove pre-ISO C support
[thirdparty/glibc.git] / intl / libintl.h
CommitLineData
40a55d20 1/* Message catalogs for internationalization.
a784e502 2 Copyright (C) 1995-2002, 2004, 2005, 2012 Free Software Foundation, Inc.
41bdb6e2 3 This file is part of the GNU C Library.
54d79e99 4 This file is derived from the file libgettext.h in the GNU gettext package.
2b83a2a4 5
54d79e99 6 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
2b83a2a4 10
54d79e99
UD
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 14 Lesser General Public License for more details.
2b83a2a4 15
41bdb6e2
AJ
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA. */
2b83a2a4
RM
20
21#ifndef _LIBINTL_H
c709e372 22#define _LIBINTL_H 1
5107cf1d 23
c709e372 24#include <features.h>
2b83a2a4 25
c709e372
RM
26/* We define an additional symbol to signal that we use the GNU
27 implementation of gettext. */
28#define __USE_GNU_GETTEXT 1
29
3172f58f
UD
30/* Provide information about the supported file formats. Returns the
31 maximum minor revision number supported for a given major revision. */
32#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
33 ((major) == 0 ? 1 : -1)
34
c709e372 35__BEGIN_DECLS
2b83a2a4
RM
36
37/* Look up MSGID in the current default message catalog for the current
38 LC_MESSAGES locale. If not found, returns MSGID itself (the default
39 text). */
a784e502 40extern char *gettext (const char *__msgid)
83c0f41f 41 __THROW __attribute_format_arg__ (1);
2b83a2a4
RM
42
43/* Look up MSGID in the DOMAINNAME message catalog for the current
44 LC_MESSAGES locale. */
a784e502 45extern char *dgettext (const char *__domainname, const char *__msgid)
83c0f41f 46 __THROW __attribute_format_arg__ (2);
a784e502 47extern char *__dgettext (const char *__domainname, const char *__msgid)
ca8d5a5f 48 __THROW __attribute_format_arg__ (2);
2b83a2a4
RM
49
50/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
51 locale. */
a784e502
UD
52extern char *dcgettext (const char *__domainname,
53 const char *__msgid, int __category)
83c0f41f 54 __THROW __attribute_format_arg__ (2);
a784e502
UD
55extern char *__dcgettext (const char *__domainname,
56 const char *__msgid, int __category)
ca8d5a5f 57 __THROW __attribute_format_arg__ (2);
2b83a2a4
RM
58
59
abbffdf9
UD
60/* Similar to `gettext' but select the plural form corresponding to the
61 number N. */
a784e502 62extern char *ngettext (const char *__msgid1, const char *__msgid2,
964328be 63 unsigned long int __n)
f369623d 64 __THROW __attribute_format_arg__ (1) __attribute_format_arg__ (2);
abbffdf9
UD
65
66/* Similar to `dgettext' but select the plural form corresponding to the
67 number N. */
a784e502
UD
68extern char *dngettext (const char *__domainname, const char *__msgid1,
69 const char *__msgid2, unsigned long int __n)
f369623d 70 __THROW __attribute_format_arg__ (2) __attribute_format_arg__ (3);
abbffdf9 71
9d9160ee 72/* Similar to `dcgettext' but select the plural form corresponding to the
abbffdf9 73 number N. */
a784e502
UD
74extern char *dcngettext (const char *__domainname, const char *__msgid1,
75 const char *__msgid2, unsigned long int __n,
964328be 76 int __category)
f369623d 77 __THROW __attribute_format_arg__ (2) __attribute_format_arg__ (3);
abbffdf9
UD
78
79
2b83a2a4
RM
80/* Set the current default message catalog to DOMAINNAME.
81 If DOMAINNAME is null, return the current default.
82 If DOMAINNAME is "", reset to the default of "messages". */
a784e502 83extern char *textdomain (const char *__domainname) __THROW;
2b83a2a4
RM
84
85/* Specify that the DOMAINNAME message catalog will be found
86 in DIRNAME rather than in the system locale data base. */
a784e502
UD
87extern char *bindtextdomain (const char *__domainname,
88 const char *__dirname) __THROW;
c709e372 89
17c389fc
UD
90/* Specify the character encoding in which the messages from the
91 DOMAINNAME message catalog will be returned. */
a784e502
UD
92extern char *bind_textdomain_codeset (const char *__domainname,
93 const char *__codeset) __THROW;
17c389fc 94
2b83a2a4 95
c709e372 96/* Optimized version of the function above. */
84b5ba7e 97#if defined __OPTIMIZE__ && !defined __cplusplus
036cc82f
RM
98
99/* We need NULL for `gettext'. */
40a55d20
UD
100# define __need_NULL
101# include <stddef.h>
036cc82f
RM
102
103/* We need LC_MESSAGES for `dgettext'. */
104# include <locale.h>
105
106/* These must be macros. Inlined functions are useless because the
c709e372
RM
107 `__builtin_constant_p' predicate in dcgettext would always return
108 false. */
2b83a2a4 109
be10a868 110# define gettext(msgid) dgettext (NULL, msgid)
2b83a2a4 111
e6d18111 112# define dgettext(domainname, msgid) \
c709e372 113 dcgettext (domainname, msgid, LC_MESSAGES)
2b83a2a4 114
e6d18111 115# define ngettext(msgid1, msgid2, n) dngettext (NULL, msgid1, msgid2, n)
abbffdf9 116
e6d18111
UD
117# define dngettext(domainname, msgid1, msgid2, n) \
118 dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES)
abbffdf9 119
575b273b 120#endif /* Optimizing. */
c709e372
RM
121
122__END_DECLS
2b83a2a4 123
c709e372 124#endif /* libintl.h */