ReactOS 0.4.17-dev-357-ga8f14ff
wcs.c File Reference
#include <limits.h>
#include <locale.h>
#include <math.h>
#include <assert.h>
#include <wchar.h>
#include <wctype.h>
#include "msvcrt.h"
#include "winnls.h"
#include "wtypes.h"
#include "wine/debug.h"
#include "printf.h"
Include dependency graph for wcs.c:

Go to the source code of this file.

Classes

struct  pf_flags
 

Macros

#define _NO_CRT_STDIO_INLINE
 
#define PRINTF_WIDE
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msvcrt)
 
wchar_t *CDECL _wcsdup (const wchar_t *str)
 
wint_t CDECL _towlower_l (wint_t c, _locale_t locale)
 
wint_t CDECL towlower (wint_t c)
 
INT CDECL _wcsicmp_l (const wchar_t *str1, const wchar_t *str2, _locale_t locale)
 
wint_t CDECL towctrans (wint_t c, wctrans_t category)
 
INT CDECL _wcsicmp (const wchar_t *str1, const wchar_t *str2)
 
INT CDECL _wcsnicmp_l (const wchar_t *str1, const wchar_t *str2, size_t n, _locale_t locale)
 
INT CDECL _wcsnicmp (const wchar_t *str1, const wchar_t *str2, size_t n)
 
int CDECL _wcsicoll_l (const wchar_t *str1, const wchar_t *str2, _locale_t locale)
 
INT CDECL _wcsicoll (const wchar_t *str1, const wchar_t *str2)
 
int CDECL _wcsnicoll_l (const wchar_t *str1, const wchar_t *str2, size_t count, _locale_t locale)
 
INT CDECL _wcsnicoll (const wchar_t *str1, const wchar_t *str2, size_t count)
 
wchar_t *CDECL _wcsnset (wchar_t *str, wchar_t c, size_t n)
 
int CDECL _wcsnset_s (wchar_t *str, size_t size, wchar_t c, size_t count)
 
wchar_t *CDECL _wcsrev (wchar_t *str)
 
int CDECL _wcsset_s (wchar_t *str, size_t n, wchar_t c)
 
wchar_t *CDECL _wcsset (wchar_t *str, wchar_t c)
 
int CDECL _wcsupr_s_l (wchar_t *str, size_t n, _locale_t locale)
 
INT CDECL _wcsupr_s (wchar_t *str, size_t n)
 
wchar_t *CDECL _wcsupr_l (wchar_t *str, _locale_t locale)
 
wchar_t *CDECL _wcsupr (wchar_t *str)
 
int CDECL _wcslwr_s_l (wchar_t *str, size_t n, _locale_t locale)
 
int CDECL _wcslwr_s (wchar_t *str, size_t n)
 
wchar_t *CDECL _wcslwr_l (wchar_t *str, _locale_t locale)
 
wchar_t *CDECL _wcslwr (wchar_t *str)
 
size_t __cdecl wcscspn (const wchar_t *str, const wchar_t *reject)
 
size_t __cdecl wcsspn (const wchar_t *str, const wchar_t *accept)
 
int CDECL wcsncmp (const wchar_t *str1, const wchar_t *str2, size_t n)
 
int CDECL _wcsncoll_l (const wchar_t *str1, const wchar_t *str2, size_t count, _locale_t locale)
 
int CDECL _wcsncoll (const wchar_t *str1, const wchar_t *str2, size_t count)
 
static wchar_t strtod_wstr_get (void *ctx)
 
static void strtod_wstr_unget (void *ctx)
 
double CDECL _wcstod_l (const wchar_t *str, wchar_t **end, _locale_t locale)
 
static size_t wcsrtombs_l (char *mbstr, const wchar_t **wcstr, size_t count, _locale_t locale)
 
size_t CDECL _wcstombs_l (char *mbstr, const wchar_t *wcstr, size_t count, _locale_t locale)
 
size_t CDECL wcstombs (char *mbstr, const wchar_t *wcstr, size_t count)
 
size_t CDECL wcsrtombs (char *mbstr, const wchar_t **wcstr, size_t count, mbstate_t *mbstate)
 
static int wcsrtombs_s_l (size_t *ret, char *mbstr, size_t size, const wchar_t **wcstr, size_t count, _locale_t locale)
 
int CDECL _wcstombs_s_l (size_t *ret, char *mbstr, size_t size, const wchar_t *wcstr, size_t count, _locale_t locale)
 
int CDECL wcstombs_s (size_t *ret, char *mbstr, size_t size, const wchar_t *wcstr, size_t count)
 
int CDECL wcsrtombs_s (size_t *ret, char *mbstr, size_t size, const wchar_t **wcstr, size_t count, mbstate_t *mbstate)
 
double CDECL wcstod (const wchar_t *lpszStr, wchar_t **end)
 
double CDECL _wtof (const wchar_t *str)
 
double CDECL _wtof_l (const wchar_t *str, _locale_t locale)
 
printf_arg arg_clbk_valist (void *ctx, int arg_pos, int type, va_list *valist)
 
printf_arg arg_clbk_positional (void *ctx, int pos, int type, va_list *valist)
 
int CDECL _vsnprintf (char *str, size_t len, const char *format, va_list valist)
 
int CDECL _vsnprintf_l (char *str, size_t len, const char *format, _locale_t locale, va_list valist)
 
int CDECL _vsprintf_l (char *str, const char *format, _locale_t locale, va_list valist)
 
int WINAPIV _sprintf_l (char *str, const char *format, _locale_t locale,...)
 
static int CDECL vsnprintf_s_l_opt (char *str, size_t sizeOfBuffer, size_t count, const char *format, DWORD options, _locale_t locale, va_list valist)
 
static int vsnwprintf_s_l_opt (wchar_t *str, size_t sizeOfBuffer, size_t count, const wchar_t *format, DWORD options, _locale_t locale, va_list valist)
 
int CDECL _vsnprintf_s_l (char *str, size_t sizeOfBuffer, size_t count, const char *format, _locale_t locale, va_list valist)
 
int CDECL _vsprintf_s_l (char *str, size_t count, const char *format, _locale_t locale, va_list valist)
 
int WINAPIV _sprintf_s_l (char *str, size_t count, const char *format, _locale_t locale,...)
 
int CDECL _vsnprintf_s (char *str, size_t sizeOfBuffer, size_t count, const char *format, va_list valist)
 
int CDECL _vsnprintf_c_l (char *str, size_t len, const char *format, _locale_t locale, va_list valist)
 
int CDECL _vsnprintf_c (char *str, size_t len, const char *format, va_list valist)
 
int CDECL vsprintf (char *str, const char *format, va_list valist)
 
int CDECL vsprintf_s (char *str, size_t num, const char *format, va_list valist)
 
int CDECL _vscprintf (const char *format, va_list valist)
 
int CDECL _vscprintf_l (const char *format, _locale_t locale, va_list valist)
 
int CDECL _vscprintf_p_l (const char *format, _locale_t locale, va_list args)
 
int CDECL _vscprintf_p (const char *format, va_list argptr)
 
int WINAPIV _snprintf (char *str, size_t len, const char *format,...)
 
int WINAPIV _snprintf_l (char *str, size_t count, const char *format, _locale_t locale,...)
 
int WINAPIV _snprintf_c_l (char *str, size_t count, const char *format, _locale_t locale,...)
 
int WINAPIV _snprintf_c (char *str, size_t count, const char *format,...)
 
int WINAPIV _snprintf_s_l (char *str, size_t len, size_t count, const char *format, _locale_t locale,...)
 
int WINAPIV _snprintf_s (char *str, size_t len, size_t count, const char *format,...)
 
int WINAPIV _scprintf (const char *format,...)
 
int WINAPIV _scprintf_l (const char *format, _locale_t locale,...)
 
int WINAPIV _scprintf_p (const char *format,...)
 
int WINAPIV _scprintf_p_l (const char *format, _locale_t locale,...)
 
int CDECL _vsnwprintf (wchar_t *str, size_t len, const wchar_t *format, va_list valist)
 
int CDECL _vsnwprintf_l (wchar_t *str, size_t len, const wchar_t *format, _locale_t locale, va_list valist)
 
int CDECL _vswprintf_c_l (wchar_t *str, size_t len, const wchar_t *format, _locale_t locale, va_list valist)
 
int CDECL _vswprintf_c (wchar_t *str, size_t len, const wchar_t *format, va_list valist)
 
static int vswprintf_p_l_opt (wchar_t *buffer, size_t length, const wchar_t *format, DWORD options, _locale_t locale, va_list args)
 
int CDECL _vswprintf_p_l (wchar_t *buffer, size_t length, const wchar_t *format, _locale_t locale, va_list args)
 
int CDECL _vsnwprintf_s_l (wchar_t *str, size_t sizeOfBuffer, size_t count, const wchar_t *format, _locale_t locale, va_list valist)
 
int CDECL _vsnwprintf_s (wchar_t *str, size_t sizeOfBuffer, size_t count, const wchar_t *format, va_list valist)
 
int WINAPIV _snwprintf (wchar_t *str, size_t len, const wchar_t *format,...)
 
int WINAPIV _snwprintf_l (wchar_t *str, size_t len, const wchar_t *format, _locale_t locale,...)
 
int WINAPIV _snwprintf_s (wchar_t *str, size_t len, size_t count, const wchar_t *format,...)
 
int WINAPIV _snwprintf_s_l (wchar_t *str, size_t len, size_t count, const wchar_t *format, _locale_t locale,...)
 
int WINAPIV sprintf (char *str, const char *format,...)
 
int WINAPIV sprintf_s (char *str, size_t num, const char *format,...)
 
int WINAPIV _scwprintf_l (const wchar_t *format, _locale_t locale,...)
 
int WINAPIV _scwprintf_p_l (const wchar_t *format, _locale_t locale,...)
 
int WINAPIV _scwprintf (const wchar_t *format,...)
 
int WINAPIV _swprintf (wchar_t *str, const wchar_t *format,...)
 
int WINAPIV swprintf_s (wchar_t *str, size_t numberOfElements, const wchar_t *format,...)
 
int WINAPIV _swprintf_s_l (wchar_t *str, size_t numberOfElements, const wchar_t *format, _locale_t locale,...)
 
int WINAPIV _swprintf_c_l (wchar_t *str, size_t len, const wchar_t *format, _locale_t locale,...)
 
int WINAPIV _swprintf_c (wchar_t *str, size_t len, const wchar_t *format,...)
 
int CDECL _vswprintf (wchar_t *str, const wchar_t *format, va_list args)
 
int CDECL _vswprintf_l (wchar_t *str, const wchar_t *format, _locale_t locale, va_list args)
 
int CDECL _vscwprintf (const wchar_t *format, va_list args)
 
int CDECL _vscwprintf_l (const wchar_t *format, _locale_t locale, va_list args)
 
int CDECL _vscwprintf_p_l (const wchar_t *format, _locale_t locale, va_list args)
 
int CDECL vswprintf_s (wchar_t *str, size_t numberOfElements, const wchar_t *format, va_list args)
 
int CDECL _vswprintf_s_l (wchar_t *str, size_t numberOfElements, const wchar_t *format, _locale_t locale, va_list args)
 
static int vsprintf_p_l_opt (char *buffer, size_t length, const char *format, DWORD options, _locale_t locale, va_list args)
 
int CDECL _vsprintf_p_l (char *buffer, size_t length, const char *format, _locale_t locale, va_list args)
 
int CDECL _vsprintf_p (char *buffer, size_t length, const char *format, va_list args)
 
int WINAPIV _sprintf_p_l (char *buffer, size_t length, const char *format, _locale_t locale,...)
 
int WINAPIV __swprintf_l (wchar_t *str, const wchar_t *format, _locale_t locale,...)
 
int WINAPIV _swprintf_p (wchar_t *buffer, size_t length, const wchar_t *format,...)
 
int WINAPIV _swprintf_p_l (wchar_t *buffer, size_t length, const wchar_t *format, _locale_t locale,...)
 
int CDECL wcscmp (const wchar_t *str1, const wchar_t *str2)
 
int CDECL _wcscoll_l (const wchar_t *str1, const wchar_t *str2, _locale_t locale)
 
int CDECL wcscoll (const wchar_t *str1, const wchar_t *str2)
 
wchar_t *CDECL wcspbrk (const wchar_t *str, const wchar_t *accept)
 
wchar_t *CDECL wcstok_s (wchar_t *str, const wchar_t *delim, wchar_t **next_token)
 
wchar_t *CDECL wcstok (wchar_t *str, const wchar_t *delim)
 
int CDECL _wctomb_s_l (int *len, char *mbchar, size_t size, wchar_t wch, _locale_t locale)
 
int CDECL wctomb_s (int *len, char *mbchar, size_t size, wchar_t wch)
 
int CDECL _wctomb_l (char *dst, wchar_t ch, _locale_t locale)
 
INT CDECL wctomb (char *dst, wchar_t ch)
 
INT CDECL wctob (wint_t wchar)
 
INT CDECL wcrtomb_s (size_t *len, char *mbchar, size_t size, wchar_t wch, mbstate_t *s)
 
size_t CDECL wcrtomb (char *dst, wchar_t ch, mbstate_t *s)
 
INT CDECL _iswctype_l (wchar_t wc, wctype_t type, _locale_t locale)
 
INT CDECL iswctype (wchar_t wc, wctype_t type)
 
int CDECL _iswalnum_l (wchar_t wc, _locale_t locale)
 
INT CDECL iswalnum (wchar_t wc)
 
INT CDECL _iswalpha_l (wchar_t wc, _locale_t locale)
 
INT CDECL iswalpha (wchar_t wc)
 
int CDECL _iswcntrl_l (wchar_t wc, _locale_t locale)
 
INT CDECL iswcntrl (wchar_t wc)
 
INT CDECL _iswdigit_l (wchar_t wc, _locale_t locale)
 
INT CDECL iswdigit (wchar_t wc)
 
int CDECL _iswgraph_l (wchar_t wc, _locale_t locale)
 
INT CDECL iswgraph (wchar_t wc)
 
int CDECL _iswlower_l (wchar_t wc, _locale_t locale)
 
INT CDECL iswlower (wchar_t wc)
 
int CDECL _iswprint_l (wchar_t wc, _locale_t locale)
 
INT CDECL iswprint (wchar_t wc)
 
INT CDECL _iswpunct_l (wchar_t wc, _locale_t locale)
 
