2001-04-11 01:21:43 +02: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 09:35:41 +01:00
|
|
|
|
2020-02-21 17:18:22 +01:00
|
|
|
#include <corecrt_wctype.h>
|
2020-02-19 12:02:18 +01:00
|
|
|
#include <corecrt_wio.h>
|
2020-02-24 16:35:44 +01:00
|
|
|
#include <corecrt_wstdio.h>
|
|
|
|
#include <corecrt_wstdlib.h>
|
2020-02-20 15:49:42 +01:00
|
|
|
#include <corecrt_wtime.h>
|
2018-05-28 23:49:55 +02:00
|
|
|
#include <string.h>
|
2020-02-20 15:50:01 +01:00
|
|
|
#include <sys/stat.h>
|
2001-04-11 01:21:43 +02:00
|
|
|
|
2002-12-18 21:17:20 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2019-10-22 15:54:08 +02:00
|
|
|
#ifndef WCHAR_MIN /* also in stdint.h */
|
|
|
|
#define WCHAR_MIN 0U
|
|
|
|
#define WCHAR_MAX 0xffffU
|
|
|
|
#endif
|
2001-04-11 01:21:43 +02:00
|
|
|
|
2004-06-25 03:19:15 +02:00
|
|
|
typedef int mbstate_t;
|
2001-04-11 01:21:43 +02:00
|
|
|
|
2004-06-25 03:19:15 +02:00
|
|
|
#ifndef _WDIRECT_DEFINED
|
|
|
|
#define _WDIRECT_DEFINED
|
2008-12-17 14:45:18 +01:00
|
|
|
int __cdecl _wchdir(const wchar_t*);
|
|
|
|
wchar_t* __cdecl _wgetcwd(wchar_t*,int);
|
|
|
|
wchar_t* __cdecl _wgetdcwd(int,wchar_t*,int);
|
|
|
|
int __cdecl _wmkdir(const wchar_t*);
|
|
|
|
int __cdecl _wrmdir(const wchar_t*);
|
2004-06-25 03:19:15 +02:00
|
|
|
#endif /* _WDIRECT_DEFINED */
|
|
|
|
|
|
|
|
#ifndef _WLOCALE_DEFINED
|
|
|
|
#define _WLOCALE_DEFINED
|
2008-12-17 14:45:18 +01:00
|
|
|
wchar_t* __cdecl _wsetlocale(int,const wchar_t*);
|
2004-06-25 03:19:15 +02:00
|
|
|
#endif /* _WLOCALE_DEFINED */
|
|
|
|
|
|
|
|
#ifndef _WPROCESS_DEFINED
|
|
|
|
#define _WPROCESS_DEFINED
|
2017-11-02 10:19:18 +01:00
|
|
|
int WINAPIV _wexecl(const wchar_t*,const wchar_t*,...);
|
|
|
|
int WINAPIV _wexecle(const wchar_t*,const wchar_t*,...);
|
|
|
|
int WINAPIV _wexeclp(const wchar_t*,const wchar_t*,...);
|
|
|
|
int WINAPIV _wexeclpe(const wchar_t*,const wchar_t*,...);
|
2008-12-17 14:45:18 +01:00
|
|
|
int __cdecl _wexecv(const wchar_t*,const wchar_t* const *);
|
|
|
|
int __cdecl _wexecve(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
|
|
|
int __cdecl _wexecvp(const wchar_t*,const wchar_t* const *);
|
|
|
|
int __cdecl _wexecvpe(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
2017-11-02 10:19:18 +01:00
|
|
|
int WINAPIV _wspawnl(int,const wchar_t*,const wchar_t*,...);
|
|
|
|
int WINAPIV _wspawnle(int,const wchar_t*,const wchar_t*,...);
|
|
|
|
int WINAPIV _wspawnlp(int,const wchar_t*,const wchar_t*,...);
|
|
|
|
int WINAPIV _wspawnlpe(int,const wchar_t*,const wchar_t*,...);
|
2008-12-17 14:45:18 +01:00
|
|
|
int __cdecl _wspawnv(int,const wchar_t*,const wchar_t* const *);
|
|
|
|
int __cdecl _wspawnve(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
|
|
|
int __cdecl _wspawnvp(int,const wchar_t*,const wchar_t* const *);
|
|
|
|
int __cdecl _wspawnvpe(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
|
|
|
int __cdecl _wsystem(const wchar_t*);
|
2004-06-25 03:19:15 +02:00
|
|
|
#endif /* _WPROCESS_DEFINED */
|
|
|
|
|
|
|
|
#ifndef _WSTRING_DEFINED
|
|
|
|
#define _WSTRING_DEFINED
|
2013-03-30 20:42:29 +01:00
|
|
|
int __cdecl _wcscoll_l(const wchar_t*,const wchar_t*,_locale_t);
|
2008-12-17 14:45:18 +01:00
|
|
|
wchar_t* __cdecl _wcsdup(const wchar_t*);
|
|
|
|
int __cdecl _wcsicmp(const wchar_t*,const wchar_t*);
|
|
|
|
int __cdecl _wcsicoll(const wchar_t*,const wchar_t*);
|
2013-03-30 20:42:29 +01:00
|
|
|
int __cdecl _wcsicoll_l(const wchar_t*,const wchar_t*,_locale_t);
|
2008-12-17 14:45:18 +01:00
|
|
|
wchar_t* __cdecl _wcslwr(wchar_t*);
|
2019-08-02 04:20:30 +02:00
|
|
|
errno_t __cdecl _wcslwr_s(wchar_t*, size_t);
|
2013-03-30 20:42:29 +01:00
|
|
|
int __cdecl _wcsncoll(const wchar_t*,const wchar_t*,size_t);
|
|
|
|
int __cdecl _wcsncoll_l(const wchar_t*,const wchar_t*,size_t,_locale_t);
|
2008-12-17 14:45:18 +01:00
|
|
|
int __cdecl _wcsnicmp(const wchar_t*,const wchar_t*,size_t);
|
2010-12-03 18:12:23 +01:00
|
|
|
int __cdecl _wcsnicoll(const wchar_t*,const wchar_t*,size_t);
|
2013-03-30 20:42:29 +01:00
|
|
|
int __cdecl _wcsnicoll_l(const wchar_t*,const wchar_t*,size_t,_locale_t);
|
2008-12-17 14:45:18 +01:00
|
|
|
wchar_t* __cdecl _wcsnset(wchar_t*,wchar_t,size_t);
|
|
|
|
wchar_t* __cdecl _wcsrev(wchar_t*);
|
|
|
|
wchar_t* __cdecl _wcsset(wchar_t*,wchar_t);
|
|
|
|
wchar_t* __cdecl _wcsupr(wchar_t*);
|
2019-08-02 04:20:30 +02:00
|
|
|
errno_t __cdecl _wcsupr_s(wchar_t*, size_t);
|
2008-12-17 14:45:18 +01:00
|
|
|
|
|
|
|
wchar_t* __cdecl wcscat(wchar_t*,const wchar_t*);
|
2010-06-16 23:42:49 +02:00
|
|
|
errno_t __cdecl wcscat_s(wchar_t*,size_t,const wchar_t*);
|
2008-12-17 14:45:18 +01:00
|
|
|
wchar_t* __cdecl wcschr(const wchar_t*,wchar_t);
|
|
|
|
int __cdecl wcscmp(const wchar_t*,const wchar_t*);
|
|
|
|
int __cdecl wcscoll(const wchar_t*,const wchar_t*);
|
|
|
|
wchar_t* __cdecl wcscpy(wchar_t*,const wchar_t*);
|
2010-06-16 23:42:49 +02:00
|
|
|
errno_t __cdecl wcscpy_s(wchar_t*,size_t,const wchar_t*);
|
2008-12-17 14:45:18 +01:00
|
|
|
size_t __cdecl wcscspn(const wchar_t*,const wchar_t*);
|
|
|
|
size_t __cdecl wcslen(const wchar_t*);
|
|
|
|
wchar_t* __cdecl wcsncat(wchar_t*,const wchar_t*,size_t);
|
2019-08-02 04:20:30 +02:00
|
|
|
errno_t __cdecl wcsncat_s(wchar_t *, size_t, const wchar_t *, size_t);
|
2008-12-17 14:45:18 +01:00
|
|
|
int __cdecl wcsncmp(const wchar_t*,const wchar_t*,size_t);
|
|
|
|
wchar_t* __cdecl wcsncpy(wchar_t*,const wchar_t*,size_t);
|
2010-06-16 23:42:49 +02:00
|
|
|
errno_t __cdecl wcsncpy_s(wchar_t*,size_t,const wchar_t*,size_t);
|
2019-08-02 04:20:30 +02:00
|
|
|
size_t __cdecl wcsnlen(const size_t*,size_t);
|
2008-12-17 14:45:18 +01:00
|
|
|
wchar_t* __cdecl wcspbrk(const wchar_t*,const wchar_t*);
|
|
|
|
wchar_t* __cdecl wcsrchr(const wchar_t*,wchar_t wcFor);
|
|
|
|
size_t __cdecl wcsspn(const wchar_t*,const wchar_t*);
|
|
|
|
wchar_t* __cdecl wcsstr(const wchar_t*,const wchar_t*);
|
2020-02-21 07:40:24 +01:00
|
|
|
wchar_t* __cdecl wcstok_s(wchar_t*,const wchar_t*,wchar_t**);
|
2008-12-17 14:45:18 +01:00
|
|
|
size_t __cdecl wcsxfrm(wchar_t*,const wchar_t*,size_t);
|
2020-02-21 07:40:24 +01:00
|
|
|
|
|
|
|
#ifdef _UCRT
|
|
|
|
wchar_t* __cdecl wcstok(wchar_t*,const wchar_t*,wchar_t**);
|
|
|
|
static inline wchar_t* _wcstok(wchar_t* str, const wchar_t *delim) { return wcstok(str, delim, NULL); }
|
|
|
|
# ifdef __cplusplus
|
|
|
|
extern "C++" inline wchar_t* wcstok(wchar_t* str, const wchar_t *delim) { return wcstok(str, delim, NULL); }
|
|
|
|
# elif defined(_CRT_NON_CONFORMING_WCSTOK)
|
|
|
|
# define wcstok _wcstok
|
|
|
|
# endif
|
|
|
|
#else /* _UCRT */
|
|
|
|
wchar_t* __cdecl wcstok(wchar_t*,const wchar_t*);
|
|
|
|
# define _wcstok wcstok
|
|
|
|
#endif /* _UCRT */
|
|
|
|
|
2004-06-25 03:19:15 +02:00
|
|
|
#endif /* _WSTRING_DEFINED */
|
|
|
|
|
2008-12-17 14:45:18 +01: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);
|
2019-08-02 04:20:30 +02:00
|
|
|
errno_t __cdecl wmemcpy_s(wchar_t *, size_t, const wchar_t *, size_t);
|
2001-04-11 01:21:43 +02:00
|
|
|
|
2018-05-28 05:05:52 +02: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 05:05:53 +02: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 23:49:55 +02:00
|
|
|
static inline wchar_t* __cdecl wmemcpy(wchar_t *dst, const wchar_t *src, size_t n)
|
|
|
|
{
|
2020-02-19 08:01:27 +01:00
|
|
|
return (wchar_t*)memcpy(dst, src, n * sizeof(wchar_t));
|
2018-05-28 23:49:55 +02:00
|
|
|
}
|
|
|
|
|
2018-05-28 23:49:56 +02:00
|
|
|
static inline wchar_t* __cdecl wmemmove(wchar_t *dst, const wchar_t *src, size_t n)
|
|
|
|
{
|
2020-02-19 08:01:27 +01:00
|
|
|
return (wchar_t*)memmove(dst, src, n * sizeof(wchar_t));
|
2018-05-28 23:49:56 +02:00
|
|
|
}
|
|
|
|
|
2018-05-28 23:49:57 +02: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-11 01:21:43 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __WINE_WCHAR_H */
|