xref: /titanic_52/usr/src/head/libintl.h (revision 0eb822a1c0c2bea495647510b75f77f0e57633eb)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /* Libintl is a library of advanced internationalization functions. */
28 
29 #ifndef	_LIBINTL_H
30 #define	_LIBINTL_H
31 
32 #pragma ident	"%Z%%M%	%I%	%E% SMI"
33 
34 #include <sys/isa_defs.h>
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 /*
41  * wchar_t is a built-in type in standard C++ and as such is not
42  * defined here when using standard C++. However, the GNU compiler
43  * fixincludes utility nonetheless creates its own version of this
44  * header for use by gcc and g++. In that version it adds a redundant
45  * guard for __cplusplus. To avoid the creation of a gcc/g++ specific
46  * header we need to include the following magic comment:
47  *
48  * we must use the C++ compiler's type
49  *
50  * The above comment should not be removed or changed until GNU
51  * gcc/fixinc/inclhack.def is updated to bypass this header.
52  */
53 #if !defined(__cplusplus) || (__cplusplus < 199711L && !defined(__GNUG__))
54 #ifndef _WCHAR_T
55 #define	_WCHAR_T
56 #if defined(_LP64)
57 typedef int	wchar_t;
58 #else
59 typedef long	wchar_t;
60 #endif
61 #endif	/* !_WCHAR_T */
62 #endif	/* !defined(__cplusplus) ... */
63 
64 #define	TEXTDOMAINMAX	256
65 
66 #ifdef __STDC__
67 extern char *dcgettext(const char *, const char *, const int);
68 extern char *dgettext(const char *, const char *);
69 extern char *gettext(const char *);
70 extern char *textdomain(const char *);
71 extern char *bindtextdomain(const char *, const char *);
72 
73 /*
74  * LI18NUX 2000 Globalization Specification Version 1.0
75  * with Amendment 2
76  */
77 extern char *dcngettext(const char *, const char *,
78 	const char *, unsigned long int, int);
79 extern char *dngettext(const char *, const char *,
80 	const char *, unsigned long int);
81 extern char *ngettext(const char *, const char *, unsigned long int);
82 extern char *bind_textdomain_codeset(const char *, const char *);
83 
84 /* Word handling functions --- requires dynamic linking */
85 /* Warning: these are experimental and subject to change. */
86 extern int wdinit(void);
87 extern int wdchkind(wchar_t);
88 extern int wdbindf(wchar_t, wchar_t, int);
89 extern wchar_t *wddelim(wchar_t, wchar_t, int);
90 extern wchar_t mcfiller(void);
91 extern int mcwrap(void);
92 
93 #else
94 extern char *dcgettext();
95 extern char *dgettext();
96 extern char *gettext();
97 extern char *textdomain();
98 extern char *bindtextdomain();
99 
100 /*
101  * LI18NUX 2000 Globalization Specification Version 1.0
102  * with Amendment 2
103  */
104 extern char *dcngettext();
105 extern char *dngettext();
106 extern char *ngettext();
107 extern char *bind_textdomain_codeset();
108 
109 /* Word handling functions --- requires dynamic linking */
110 /* Warning: these are experimental and subject to change. */
111 extern int wdinit();
112 extern int wdchkind();
113 extern int wdbindf();
114 extern wchar_t *wddelim();
115 extern wchar_t mcfiller();
116 extern int mcwrap();
117 
118 #endif
119 
120 #ifdef	__cplusplus
121 }
122 #endif
123 
124 #endif /* _LIBINTL_H */
125