INT CDECL iswpunct (wchar_t wc)
 
INT CDECL _iswspace_l (wchar_t wc, _locale_t locale)
 
INT CDECL iswspace (wchar_t wc)
 
int CDECL _iswupper_l (wchar_t wc, _locale_t locale)
 
INT CDECL iswupper (wchar_t wc)
 
int CDECL _iswxdigit_l (wchar_t wc, _locale_t locale)
 
INT CDECL iswxdigit (wchar_t wc)
 
INT CDECL _iswblank_l (wchar_t wc, _locale_t locale)
 
INT CDECL iswblank (wchar_t wc)
 
INT CDECL wcscpy_s (wchar_t *wcDest, size_t numElement, const wchar_t *wcSrc)
 
wchar_t *__cdecl wcscpy (wchar_t *dst, const wchar_t *src)
 
wchar_t *__cdecl wcsncpy (wchar_t *s1, const wchar_t *s2, size_t n)
 
INT CDECL wcsncpy_s (wchar_t *dst, size_t elem, const wchar_t *src, size_t count)
 
INT CDECL wcscat_s (wchar_t *dst, size_t elem, const wchar_t *src)
 
wchar_t *__cdecl wcscat (wchar_t *dst, const wchar_t *src)
 
errno_t CDECL wcsncat_s (wchar_t *dst, size_t elem, const wchar_t *src, size_t count)
 
wchar_t *__cdecl wcsncat (wchar_t *s1, const wchar_t *s2, size_t n)
 
static int wctoint (WCHAR c, int base)
 
__int64 CDECL _wcstoi64_l (const wchar_t *nptr, wchar_t **endptr, int base, _locale_t locale)
 
__int64 CDECL _wcstoi64 (const wchar_t *nptr, wchar_t **endptr, int base)
 
__msvcrt_long CDECL _wcstol_l (const wchar_t *s, wchar_t **end, int base, _locale_t locale)
 
__msvcrt_long CDECL wcstol (const wchar_t *s, wchar_t **end, int base)
 
int __cdecl _wtoi_l (const wchar_t *str, _locale_t locale)
 
int __cdecl _wtoi (const wchar_t *str)
 
__msvcrt_long __cdecl _wtol_l (const wchar_t *str, _locale_t locale)
 
__msvcrt_long __cdecl _wtol (const wchar_t *str)
 
unsigned __int64 CDECL _wcstoui64_l (const wchar_t *nptr, wchar_t **endptr, int base, _locale_t locale)
 
unsigned __int64 CDECL _wcstoui64 (const wchar_t *nptr, wchar_t **endptr, int base)
 
__msvcrt_ulong __cdecl _wcstoul_l (const wchar_t *s, wchar_t **end, int base, _locale_t locale)
 
__msvcrt_ulong __cdecl wcstoul (const wchar_t *s, wchar_t **end, int base)
 
size_t CDECL wcsnlen (const wchar_t *s, size_t maxlen)
 
wint_t CDECL _towupper_l (wint_t c, _locale_t locale)
 
wint_t CDECL towupper (wint_t c)
 
wchar_t *CDECL wcschr (const wchar_t *str, wchar_t ch)
 
wchar_t *CDECL wcsrchr (const wchar_t *str, wchar_t ch)
 
size_t CDECL wcslen (const wchar_t *str)
 
wchar_t *CDECL wcsstr (const wchar_t *str, const wchar_t *sub)
 
__int64 CDECL _wtoi64_l (const wchar_t *str, _locale_t locale)
 
__int64 CDECL _wtoi64 (const wchar_t *str)
 
size_t CDECL _wcsxfrm_l (wchar_t *dest, const wchar_t *src, size_t len, _locale_t locale)
 
size_t CDECL wcsxfrm (wchar_t *dest, const wchar_t *src, size_t len)
 

Variables

static BOOL n_format_enabled = TRUE
 

Macro Definition Documentation

◆ _NO_CRT_STDIO_INLINE

#define _NO_CRT_STDIO_INLINE

Definition at line 22 of file wcs.c.

◆ PRINTF_WIDE

#define PRINTF_WIDE

Definition at line 57 of file wcs.c.

Function Documentation

◆ __swprintf_l()

int WINAPIV __swprintf_l ( wchar_t str,
const wchar_t format,
_locale_t  locale,
  ... 
)

Definition at line 1914 of file wcs.c.

1916{
1917 int retval;
1921 va_end(valist);
1922 return retval;
1923}
Definition: _locale.h:75
#define va_end(v)
Definition: stdarg.h:28
#define va_start(v, l)
Definition: stdarg.h:26
char * va_list
Definition: vadefs.h:50
int CDECL _vswprintf_l(wchar_t *str, const wchar_t *format, _locale_t locale, va_list args)
Definition: wcs.c:1778
static va_list valist
Definition: printf.c:46
const WCHAR * str
Definition: format.c:58
int retval
Definition: wcstombs.cpp:91

◆ _iswalnum_l()

int CDECL _iswalnum_l ( wchar_t  wc,
_locale_t  locale 
)

Definition at line 2252 of file wcs.c.

2253{
2254 return _iswctype_l( wc, _ALPHA | _DIGIT, locale );
2255}
#define _ALPHA
#define _DIGIT
INT CDECL _iswctype_l(wchar_t wc, wctype_t type, _locale_t locale)
Definition: wcs.c:2226

◆ _iswalpha_l()

INT CDECL _iswalpha_l ( wchar_t  wc,
_locale_t  locale 
)

Definition at line 2268 of file wcs.c.

2269{
2270 return _iswctype_l( wc, _ALPHA, locale );
2271}

◆ _iswblank_l()

INT CDECL _iswblank_l ( wchar_t  wc,
_locale_t  locale 
)

Definition at line 2428 of file wcs.c.

2429{
2430 return wc == '\t' || _iswctype_l( wc, _BLANK, locale );
2431}
#define _BLANK

◆ _iswcntrl_l()

int CDECL _iswcntrl_l ( wchar_t  wc,
_locale_t  locale 
)

Definition at line 2284 of file wcs.c.

2285{
2286 return _iswctype_l( wc, _CONTROL, locale );
2287}
#define _CONTROL

◆ _iswctype_l()

INT CDECL _iswctype_l ( wchar_t  wc,
wctype_t  type,
_locale_t  locale 
)

Definition at line 2226 of file wcs.c.

2227{
2228 WORD ct;
2229
2230 if (wc == WEOF) return 0;
2231 if (wc < 256) return MSVCRT__pwctype[wc] & type;
2232
2233 if (!GetStringTypeW(CT_CTYPE1, &wc, 1, &ct))
2234 {
2235 ERR("GetStringTypeW failed for %x\n", wc);
2236 return 0;
2237 }
2238 return ct & type;
2239}
#define ERR(fmt,...)
Definition: precomp.h:57
BOOL WINAPI GetStringTypeW(DWORD type, LPCWSTR src, INT count, LPWORD chartype)
Definition: locale.c:3098
WORD * MSVCRT__pwctype
Definition: ctype.c:128
#define WEOF
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define CT_CTYPE1
Definition: winnls.h:265

Referenced by _iswalnum_l(), _iswalpha_l(), _iswblank_l(), _iswcntrl_l(), _iswdigit_l(), _iswgraph_l(), _iswlower_l(), _iswprint_l(), _iswpunct_l(), _iswspace_l(), _iswupper_l(), _iswxdigit_l(), iswblank(), and iswctype().

◆ _iswdigit_l()

INT CDECL _iswdigit_l ( wchar_t  wc,
_locale_t  locale 
)

Definition at line 2300 of file wcs.c.

2301{
2302 return _iswctype_l( wc, _DIGIT, locale );
2303}

◆ _iswgraph_l()

int CDECL _iswgraph_l ( wchar_t  wc,
_locale_t  locale 
)

Definition at line 2316 of file wcs.c.

2317{
2318 return _iswctype_l( wc, _ALPHA | _DIGIT | _PUNCT, locale );
2319}
#define _PUNCT

◆ _iswlower_l()

int CDECL _iswlower_l ( wchar_t  wc,
_locale_t  locale 
)

Definition at line 2332 of file wcs.c.

2333{
2334 return _iswctype_l( wc, _LOWER, locale );
2335}
#define _LOWER

◆ _iswprint_l()

int CDECL _iswprint_l ( wchar_t  wc,
_locale_t  locale 
)

Definition at line 2348 of file wcs.c.

2349{
2350 return _iswctype_l( wc, _ALPHA | _BLANK | _DIGIT | _PUNCT, locale );
2351}

◆ _iswpunct_l()

INT CDECL _iswpunct_l ( wchar_t  wc,
_locale_t  locale 
)

Definition at line 2364 of file wcs.c.

2365{
2366 return _iswctype_l( wc, _PUNCT, locale );
2367}

◆ _iswspace_l()

INT CDECL _iswspace_l ( wchar_t  wc,
_locale_t  locale 
)

Definition at line 2380 of file wcs.c.

2381{
2382 return _iswctype_l( wc, _SPACE, locale );
2383}
#define _SPACE

◆ _iswupper_l()

int CDECL _iswupper_l ( wchar_t  wc,
_locale_t  locale 
)

Definition at line 2396 of file wcs.c.

2397{
2398 return _iswctype_l( wc, _UPPER, locale );
2399}
#define _UPPER

◆ _iswxdigit_l()

int CDECL _iswxdigit_l ( wchar_t  wc,
_locale_t  locale 
)

Definition at line 2412 of file wcs.c.

2413{
2414 return _iswctype_l( wc, _HEX, locale );
2415}
#define _HEX

◆ _scprintf()

int WINAPIV _scprintf ( const char format,
  ... 
)

Definition at line 1318 of file wcs.c.

1319{
1320 int retval;
1324 va_end(valist);
1325 return retval;
1326}
#define _vscprintf
Definition: _vscprintf.c:25

◆ _scprintf_l()

int WINAPIV _scprintf_l ( const char format,
_locale_t  locale,
  ... 
)

Definition at line 1331 of file wcs.c.

1332{
1333 int retval;
1337 va_end(valist);
1338 return retval;
1339}
int CDECL _vscprintf_l(const char *format, _locale_t locale, va_list valist)
Definition: wcs.c:1189

◆ _scprintf_p()

int WINAPIV _scprintf_p ( const char format,
  ... 
)

Definition at line 1344 of file wcs.c.

1345{
1346 int retval;
1350 va_end(valist);
1351 return retval;
1352}
#define NULL
Definition: types.h:112
int CDECL _vscprintf_p_l(const char *format, _locale_t locale, va_list args)
Definition: wcs.c:1198

◆ _scprintf_p_l()

int WINAPIV _scprintf_p_l ( const char format,
_locale_t  locale,
  ... 
)

Definition at line 1357 of file wcs.c.

1358{
1359 int retval;
1363 va_end(valist);
1364 return retval;
1365}

◆ _scwprintf()

int WINAPIV _scwprintf ( const wchar_t format,
  ... 
)

Definition at line 1678 of file wcs.c.

1679{
1680 va_list ap;
1681 int r;
1682
1683 va_start( ap, format );
1685 va_end( ap );
1686 return r;
1687}
#define INT_MAX
Definition: limits.h:26
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define _vsnwprintf
Definition: _vsnwprintf.c:28
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36

◆ _scwprintf_l()

int WINAPIV _scwprintf_l ( const wchar_t format,
_locale_t  locale,
  ... 
)

Definition at line 1634 of file wcs.c.

1635{
1636 va_list ap;
1637 int r;
1638
1639 va_start( ap, locale );
1641 va_end( ap );
1642 return r;
1643}
int CDECL _vsnwprintf_l(wchar_t *str, size_t len, const wchar_t *format, _locale_t locale, va_list valist)
Definition: wcs.c:1385

◆ _scwprintf_p_l()

int WINAPIV _scwprintf_p_l ( const wchar_t format,
_locale_t  locale,
  ... 
)

Definition at line 1648 of file wcs.c.

1649{
1650 va_list ap;
1651 int r;
1652
1653 va_start( ap, locale );
1655 va_end( ap );
1656 return r;
1657}
static int vswprintf_p_l_opt(wchar_t *buffer, size_t length, const wchar_t *format, DWORD options, _locale_t locale, va_list args)
Definition: wcs.c:1415

◆ _snprintf()

int WINAPIV _snprintf ( char str,
size_t  len,
const char format,
  ... 
)

Definition at line 1236 of file wcs.c.

1237{
1238 int retval;
1242 va_end(valist);
1243 return retval;
1244}
#define vsnprintf
Definition: acwin.h:108
GLenum GLsizei len
Definition: glext.h:6722

◆ _snprintf_c()

int WINAPIV _snprintf_c ( char str,
size_t  count,
const char format,
  ... 
)

Definition at line 1277 of file wcs.c.

1278{
1279 int retval;
1283 va_end(valist);
1284 return retval;
1285}
int CDECL _vsnprintf_c(char *str, size_t len, const char *format, va_list valist)
Definition: wcs.c:1106
GLuint GLuint GLsizei count
Definition: gl.h:1545

◆ _snprintf_c_l()

int WINAPIV _snprintf_c_l ( char str,
size_t  count,
const char format,
_locale_t  locale,
  ... 
)

Definition at line 1263 of file wcs.c.

1265{
1266 int retval;
1270 va_end(valist);
1271 return retval;
1272}
int CDECL _vsnprintf_c_l(char *str, size_t len, const char *format, _locale_t locale, va_list valist)
Definition: wcs.c:1097

◆ _snprintf_l()

int WINAPIV _snprintf_l ( char str,
size_t  count,
const char format,
_locale_t  locale,
  ... 
)

Definition at line 1249 of file wcs.c.

1251{
1252 int retval;
1256 va_end(valist);
1257 return retval;
1258}
int CDECL _vsnprintf_l(char *str, size_t len, const char *format, _locale_t locale, va_list valist)
Definition: wcs.c:954

◆ _snprintf_s()

int WINAPIV _snprintf_s ( char str,
size_t  len,
size_t  count,
const char format,
  ... 
)

Definition at line 1304 of file wcs.c.

1306{
1307 int retval;
1311 va_end(valist);
1312 return retval;
1313}
int CDECL _vsnprintf_s_l(char *str, size_t sizeOfBuffer, size_t count, const char *format, _locale_t locale, va_list valist)
Definition: wcs.c:1055

