]> Pileus Git - ~andy/gtk/blob - gdk/gdki18n.h
It's all in the changelog. Well, almost all.
[~andy/gtk] / gdk / gdki18n.h
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
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.
8  *
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.
13  *
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.
17  */
18
19 #ifndef __GDK_I18N_H__
20 #define __GDK_I18N_H__
21
22 /* GDK uses "glib". (And so does GTK).
23  */
24 #include <glib.h>
25
26 /* international string support */
27
28 #include <stdlib.h>
29
30 #ifdef X_LOCALE
31
32 #include <X11/Xfuncproto.h>
33 #include <X11/Xosdefs.h>
34
35 #ifdef  __cplusplus
36 extern "C" {
37 #endif
38
39 _XFUNCPROTOBEGIN
40 extern int _Xmblen (
41 #if NeedFunctionPrototypes
42   const char *s, size_t n
43 #endif
44
45 );
46 _XFUNCPROTOEND
47
48 _XFUNCPROTOBEGIN
49 extern int _Xmbtowc (
50 #if NeedFunctionPrototypes
51   wchar_t *wstr, const char *str, size_t len
52 #endif
53 );
54 _XFUNCPROTOEND
55
56 _XFUNCPROTOBEGIN
57 extern int _Xwctomb (
58 #if NeedFunctionPrototypes
59   char *str, wchar_t wc
60 #endif
61 );
62 _XFUNCPROTOEND
63
64 _XFUNCPROTOBEGIN
65 extern size_t _Xmbstowcs (
66 #if NeedFunctionPrototypes
67   wchar_t *wstr, const char *str, size_t len
68 #endif
69 );
70 _XFUNCPROTOEND
71
72 _XFUNCPROTOBEGIN
73 extern size_t _Xwcstombs (
74 #if NeedFunctionPrototypes
75   char *str, const wchar_t *wstr, size_t len
76 #endif
77 );
78 _XFUNCPROTOEND
79
80 _XFUNCPROTOBEGIN
81 extern size_t _Xwcslen (
82 #if NeedFunctionPrototypes
83   const wchar_t *wstr
84 #endif
85 );
86 _XFUNCPROTOEND
87
88 _XFUNCPROTOBEGIN
89 extern wchar_t* _Xwcscpy (
90 #if NeedFunctionPrototypes
91   wchar_t *wstr1, const wchar_t *wstr2
92 #endif
93 );
94 _XFUNCPROTOEND
95
96 _XFUNCPROTOBEGIN
97 extern wchar_t* _Xwcsncpy (
98 #if NeedFunctionPrototypes
99   wchar_t *wstr1, const wchar_t *wstr2, size_t len
100 #endif
101 );
102 _XFUNCPROTOEND
103
104 _XFUNCPROTOBEGIN
105 extern int _Xwcscmp (
106 #if NeedFunctionPrototypes
107   const wchar_t *wstr1, const wchar_t *wstr2
108 #endif
109 );
110 _XFUNCPROTOEND
111
112 _XFUNCPROTOBEGIN
113 extern int _Xwcsncmp (
114 #if NeedFunctionPrototypes
115   const wchar_t *wstr1, const wchar_t *wstr2, size_t len
116 #endif
117 );
118 _XFUNCPROTOEND
119
120 /* 
121  * mblen, mbtowc, and mbstowcs of the locale "ja_JP.eucJP" are buggy.
122  */
123
124 #ifdef MB_CUR_MAX
125 # undef MB_CUR_MAX
126 #endif
127 #define MB_CUR_MAX 4
128 extern int _g_mbtowc (wchar_t *wstr, const char *str, size_t len);
129
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))
134
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))
141
142 #ifdef  __cplusplus
143 }
144 #endif
145
146 #endif /* X_LOCALE */
147
148 #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H)) && !defined(X_LOCALE)
149 #  ifdef HAVE_WCTYPE_H
150 #    include <wctype.h>
151 #  else
152 #    ifdef HAVE_WCHAR_H
153 #      include <wchar.h>
154 #    endif
155 #  endif
156 #else
157 #  define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
158 #endif
159
160 #endif /* __GDK_I18N_H__ */