00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 #ifndef COMMON_AC_WCHAR_H
00021 #define COMMON_AC_WCHAR_H
00022 
00023 #include <common/ac/stdarg.h>
00024 #include <common/ac/stddef.h>
00025 
00026 #if HAVE_WCHAR_H
00027 #include <wchar.h>
00028 
00029 #if !HAVE_WINT_T
00030 #define HAVE_WINT_T 1
00031 #ifndef _WINT_T
00032 #define _WINT_T
00033 typedef wchar_t wint_t;
00034 #endif
00035 #endif
00036 
00037 #if !HAVE_MBSTATE_T
00038 #define HAVE_MBSTATE_T 1
00039 #ifndef _MBSTATE_T
00040 #define _MBSTATE_T
00041 typedef int mbstate_t;
00042 #endif
00043 #endif
00044 
00045 #else
00046 
00047 #include <common/ac/stddef.h>
00048 #include <common/main.h>
00049 typedef int mbstate_t;
00050 #ifndef WEOF
00051 #define WEOF (wchar_t)(-1);
00052 #endif
00053 int mbsinit(const mbstate_t *);
00054 size_t wcslen(const wchar_t *);
00055 size_t mbrlen(const char *, size_t, mbstate_t *);
00056 size_t mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *);
00057 size_t wcsrtombs(char *, const wchar_t **, size_t, mbstate_t *);
00058 
00059 #endif
00060 
00061 
00062 #if !HAVE_DECL_WCWIDTH
00063 extern "C" {
00064 int wcwidth(wchar_t);
00065 }
00066 #endif
00067 
00068 #if !HAVE_DECL_WCSWIDTH
00069 extern "C" {
00070 int wcswidth(const wchar_t *, size_t);
00071 }
00072 #endif
00073 
00074 #if !HAVE_DECL_MBRTOWC
00075 extern "C" {
00076 size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *);
00077 }
00078 #endif
00079 
00080 #if !HAVE_DECL_WCRTOMB
00081 extern "C" {
00082 size_t wcrtomb(char *, wchar_t, mbstate_t *);
00083 }
00084 #endif
00085 
00086 
00087 #if HAVE_WIDEC_H
00088 #include <widec.h>
00089 #endif
00090 
00091 
00092 
00093 
00094 
00095 
00096 
00097 
00098 
00099 
00100 #if HAVE_ISWPRINT
00101 
00102 #ifdef iswprint
00103 #undef iswprint
00104 #endif
00105 
00106 #ifdef iswspace
00107 #undef iswspace
00108 #endif
00109 
00110 #ifdef iswpunct
00111 #undef iswpunct
00112 #endif
00113 
00114 #ifdef iswupper
00115 #undef iswupper
00116 #endif
00117 
00118 #ifdef iswlower
00119 #undef iswlower
00120 #endif
00121 
00122 #ifdef iswdigit
00123 #undef iswdigit
00124 #endif
00125 
00126 #ifdef iswalnum
00127 #undef iswalnum
00128 #endif
00129 
00130 #ifdef towupper
00131 #undef towupper
00132 #endif
00133 
00134 #ifdef towlower
00135 #undef towlower
00136 #endif
00137 
00138 #endif // !HAVE_ISWPRINT
00139 
00140 
00141 
00142 
00143 
00144 
00145 #ifndef HAVE_WINT_T
00146 #define HAVE_WINT_T
00147 typedef wchar_t wint_t;
00148 #endif
00149 
00150 #endif // COMMON_AC_WCHAR_H