◆ _snprintf_s_l()

int WINAPIV _snprintf_s_l ( char str,
size_t  len,
size_t  count,
const char format,
_locale_t  locale,
  ... 
)

Definition at line 1290 of file wcs.c.

1292{
1293 int retval;
1297 va_end(valist);
1298 return retval;
1299}

◆ _snwprintf()

◆ _snwprintf_l()

int WINAPIV _snwprintf_l ( wchar_t str,
size_t  len,
const wchar_t format,
_locale_t  locale,
  ... 
)

Definition at line 1511 of file wcs.c.

1513{
1514 int retval;
1518 va_end(valist);
1519 return retval;
1520}

◆ _snwprintf_s()

int WINAPIV _snwprintf_s ( wchar_t str,
size_t  len,
size_t  count,
const wchar_t format,
  ... 
)

Definition at line 1525 of file wcs.c.

1527{
1528 int retval;
1532 va_end(valist);
1533 return retval;
1534}
int CDECL _vsnwprintf_s_l(wchar_t *str, size_t sizeOfBuffer, size_t count, const wchar_t *format, _locale_t locale, va_list valist)
Definition: wcs.c:1478

Referenced by _VCrtDbgReportW(), common_message_window(), and InitFunctionPtrs().

◆ _snwprintf_s_l()

int WINAPIV _snwprintf_s_l ( wchar_t str,
size_t  len,
size_t  count,
const wchar_t format,
_locale_t  locale,
  ... 
)

Definition at line 1539 of file wcs.c.

1541{
1542 int retval;
1546 va_end(valist);
1547 return retval;
1548}

◆ _sprintf_l()

int WINAPIV _sprintf_l ( char str,
const char format,
_locale_t  locale,
  ... 
)

Definition at line 979 of file wcs.c.

981{
982 int retval;
986 va_end(valist);
987 return retval;
988}

◆ _sprintf_p_l()

int WINAPIV _sprintf_p_l ( char buffer,
size_t  length,
const char format,
_locale_t  locale,
  ... 
)

Definition at line 1898 of file wcs.c.

1900{
1902 int r;
1903
1906 va_end(valist);
1907
1908 return r;
1909}
int CDECL _vsprintf_p_l(char *buffer, size_t length, const char *format, _locale_t locale, va_list args)
Definition: wcs.c:1867
GLuint buffer
Definition: glext.h:5915
GLuint GLsizei GLsizei * length
Definition: glext.h:6040

◆ _sprintf_s_l()

int WINAPIV _sprintf_s_l ( char str,
size_t  count,
const char format,
_locale_t  locale,
  ... 
)

Definition at line 1074 of file wcs.c.

1076{
1077 int retval;
1081 va_end(valist);
1082 return retval;
1083}

◆ _swprintf()

int WINAPIV _swprintf ( wchar_t str,
const wchar_t format,
  ... 
)

Definition at line 1692 of file wcs.c.

1693{
1694 va_list ap;
1695 int r;
1696
1697 va_start( ap, format );
1698 r = _vsnwprintf( str, INT_MAX, format, ap );
1699 va_end( ap );
1700 return r;
1701}

◆ _swprintf_c()

int WINAPIV _swprintf_c ( wchar_t str,
size_t  len,
const wchar_t format,
  ... 
)

Definition at line 1754 of file wcs.c.

1756{
1757 va_list ap;
1758 int r;
1759
1760 va_start(ap, format);
1761 r = _vswprintf_c(str, len, format, ap);
1762 va_end(ap);
1763
1764 return r;
1765}
int CDECL _vswprintf_c(wchar_t *str, size_t len, const wchar_t *format, va_list valist)
Definition: wcs.c:1409

◆ _swprintf_c_l()

int WINAPIV _swprintf_c_l ( wchar_t str,
size_t  len,
const wchar_t format,
_locale_t  locale,
  ... 
)

Definition at line 1738 of file wcs.c.

1740{
1741 va_list ap;
1742 int r;
1743
1744 va_start(ap, locale);
1746 va_end(ap);
1747
1748 return r;
1749}
int CDECL _vswprintf_c_l(wchar_t *str, size_t len, const wchar_t *format, _locale_t locale, va_list valist)
Definition: wcs.c:1400

◆ _swprintf_p()

int WINAPIV _swprintf_p ( wchar_t buffer,
size_t  length,
const wchar_t format,
  ... 
)

Definition at line 1945 of file wcs.c.

1947{
1949 int r;
1950
1953 va_end(valist);
1954
1955 return r;
1956}

◆ _swprintf_p_l()

int WINAPIV _swprintf_p_l ( wchar_t buffer,
size_t  length,
const wchar_t format,
_locale_t  locale,
  ... 
)

Definition at line 1961 of file wcs.c.

1963{
1965 int r;
1966
1969 va_end(valist);
1970
1971 return r;
1972}

◆ _swprintf_s_l()

int WINAPIV _swprintf_s_l ( wchar_t str,
size_t  numberOfElements,
const wchar_t format,
_locale_t  locale,
  ... 
)

Definition at line 1722 of file wcs.c.

1724{
1725 va_list ap;
1726 int r;
1727
1728 va_start(ap, locale);
1730 va_end(ap);
1731
1732 return r;
1733}
static size_t numberOfElements
Definition: string.c:98

◆ _towlower_l()

wint_t CDECL _towlower_l ( wint_t  c,
_locale_t  locale 
)

Definition at line 101 of file wcs.c.

102{
104 wchar_t ret;
105
106 if(!locale)
108 else
109 locinfo = locale->locinfo;
110
111 if(!locinfo->lc_handle[LC_CTYPE]) {
112 if(c >= 'A' && c <= 'Z')
113 return c + 'a' - 'A';
114 return c;
115 }
116
117 if(!LCMapStringW(locinfo->lc_handle[LC_CTYPE], LCMAP_LOWERCASE, &c, 1, &ret, 1))
118 return c;
119 return ret;
120}
INT WINAPI LCMapStringW(LCID lcid, DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen)
Definition: locale.c:3808
#define LC_CTYPE
Definition: locale.h:27
else locinfo
Definition: scanf.h:225
return ret
Definition: mutex.c:146
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
#define get_locinfo()
Definition: winesup.h:25
#define LCMAP_LOWERCASE
Definition: winnls.h:201

Referenced by _wcsicmp_l(), _wcslwr_s_l(), _wcsnicmp_l(), towctrans(), and towlower().

◆ _towupper_l()

wint_t CDECL _towupper_l ( wint_t  c,
_locale_t  locale 
)

Definition at line 2937 of file wcs.c.

2938{
2940 wchar_t ret;
2941
2942 if(!locale)
2943 locinfo = get_locinfo();
2944 else
2945 locinfo = locale->locinfo;
2946
2947 if(!locinfo->lc_handle[LC_CTYPE]) {
2948 if(c >= 'a' && c <= 'z')
2949 return c + 'A' - 'a';
2950 return c;
2951 }
2952
2953 if(!LCMapStringW(locinfo->lc_handle[LC_CTYPE], LCMAP_UPPERCASE, &c, 1, &ret, 1))
2954 return c;
2955 return ret;
2956}
#define LCMAP_UPPERCASE
Definition: winnls.h:202

Referenced by _wcsupr_s_l(), towctrans(), and towupper().

◆ _vscprintf()

int CDECL _vscprintf ( const char format,
va_list  valist 
)

Definition at line 1181 of file wcs.c.

1182{
1183 return _vsnprintf_l( NULL, INT_MAX, format, NULL, valist );
1184}

◆ _vscprintf_l()

int CDECL _vscprintf_l ( const char format,
_locale_t  locale,
va_list  valist 
)

Definition at line 1189 of file wcs.c.

1191{
1193}

Referenced by _scprintf_l().

◆ _vscprintf_p()

int CDECL _vscprintf_p ( const char format,
va_list  argptr 
)

Definition at line 1228 of file wcs.c.

1229{
1230 return _vscprintf_p_l(format, NULL, argptr);
1231}

◆ _vscprintf_p_l()

int CDECL _vscprintf_p_l ( const char format,
_locale_t  locale,
va_list  args 
)

Definition at line 1198 of file wcs.c.

