xref: /illumos-gate/usr/src/lib/libxcurses/h/m_i18n.h (revision 1da57d55)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1996, by Sun Microsystems, Inc.
24*7c478bd9Sstevel@tonic-gate  * All rights reserved.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate /*
28*7c478bd9Sstevel@tonic-gate  * m_i18n.h: Header file dealing with all i18n issues.  #included from mks.h,
29*7c478bd9Sstevel@tonic-gate  * no program should ever #include any i18n-specific header (i.e. this
30*7c478bd9Sstevel@tonic-gate  * will decide to include locale.h, nls.h and what not).
31*7c478bd9Sstevel@tonic-gate  *
32*7c478bd9Sstevel@tonic-gate  * Copyright 1992, 1993 by Mortice Kern Systems Inc.  All rights reserved.
33*7c478bd9Sstevel@tonic-gate  *
34*7c478bd9Sstevel@tonic-gate  * $Header: /rd/h/rcs/m_i18n.h 1.17 1995/01/04 02:42:04 mark Exp ross $
35*7c478bd9Sstevel@tonic-gate  */
36*7c478bd9Sstevel@tonic-gate 
37*7c478bd9Sstevel@tonic-gate #ifndef __M_M_I18N_H_
38*7c478bd9Sstevel@tonic-gate #define __M_M_I18N_H_
39*7c478bd9Sstevel@tonic-gate 
40*7c478bd9Sstevel@tonic-gate #ifndef	M_I18N_M_
41*7c478bd9Sstevel@tonic-gate /*l
42*7c478bd9Sstevel@tonic-gate  * Libraries do not have leading m_ prefixes.
43*7c478bd9Sstevel@tonic-gate  * Thus, we must create #defines which will change all our code from
44*7c478bd9Sstevel@tonic-gate  * having m_ prefixes, to direct library calls.
45*7c478bd9Sstevel@tonic-gate  */
46*7c478bd9Sstevel@tonic-gate #define	m_collel_t	collel_t
47*7c478bd9Sstevel@tonic-gate #define	m_ismccollel	ismccollel
48*7c478bd9Sstevel@tonic-gate #define	m_collequiv	collequiv
49*7c478bd9Sstevel@tonic-gate #define	m_collrange	collrange
50*7c478bd9Sstevel@tonic-gate #define	m_collorder	collorder
51*7c478bd9Sstevel@tonic-gate #define	m_cclass	cclass
52*7c478bd9Sstevel@tonic-gate #define	m_strtocoll	strtocoll
53*7c478bd9Sstevel@tonic-gate #define	m_colltostr	colltostr
54*7c478bd9Sstevel@tonic-gate 
55*7c478bd9Sstevel@tonic-gate #define	m_localedtconv	localedtconv
56*7c478bd9Sstevel@tonic-gate #define	m_localeldconv	localeldconv
57*7c478bd9Sstevel@tonic-gate #define	m_dtconv	dtconv
58*7c478bd9Sstevel@tonic-gate 
59*7c478bd9Sstevel@tonic-gate #endif	/* !M_I18N_M_ */
60*7c478bd9Sstevel@tonic-gate 
61*7c478bd9Sstevel@tonic-gate #define	M_CSETSIZE	(UCHAR_MAX+1)
62*7c478bd9Sstevel@tonic-gate 
63*7c478bd9Sstevel@tonic-gate /*l
64*7c478bd9Sstevel@tonic-gate  *  Fetch all the data structures.
65*7c478bd9Sstevel@tonic-gate  *  Even if I18N is off, we need access to the data structures.
66*7c478bd9Sstevel@tonic-gate  *  Routines defined inside these headers may get changed via #define's
67*7c478bd9Sstevel@tonic-gate  *  below.
68*7c478bd9Sstevel@tonic-gate  */
69*7c478bd9Sstevel@tonic-gate #include <m_nls.h>	/* Our messaging scheme file */
70*7c478bd9Sstevel@tonic-gate #include <locale.h>	/* Local compiler's locale.h */
71*7c478bd9Sstevel@tonic-gate #include <collate.h>	/* Local compiler's collation: includes m_collel_t */
72*7c478bd9Sstevel@tonic-gate 
73*7c478bd9Sstevel@tonic-gate /*l
74*7c478bd9Sstevel@tonic-gate  * Define i18n portability routines -- built on top of what we define
75*7c478bd9Sstevel@tonic-gate  * as the mks extentions.
76*7c478bd9Sstevel@tonic-gate  */
77*7c478bd9Sstevel@tonic-gate extern int		m_isyes (char *);
78*7c478bd9Sstevel@tonic-gate 
79*7c478bd9Sstevel@tonic-gate #ifndef	I18N
80*7c478bd9Sstevel@tonic-gate 
81*7c478bd9Sstevel@tonic-gate /*l
82*7c478bd9Sstevel@tonic-gate  * I18N is not supported -- make most of it disappear
83*7c478bd9Sstevel@tonic-gate  *
84*7c478bd9Sstevel@tonic-gate  * If we don't want all the internationalization stuff, then we get rid
85*7c478bd9Sstevel@tonic-gate  * all the code, and all the data except the lconv structure (if used).
86*7c478bd9Sstevel@tonic-gate  * This is done if I18N is undefined at compile time.  In this case, #define's
87*7c478bd9Sstevel@tonic-gate  * are used to convert strcoll into strcmp; setlocale to simply return POSIX,
88*7c478bd9Sstevel@tonic-gate  * and localeconv to return a pointer to the static lconv structure.
89*7c478bd9Sstevel@tonic-gate  */
90*7c478bd9Sstevel@tonic-gate 
91*7c478bd9Sstevel@tonic-gate /* messaging */
92*7c478bd9Sstevel@tonic-gate #undef	m_textstr
93*7c478bd9Sstevel@tonic-gate #undef	m_msgdup
94*7c478bd9Sstevel@tonic-gate #undef	m_msgfree
95*7c478bd9Sstevel@tonic-gate #define	m_textdomain(str)
96*7c478bd9Sstevel@tonic-gate #define m_textmsg(id, str, cls)		(str)
97*7c478bd9Sstevel@tonic-gate #define m_textstr(id, str, cls)		str
98*7c478bd9Sstevel@tonic-gate #define m_strmsg(str)			(str)
99*7c478bd9Sstevel@tonic-gate #define m_msgdup(m)	(m)
100*7c478bd9Sstevel@tonic-gate #define m_msgfree(m)
101*7c478bd9Sstevel@tonic-gate 
102*7c478bd9Sstevel@tonic-gate /* locale */
103*7c478bd9Sstevel@tonic-gate #define	setlocale(class, locale)	((char *)"POSIX")
104*7c478bd9Sstevel@tonic-gate #define	strcoll				strcmp
105*7c478bd9Sstevel@tonic-gate #define	localeconv()			(&_m_lconv)
106*7c478bd9Sstevel@tonic-gate #undef	m_localedtconv
107*7c478bd9Sstevel@tonic-gate #define	m_localedtconv()		(&_m_dtconv)
108*7c478bd9Sstevel@tonic-gate #undef	m_localeldconv
109*7c478bd9Sstevel@tonic-gate #define	m_localeldconv()		(&_m_locdef)
110*7c478bd9Sstevel@tonic-gate #undef	m_colltostr
111*7c478bd9Sstevel@tonic-gate #define	m_colltostr(c)			(NULL)
112*7c478bd9Sstevel@tonic-gate 
113*7c478bd9Sstevel@tonic-gate extern struct lconv		_m_lconv;
114*7c478bd9Sstevel@tonic-gate extern struct m_dtconv		_m_dtconv;
115*7c478bd9Sstevel@tonic-gate extern struct _m_localedef	_m_locdef;
116*7c478bd9Sstevel@tonic-gate 
117*7c478bd9Sstevel@tonic-gate #endif /*I18N*/
118*7c478bd9Sstevel@tonic-gate 
119*7c478bd9Sstevel@tonic-gate #endif /*__M_M_I18N_H_*/
120