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