lcInit.c revision 61b2299d
1/*
2Copyright 1985, 1986, 1987, 1991, 1998  The Open Group
3
4Portions Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
5
6Permission is hereby granted, free of charge, to any person obtaining a
7copy of this software and associated documentation files (the
8"Software"), to deal in the Software without restriction, including
9without limitation the rights to use, copy, modify, merge, publish,
10distribute, sublicense, and/or sell copies of the Software, and to
11permit persons to whom the Software is furnished to do so, subject to
12the following conditions: The above copyright notice and this
13permission notice shall be included in all copies or substantial
14portions of the Software.
15
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20IN NO EVENT SHALL THE OPEN GROUP OR SUN MICROSYSTEMS, INC. BE LIABLE
21FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
22CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
23THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE EVEN IF
24ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.
25
26
27Except as contained in this notice, the names of The Open Group and/or
28Sun Microsystems, Inc. shall not be used in advertising or otherwise to
29promote the sale, use or other dealings in this Software without prior
30written authorization from The Open Group and/or Sun Microsystems,
31Inc., as applicable.
32
33
34X Window System is a trademark of The Open Group
35
36OSF/1, OSF/Motif and Motif are registered trademarks, and OSF, the OSF
37logo, LBX, X Window System, and Xinerama are trademarks of the Open
38Group. All other trademarks and registered trademarks mentioned herein
39are the property of their respective owners. No right, title or
40interest in or to any trademark, service mark, logo or trade name of
41Sun Microsystems, Inc. or its licensors is granted.
42
43*/
44/* $Xorg: lcInit.c,v 1.4 2000/12/12 12:44:05 coskrey Exp $ */
45/*
46 * Copyright 1992, 1993 by TOSHIBA Corp.
47 *
48 * Permission to use, copy, modify, and distribute this software and its
49 * documentation for any purpose and without fee is hereby granted, provided
50 * that the above copyright notice appear in all copies and that both that
51 * copyright notice and this permission notice appear in supporting
52 * documentation, and that the name of TOSHIBA not be used in advertising
53 * or publicity pertaining to distribution of the software without specific,
54 * written prior permission. TOSHIBA make no representations about the
55 * suitability of this software for any purpose.  It is provided "as is"
56 * without express or implied warranty.
57 *
58 * TOSHIBA DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
59 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
60 * TOSHIBA BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
61 * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
62 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
63 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
64 * SOFTWARE.
65 *
66 * Author: Katsuhisa Yano	TOSHIBA Corp.
67 *			   	mopi@osa.ilab.toshiba.co.jp
68 */
69/*
70 *  (c) Copyright 1995 FUJITSU LIMITED
71 *  This is source code modified by FUJITSU LIMITED under the Joint
72 *  Development Agreement for the CDE/Motif PST.
73 *
74 *   Modifier: Masayoshi Shimamura      FUJITSU LIMITED
75 *
76 */
77/* $XFree86: xc/lib/X11/lcInit.c,v 3.9 2001/11/16 00:52:27 dawes Exp $ */
78
79#ifdef HAVE_CONFIG_H
80#include <config.h>
81#endif
82#include "Xlibint.h"
83#include "Xlcint.h"
84
85#ifdef USE_DYNAMIC_LC
86#undef USE_DEFAULT_LOADER
87#undef USE_GENERIC_LOADER
88#undef USE_UTF8_LOADER
89#else
90#define USE_GENERIC_LOADER
91#define USE_DEFAULT_LOADER
92#define USE_UTF8_LOADER
93#ifdef X_LOCALE
94# define USE_EUC_LOADER
95# define USE_SJIS_LOADER
96# define USE_JIS_LOADER
97#endif
98#endif
99
100/*
101 * The _XlcInitLoader function initializes the locale object loader list
102 * with vendor specific manner.
103 */
104
105void
106_XlcInitLoader(void)
107{
108
109#ifdef USE_DYNAMIC_LC
110    _XlcAddLoader(_XlcDynamicLoad, XlcHead);
111#else /* USE_DYNAMIC_LC */
112
113#ifdef USE_GENERIC_LOADER
114    _XlcAddLoader(_XlcGenericLoader, XlcHead);
115#endif
116
117#ifdef USE_DEFAULT_LOADER
118    _XlcAddLoader(_XlcDefaultLoader, XlcHead);
119#endif
120
121#ifdef USE_UTF8_LOADER
122    _XlcAddLoader(_XlcUtf8Loader, XlcHead);
123#endif
124
125#ifdef USE_EUC_LOADER
126    _XlcAddLoader(_XlcEucLoader, XlcHead);
127#endif
128
129#ifdef USE_SJIS_LOADER
130    _XlcAddLoader(_XlcSjisLoader, XlcHead);
131#endif
132
133#ifdef USE_JIS_LOADER
134    _XlcAddLoader(_XlcJisLoader, XlcHead);
135#endif
136
137#ifdef USE_DYNAMIC_LOADER
138    _XlcAddLoader(_XlcDynamicLoader, XlcHead);
139#endif
140
141#endif /* USE_DYNAMIC_LC */
142}
143
144void
145_XlcDeInitLoader(void)
146{
147
148#ifdef USE_DYNAMIC_LC
149    _XlcRemoveLoader(_XlcDynamicLoad);
150#else /* USE_DYNAMIC_LC */
151
152#ifdef USE_GENERIC_LOADER
153    _XlcRemoveLoader(_XlcGenericLoader);
154#endif
155
156#ifdef USE_DEFAULT_LOADER
157    _XlcRemoveLoader(_XlcDefaultLoader);
158#endif
159
160#ifdef USE_UTF8_LOADER
161    _XlcRemoveLoader(_XlcUtf8Loader);
162#endif
163
164#ifdef USE_EUC_LOADER
165    _XlcRemoveLoader(_XlcEucLoader);
166#endif
167
168#ifdef USE_SJIS_LOADER
169   _XlcRemoveLoader(_XlcSjisLoader);
170#endif
171
172#ifdef USE_JIS_LOADER
173    _XlcRemoveLoader(_XlcJisLoader);
174#endif
175
176#ifdef USE_DYNAMIC_LOADER
177    _XlcRemoveLoader(_XlcDynamicLoader);
178#endif
179
180#endif /* USE_DYNAMIC_LC */
181}
182