1200{
1201 printf_arg args_ctx[_ARGMAX+1];
1202 struct _str_ctx_a puts_ctx = {INT_MAX, NULL};
1203 int ret;
1204
1205 memset(args_ctx, 0, sizeof(args_ctx));
1206
1207 ret = create_positional_ctx_a(args_ctx, format, args);
1208 if(ret < 0) {
1210 *_errno() = EINVAL;
1211 return ret;
1212 } else if(ret == 0) {
1213 ret = pf_printf_a(puts_clbk_str_a, &puts_ctx, format, locale,
1216 } else {
1217 ret = pf_printf_a(puts_clbk_str_a, &puts_ctx, format, locale,
1219 arg_clbk_positional, args_ctx, NULL);
1220 }
1221
1222 return ret;
1223}
void __cdecl _invalid_parameter(const wchar_t *expr, const wchar_t *func, const wchar_t *file, unsigned int line, uintptr_t arg)
Definition: errno.c:461
int *CDECL _errno(void)
Definition: errno.c:215
#define _ARGMAX
Definition: corecrt.h:157
#define EINVAL
Definition: errno.h:44
int pf_printf_a(puts_clbk_a, void *, const char *, _locale_t, DWORD, args_clbk, void *, va_list *)
#define MSVCRT_PRINTF_POSITIONAL_PARAMS
Definition: msvcrt.h:409
int create_positional_ctx_a(void *, const char *, va_list)
#define MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER
Definition: msvcrt.h:410
printf_arg arg_clbk_valist(void *ctx, int arg_pos, int type, va_list *valist)
Definition: wcs.c:852
printf_arg arg_clbk_positional(void *ctx, int pos, int type, va_list *valist)
Definition: wcs.c:875
#define memset(x, y, z)
Definition: compat.h:39
Definition: match.c:390

Referenced by _scprintf_p(), _scprintf_p_l(), and _vscprintf_p().

◆ _vscwprintf()

int CDECL _vscwprintf ( const wchar_t format,
va_list  args 
)

Definition at line 1787 of file wcs.c.

1788{
1789 return _vsnwprintf( NULL, INT_MAX, format, args );
1790}

◆ _vscwprintf_l()

int CDECL _vscwprintf_l ( const wchar_t format,
_locale_t  locale,
va_list  args 
)

Definition at line 1795 of file wcs.c.

1796{
1798}

◆ _vscwprintf_p_l()

int CDECL _vscwprintf_p_l ( const wchar_t format,
_locale_t  locale,
va_list  args 
)

Definition at line 1803 of file wcs.c.

1804{
1806}

◆ _vsnprintf()

int CDECL _vsnprintf ( char str,
size_t  len,
const char format,
va_list  valist 
)

Definition at line 886 of file wcs.c.

887{
888 static const char nullbyte = '\0';
889 struct _str_ctx_a ctx = {len, str};
890 int ret;
891
892 ret = pf_printf_a(puts_clbk_str_a, &ctx, format, NULL, 0,
894 puts_clbk_str_a(&ctx, 1, &nullbyte);
895 return ret;
896}

◆ _vsnprintf_c()

int CDECL _vsnprintf_c ( char str,
size_t  len,
const char format,
va_list  valist 
)

Definition at line 1106 of file wcs.c.

1108{
1109 return _vsnprintf_c_l(str, len, format, NULL, valist);
1110}

Referenced by _snprintf_c().

◆ _vsnprintf_c_l()

int CDECL _vsnprintf_c_l ( char str,
size_t  len,
const char format,
_locale_t  locale,
va_list  valist 
)

Definition at line 1097 of file wcs.c.

1099{
1101}
static int CDECL vsnprintf_s_l_opt(char *str, size_t sizeOfBuffer, size_t count, const char *format, DWORD options, _locale_t locale, va_list valist)
Definition: wcs.c:990

Referenced by _snprintf_c_l(), and _vsnprintf_c().

◆ _vsnprintf_l()

int CDECL _vsnprintf_l ( char str,
size_t  len,
const char format,
_locale_t  locale,
va_list  valist 
)

Definition at line 954 of file wcs.c.

956{
957 static const char nullbyte = '\0';
958 struct _str_ctx_a ctx = {len, str};
959 int ret;
960
961 ret = pf_printf_a(puts_clbk_str_a, &ctx, format, locale, 0,
963 puts_clbk_str_a(&ctx, 1, &nullbyte);
964 return ret;
965}

Referenced by _snprintf_l(), _sprintf_l(), _vscprintf(), _vscprintf_l(), and _vsprintf_l().

◆ _vsnprintf_s()

int CDECL _vsnprintf_s ( char str,
size_t  sizeOfBuffer,
size_t  count,
const char format,
va_list  valist 
)

Definition at line 1088 of file wcs.c.

1090{
1092}
static size_t sizeOfBuffer
Definition: printf.c:48

◆ _vsnprintf_s_l()

int CDECL _vsnprintf_s_l ( char str,
size_t  sizeOfBuffer,
size_t  count,
const char format,
_locale_t  locale,
va_list  valist 
)

Definition at line 1055 of file wcs.c.

1058{
1060}

Referenced by _snprintf_s(), _snprintf_s_l(), _sprintf_s_l(), _vsnprintf_s(), and _vsprintf_s_l().

◆ _vsnwprintf()

int CDECL _vsnwprintf ( wchar_t str,
size_t  len,
const wchar_t format,
va_list  valist 
)

Definition at line 1370 of file wcs.c.

1372{
1373 struct _str_ctx_w ctx = {len, str};
1374 int ret;
1375
1376 ret = pf_printf_w(puts_clbk_str_w, &ctx, format, NULL, 0,
1378 puts_clbk_str_w(&ctx, 1, L"");
1379 return ret;
1380}
int pf_printf_w(puts_clbk_w, void *, const wchar_t *, _locale_t, DWORD, args_clbk, void *, va_list *)
#define L(x)
Definition: resources.c:13

◆ _vsnwprintf_l()

int CDECL _vsnwprintf_l ( wchar_t str,
size_t  len,
const wchar_t format,
_locale_t  locale,
va_list  valist 
)

Definition at line 1385 of file wcs.c.

1387{
1388 struct _str_ctx_w ctx = {len, str};
1389 int ret;
1390
1391 ret = pf_printf_w(puts_clbk_str_w, &ctx, format, locale, 0,
1393 puts_clbk_str_w(&ctx, 1, L"");
1394 return ret;
1395}

Referenced by _scwprintf_l(), _snwprintf_l(), _vscwprintf_l(), and _vswprintf_l().

◆ _vsnwprintf_s()

int CDECL _vsnwprintf_s ( wchar_t str,
size_t  sizeOfBuffer,
size_t  count,
const wchar_t format,
va_list  valist 
)

Definition at line 1488 of file wcs.c.

1490{
1492 format, NULL, valist);
1493}

Referenced by swprintf_s(), and vswprintf_s().

◆ _vsnwprintf_s_l()

int CDECL _vsnwprintf_s_l ( wchar_t str,
size_t  sizeOfBuffer,
size_t  count,
const wchar_t format,
_locale_t  locale,
va_list  valist 
)

Definition at line 1478 of file wcs.c.

1481{
1483}
static int vsnwprintf_s_l_opt(wchar_t *str, size_t sizeOfBuffer, size_t count, const wchar_t *format, DWORD options, _locale_t locale, va_list valist)
Definition: wcs.c:1022

Referenced by _snwprintf_s(), _snwprintf_s_l(), _swprintf_s_l(), _vsnwprintf_s(), and _vswprintf_s_l().

◆ _vsprintf_l()

int CDECL _vsprintf_l ( char str,
const char format,
_locale_t  locale,
va_list  valist 
)

Definition at line 970 of file wcs.c.

972{
974}

◆ _vsprintf_p()

int CDECL _vsprintf_p ( char buffer,
size_t  length,
const char format,
va_list  args 
)

Definition at line 1876 of file wcs.c.

1878{
1880}

◆ _vsprintf_p_l()

int CDECL _vsprintf_p_l ( char buffer,
size_t  length,
const char format,
_locale_t  locale,
va_list  args 
)

Definition at line 1867 of file wcs.c.

1869{
1871}
static int vsprintf_p_l_opt(char *buffer, size_t length, const char *format, DWORD options, _locale_t locale, va_list args)
Definition: wcs.c:1837

Referenced by _sprintf_p_l(), and _vsprintf_p().

◆ _vsprintf_s_l()

int CDECL _vsprintf_s_l ( char str,
size_t  count,
const char format,
_locale_t  locale,
va_list  valist 
)

Definition at line 1065 of file wcs.c.

1067{
1069}

◆ _vswprintf()

int CDECL _vswprintf ( wchar_t str,
const wchar_t format,
va_list  args 
)

Definition at line 1770 of file wcs.c.

1771{
1772 return _vsnwprintf( str, INT_MAX, format, args );
1773}

Referenced by ConPrintfVPaging(), and ErrorMessage().

◆ _vswprintf_c()

int CDECL _vswprintf_c ( wchar_t str,
size_t  len,
const wchar_t format,
va_list  valist 
)

Definition at line 1409 of file wcs.c.

1411{
1412 return _vswprintf_c_l(str, len, format, NULL, valist);
1413}

Referenced by _swprintf_c().

◆ _vswprintf_c_l()

int CDECL _vswprintf_c_l ( wchar_t str,
size_t  len,
const wchar_t format,
_locale_t  locale,
va_list  valist 
)

Definition at line 1400 of file wcs.c.

1402{
1404}

Referenced by _swprintf_c_l(), and _vswprintf_c().

◆ _vswprintf_l()

int CDECL _vswprintf_l ( wchar_t str,
const wchar_t format,
_locale_t  locale,
va_list  args 
)

Definition at line 1778 of file wcs.c.

1780{
1781 return _vsnwprintf_l( str, INT_MAX, format, locale, args );
1782}

Referenced by __swprintf_l().

◆ _vswprintf_p_l()

int CDECL _vswprintf_p_l ( wchar_t buffer,
size_t  length,
const wchar_t format,
_locale_t  locale,
va_list  args 
)

Definition at line 1444 of file wcs.c.

1446{
1448}

◆ _vswprintf_s_l()

int CDECL _vswprintf_s_l ( wchar_t str,
size_t  numberOfElements,
const wchar_t format,
_locale_t  locale,
va_list  args 
)

Definition at line 1830 of file wcs.c.

1832{
1834 format, locale, args );
1835}

◆ _wcscoll_l()

int CDECL _wcscoll_l ( const wchar_t str1,
const wchar_t str2,
_locale_t  locale 
)

Definition at line 1995 of file wcs.c.

1996{
1998
1999 if(!locale)
2000 locinfo = get_locinfo();
2001 else
2002 locinfo = locale->locinfo;
2003
2004 if(!locinfo->lc_handle[LC_COLLATE])
2005 return wcscmp(str1, str2);
2007 str1, -1, str2, -1)-CSTR_EQUAL;
2008}
INT WINAPI CompareStringW(LCID lcid, DWORD flags, LPCWSTR str1, INT len1, LPCWSTR str2, INT len2)
Definition: locale.c:3946
#define LC_COLLATE
Definition: locale.h:26
int CDECL wcscmp(const wchar_t *str1, const wchar_t *str2)
Definition: wcs.c:1977
XML_HIDDEN void xmlParserErrors const char const xmlChar const xmlChar * str2
Definition: parser.h:35
XML_HIDDEN void xmlParserErrors const char const xmlChar * str1
Definition: parser.h:35
#define SORT_STRINGSORT
Definition: winnls.h:199
#define CSTR_EQUAL
Definition: winnls.h:510

Referenced by wcscoll().

◆ _wcsdup()

wchar_t *CDECL _wcsdup ( const wchar_t str)

Definition at line 86 of file wcs.c.

87{
88 wchar_t* ret = NULL;
89 if (str)
90 {
91 size_t size = (wcslen(str) + 1) * sizeof(wchar_t);
92 ret = malloc( size );
93 if (ret) memcpy( ret, str, size );
94 }
95 return ret;
96}
#define malloc
Definition: debug_ros.c:4
size_t CDECL wcslen(const wchar_t *str)
Definition: wcs.c:2988
GLsizeiptr size
Definition: glext.h:5919
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

◆ _wcsicmp()

INT CDECL _wcsicmp ( const wchar_t str1,
const wchar_t str2 
)

Definition at line 164 of file wcs.c.

165{
166 return _wcsicmp_l(str1, str2, NULL);
167}
INT CDECL _wcsicmp_l(const wchar_t *str1, const wchar_t *str2, _locale_t locale)
Definition: wcs.c:130

◆ _wcsicmp_l()

INT CDECL _wcsicmp_l ( const wchar_t str1,
const wchar_t str2,
_locale_t  locale 
)

Definition at line 130 of file wcs.c.

131{
132 _locale_tstruct tmp = {0};
133 wchar_t c1, c2;
134
136 return _NLSCMPERROR;
137
138 if(!locale)
140
141 do
142 {
143 c1 = _towlower_l(*str1++, locale);
144 c2 = _towlower_l(*str2++, locale);
145 } while(c1 && (c1 == c2));
146
148 return c1 - c2;
149}
#define _NLSCMPERROR
Definition: mbstring.h:28
_locale_t CDECL get_current_locale_noalloc(_locale_t locale)
Definition: locale.c:1149
void CDECL free_locale_noalloc(_locale_t locale)
Definition: locale.c:1162
#define MSVCRT_CHECK_PMT(x)
Definition: msvcrt.h:378
wint_t CDECL _towlower_l(wint_t c, _locale_t locale)
Definition: wcs.c:101

Referenced by _wcsicmp().

◆ _wcsicoll()

INT CDECL _wcsicoll ( const wchar_t str1,
const wchar_t str2 
)

Definition at line 241 of file wcs.c.

242{
243 return _wcsicoll_l(str1, str2, NULL);
244}
int CDECL _wcsicoll_l(const wchar_t *str1, const wchar_t *str2, _locale_t locale)
Definition: wcs.c:208

◆ _wcsicoll_l()

int CDECL _wcsicoll_l ( const wchar_t str1,
const wchar_t str2,
_locale_t  locale 
)

Definition at line 208 of file wcs.c.

209{
211
212 if(!locale)
214 else
215 locinfo = locale->locinfo;
216
217 if(!locinfo->lc_handle[LC_COLLATE])
218 {
219 wchar_t c1, c2;
220
221 do
222 {
223 c1 = *str1++;
224 if (c1 >= 'A' && c1 <= 'Z')
225 c1 += 'a' - 'A';
226
227 c2 = *str2++;
228 if (c2 >= 'A' && c2 <= 'Z')
229 c2 += 'a' - 'A';
230 } while(c1 && (c1 == c2));
231 return c1 - c2;
232 }
233
235 str1, -1, str2, -1)-CSTR_EQUAL;
236}
#define NORM_IGNORECASE
Definition: winnls.h:191

Referenced by _wcsicoll().

◆ _wcslwr()

wchar_t *CDECL _wcslwr ( wchar_t str)

Definition at line 494 of file wcs.c.

495{
496 _wcslwr_s_l(str, -1, NULL);
497 return str;
498}
_wcslwr_s_l

◆ _wcslwr_l()

wchar_t *CDECL _wcslwr_l ( wchar_t str,
_locale_t  locale 
)

Definition at line 485 of file wcs.c.

486{
487 _wcslwr_s_l(str, -1, locale);
488 return str;
489}

◆ _wcslwr_s()

int CDECL _wcslwr_s ( wchar_t str,
size_t  n 
)

Definition at line 477 of file wcs.c.

478{
479 return _wcslwr_s_l(str, n, NULL);
480}
GLdouble n
Definition: glext.h:7729

◆ _wcslwr_s_l()

int CDECL _wcslwr_s_l ( wchar_t str,
size_t  n,
_locale_t  locale 
)

Definition at line 439 of file wcs.c.

440{
441 _locale_tstruct tmp = {0};
442 wchar_t* ptr = str;
443
444 if (!str || !n)
445 {
446 if (str) *str = '\0';
447 *_errno() = EINVAL;
448 return EINVAL;
449 }
450
451 if(!locale)
453
454 while (n--)
455 {
456 if (!*ptr)
457 {
459 return 0;
460 }
462 ptr++;
463 }
464
466
467 /* MSDN claims that the function should return and set errno to
468 * ERANGE, which doesn't seem to be true based on the tests. */
469 *str = '\0';
470 *_errno() = EINVAL;
471 return EINVAL;
472}
static PVOID ptr
Definition: dispmode.c:27

◆ _wcsncoll()

int CDECL _wcsncoll ( const wchar_t str1,
const wchar_t str2,
size_t  count 
)

Definition at line 558 of file wcs.c.

559{
560 return _wcsncoll_l(str1, str2, count, NULL);
561}
int CDECL _wcsncoll_l(const wchar_t *str1, const wchar_t *str2, size_t count, _locale_t locale)
Definition: wcs.c:538

◆ _wcsncoll_l()

int CDECL _wcsncoll_l ( const wchar_t str1,
const wchar_t str2,
size_t  count,
_locale_t  locale 
)

Definition at line 538 of file wcs.c.

540{
542
543 if(!locale)
545 else
546 locinfo = locale->locinfo;
547
548 if(!locinfo->lc_handle[LC_COLLATE])
549 return wcsncmp(str1, str2, count);
553}
size_t CDECL wcsnlen(const wchar_t *s, size_t maxlen)
Definition: wcs.c:2925
int CDECL wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t n)
Definition: wcs.c:523

Referenced by _wcsncoll().

◆ _wcsnicmp()

INT CDECL _wcsnicmp ( const wchar_t str1,
const wchar_t str2,
size_t  n 
)

Definition at line 200 of file wcs.c.

201{
202 return _wcsnicmp_l(str1, str2, n, NULL);
203}
INT CDECL _wcsnicmp_l(const wchar_t *str1, const wchar_t *str2, size_t n, _locale_t locale)
Definition: wcs.c:172

◆ _wcsnicmp_l()

INT CDECL _wcsnicmp_l ( const wchar_t str1,
const wchar_t str2,
size_t  n,
_locale_t  locale 
)

Definition at line 172 of file wcs.c.

174{
175 _locale_tstruct tmp = {0};
176 wchar_t c1, c2;
177
178 if (!n)
179 return 0;
180
182 return _NLSCMPERROR;
183
184 if(!locale)
186
187 do
188 {
189 c1 = _towlower_l(*str1++, locale);
190 c2 = _towlower_l(*str2++, locale);
191 } while(--n && c1 && (c1 == c2));
192
194 return c1 - c2;
195}

Referenced by _wcsnicmp().

◆ _wcsnicoll()

INT CDECL _wcsnicoll ( const wchar_t str1,
const wchar_t str2,
size_t  count 
)

Definition at line 287 of file wcs.c.

288{
289 return _wcsnicoll_l(str1, str2, count, NULL);
290}
int CDECL _wcsnicoll_l(const wchar_t *str1, const wchar_t *str2, size_t count, _locale_t locale)
Definition: wcs.c:249

◆ _wcsnicoll_l()

int CDECL _wcsnicoll_l ( const wchar_t str1,
const wchar_t str2,
size_t  count,
_locale_t  locale 
)

Definition at line 249 of file wcs.c.

251{
253
254 if(!locale)
256 else
257 locinfo = locale->locinfo;
258
259 if(!locinfo->lc_handle[LC_COLLATE])
260 {
261 wchar_t c1, c2;
262
263 if (!count)
264 return 0;
265
266 do
267 {
268 c1 = *str1++;
269 if (c1 >= 'A' && c1 <= 'Z')
270 c1 += 'a' - 'A';
271
272 c2 = *str2++;
273 if (c2 >= 'A' && c2 <= 'Z')
274 c2 += 'a' - 'A';
275 } while(--count && c1 && (c1 == c2));
276 return c1 - c2;
277 }
278
282}

Referenced by _wcsnicoll().

◆ _wcsnset()

wchar_t *CDECL _wcsnset ( wchar_t str,
wchar_t  c,
size_t  n 
)

Definition at line 295 of file wcs.c.

296{
297 wchar_t* ret = str;
298 while ((n-- > 0) && *str) *str++ = c;
299 return ret;
300}

◆ _wcsnset_s()

int CDECL _wcsnset_s ( wchar_t str,
size_t  size,
wchar_t  c,
size_t  count 
)

Definition at line 305 of file wcs.c.

