Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / OS_NS_wchar.h
blob5f5f0eb8379c3f04a30725d30924539ad3b6fdc4
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file OS_NS_wchar.h
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
8 * @author Jesper S. M|ller<stophph@diku.dk>
9 * @author and a cast of thousands...
11 //=============================================================================
13 #ifndef ACE_OS_NS_WCHAR_H
14 # define ACE_OS_NS_WCHAR_H
16 # include /**/ "ace/pre.h"
18 # include "ace/config-all.h"
20 # if !defined (ACE_LACKS_PRAGMA_ONCE)
21 # pragma once
22 # endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "ace/os_include/os_wchar.h"
25 #include "ace/Basic_Types.h"
26 #include /**/ "ace/ACE_export.h"
27 #include "ace/ace_wchar.h" // include for the time being, but this code needs to be moved. dhinton
29 #include "ace/os_include/os_errno.h"
31 #if defined (ACE_EXPORT_MACRO)
32 # undef ACE_EXPORT_MACRO
33 #endif
34 #define ACE_EXPORT_MACRO ACE_Export
36 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
38 namespace ACE_OS
40 typedef ACE_WCHAR_T WChar;
42 #if defined (ACE_HAS_WCHAR)
43 ACE_NAMESPACE_INLINE_FUNCTION
44 wint_t fgetwc (FILE* fp);
45 #endif /* ACE_HAS_WCHAR */
47 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSCAT)
48 /// Emulated wcscat - Appends a string.
49 extern ACE_Export
50 wchar_t *wcscat_emulation (wchar_t *destination,
51 const wchar_t *source);
52 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSCAT */
54 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSCHR)
55 /// Emulated wcschr - Finds a character in a string.
56 extern ACE_Export
57 wchar_t *wcschr_emulation (const wchar_t *string, wchar_t c);
58 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSCHR */
60 #if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSCMP)
61 /// Emulated wcscmp - Compares strings.
62 extern ACE_Export
63 int wcscmp_emulation (const ACE_WCHAR_T *string1, const ACE_WCHAR_T *string2);
64 #endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSCMP */
66 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSCPY)
67 /// Emulated wcscpy - Copies a string.
68 extern ACE_Export
69 wchar_t *wcscpy_emulation (wchar_t *destination,
70 const wchar_t *source);
71 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSCPY */
73 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSCSPN)
74 /// Emulated wcscspn.
75 extern ACE_Export
76 size_t wcscspn_emulation (const wchar_t *string,
77 const wchar_t *reject);
78 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSCSPN */
80 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSICMP)
81 /// Emulated wcsicmp - Performs a case insensitive comparison of strings.
82 extern ACE_Export
83 int wcsicmp_emulation (const wchar_t *string1,
84 const wchar_t *string2);
85 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSICMP */
87 #if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSLEN)
88 /// Emulated wcslen - Returns the length of a string.
89 extern ACE_Export
90 size_t wcslen_emulation (const ACE_WCHAR_T *string);
91 #endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSLEN */
93 #if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSNCAT)
94 /// Emulated wcscat - Appends a string.
95 extern ACE_Export
96 ACE_WCHAR_T *wcsncat_emulation (ACE_WCHAR_T *destination,
97 const ACE_WCHAR_T *source,
98 size_t count);
99 #endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSCAT */
101 #if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSNCMP)
102 /// Emulated wcsncmp - Compares two arrays.
103 extern ACE_Export
104 int wcsncmp_emulation (const ACE_WCHAR_T *string1,
105 const ACE_WCHAR_T *string2,
106 size_t len);
107 #endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCMP */
109 #if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSNCPY)
110 /// Emulated wcsncpy - Copies an array.
111 extern ACE_Export
112 ACE_WCHAR_T *wcsncpy_emulation (ACE_WCHAR_T *destination,
113 const ACE_WCHAR_T *source,
114 size_t len);
115 #endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCPY */
117 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSNICMP)
118 /// Emulated wcsnicmp - Performs a case insensitive comparison of two
119 /// arrays
120 extern ACE_Export
121 int wcsnicmp_emulation (const wchar_t *string1,
122 const wchar_t *string2,
123 size_t len);
124 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSNICMP */
126 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSPBRK)
127 /// Emulated wcspbrk - Searches for characters in a string.
128 extern ACE_Export
129 wchar_t *wcspbrk_emulation (const wchar_t *string,
130 const wchar_t *charset);
131 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSPBRK */
133 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSRCHR)
134 /// Emulated wcsrchr (wchar_t version) - Finds the last occurrence of a
135 /// character in a string.
136 extern ACE_Export
137 wchar_t *wcsrchr_emulation (wchar_t *string, wint_t c);
139 /// Emulated wcsrchr (const wchar_t version) - Finds the last occurrence of a
140 /// character in a string.
141 extern ACE_Export
142 const wchar_t *wcsrchr_emulation (const wchar_t *string, wint_t c);
143 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSRCHR */
145 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSSPN)
146 /// Emulated wcsspn.
147 extern ACE_Export
148 size_t wcsspn_emulation (const wchar_t *string,
149 const wchar_t *charset);
150 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSSPN */
152 #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSSTR)
153 /// Emulated wcsstr - Performs a case insensitive comparison of two strings.
154 extern ACE_Export
155 wchar_t *wcsstr_emulation (const wchar_t *string,
156 const wchar_t *charset);
157 #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSSTR */
159 // these are named wrong. should be wcslen, etc... dhinton
160 ACE_NAMESPACE_INLINE_FUNCTION
161 u_int wslen (const WChar *);
163 ACE_NAMESPACE_INLINE_FUNCTION
164 WChar *wscpy (WChar *,
165 const WChar *);
167 ACE_NAMESPACE_INLINE_FUNCTION
168 int wscmp (const WChar *,
169 const WChar *);
171 ACE_NAMESPACE_INLINE_FUNCTION
172 int wsncmp (const WChar *,
173 const WChar *,
174 size_t len);
176 #if defined (ACE_HAS_WCHAR)
177 ACE_NAMESPACE_INLINE_FUNCTION
178 wint_t ungetwc (wint_t c, FILE* fp);
179 #endif /* ACE_HAS_WCHAR */
181 } /* namespace ACE_OS */
183 ACE_END_VERSIONED_NAMESPACE_DECL
185 # if defined (ACE_HAS_INLINED_OSCALLS)
186 # if defined (ACE_INLINE)
187 # undef ACE_INLINE
188 # endif /* ACE_INLINE */
189 # define ACE_INLINE inline
190 # include "ace/OS_NS_wchar.inl"
191 # endif /* ACE_HAS_INLINED_OSCALLS */
193 # include /**/ "ace/post.h"
194 #endif /* ACE_OS_NS_STDIO_H */