OSDN Git Service

Refactor to make <parts/time.h> redundant.
[mingw/mingw-org-wsl.git] / mingwrt / include / parts / wchar.h
1 /*
2  * parts/wchar.h
3  *
4  * Internal header file, declaring types and structures which nominally
5  * originate from <wchar.h>, but which POSIX, or MSVC, require to be made
6  * visible on inclusion of certain other headers, without inclusion of
7  * <wchar.h> itself.
8  *
9  * $Id$
10  *
11  * Written by Keith Marshall  <keithmarshall@users.sourceforge.net>
12  * Copyright (C) 2015, MinGW.org Project.
13  *
14  *
15  * Permission is hereby granted, free of charge, to any person obtaining a
16  * copy of this software and associated documentation files (the "Software"),
17  * to deal in the Software without restriction, including without limitation
18  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
19  * and/or sell copies of the Software, and to permit persons to whom the
20  * Software is furnished to do so, subject to the following conditions:
21  *
22  * The above copyright notice, this permission notice, and the following
23  * disclaimer shall be included in all copies or substantial portions of
24  * the Software.
25  *
26  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
29  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
31  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
32  * DEALINGS IN THE SOFTWARE.
33  *
34  */
35 #if _FAKE_WCHAR_H_SOURCED
36 /*
37  * Since we expect this part-header to be sourced exclusively by other
38  * system headers, (nominally <wchar.h>), we don't apply any conventional
39  * multiple inclusion guard; rather, we rely on the guard within <wchar.h>
40  * itself, but allow other headers to fake it for one-shot inclusion...
41  */
42 # undef _FAKE_WCHAR_H_SOURCED
43
44 #elif ! defined _WCHAR_H
45 /*
46  * ...otherwise, we fail if the <wchar.h> guard is not in place.
47  */
48 # error "Never include <parts/wchar.h> directly; use <wchar.h> instead"
49 #endif
50
51 #if defined _WCHAR_H || defined __need_wstring_function_prototypes
52 /*
53  * Wide character versions of the ISO-C standard string functions.
54  */
55 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  wcscat (wchar_t *, const wchar_t *);
56 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  wcschr (const wchar_t *, wchar_t);
57 _CRTIMP int       __cdecl __MINGW_NOTHROW  wcscmp (const wchar_t *, const wchar_t *);
58 _CRTIMP int       __cdecl __MINGW_NOTHROW  wcscoll (const wchar_t *, const wchar_t *);
59 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  wcscpy (wchar_t *, const wchar_t *);
60 _CRTIMP size_t    __cdecl __MINGW_NOTHROW  wcscspn (const wchar_t *, const wchar_t *);
61 _CRTIMP size_t    __cdecl __MINGW_NOTHROW  wcslen (const wchar_t *);
62 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  wcsncat (wchar_t *, const wchar_t *, size_t);
63 _CRTIMP int       __cdecl __MINGW_NOTHROW  wcsncmp (const wchar_t *, const wchar_t *, size_t);
64 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  wcsncpy (wchar_t *, const wchar_t *, size_t);
65 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  wcspbrk (const wchar_t *, const wchar_t *);
66 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  wcsrchr (const wchar_t *, wchar_t);
67 _CRTIMP size_t    __cdecl __MINGW_NOTHROW  wcsspn (const wchar_t *, const wchar_t *);
68 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  wcsstr (const wchar_t *, const wchar_t *);
69 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  wcstok (wchar_t *, const wchar_t *);
70 _CRTIMP size_t    __cdecl __MINGW_NOTHROW  wcsxfrm (wchar_t *, const wchar_t *, size_t);
71
72 #ifndef __STRICT_ANSI__
73 /* UTF-16LE versions of non-ANSI string functions provided by CRTDLL.
74  */
75 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  _wcsdup (const wchar_t *);
76 _CRTIMP int       __cdecl __MINGW_NOTHROW  _wcsicmp (const wchar_t *, const wchar_t *);
77 _CRTIMP int       __cdecl __MINGW_NOTHROW  _wcsicoll (const wchar_t *, const wchar_t *);
78 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  _wcslwr (wchar_t*);
79 _CRTIMP int       __cdecl __MINGW_NOTHROW  _wcsnicmp (const wchar_t *, const wchar_t *, size_t);
80 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  _wcsnset (wchar_t *, wchar_t, size_t);
81 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  _wcsrev (wchar_t *);
82 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  _wcsset (wchar_t *, wchar_t);
83 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  _wcsupr (wchar_t *);
84
85 #ifdef __MSVCRT__
86 _CRTIMP int       __cdecl __MINGW_NOTHROW  _wcsncoll (const wchar_t *, const wchar_t *, size_t);
87 _CRTIMP int       __cdecl __MINGW_NOTHROW  _wcsnicoll (const wchar_t *, const wchar_t *, size_t);
88
89 /* A wide character counterpart to the strerror() API was introduced in
90  * MSVCR70.DLL, and subsequently back-ported to MSVCRT.DLL in WinXP.
91  */
92 #if __MSVCRT_VERSION__ >= __MSVCR70_DLL || NTDDI_VERSION >= NTDDI_WINXP
93  /*
94   * These are are the wide character counterparts to the strerror()
95   * function itself, and the _strerror() function, respectively.
96   */
97 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  _wcserror (int);
98 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW __wcserror (const wchar_t *);
99
100 #endif /* MSVCR70.DLL / WinXP */
101 #endif /* __MSVCRT__ */
102
103 /* MSVCRT.DLL provides neither _wcscmpi() nor wcscmpi(); the heritage
104  * is uncertain, but for the convenience, (and portability), of legacy
105  * applications which assume wcscmpi() should be available:
106  */
107 #define _wcscmpi _wcsicmp
108 int __cdecl __MINGW_NOTHROW wcscmpi (const wchar_t *, const wchar_t *);
109
110 #if ! defined __NO_INLINE__ && ! defined __have_wcscmpi
111 __CRT_ALIAS __JMPSTUB__(( FUNCTION = wcscmpi, REMAPPED = _wcsicmp ))
112   int wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2)
113   { return _wcsicmp (__ws1, __ws2); }
114
115 # define __have_wcscmpi
116 #endif
117
118 #ifndef _NO_OLDNAMES
119  /* Older CRTDLL versions may have provided these alternatively named
120   * functions; we continue to support them, via the OLDNAME libraries:
121   */
122 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  wcsdup (const wchar_t*);
123 _CRTIMP int       __cdecl __MINGW_NOTHROW  wcsicmp (const wchar_t*, const wchar_t*);
124 _CRTIMP int       __cdecl __MINGW_NOTHROW  wcsicoll (const wchar_t*, const wchar_t*);
125 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  wcslwr (wchar_t*);
126 _CRTIMP int       __cdecl __MINGW_NOTHROW  wcsnicmp (const wchar_t*, const wchar_t*, size_t);
127 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  wcsnset (wchar_t*, wchar_t, size_t);
128 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  wcsrev (wchar_t*);
129 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  wcsset (wchar_t*, wchar_t);
130 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW  wcsupr (wchar_t*);
131
132 #endif /* ! _NO_OLDNAMES */
133
134 #endif /* ! __STRICT_ANSI__ */
135 #endif /* __need_wstring_function_prototypes */
136
137 /* $RCSfile$: end of file */