306{
307 size_t i;
308
309 if(!str && !size && !count) return 0;
310 if(!MSVCRT_CHECK_PMT(str != NULL)) return EINVAL;
311 if(!MSVCRT_CHECK_PMT(size > 0)) return EINVAL;
312
313 for(i=0; i<size-1 && i<count; i++) {
314 if(!str[i]) return 0;
315 str[i] = c;
316 }
317 for(; i<size; i++)
318 if(!str[i]) return 0;
319
320 str[0] = 0;
322 *_errno() = EINVAL;
323 return EINVAL;
324}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

◆ _wcsrev()

wchar_t *CDECL _wcsrev ( wchar_t str)

Definition at line 329 of file wcs.c.

330{
331 wchar_t* ret = str;
332 wchar_t* end = str + wcslen(str) - 1;
333 while (end > str)
334 {
335 wchar_t t = *end;
336 *end-- = *str;
337 *str++ = t;
338 }
339 return ret;
340}
GLuint GLuint end
Definition: gl.h:1545
GLdouble GLdouble t
Definition: gl.h:2047

◆ _wcsset()

wchar_t *CDECL _wcsset ( wchar_t str,
wchar_t  c 
)

Definition at line 365 of file wcs.c.

366{
367 wchar_t* ret = str;
368 while (*str) *str++ = c;
369 return ret;
370}

◆ _wcsset_s()

int CDECL _wcsset_s ( wchar_t str,
size_t  n,
wchar_t  c 
)

Definition at line 345 of file wcs.c.

346{
347 wchar_t *p = str;
348
349 if(!MSVCRT_CHECK_PMT(str != NULL)) return EINVAL;
350 if(!MSVCRT_CHECK_PMT(n)) return EINVAL;
351
352 while(*p && --n) *p++ = c;
353 if(!n) {
354 str[0] = 0;
356 *_errno() = EINVAL;
357 return EINVAL;
358 }
359 return 0;
360}
GLfloat GLfloat p
Definition: glext.h:8902

◆ _wcstod_l()

double CDECL _wcstod_l ( const wchar_t str,
wchar_t **  end,
_locale_t  locale 
)

Definition at line 579 of file wcs.c.

581{
583 const wchar_t *beg, *p;
584 struct fpnum fp;
585 double ret;
586 int err;
587
588 if (!MSVCRT_CHECK_PMT(str != NULL)) {
589 if (end) *end = NULL;
590 return 0;
591 }
592
593 if (!locale)
595 else
596 locinfo = locale->locinfo;
597
598 p = str;
599 while(_iswspace_l(*p, locale))
600 p++;
601 beg = p;
602
604 if (end) *end = (p == beg ? (wchar_t*)str : (wchar_t*)p);
605
606 err = fpnum_double(&fp, &ret);
607 if(err) *_errno() = err;
608 return ret;
609}
#define FALSE
Definition: types.h:117
struct fpnum fpnum_parse(wchar_t(*)(void *), void(*)(void *), void *, pthreadlocinfo, BOOL)
int fpnum_double(struct fpnum *, double *)
Definition: string.c:370
static void strtod_wstr_unget(void *ctx)
Definition: wcs.c:570
static wchar_t strtod_wstr_get(void *ctx)
Definition: wcs.c:563
#define err(...)
#define _iswspace_l(_c, _p)
Definition: ctype.h:681
Definition: msvcrt.h:359

Referenced by _wtof(), _wtof_l(), and wcstod().

◆ _wcstoi64()

__int64 CDECL _wcstoi64 ( const wchar_t nptr,
wchar_t **  endptr,
int  base 
)

Definition at line 2725 of file wcs.c.

2727{
2728 return _wcstoi64_l(nptr, endptr, base, NULL);
2729}
__int64 CDECL _wcstoi64_l(const wchar_t *nptr, wchar_t **endptr, int base, _locale_t locale)
Definition: wcs.c:2660

◆ _wcstoi64_l()

__int64 CDECL _wcstoi64_l ( const wchar_t nptr,
wchar_t **  endptr,
int  base,
_locale_t  locale 
)

Definition at line 2660 of file wcs.c.

2662{
2663 BOOL negative = FALSE, empty = TRUE;
2664 __int64 ret = 0;
2665
2666 TRACE("(%s %p %d %p)\n", debugstr_w(nptr), endptr, base, locale);
2667
2668 if (!MSVCRT_CHECK_PMT(nptr != NULL)) return 0;
2669 if (!MSVCRT_CHECK_PMT(base == 0 || base >= 2)) return 0;
2670 if (!MSVCRT_CHECK_PMT(base <= 36)) return 0;
2671
2672 if(endptr)
2673 *endptr = (wchar_t*)nptr;
2674
2675 while(_iswspace_l(*nptr, locale)) nptr++;
2676
2677 if(*nptr == '-') {
2678 negative = TRUE;
2679 nptr++;
2680 } else if(*nptr == '+')
2681 nptr++;
2682
2683 if((base==0 || base==16) && wctoint(*nptr, 1)==0 && (nptr[1]=='x' || nptr[1]=='X')) {
2684 base = 16;
2685 nptr += 2;
2686 }
2687
2688 if(base == 0) {
2689 if(wctoint(*nptr, 1)==0)
2690 base = 8;
2691 else
2692 base = 10;
2693 }
2694
2695 while(*nptr) {
2696 int v = wctoint(*nptr, base);
2697 if(v<0)
2698 break;
2699
2700 if(negative)
2701 v = -v;
2702
2703 nptr++;
2704 empty = FALSE;
2705
2706 if(!negative && (ret>I64_MAX/base || ret*base>I64_MAX-v)) {
2707 ret = I64_MAX;
2708 *_errno() = ERANGE;
2709 } else if(negative && (ret<I64_MIN/base || ret*base<I64_MIN-v)) {
2710 ret = I64_MIN;
2711 *_errno() = ERANGE;
2712 } else
2713 ret = ret*base + v;
2714 }
2715
2716 if(endptr && !empty)
2717 *endptr = (wchar_t*)nptr;
2718
2719 return ret;
2720}
#define TRUE
Definition: types.h:120
static const WCHAR empty[1]
Definition: string.c:47
#define __int64
Definition: corecrt.h:72
#define ERANGE
Definition: errno.h:55
#define I64_MIN
Definition: limits.h:41
#define I64_MAX
Definition: limits.h:42
static int wctoint(WCHAR c, int base)
Definition: wcs.c:2630
unsigned int BOOL
Definition: ntddk_ex.h:94
const GLdouble * v
Definition: gl.h:2040
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by _wcstoi64(), _wcstol_l(), _wcstoul_l(), _wtoi_l(), and _wtol_l().

◆ _wcstol_l()

__msvcrt_long CDECL _wcstol_l ( const wchar_t s,
wchar_t **  end,
int  base,
_locale_t  locale 
)

Definition at line 2734 of file wcs.c.

2736{
2738
2739 if(ret > LONG_MAX) {
2740 ret = LONG_MAX;
2741 *_errno() = ERANGE;
2742 }else if(ret < LONG_MIN) {
2743 ret = LONG_MIN;
2744 *_errno() = ERANGE;
2745 }
2746 return ret;
2747}
#define LONG_MAX
Definition: limits.h:30
#define LONG_MIN
Definition: limits.h:29
GLdouble s
Definition: gl.h:2039

Referenced by wcstol().

◆ _wcstombs_l()

size_t CDECL _wcstombs_l ( char mbstr,
const wchar_t wcstr,
size_t  count,
_locale_t  locale 
)

Definition at line 688 of file wcs.c.

690{
691 return wcsrtombs_l(mbstr, &wcstr, count, locale);
692}
static size_t wcsrtombs_l(char *mbstr, const wchar_t **wcstr, size_t count, _locale_t locale)
Definition: wcs.c:614

◆ _wcstombs_s_l()

int CDECL _wcstombs_s_l ( size_t ret,
char mbstr,
size_t  size,
const wchar_t wcstr,
size_t  count,
_locale_t  locale 
)

Definition at line 772 of file wcs.c.

774{
775 return wcsrtombs_s_l(ret, mbstr, size, &wcstr,count, locale);
776}
static int wcsrtombs_s_l(size_t *ret, char *mbstr, size_t size, const wchar_t **wcstr, size_t count, _locale_t locale)
Definition: wcs.c:718

◆ _wcstoui64()

unsigned __int64 CDECL _wcstoui64 ( const wchar_t nptr,
wchar_t **  endptr,
int  base 
)

Definition at line 2890 of file wcs.c.

2892{
2893 return _wcstoui64_l(nptr, endptr, base, NULL);
2894}
unsigned __int64 CDECL _wcstoui64_l(const wchar_t *nptr, wchar_t **endptr, int base, _locale_t locale)
Definition: wcs.c:2831

◆ _wcstoui64_l()

unsigned __int64 CDECL _wcstoui64_l ( const wchar_t nptr,
wchar_t **  endptr,
int  base,
_locale_t  locale 
)

Definition at line 2831 of file wcs.c.

2833{
2834 BOOL negative = FALSE, empty = TRUE;
2835 unsigned __int64 ret = 0;
2836
2837 TRACE("(%s %p %d %p)\n", debugstr_w(nptr), endptr, base, locale);
2838
2839 if (!MSVCRT_CHECK_PMT(nptr != NULL)) return 0;
2840 if (!MSVCRT_CHECK_PMT(base == 0 || base >= 2)) return 0;
2841 if (!MSVCRT_CHECK_PMT(base <= 36)) return 0;
2842
2843 if(endptr)
2844 *endptr = (wchar_t*)nptr;
2845
2846 while(_iswspace_l(*nptr, locale)) nptr++;
2847
2848 if(*nptr == '-') {
2849 negative = TRUE;
2850 nptr++;
2851 } else if(*nptr == '+')
2852 nptr++;
2853
2854 if((base==0 || base==16) && wctoint(*nptr, 1)==0 && (nptr[1]=='x' || nptr[1]=='X')) {
2855 base = 16;
2856 nptr += 2;
2857 }
2858
2859 if(base == 0) {
2860 if(wctoint(*nptr, 1)==0)
2861 base = 8;
2862 else
2863 base = 10;
2864 }
2865
2866 while(*nptr) {
2867 int v = wctoint(*nptr, base);
2868 if(v<0)
2869 break;
2870
2871 nptr++;
2872 empty = FALSE;
2873
2874 if(ret>UI64_MAX/base || ret*base>UI64_MAX-v) {
2875 ret = UI64_MAX;
2876 *_errno() = ERANGE;
2877 } else
2878 ret = ret*base + v;
2879 }
2880
2881 if(endptr && !empty)
2882 *endptr = (wchar_t*)nptr;
2883
2884 return negative ? -ret : ret;
2885}
#define UI64_MAX
Definition: limits.h:43

Referenced by _wcstoui64().

◆ _wcstoul_l()

__msvcrt_ulong __cdecl _wcstoul_l ( const wchar_t s,
wchar_t **  end,
int  base,
_locale_t  locale 
)

Definition at line 2899 of file wcs.c.

2901{
2903
2904 if(ret > ULONG_MAX) {
2905 ret = ULONG_MAX;
2906 *_errno() = ERANGE;
2907 }else if(ret < -(__int64)ULONG_MAX) {
2908 ret = 1;
2909 *_errno() = ERANGE;
2910 }
2911 return ret;
2912}
#define ULONG_MAX
Definition: limits.h:31

Referenced by wcstoul().

◆ _wcsupr()

wchar_t *CDECL _wcsupr ( wchar_t str)

Definition at line 431 of file wcs.c.

432{
433 return _wcsupr_l(str, NULL);
434}
_wcsupr_l

◆ _wcsupr_l()

wchar_t *CDECL _wcsupr_l ( wchar_t str,
_locale_t  locale 
)

Definition at line 422 of file wcs.c.

423{
424 _wcsupr_s_l( str, -1, locale);
425 return str;
426}
_wcsupr_s_l

◆ _wcsupr_s()

INT CDECL _wcsupr_s ( wchar_t str,
size_t  n 
)

Definition at line 414 of file wcs.c.

415{
416 return _wcsupr_s_l( str, n, NULL );
417}

◆ _wcsupr_s_l()

int CDECL _wcsupr_s_l ( wchar_t str,
size_t  n,
_locale_t  locale 
)

Definition at line 375 of file wcs.c.

376{
377 _locale_tstruct tmp = {0};
378 wchar_t* ptr = str;
379
380 if (!str || !n)
381 {
382 if (str) *str = '\0';
383 *_errno() = EINVAL;
384 return EINVAL;
385 }
386
387 if(!locale)
389
390 while (n--)
391 {
392 if (!*ptr)
393 {
395 return 0;
396 }
398 ptr++;
399 }
400
402
403 /* MSDN claims that the function should return and set errno to
404 * ERANGE, which doesn't seem to be true based on the tests. */
405 *str = '\0';
406 *_errno() = EINVAL;
407 return EINVAL;
408}
wint_t CDECL _towupper_l(wint_t c, _locale_t locale)
Definition: wcs.c:2937

◆ _wcsxfrm_l()

size_t CDECL _wcsxfrm_l ( wchar_t dest,
const wchar_t src,
size_t  len,
_locale_t  locale 
)

Definition at line 3053 of file wcs.c.

3055{
3057 int i, ret;
3058
3059 if(!MSVCRT_CHECK_PMT(src)) return INT_MAX;
3060 if(!MSVCRT_CHECK_PMT(dest || !len)) return INT_MAX;
3061
3062 if(len > INT_MAX) {
3063 FIXME("len > INT_MAX not supported\n");
3064 len = INT_MAX;
3065 }
3066
3067 if(!locale)
3068 locinfo = get_locinfo();
3069 else
3070 locinfo = locale->locinfo;
3071
3072 if(!locinfo->lc_handle[LC_COLLATE]) {
3073 wcsncpy(dest, src, len);
3074 return wcslen(src);
3075 }
3076
3077 ret = LCMapStringW(locinfo->lc_handle[LC_COLLATE],
3078 LCMAP_SORTKEY, src, -1, NULL, 0);
3079 if(!ret) {
3080 if(len) dest[0] = 0;
3081 *_errno() = EILSEQ;
3082 return INT_MAX;
3083 }
3084 if(!len) return ret-1;
3085
3086 if(ret > len) {
3087 dest[0] = 0;
3088 *_errno() = ERANGE;
3089 return ret-1;
3090 }
3091
3092 ret = LCMapStringW(locinfo->lc_handle[LC_COLLATE],
3093 LCMAP_SORTKEY, src, -1, dest, len) - 1;
3094 for(i=ret; i>=0; i--)
3095 dest[i] = ((unsigned char*)dest)[i];
3096 return ret;
3097}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define EILSEQ
Definition: errno.h:62
GLenum src
Definition: glext.h:6340
static char * dest
Definition: rtl.c:149
wcsncpy
#define LCMAP_SORTKEY
Definition: winnls.h:204

