1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 #ifndef __GDK_I18N_H__
20 #define __GDK_I18N_H__
22 /* GDK uses "glib". (And so does GTK).
26 /* international string support */
32 #include <X11/Xfuncproto.h>
33 #include <X11/Xosdefs.h>
41 #if NeedFunctionPrototypes
42 const char *s, size_t n
50 #if NeedFunctionPrototypes
51 wchar_t *wstr, const char *str, size_t len
58 #if NeedFunctionPrototypes
65 extern size_t _Xmbstowcs (
66 #if NeedFunctionPrototypes
67 wchar_t *wstr, const char *str, size_t len
73 extern size_t _Xwcstombs (
74 #if NeedFunctionPrototypes
75 char *str, const wchar_t *wstr, size_t len
81 extern size_t _Xwcslen (
82 #if NeedFunctionPrototypes
89 extern wchar_t* _Xwcscpy (
90 #if NeedFunctionPrototypes
91 wchar_t *wstr1, const wchar_t *wstr2
97 extern wchar_t* _Xwcsncpy (
98 #if NeedFunctionPrototypes
99 wchar_t *wstr1, const wchar_t *wstr2, size_t len
105 extern int _Xwcscmp (
106 #if NeedFunctionPrototypes
107 const wchar_t *wstr1, const wchar_t *wstr2
113 extern int _Xwcsncmp (
114 #if NeedFunctionPrototypes
115 const wchar_t *wstr1, const wchar_t *wstr2, size_t len
121 * mblen, mbtowc, and mbstowcs of the locale "ja_JP.eucJP" are buggy.
128 extern int _g_mbtowc (wchar_t *wstr, const char *str, size_t len);
130 /* #define mblen _Xmblen */
131 /* #define mbtowc _Xmbtowc */
132 #define mblen(a,b) _g_mbtowc ((wchar_t *)(NULL), (a), (b))
133 #define mbtowc(a,b,c) _g_mbtowc ((a),(b),(c))
135 #define wctomb(a,b) _Xwctomb ((a),(b))
136 #define mbstowcs(a,b,c) _Xmbstowcs ((a),(b),(c))
137 #define wcstombs(a,b,c) _Xwcstombs ((a),(b),(c))
138 #define wcslen(a) _Xwcslen ((a))
139 #define wcscpy(a,b) _Xwcscpy ((a),(b))
140 #define wcsncpy(a,b,c) _Xwcsncpy ((a),(b),(c))
146 #endif /* X_LOCALE */
148 #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H)) && !defined(X_LOCALE)
149 # ifdef HAVE_WCTYPE_H
157 # define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
160 #endif /* __GDK_I18N_H__ */