Import of Mangos
[auctionmangos.git] / dep / ACE_wrappers / ace / OS_NS_wchar.h
blob4a9843ab84554e5120e6b10b09907a440376c779
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file OS_NS_wchar.h
7 * $Id: OS_NS_wchar.h 80826 2008-03-04 14:51:23Z wotte $
9 * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
10 * @author Jesper S. M|ller<stophph@diku.dk>
11 * @author and a cast of thousands...
13 * Originally in OS.h.
15 //=============================================================================
17 #ifndef ACE_OS_NS_WCHAR_H
18 # define ACE_OS_NS_WCHAR_H
20 # include /**/ "ace/pre.h"
22 # include "ace/config-all.h"
24 # if !defined (ACE_LACKS_PRAGMA_ONCE)
25 # pragma once
26 # endif /* ACE_LACKS_PRAGMA_ONCE */
28 #include "ace/os_include/os_wchar.h"
29 #include "ace/Basic_Types.h"
30 #include /**/ "ace/ACE_export.h"
31 #include "ace/ace_wchar.h" // include for the time being, but this code needs to be moved. dhinton
33 #include "ace/os_include/os_errno.h"
35 #if defined (ACE_EXPORT_MACRO)
36 # undef ACE_EXPORT_MACRO
37 #endif
38 #define ACE_EXPORT_MACRO ACE_Export
40 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
42 namespace ACE_OS
45 typedef ACE_WCHAR_T WChar;
47 #if defined (ACE_HAS_WCHAR)
48 ACE_NAMESPACE_INLINE_FUNCTION
49 wint_t fgetwc (FILE* fp);
50 #endif /* ACE_HAS_WCHAR */
52 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSCAT)
53 /// Emulated wcscat - Appends a string.
54 extern ACE_Export
55 wchar_t *wcscat_emulation (wchar_t *destination,
56 const wchar_t *source);
57 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSCAT */
59 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSCHR)
60 /// Emulated wcschr - Finds a character in a string.
61 extern ACE_Export
62 wchar_t *wcschr_emulation (const wchar_t *string, wchar_t c);
63 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSCHR */
65 #if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSCMP)
66 /// Emulated wcscmp - Compares strings.
67 extern ACE_Export
68 int wcscmp_emulation (const ACE_WCHAR_T *string1, const ACE_WCHAR_T *string2);
69 #endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSCMP */
71 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSCPY)
72 /// Emulated wcscpy - Copies a string.
73 extern ACE_Export
74 wchar_t *wcscpy_emulation (wchar_t *destination,
75 const wchar_t *source);
76 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSCPY */
78 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSCSPN)
79 /// Emulated wcscspn.
80 extern ACE_Export
81 size_t wcscspn_emulation (const wchar_t *string,
82 const wchar_t *reject);
83 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSCSPN */
85 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSICMP)
86 /// Emulated wcsicmp - Performs a case insensitive comparison of strings.
87 extern ACE_Export
88 int wcsicmp_emulation (const wchar_t *string1,
89 const wchar_t *string2);
90 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSICMP */
92 #if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSLEN)
93 /// Emulated wcslen - Returns the length of a string.
94 extern ACE_Export
95 size_t wcslen_emulation (const ACE_WCHAR_T *string);
96 #endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSLEN */
98 #if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSNCAT)
99 /// Emulated wcscat - Appends a string.
100 extern ACE_Export
101 ACE_WCHAR_T *wcsncat_emulation (ACE_WCHAR_T *destination,
102 const ACE_WCHAR_T *source,
103 size_t count);
104 #endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSCAT */
106 #if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSNCMP)
107 /// Emulated wcsncmp - Compares two arrays.
108 extern ACE_Export
109 int wcsncmp_emulation (const ACE_WCHAR_T *string1,
110 const ACE_WCHAR_T *string2,
111 size_t len);
112 #endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCMP */
114 #if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSNCPY)
115 /// Emulated wcsncpy - Copies an array.
116 extern ACE_Export
117 ACE_WCHAR_T *wcsncpy_emulation (ACE_WCHAR_T *destination,
118 const ACE_WCHAR_T *source,
119 size_t len);
120 #endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCPY */
122 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSNICMP)
123 /// Emulated wcsnicmp - Performs a case insensitive comparison of two
124 /// arrays
125 extern ACE_Export
126 int wcsnicmp_emulation (const wchar_t *string1,
127 const wchar_t *string2,
128 size_t len);
129 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSNICMP */
131 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSPBRK)
132 /// Emulated wcspbrk - Searches for characters in a string.
133 extern ACE_Export
134 wchar_t *wcspbrk_emulation (const wchar_t *string,
135 const wchar_t *charset);
136 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSPBRK */
138 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSRCHR)
139 /// Emulated wcsrchr (wchar_t version) - Finds the last occurance of a
140 /// character in a string.
141 extern ACE_Export
142 wchar_t *wcsrchr_emulation (wchar_t *string, wint_t c);
144 /// Emulated wcsrchr (const wchar_t version) - Finds the last occurance of a
145 /// character in a string.
146 extern ACE_Export
147 const wchar_t *wcsrchr_emulation (const wchar_t *string, wint_t c);
148 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSRCHR */
150 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSSPN)
151 /// Emulated wcsspn.
152 extern ACE_Export
153 size_t wcsspn_emulation (const wchar_t *string,
154 const wchar_t *charset);
155 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSSPN */
157 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSSTR)
158 /// Emulated wcsstr - Performs a case insensitive comparison of two strings.
159 extern ACE_Export
160 wchar_t *wcsstr_emulation (const wchar_t *string,
161 const wchar_t *charset);
162 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSSTR */
164 // these are named wrong. should be wcslen, etc... dhinton
165 ACE_NAMESPACE_INLINE_FUNCTION
166 u_int wslen (const WChar *);
168 ACE_NAMESPACE_INLINE_FUNCTION
169 WChar *wscpy (WChar *,
170 const WChar *);
172 ACE_NAMESPACE_INLINE_FUNCTION
173 int wscmp (const WChar *,
174 const WChar *);
176 ACE_NAMESPACE_INLINE_FUNCTION
177 int wsncmp (const WChar *,
178 const WChar *,
179 size_t len);
181 #if defined (ACE_HAS_WCHAR)
182 ACE_NAMESPACE_INLINE_FUNCTION
183 wint_t ungetwc (wint_t c, FILE* fp);
184 #endif /* ACE_HAS_WCHAR */
186 } /* namespace ACE_OS */
188 ACE_END_VERSIONED_NAMESPACE_DECL
190 # if defined (ACE_HAS_INLINED_OSCALLS)
191 # if defined (ACE_INLINE)
192 # undef ACE_INLINE
193 # endif /* ACE_INLINE */
194 # define ACE_INLINE inline
195 # include "ace/OS_NS_wchar.inl"
196 # endif /* ACE_HAS_INLINED_OSCALLS */
198 # include /**/ "ace/post.h"
199 #endif /* ACE_OS_NS_STDIO_H */