Referenced by wcsxfrm().

◆ _wctomb_l()

int CDECL _wctomb_l ( char dst,
wchar_t  ch,
_locale_t  locale 
)

Definition at line 2152 of file wcs.c.

2153{
2154 int len;
2155#ifdef __REACTOS__
2156 int maxlen;
2157 if (locale)
2158 maxlen = locale->locinfo->mb_cur_max;
2159 else
2160 maxlen = get_locinfo()->mb_cur_max;
2161 if (_wctomb_s_l(&len, dst, maxlen, ch, locale) != 0)
2162 return -1;
2163#else
2165#endif
2166 return len;
2167}
unsigned char ch[4][2]
Definition: console.c:118
#define MB_LEN_MAX
Definition: limits.h:7
int CDECL _wctomb_s_l(int *len, char *mbchar, size_t size, wchar_t wch, _locale_t locale)
Definition: wcs.c:2079
GLenum GLenum dst
Definition: glext.h:6340

Referenced by wctomb().

◆ _wctomb_s_l()

int CDECL _wctomb_s_l ( int len,
char mbchar,
size_t  size,
wchar_t  wch,
_locale_t  locale 
)

Definition at line 2079 of file wcs.c.

2081{
2083 BOOL error = FALSE;
2084 BOOL *perror;
2085 int mblen;
2086
2087 if(!mbchar && size>0) {
2088 if(len)
2089 *len = 0;
2090 return 0;
2091 }
2092
2093 if(len)
2094 *len = -1;
2095
2097 return EINVAL;
2098
2099 if(!locale)
2100 locinfo = get_locinfo();
2101 else
2102 locinfo = locale->locinfo;
2103
2104 if(!locinfo->lc_codepage) {
2105 if(wch > 0xff) {
2106 if(mbchar && size>0)
2107 memset(mbchar, 0, size);
2108 *_errno() = EILSEQ;
2109 return EILSEQ;
2110 }
2111
2112 if(!MSVCRT_CHECK_PMT_ERR(size >= 1, ERANGE))
2113 return ERANGE;
2114
2115 *mbchar = wch;
2116 if(len)
2117 *len = 1;
2118 return 0;
2119 }
2120
2121 perror = (locinfo->lc_codepage != CP_UTF8 ? &error : NULL);
2122 mblen = WideCharToMultiByte(locinfo->lc_codepage, 0, &wch, 1, mbchar, size, NULL, perror);
2123 if(!mblen || error) {
2125 if(mbchar && size>0)
2126 memset(mbchar, 0, size);
2127
2128 MSVCRT_INVALID_PMT("insufficient buffer size", ERANGE);
2129 return ERANGE;
2130 }
2131
2132 *_errno() = EILSEQ;
2133 return EILSEQ;
2134 }
2135
2136 if(len)
2137 *len = mblen;
2138 return 0;
2139}
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define WideCharToMultiByte
Definition: compat.h:111
void CDECL perror(const char *str)
Definition: errno.c:337
_ACRTIMP int __cdecl mblen(const char *, size_t)
Definition: mbcs.c:3092
#define MSVCRT_INVALID_PMT(x, err)
Definition: msvcrt.h:376
#define MSVCRT_CHECK_PMT_ERR(x, err)
Definition: msvcrt.h:377
#define error(str)
Definition: mkdosfs.c:1605
#define CP_UTF8
Definition: nls.h:20
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by _wctomb_l(), and wctomb_s().

◆ _wtof()

double CDECL _wtof ( const wchar_t str)

Definition at line 810 of file wcs.c.

811{
812 return _wcstod_l(str, NULL, NULL);
813}
double CDECL _wcstod_l(const wchar_t *str, wchar_t **end, _locale_t locale)
Definition: wcs.c:579

◆ _wtof_l()

double CDECL _wtof_l ( const wchar_t str,
_locale_t  locale 
)

Definition at line 818 of file wcs.c.

819{
820 return _wcstod_l(str, NULL, locale);
821}

◆ _wtoi()

int __cdecl _wtoi ( const wchar_t str)

Definition at line 2778 of file wcs.c.

2779{
2780 return _wtoi_l(str, NULL);
2781}
int __cdecl _wtoi_l(const wchar_t *str, _locale_t locale)
Definition: wcs.c:2761

◆ _wtoi64()

__int64 CDECL _wtoi64 ( const wchar_t str)

Definition at line 3045 of file wcs.c.

3046{
3047 return _wtoi64_l(str, NULL);
3048}
__int64 CDECL _wtoi64_l(const wchar_t *str, _locale_t locale)
Definition: wcs.c:3018

◆ _wtoi64_l()

__int64 CDECL _wtoi64_l ( const wchar_t str,
_locale_t  locale 
)

Definition at line 3018 of file wcs.c.

3019{
3020 ULONGLONG RunningTotal = 0;
3021 BOOL bMinus = FALSE;
3022
3023 while (_iswspace_l(*str, locale)) {
3024 str++;
3025 } /* while */
3026
3027 if (*str == '+') {
3028 str++;
3029 } else if (*str == '-') {
3030 bMinus = TRUE;
3031 str++;
3032 } /* if */
3033
3034 while (*str >= '0' && *str <= '9') {
3035 RunningTotal = RunningTotal * 10 + *str - '0';
3036 str++;
3037 } /* while */
3038
3039 return bMinus ? -RunningTotal : RunningTotal;
3040}
uint64_t ULONGLONG
Definition: typedefs.h:67

Referenced by _wtoi64().

◆ _wtoi_l()

int __cdecl _wtoi_l ( const wchar_t str,
_locale_t  locale 
)

Definition at line 2761 of file wcs.c.

2762{
2764
2765 if(ret > INT_MAX) {
2766 ret = INT_MAX;
2767 *_errno() = ERANGE;
2768 } else if(ret < INT_MIN) {
2769 ret = INT_MIN;
2770 *_errno() = ERANGE;
2771 }
2772 return ret;
2773}
#define INT_MIN
Definition: limits.h:25

Referenced by _wtoi().

◆ _wtol()

__msvcrt_long __cdecl _wtol ( const wchar_t str)

Definition at line 2803 of file wcs.c.

2804{
2805 return _wtol_l(str, NULL);
2806}
__msvcrt_long __cdecl _wtol_l(const wchar_t *str, _locale_t locale)
Definition: wcs.c:2786

◆ _wtol_l()

__msvcrt_long __cdecl _wtol_l ( const wchar_t str,
_locale_t  locale 
)

Definition at line 2786 of file wcs.c.

2787{
2789
2790 if(ret > LONG_MAX) {
2791 ret = LONG_MAX;
2792 *_errno() = ERANGE;
2793 } else if(ret < LONG_MIN) {
2794 ret = LONG_MIN;
2795 *_errno() = ERANGE;
2796 }
2797 return ret;
2798}

Referenced by _wtol().

◆ arg_clbk_positional()

printf_arg arg_clbk_positional ( void ctx,
int  pos,
int  type,
va_list valist 
)

Definition at line 875 of file wcs.c.

876{
878 return args[pos];
879}

Referenced by _vscprintf_p_l(), vfprintf_helper(), vfwprintf_helper(), vsprintf_p_l_opt(), and vswprintf_p_l_opt().

◆ arg_clbk_valist()

printf_arg arg_clbk_valist ( void ctx,
int  arg_pos,
int  type,
va_list valist 
)

Definition at line 852 of file wcs.c.

853{
855
856 if(type == VT_I8)
857 ret.get_longlong = va_arg(*valist, LONGLONG);
858 else if(type == VT_INT)
859 ret.get_int = va_arg(*valist, int);
860 else if(type == VT_R8)
861 ret.get_double = va_arg(*valist, double);
862 else if(type == VT_PTR)
863 ret.get_ptr = va_arg(*valist, void*);
864 else {
865 ERR("Incorrect type\n");
866 ret.get_int = 0;
867 }
868
869 return ret;
870}
@ VT_INT
Definition: compat.h:2316
@ VT_PTR
Definition: compat.h:2320
@ VT_R8
Definition: compat.h:2300
@ VT_I8
Definition: compat.h:2314
#define va_arg(v, l)
Definition: stdarg.h:27
int64_t LONGLONG
Definition: typedefs.h:68

Referenced by _vcprintf(), _vcprintf_l(), _vcwprintf(), _vcwprintf_l(), _vscprintf_p_l(), _vsnprintf(), _vsnprintf_l(), _vsnwprintf(), _vsnwprintf_l(), vfprintf_helper(), vfwprintf_helper(), vsnprintf_s_l_opt(), vsnwprintf_s_l_opt(), vsprintf_p_l_opt(), and vswprintf_p_l_opt().

◆ iswalnum()

INT CDECL iswalnum ( wchar_t  wc)

Definition at line 2260 of file wcs.c.

2261{
2262 return _iswalnum_l( wc, NULL );
2263}
#define _iswalnum_l(_c, _p)
Definition: ctype.h:683

◆ iswalpha()

INT CDECL iswalpha ( wchar_t  wc)

Definition at line 2276 of file wcs.c.

2277{
2278 return _iswalpha_l( wc, NULL );
2279}
#define _iswalpha_l(_c, _p)
Definition: ctype.h:676

◆ iswblank()

INT CDECL iswblank ( wchar_t  wc)

Definition at line 2436 of file wcs.c.

2437{
2438 return wc == '\t' || _iswctype_l( wc, _BLANK, NULL );
2439}

◆ iswcntrl()

INT CDECL iswcntrl ( wchar_t  wc)

Definition at line 2292 of file wcs.c.

2293{
2294 return _iswcntrl_l( wc, NULL );
2295}
#define _iswcntrl_l(_c, _p)
Definition: ctype.h:686

◆ iswctype()

INT CDECL iswctype ( wchar_t  wc,
wctype_t  type 
)

Definition at line 2244 of file wcs.c.

2245{
2246 return _iswctype_l( wc, type, NULL );
2247}

◆ iswdigit()

INT CDECL iswdigit ( wchar_t  wc)

Definition at line 2308 of file wcs.c.

2309{
2310 return _iswdigit_l( wc, NULL );
2311}
#define _iswdigit_l(_c, _p)
Definition: ctype.h:679

◆ iswgraph()

INT CDECL iswgraph ( wchar_t  wc)

Definition at line 2324 of file wcs.c.

2325{
2326 return _iswgraph_l( wc, NULL );
2327}
#define _iswgraph_l(_c, _p)
Definition: ctype.h:685

◆ iswlower()

INT CDECL iswlower ( wchar_t  wc)

Definition at line 2340 of file wcs.c.

2341{
2342 return _iswlower_l( wc, NULL );
2343}
#define _iswlower_l(_c, _p)
Definition: ctype.h:678

◆ iswprint()

INT CDECL iswprint ( wchar_t  wc)

Definition at line 2356 of file wcs.c.

2357{
2358 return _iswprint_l( wc, NULL );
2359}
#define _iswprint_l(_c, _p)
Definition: ctype.h:684

◆ iswpunct()

INT CDECL iswpunct ( wchar_t  wc)

Definition at line 2372 of file wcs.c.

2373{
2374 return _iswpunct_l( wc, NULL );
2375}
#define _iswpunct_l(_c, _p)
Definition: ctype.h:682

◆ iswspace()

INT CDECL iswspace ( wchar_t  wc)

Definition at line 2388 of file wcs.c.

2389{
2390 return _iswspace_l( wc, NULL );
2391}

◆ iswupper()

INT CDECL iswupper ( wchar_t  wc)

Definition at line 2404 of file wcs.c.

2405{
2406 return _iswupper_l( wc, NULL );
2407}
#define _iswupper_l(_c, _p)
Definition: ctype.h:677

◆ iswxdigit()

INT CDECL iswxdigit ( wchar_t  wc)

Definition at line 2420 of file wcs.c.

2421{
2422 return _iswxdigit_l( wc, NULL );
2423}
#define _iswxdigit_l(_c, _p)
Definition: ctype.h:680

◆ sprintf()

int WINAPIV sprintf ( char str,
const char format,
  ... 
)

Definition at line 1606 of file wcs.c.

1607{
1608 va_list ap;
1609 int r;
1610
1611 va_start( ap, format );
1612 r = vsnprintf( str, INT_MAX, format, ap );
1613 va_end( ap );
1614 return r;
1615}

◆ sprintf_s()

int WINAPIV sprintf_s ( char str,
size_t  num,
const char format,
  ... 
)

Definition at line 1620 of file wcs.c.

1621{
1622 va_list ap;
1623 int r;
1624
1625 va_start( ap, format );
1626 r = vsnprintf( str, num, format, ap );
1627 va_end( ap );
1628 return r;
1629}
GLuint GLuint num
Definition: glext.h:9618

◆ strtod_wstr_get()

static wchar_t strtod_wstr_get ( void ctx)
static

Definition at line 563 of file wcs.c.

564{
565 const wchar_t **p = ctx;
566 if (!**p) return WEOF;
567 return *(*p)++;
568}

Referenced by _wcstod_l().

◆ strtod_wstr_unget()

static void strtod_wstr_unget ( void ctx)
static

Definition at line 570 of file wcs.c.

571{
572 const wchar_t **p = ctx;
573 (*p)--;
574}

Referenced by _wcstod_l().

◆ swprintf_s()

int WINAPIV swprintf_s ( wchar_t str,
size_t  numberOfElements,
const wchar_t format,
  ... 
)

Definition at line 1706 of file wcs.c.

1708{
1709 va_list ap;
1710 int r;
1711
1712 va_start(ap, format);
1714 va_end(ap);
1715
1716 return r;
1717}
int CDECL _vsnwprintf_s(wchar_t *str, size_t sizeOfBuffer, size_t count, const wchar_t *format, va_list valist)
Definition: wcs.c:1488

Referenced by tirpc_report().

◆ towctrans()

wint_t CDECL towctrans ( wint_t  c,
wctrans_t  category 
)

Definition at line 154 of file wcs.c.

155{
156 if(category == 1)
157 return _towupper_l(c, NULL);
158 return _towlower_l(c, NULL);
159}

