2001-04-10 23:21:43 +00:00
|
|
|
/*
|
|
|
|
* Unicode definitions
|
|
|
|
*
|
|
|
|
* Derived from the mingw header written by Colin Peters.
|
|
|
|
* Modified for Wine use by Jon Griffiths and Francois Gouget.
|
|
|
|
* This file is in the public domain.
|
|
|
|
*/
|
|
|
|
#ifndef __WINE_WCHAR_H
|
|
|
|
#define __WINE_WCHAR_H
|
2007-02-20 08:35:41 +00:00
|
|
|
|
2020-02-21 16:18:22 +00:00
|
|
|
#include <corecrt_wctype.h>
|
2020-03-09 16:53:42 +00:00
|
|
|
#include <corecrt_wdirect.h>
|
2020-02-19 11:02:18 +00:00
|
|
|
#include <corecrt_wio.h>
|
2020-03-09 16:53:23 +00:00
|
|
|
#include <corecrt_wprocess.h>
|
2020-02-24 15:35:44 +00:00
|
|
|
#include <corecrt_wstdio.h>
|
|
|
|
#include <corecrt_wstdlib.h>
|
2020-02-25 15:51:37 +00:00
|
|
|
#include <corecrt_wstring.h>
|
2020-02-20 14:49:42 +00:00
|
|
|
#include <corecrt_wtime.h>
|
2020-02-20 14:50:01 +00:00
|
|
|
#include <sys/stat.h>
|
2001-04-10 23:21:43 +00:00
|
|
|
|
2002-12-18 20:17:20 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2019-10-22 13:54:08 +00:00
|
|
|
#ifndef WCHAR_MIN /* also in stdint.h */
|
|
|
|
#define WCHAR_MIN 0U
|
|
|
|
#define WCHAR_MAX 0xffffU
|
|
|
|
#endif
|
2001-04-10 23:21:43 +00:00
|
|
|
|
2004-06-25 01:19:15 +00:00
|
|
|
typedef int mbstate_t;
|
2001-04-10 23:21:43 +00:00
|
|
|
|
2004-06-25 01:19:15 +00:00
|
|
|
#ifndef _WLOCALE_DEFINED
|
|
|
|
#define _WLOCALE_DEFINED
|
2020-11-24 17:50:06 +00:00
|
|
|
_ACRTIMP wchar_t* __cdecl _wsetlocale(int,const wchar_t*);
|
2004-06-25 01:19:15 +00:00
|
|
|
#endif /* _WLOCALE_DEFINED */
|
|
|
|
|
2008-12-17 13:45:18 +00:00
|
|
|
wchar_t __cdecl btowc(int);
|
|
|
|
size_t __cdecl mbrlen(const char *,size_t,mbstate_t*);
|
|
|
|
size_t __cdecl mbrtowc(wchar_t*,const char*,size_t,mbstate_t*);
|
|
|
|
size_t __cdecl mbsrtowcs(wchar_t*,const char**,size_t,mbstate_t*);
|
|
|
|
size_t __cdecl wcrtomb(char*,wchar_t,mbstate_t*);
|
|
|
|
size_t __cdecl wcsrtombs(char*,const wchar_t**,size_t,mbstate_t*);
|
|
|
|
int __cdecl wctob(wint_t);
|
2020-11-24 17:50:06 +00:00
|
|
|
|
|
|
|
_ACRTIMP errno_t __cdecl wmemcpy_s(wchar_t *, size_t, const wchar_t *, size_t);
|
2001-04-10 23:21:43 +00:00
|
|
|
|
2018-05-28 03:05:52 +00:00
|
|
|
static inline wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n)
|
|
|
|
{
|
|
|
|
const wchar_t *end;
|
|
|
|
for (end = s + n; s < end; s++)
|
|
|
|
if (*s == c) return (wchar_t*)s;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2018-05-28 03:05:53 +00:00
|
|
|
static inline int wmemcmp(const wchar_t *s1, const wchar_t *s2, size_t n)
|
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
for (i = 0; i < n; i++)
|
|
|
|
{
|
|
|
|
if (s1[i] > s2[i]) return 1;
|
|
|
|
if (s1[i] < s2[i]) return -1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-05-28 21:49:55 +00:00
|
|
|
static inline wchar_t* __cdecl wmemcpy(wchar_t *dst, const wchar_t *src, size_t n)
|
|
|
|
{
|
2020-02-19 07:01:27 +00:00
|
|
|
return (wchar_t*)memcpy(dst, src, n * sizeof(wchar_t));
|
2018-05-28 21:49:55 +00:00
|
|
|
}
|
|
|
|
|
2018-05-28 21:49:56 +00:00
|
|
|
static inline wchar_t* __cdecl wmemmove(wchar_t *dst, const wchar_t *src, size_t n)
|
|
|
|
{
|
2020-02-19 07:01:27 +00:00
|
|
|
return (wchar_t*)memmove(dst, src, n * sizeof(wchar_t));
|
2018-05-28 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2018-05-28 21:49:57 +00:00
|
|
|
static inline wchar_t* __cdecl wmemset(wchar_t *s, wchar_t c, size_t n)
|
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
for (i = 0; i < n; i++)
|
|
|
|
s[i] = c;
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
2001-04-10 23:21:43 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __WINE_WCHAR_H */
|