◆ towlower()

wint_t CDECL towlower ( wint_t  c)

Definition at line 125 of file wcs.c.

126{
127 return _towlower_l(c, NULL);
128}

◆ towupper()

wint_t CDECL towupper ( wint_t  c)

Definition at line 2961 of file wcs.c.

2962{
2963 return _towupper_l(c, NULL);
2964}

◆ vsnprintf_s_l_opt()

static int CDECL vsnprintf_s_l_opt ( char str,
size_t  sizeOfBuffer,
size_t  count,
const char format,
DWORD  options,
_locale_t  locale,
va_list  valist 
)
static

Definition at line 990 of file wcs.c.

993{
994 static const char nullbyte = '\0';
995 struct _str_ctx_a ctx;
996 int len, ret;
997
998 if(sizeOfBuffer<count+1 || count==-1)
1000 else
1001 len = count+1;
1002
1003 ctx.len = len;
1004 ctx.buf = str;
1007 puts_clbk_str_a(&ctx, 1, &nullbyte);
1008
1009 if(ret<0 || ret==len) {
1011 MSVCRT_INVALID_PMT("str[sizeOfBuffer] is too small", ERANGE);
1012 memset(str, 0, sizeOfBuffer);
1013 } else
1014 str[len-1] = '\0';
1015
1016 return -1;
1017 }
1018
1019 return ret;
1020}
#define _TRUNCATE
Definition: stdlib.h:45

Referenced by _vsnprintf_c_l(), and _vsnprintf_s_l().

◆ vsnwprintf_s_l_opt()

static int vsnwprintf_s_l_opt ( wchar_t str,
size_t  sizeOfBuffer,
size_t  count,
const wchar_t format,
DWORD  options,
_locale_t  locale,
va_list  valist 
)
static

Definition at line 1022 of file wcs.c.

1025{
1026 struct _str_ctx_w ctx;
1027 int len, ret;
1028
1029 len = sizeOfBuffer;
1030 if(count!=-1 && len>count+1)
1031 len = count+1;
1032
1033 ctx.len = len;
1034 ctx.buf = str;
1037 puts_clbk_str_w(&ctx, 1, L"");
1038
1039 if(ret<0 || ret==len) {
1041 MSVCRT_INVALID_PMT("str[sizeOfBuffer] is too small", ERANGE);
1042 memset(str, 0, sizeOfBuffer*sizeof(wchar_t));
1043 } else
1044 str[len-1] = '\0';
1045
1046 return -1;
1047 }
1048
1049 return ret;
1050}

Referenced by _vsnwprintf_s_l(), and _vswprintf_c_l().

◆ vsprintf()

int CDECL vsprintf ( char str,
const char format,
va_list  valist 
)

Definition at line 1165 of file wcs.c.

1166{
1167 return vsnprintf(str, INT_MAX, format, valist);
1168}

◆ vsprintf_p_l_opt()

static int vsprintf_p_l_opt ( char buffer,
size_t  length,
const char format,
DWORD  options,
_locale_t  locale,
va_list  args 
)
static

Definition at line 1837 of file wcs.c.

1839{
1840 static const char nullbyte = '\0';
1841 printf_arg args_ctx[_ARGMAX+1];
1842 struct _str_ctx_a puts_ctx = {length, buffer};
1843 int ret;
1844
1845 memset(args_ctx, 0, sizeof(args_ctx));
1846
1847 ret = create_positional_ctx_a(args_ctx, format, args);
1848 if(ret < 0) {
1850 *_errno() = EINVAL;
1851 return ret;
1852 } else if(ret == 0)
1853 ret = pf_printf_a(puts_clbk_str_a, &puts_ctx, format, locale,
1855 else
1856 ret = pf_printf_a(puts_clbk_str_a, &puts_ctx, format, locale,
1858 arg_clbk_positional, args_ctx, NULL);
1859
1860 puts_clbk_str_a(&puts_ctx, 1, &nullbyte);
1861 return ret;
1862}

Referenced by _vsprintf_p_l().

◆ vsprintf_s()

int CDECL vsprintf_s ( char str,
size_t  num,
const char format,
va_list  valist 
)

Definition at line 1173 of file wcs.c.

1174{
1175 return vsnprintf(str, num, format, valist);
1176}

◆ vswprintf_p_l_opt()

static int vswprintf_p_l_opt ( wchar_t buffer,
size_t  length,
const wchar_t format,
DWORD  options,
_locale_t  locale,
va_list  args 
)
static

Definition at line 1415 of file wcs.c.

1417{
1418 printf_arg args_ctx[_ARGMAX+1];
1419 struct _str_ctx_w puts_ctx = {length, buffer};
1420 int ret;
1421
1422 memset(args_ctx, 0, sizeof(args_ctx));
1423
1424 ret = create_positional_ctx_w(args_ctx, format, args);
1425 if(ret < 0) {
1427 *_errno() = EINVAL;
1428 return ret;
1429 } else if(ret == 0)
1432 else
1433 ret = pf_printf_w(puts_clbk_str_w, &puts_ctx, format, locale,
1435 arg_clbk_positional, args_ctx, NULL);
1436
1437 puts_clbk_str_w(&puts_ctx, 1, L"");
1438 return ret;
1439}
int create_positional_ctx_w(void *, const wchar_t *, va_list)

Referenced by _scwprintf_p_l(), _swprintf_p(), _swprintf_p_l(), _vscwprintf_p_l(), and _vswprintf_p_l().

◆ vswprintf_s()

int CDECL vswprintf_s ( wchar_t str,
size_t  numberOfElements,
const wchar_t format,
va_list  args 
)

Definition at line 1821 of file wcs.c.

1823{
1825}

◆ wcrtomb()

size_t CDECL wcrtomb ( char dst,
wchar_t  ch,
mbstate_t s 
)

Definition at line 2216 of file wcs.c.

2217{
2218 if(s)
2219 *s = 0;
2220 return wctomb(dst, ch);
2221}
#define wctomb
Definition: wctomb.c:31

◆ wcrtomb_s()

INT CDECL wcrtomb_s ( size_t len,
char mbchar,
size_t  size,
wchar_t  wch,
mbstate_t s 
)

Definition at line 2202 of file wcs.c.

2204{
2205 int ilen, ret;
2206
2207 if (s) *s = 0;
2208 ret = wctomb_s(&ilen, mbchar, size, wch);
2209 if (len) *len = ilen;
2210 return ret;
2211}
int CDECL wctomb_s(int *len, char *mbchar, size_t size, wchar_t wch)
Definition: wcs.c:2144

◆ wcscat()

wchar_t *__cdecl wcscat ( wchar_t dst,
const wchar_t src 
)

Definition at line 2565 of file wcs.c.

2566{
2567 wcscpy( dst + wcslen(dst), src );
2568 return dst;
2569}
wcscpy

◆ wcscat_s()

INT CDECL wcscat_s ( wchar_t dst,
size_t  elem,
const wchar_t src 
)

Definition at line 2540 of file wcs.c.

2541{
2542 wchar_t* ptr = dst;
2543
2544 if (!dst || elem == 0) return EINVAL;
2545 if (!src)
2546 {
2547 dst[0] = '\0';
2548 return EINVAL;
2549 }
2550
2551 /* seek to end of dst string (or elem if no end of string is found */
2552 while (ptr < dst + elem && *ptr != '\0') ptr++;
2553 while (ptr < dst + elem)
2554 {
2555 if ((*ptr++ = *src++) == '\0') return 0;
2556 }
2557 /* not enough space */
2558 dst[0] = '\0';
2559 return ERANGE;
2560}
static size_t elem
Definition: string.c:71

◆ wcschr()

wchar_t *CDECL wcschr ( const wchar_t str,
wchar_t  ch 
)

Definition at line 2969 of file wcs.c.

2970{
2971 do { if (*str == ch) return (WCHAR *)(ULONG_PTR)str; } while (*str++);
2972 return NULL;
2973}
#define ULONG_PTR
Definition: config.h:101
short WCHAR
Definition: pedump.c:58

◆ wcscmp()

int CDECL wcscmp ( const wchar_t str1,
const wchar_t str2 
)

Definition at line 1977 of file wcs.c.

1978{
1979 while (*str1 && (*str1 == *str2))
1980 {
1981 str1++;
1982 str2++;
1983 }
1984
1985 if (*str1 < *str2)
1986 return -1;
1987 if (*str1 > *str2)
1988 return 1;
1989 return 0;
1990}

Referenced by _wcscoll_l().

◆ wcscoll()

int CDECL wcscoll ( const wchar_t str1,
const wchar_t str2 
)

Definition at line 2013 of file wcs.c.

2014{
2015 return _wcscoll_l(str1, str2, NULL);
2016}
int CDECL _wcscoll_l(const wchar_t *str1, const wchar_t *str2, _locale_t locale)
Definition: wcs.c:1995

◆ wcscpy()

wchar_t *__cdecl wcscpy ( wchar_t dst,
const wchar_t src 
)

Definition at line 2473 of file wcs.c.

2474{
2475 WCHAR *p = dst;
2476 while ((*p++ = *src++));
2477 return dst;
2478}

◆ wcscpy_s()

INT CDECL wcscpy_s ( wchar_t wcDest,
size_t  numElement,
const wchar_t wcSrc 
)

Definition at line 2444 of file wcs.c.

2445{
2446 size_t size = 0;
2447
2448 if(!MSVCRT_CHECK_PMT(wcDest)) return EINVAL;
2449 if(!MSVCRT_CHECK_PMT(numElement)) return EINVAL;
2450
2452 {
2453 wcDest[0] = 0;
2454 return EINVAL;
2455 }
2456
2457 size = wcslen(wcSrc) + 1;
2458
2459 if(!MSVCRT_CHECK_PMT_ERR(size <= numElement, ERANGE))
2460 {
2461 wcDest[0] = 0;
2462 return ERANGE;
2463 }
2464
2465 memmove( wcDest, wcSrc, size*sizeof(WCHAR) );
2466
2467 return 0;
2468}
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static const unsigned char *static size_t const wchar_t * wcSrc
Definition: string.c:76

◆ wcscspn()

size_t __cdecl wcscspn ( const wchar_t str,
const wchar_t reject 
)

Definition at line 503 of file wcs.c.

504{
505 const wchar_t *ptr;
506 for (ptr = str; *ptr; ptr++) if (wcschr( reject, *ptr )) break;
507 return ptr - str;
508}
#define wcschr
Definition: compat.h:17

◆ wcslen()

size_t CDECL wcslen ( const wchar_t str)

Definition at line 2988 of file wcs.c.

2989{
2990 const wchar_t *s = str;
2991 while (*s) s++;
2992 return s - str;
2993}

Referenced by _wcsdup(), _wcsrev(), _wcsxfrm_l(), wcscat(), wcscpy_s(), and wcsrtombs_l().

◆ wcsncat()

wchar_t *__cdecl wcsncat ( wchar_t s1,
const wchar_t s2,
size_t  n 
)

Definition at line 2618 of file wcs.c.

2619{
2620 wchar_t *ret = s1;
2621 while (*s1) s1++;
2622 while (n-- > 0) if (!(*s1++ = *s2++)) return ret;
2623 *s1 = 0;
2624 return ret;
2625}
struct S1 s1
PCWSTR s2
Definition: shell32_main.h:38

◆ wcsncat_s()

errno_t CDECL wcsncat_s ( wchar_t dst,
size_t  elem,
const wchar_t src,
size_t  count 
)

Definition at line 2574 of file wcs.c.

2575{
2576 size_t i, j;
2577
2578 if (!MSVCRT_CHECK_PMT(dst != NULL)) return EINVAL;
2579 if (!MSVCRT_CHECK_PMT(elem > 0)) return EINVAL;
2580 if (count == 0) return 0;
2581 if (!MSVCRT_CHECK_PMT(src != NULL))
2582 {
2583 *dst = 0;
2584 return EINVAL;
2585 }
2586
2587 for (i = 0; i < elem; i++) if (!dst[i]) break;
2588
2589 if (i == elem)
2590 {
2591 MSVCRT_INVALID_PMT("dst[elem] is not NULL terminated\n", EINVAL);
2592 *dst = 0;
2593 return EINVAL;
2594 }
2595
2596 for (j = 0; (j + i) < elem; j++)
2597 {
2598 if(count == _TRUNCATE && j + i == elem - 1)
2599 {
2600 dst[j + i] = '\0';
2601 return STRUNCATE;
2602 }
2603 if(j == count || (dst[j + i] = src[j]) == '\0')
2604 {
2605 dst[j + i] = '\0';
2606 return 0;
2607 }
2608 }
2609
2610 MSVCRT_INVALID_PMT("dst[elem] is too small", ERANGE);
2611 dst[0] = '\0';
2612 return ERANGE;
2613}
#define STRUNCATE
Definition: errno.h:64
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250

◆ wcsncmp()

int CDECL wcsncmp ( const wchar_t str1,
const wchar_t str2,
size_t  n 
)

Definition at line 523 of file wcs.c.

524{
525 if (!n)
526 return 0;
527 while(--n && *str1 && (*str1 == *str2))
528 {
529 str1++;
530 str2++;
531 }
532 return *str1 - *str2;
533}

Referenced by _wcsncoll_l().

◆ wcsncpy()

wchar_t *__cdecl wcsncpy ( wchar_t s1,
const wchar_t s2,
size_t  n 
)

Definition at line 2483 of file wcs.c.

2484{
2485 size_t i;
2486
2487 for(i=0; i<n; i++)
2488 if(!(s1[i] = s2[i])) break;
2489 for(; i<n; i++)
2490 s1[i] = 0;
2491 return s1;
2492}

◆ wcsncpy_s()

INT CDECL wcsncpy_s ( wchar_t dst,
size_t  elem,
const wchar_t src,
size_t  count 
)

Definition at line 2497 of file wcs.c.

2498{
2499 WCHAR *p = dst;
2500 BOOL truncate = (count == _TRUNCATE);
2501
2502 if (!count)
2503 {
2504 if (dst && elem) *dst = 0;
2505 return 0;
2506 }
2507
2508 if (!MSVCRT_CHECK_PMT(dst != NULL)) return EINVAL;
2509 if (!MSVCRT_CHECK_PMT(elem != 0)) return EINVAL;
2510 if (!MSVCRT_CHECK_PMT(src != NULL))
2511 {
2512 *dst = 0;
2513 return EINVAL;
2514 }
2515
2516 while (elem && count && *src)
2517 {
2518 *p++ = *src++;
2519 elem--;
2520 count--;
2521 }
2522 if (!elem && truncate)
2523 {
2524 *(p-1) = 0;
2525 return STRUNCATE;
2526 }
2527 else if (!elem)
2528 {
2529 *dst = 0;
2530 return ERANGE;
2531 }
2532 *p = 0;
2533 return 0;
2534}

◆ wcsnlen()

size_t CDECL wcsnlen ( const wchar_t s,
size_t  maxlen 
)

Definition at line 2925 of file wcs.c.

2926{
2927 size_t i;
2928
2929 for (i = 0; i < maxlen; i++)
2930 if (!s[i]) break;
2931 return i;
2932}

Referenced by _wcsncoll_l(), and _wcsnicoll_l().

◆ wcspbrk()

wchar_t *CDECL wcspbrk ( const wchar_t str,
const wchar_t accept 
)

Definition at line 2021 of file wcs.c.

2022{
2023 const wchar_t* p;
2024
2025 while (*str)
2026 {
2027 for (p = accept; *p; p++) if (*p == *str) return (wchar_t*)str;
2028 str++;
2029 }
2030 return NULL;
2031}
SOCKET WSAAPI accept(IN SOCKET s, OUT LPSOCKADDR addr, OUT INT FAR *addrlen)
Definition: socklife.c:23

◆ wcsrchr()

wchar_t *CDECL wcsrchr ( const wchar_t str,
wchar_t  ch 
)

Definition at line 2978 of file wcs.c.

2979{
2980 WCHAR *ret = NULL;
2981 do { if (*str == ch) ret = (WCHAR *)(ULONG_PTR)str; } while (*str++);
2982 return ret;
2983}
uint32_t ULONG_PTR
Definition: typedefs.h:65

◆ wcsrtombs()

size_t CDECL wcsrtombs ( char mbstr,
const wchar_t **  wcstr,
size_t  count,
mbstate_t mbstate 
)

Definition at line 706 of file wcs.c.

708{
709 if(mbstate)
710 *mbstate = 0;
711
712 return wcsrtombs_l(mbstr, wcstr, count, NULL);
713}

◆ wcsrtombs_l()

static size_t wcsrtombs_l ( char mbstr,
const wchar_t **  wcstr,
size_t  count,
_locale_t  locale 
)
static

Definition at line 614 of file wcs.c.

616{
618 size_t tmp = 0;
619 BOOL used_default = FALSE;
620 BOOL *pused_default;
621
622 if(!locale)
624 else
625 locinfo = locale->locinfo;
626
627 if(!locinfo->lc_codepage) {
628 size_t i;
629
630 if(!mbstr)
631 return wcslen(*wcstr);
632
633 for(i=0; i<count; i++) {
634 if((*wcstr)[i] > 255) {
635 *_errno() = EILSEQ;
636 return -1;
637 }
638
639 mbstr[i] = (*wcstr)[i];
640 if(!(*wcstr)[i]) break;
641 }
642
643 if(i < count) *wcstr = NULL;
644 else *wcstr += i;
645 return i;
646 }
647
648 pused_default = (locinfo->lc_codepage != CP_UTF8 ? &used_default : NULL);
649
650 if(!mbstr) {
652 *wcstr, -1, NULL, 0, NULL, pused_default);
653 if(!tmp || used_default) {
654 *_errno() = EILSEQ;
655 return -1;
656 }
657 return tmp-1;
658 }
659
660 while(**wcstr) {
661 char buf[3];
662 size_t i, size;
663
665 *wcstr, 1, buf, 3, NULL, pused_default);
666 if(!size || used_default) {
667 *_errno() = EILSEQ;
668 return -1;
669 }
670 if(tmp+size > count)
671 return tmp;
672
673 for(i=0; i<size; i++)
674 mbstr[tmp++] = buf[i];
675 (*wcstr)++;
676 }
677
678 if(tmp < count) {
679 mbstr[tmp] = '\0';
680 *wcstr = NULL;
681 }
682 return tmp;
683}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define WC_NO_BEST_FIT_CHARS
Definition: unicode.h:46

Referenced by _wcstombs_l(), wcsrtombs(), wcsrtombs_s_l(), and wcstombs().

◆ wcsrtombs_s()

int CDECL wcsrtombs_s ( size_t ret,
char mbstr,
size_t  size,
const wchar_t **  wcstr,
size_t  count,
mbstate_t mbstate 
)

Definition at line 790 of file wcs.c.

792{
793 if(mbstate)
794 *mbstate = 0;
795
796 return wcsrtombs_s_l(ret, mbstr, size, wcstr, count, NULL);
797}

◆ wcsrtombs_s_l()

static int wcsrtombs_s_l ( size_t ret,
char mbstr,
size_t  size,
const wchar_t **  wcstr,
size_t  count,
_locale_t  locale 
)
static

Definition at line 718 of file wcs.c.

720{
721 size_t conv;
722 int err;
723
724 if(!mbstr && !size && wcstr) {
725 conv = wcsrtombs_l(NULL, wcstr, 0, locale);
726 if(ret)
727 *ret = conv+1;
728 if(conv == -1)
729 return *_errno();
730 return 0;
731 }
732
733 if (!MSVCRT_CHECK_PMT(mbstr != NULL)) return EINVAL;
734 if (size) mbstr[0] = '\0';
735 if (!MSVCRT_CHECK_PMT(wcstr != NULL)) return EINVAL;
736 if (!MSVCRT_CHECK_PMT(*wcstr != NULL)) return EINVAL;
737
738 if(count==_TRUNCATE || size<count)
739 conv = size;
740 else
741 conv = count;
742
743 err = 0;
744 conv = wcsrtombs_l(mbstr, wcstr, conv, locale);
745 if(conv == -1) {
746 conv = 0;
747 if(size)
748 mbstr[0] = '\0';
749 err = *_errno();
750 }else if(conv < size)
751 mbstr[conv++] = '\0';
752 else if(conv==size && (count==_TRUNCATE || mbstr[conv-1]=='\0')) {
753 mbstr[conv-1] = '\0';
754 if(count==_TRUNCATE)
755 err = STRUNCATE;
756 }else {
757 MSVCRT_INVALID_PMT("mbstr[size] is too small", ERANGE);
758 conv = 0;
759 if(size)
760 mbstr[0] = '\0';
761 err = ERANGE;
762 }
763
764 if(ret)
765 *ret = conv;
766 return err;
767}

Referenced by _wcstombs_s_l(), wcsrtombs_s(), and wcstombs_s().

◆ wcsspn()

size_t __cdecl wcsspn ( const wchar_t str,
const wchar_t accept 
)

Definition at line 513 of file wcs.c.

514{
515 const wchar_t *ptr;
516 for (ptr = str; *ptr; ptr++) if (!wcschr( accept, *ptr )) break;
517 return ptr - str;
518}

◆ wcsstr()

wchar_t *CDECL wcsstr ( const wchar_t str,
const wchar_t sub 
)

Definition at line 2998 of file wcs.c.

2999{
3000 while(*str)
3001 {
3002 const wchar_t *p1 = str, *p2 = sub;
3003 while(*p1 && *p2 && *p1 == *p2)
3004 {
3005 p1++;
3006 p2++;
3007 }
3008 if(!*p2)
3009 return (wchar_t*)str;
3010 str++;
3011 }
3012 return NULL;
3013}

◆ wcstod()

double CDECL wcstod ( const wchar_t lpszStr,
wchar_t **  end 
)

Definition at line 802 of file wcs.c.

803{
804 return _wcstod_l(lpszStr, end, NULL);
805}

◆ wcstok()

wchar_t *CDECL wcstok ( wchar_t str,
const wchar_t delim 
)

Definition at line 2070 of file wcs.c.

2071{
2072 return wcstok_s(str, delim, &msvcrt_get_thread_data()->wcstok_next);
2073}
thread_data_t *CDECL msvcrt_get_thread_data(void)
Definition: ucrt_tls_sup.c:59
wchar_t *CDECL wcstok_s(wchar_t *str, const wchar_t *delim, wchar_t **next_token)
Definition: wcs.c:2036

Referenced by _CorExeMain(), GetDefaultLayoutForLocale(), GetLayerInfo(), GetMessageStringFromDllList(), is_idn_error(), LoadUsernameHint(), ParseCommandLine(), ParseMoreVariable(), ParseSettings(), pBuildFileList(), StreamingDeviceSetupW(), test_wcstok(), WhereFindByDirs(), WhereGetPathExt(), and wmain().

◆ wcstok_s()

wchar_t *CDECL wcstok_s ( wchar_t str,
const wchar_t delim,
wchar_t **  next_token 
)

Definition at line 2036 of file wcs.c.

2038{
2039 wchar_t *ret;
2040
2041 if (!MSVCRT_CHECK_PMT(delim != NULL)) return NULL;
2042 if (!MSVCRT_CHECK_PMT(next_token != NULL)) return NULL;
2043 if (!MSVCRT_CHECK_PMT(str != NULL || *next_token != NULL)) return NULL;
2044
2045 if (!str) str = *next_token;
2046
2047 while (*str && wcschr( delim, *str )) str++;
2048 if (!*str) ret = NULL;
2049 else
2050 {
2051 ret = str++;
2052 while (*str && !wcschr( delim, *str )) str++;
2053 if (*str) *str++ = 0;
2054 }
2055 *next_token = str;
2056 return ret;
2057}
int next_token(char **, FILE *)

Referenced by wcstok().

◆ wcstol()

__msvcrt_long CDECL wcstol ( const wchar_t s,
wchar_t **  end,
int  base 
)

Definition at line 2752 of file wcs.c.

2754{
2755 return _wcstol_l(s, end, base, NULL);
2756}
__msvcrt_long CDECL _wcstol_l(const wchar_t *s, wchar_t **end, int base, _locale_t locale)
Definition: wcs.c:2734

◆ wcstombs()

size_t CDECL wcstombs ( char mbstr,
const wchar_t wcstr,
size_t  count 
)

Definition at line 697 of file wcs.c.

699{
700 return wcsrtombs_l(mbstr, &wcstr, count, NULL);
701}

◆ wcstombs_s()

int CDECL wcstombs_s ( size_t ret,
char mbstr,
size_t  size,
const wchar_t wcstr,
size_t  count 
)

Definition at line 781 of file wcs.c.

783{
784 return wcsrtombs_s_l(ret, mbstr, size, &wcstr, count, NULL);
785}

Referenced by _VCrtDbgReportW(), _wperror(), and process_sub().

◆ wcstoul()

__msvcrt_ulong __cdecl wcstoul ( const wchar_t s,
wchar_t **  end,
int  base 
)

Definition at line 2917 of file wcs.c.

2918{
2919 return _wcstoul_l(s, end, base, NULL);
2920}
__msvcrt_ulong __cdecl _wcstoul_l(const wchar_t *s, wchar_t **end, int base, _locale_t locale)
Definition: wcs.c:2899

◆ wcsxfrm()

size_t CDECL wcsxfrm ( wchar_t dest,
const wchar_t src,
size_t  len 
)

Definition at line 3102 of file wcs.c.

3103{
3104 return _wcsxfrm_l(dest, src, len, NULL);
3105}
size_t CDECL _wcsxfrm_l(wchar_t *dest, const wchar_t *src, size_t len, _locale_t locale)
Definition: wcs.c:3053

◆ wctob()

INT CDECL wctob ( wint_t  wchar)

Definition at line 2180 of file wcs.c.

2181{
2182 char out;
2183 BOOL error = FALSE;
2184 BOOL *perror;
2185 UINT codepage = get_locinfo()->lc_codepage;
2186
2187 perror = (codepage != CP_UTF8 ? &error : NULL);
2188
2189 if(!codepage) {
2190 if (wchar < 0xff)
2191 return (signed char)wchar;
2192 else
2193 return EOF;
2194 } else if(WideCharToMultiByte( codepage, 0, &wchar, 1, &out, 1, NULL, perror ) && !error)
2195 return (INT)out;
2196 return EOF;
2197}
#define EOF
Definition: stdio.h:33
unsigned int UINT
Definition: ndis.h:50
int32_t INT
Definition: typedefs.h:58
size_t const wchar_t const wchar
Definition: wcrtomb.cpp:53
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
int codepage
Definition: win_iconv.c:156

◆ wctoint()

static int wctoint ( WCHAR  c,
int  base 
)
static

Definition at line 2630 of file wcs.c.

2631{
2632 int v = -1;
2633 if ('0' <= c && c <= '9')
2634 v = c - '0';
2635 else if ('A' <= c && c <= 'Z')
2636 v = c - 'A' + 10;
2637 else if ('a' <= c && c <= 'z')
2638 v = c - 'a' + 10;
2639 else {
2640 /* NOTE: MAP_FOLDDIGITS supports too many things. */
2641 /* Unicode points that contain digits 0-9; keep this sorted! */
2642 static const WCHAR zeros[] = {
2643 0x660, 0x6f0, 0x966, 0x9e6, 0xa66, 0xae6, 0xb66, 0xc66, 0xce6,
2644 0xd66, 0xe50, 0xed0, 0xf20, 0x1040, 0x17e0, 0x1810, 0xff10
2645 };
2646 int i;
2647 for (i = 0; i < ARRAY_SIZE(zeros) && c >= zeros[i]; ++i) {
2648 if (zeros[i] <= c && c <= zeros[i] + 9) {
2649 v = c - zeros[i];
2650 break;
2651 }
2652 }
2653 }
2654 return v < base ? v : -1;
2655}
#define ARRAY_SIZE(A)
Definition: main.h:20

Referenced by _wcstoi64_l(), and _wcstoui64_l().

◆ wctomb()

INT CDECL wctomb ( char dst,
wchar_t  ch 
)

Definition at line 2172 of file wcs.c.

2173{
2174 return _wctomb_l(dst, ch, NULL);
2175}
int CDECL _wctomb_l(char *dst, wchar_t ch, _locale_t locale)
Definition: wcs.c:2152

◆ wctomb_s()

int CDECL wctomb_s ( int len,
char mbchar,
size_t  size,
wchar_t  wch 
)

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msvcrt  )

Variable Documentation

◆ n_format_enabled

BOOL n_format_enabled = TRUE
static

Definition at line 54 of file wcs.c.

Referenced by pf_printf().