ReactOS 0.4.16-dev-2104-gb84fa49
mbstring.h File Reference
#include <corecrt.h>
#include <pshpack8.h>
#include <poppack.h>
Include dependency graph for mbstring.h:

Go to the source code of this file.

Macros

#define _NLSCMPERROR   ((unsigned int)0x7fffffff)
 
#define _NLSCMP_DEFINED
 
#define _mbccmp(_cpc1, _cpc2)   _mbsncmp((_cpc1),(_cpc2),1)
 
#define _MBLEADTRAIL_DEFINED
 

Functions

_ACRTIMP int __cdecl _ismbcalnum (unsigned int)
 
_ACRTIMP int __cdecl _ismbcalpha (unsigned int)
 
_ACRTIMP int __cdecl _ismbcdigit (unsigned int)
 
_ACRTIMP int __cdecl _ismbcgraph (unsigned int)
 
_ACRTIMP int __cdecl _ismbchira (unsigned int)
 
_ACRTIMP int __cdecl _ismbckata (unsigned int)
 
_ACRTIMP int __cdecl _ismbcl0 (unsigned int)
 
_ACRTIMP int __cdecl _ismbcl1 (unsigned int)
 
_ACRTIMP int __cdecl _ismbcl2 (unsigned int)
 
_ACRTIMP int __cdecl _ismbclegal (unsigned int)
 
_ACRTIMP int __cdecl _ismbclegal_l (unsigned int, _locale_t)
 
_ACRTIMP int __cdecl _ismbclower (unsigned int)
 
_ACRTIMP int __cdecl _ismbcprint (unsigned int)
 
_ACRTIMP int __cdecl _ismbcpunct (unsigned int)
 
_ACRTIMP int __cdecl _ismbcspace (unsigned int)
 
_ACRTIMP int __cdecl _ismbcsymbol (unsigned int)
 
_ACRTIMP int __cdecl _ismbcupper (unsigned int)
 
_ACRTIMP unsigned int __cdecl _mbbtombc (unsigned int)
 
_ACRTIMP int __cdecl _mbbtype (unsigned char, int)
 
_ACRTIMP int __cdecl _mbbtype_l (unsigned char, int, _locale_t)
 
_ACRTIMP void __cdecl _mbccpy (unsigned char *, const unsigned char *)
 
_ACRTIMP unsigned int __cdecl _mbcjistojms (unsigned int)
 
_ACRTIMP unsigned int __cdecl _mbcjmstojis (unsigned int)
 
_ACRTIMP size_t __cdecl _mbclen (const unsigned char *)
 
_ACRTIMP unsigned int __cdecl _mbctohira (unsigned int)
 
_ACRTIMP unsigned int __cdecl _mbctokata (unsigned int)
 
_ACRTIMP unsigned int __cdecl _mbctolower (unsigned int)
 
_ACRTIMP unsigned int __cdecl _mbctombb (unsigned int)
 
_ACRTIMP unsigned int __cdecl _mbctoupper (unsigned int)
 
_ACRTIMP int __cdecl _mbsbtype (const unsigned char *, size_t)
 
_ACRTIMP unsigned char *__cdecl _mbscat (unsigned char *, const unsigned char *)
 
_ACRTIMP unsigned char *__cdecl _mbschr (const unsigned char *, unsigned int)
 
_ACRTIMP int __cdecl _mbscmp (const unsigned char *, const unsigned char *)
 
_ACRTIMP int __cdecl _mbscmp_l (const unsigned char *, const unsigned char *, _locale_t)
 
_ACRTIMP int __cdecl _mbscoll (const unsigned char *, const unsigned char *)
 
_ACRTIMP unsigned char *__cdecl _mbscpy (unsigned char *, const unsigned char *)
 
_ACRTIMP size_t __cdecl _mbscspn (const unsigned char *, const unsigned char *)
 
_ACRTIMP unsigned char *__cdecl _mbsdec (const unsigned char *, const unsigned char *)
 
_ACRTIMP unsigned char *__cdecl _mbsdup (const unsigned char *)
 
_ACRTIMP int __cdecl _mbsicmp (const unsigned char *, const unsigned char *)
 
_ACRTIMP int __cdecl _mbsicoll (const unsigned char *, const unsigned char *)
 
_ACRTIMP unsigned char *__cdecl _mbsinc (const unsigned char *)
 
_ACRTIMP size_t __cdecl _mbslen (const unsigned char *)
 
_ACRTIMP unsigned char *__cdecl _mbslwr (unsigned char *)
 
_ACRTIMP errno_t __cdecl _mbslwr_s (unsigned char *, size_t)
 
_ACRTIMP unsigned char *__cdecl _mbsnbcat (unsigned char *, const unsigned char *, size_t)
 
_ACRTIMP errno_t __cdecl _mbsnbcat_s (unsigned char *, size_t, const unsigned char *, size_t)
 
_ACRTIMP int __cdecl _mbsnbcmp (const unsigned char *, const unsigned char *, size_t)
 
_ACRTIMP int __cdecl _mbsnbcoll (const unsigned char *, const unsigned char *, size_t)
 
_ACRTIMP size_t __cdecl _mbsnbcnt (const unsigned char *, size_t)
 
_ACRTIMP unsigned char *__cdecl _mbsnbcpy (unsigned char *, const unsigned char *, size_t)
 
_ACRTIMP int __cdecl _mbsnbicmp (const unsigned char *, const unsigned char *, size_t)
 
_ACRTIMP int __cdecl _mbsnbicoll (const unsigned char *, const unsigned char *, size_t)
 
_ACRTIMP unsigned char *__cdecl _mbsnbset (unsigned char *, unsigned int, size_t)
 
_ACRTIMP unsigned char *__cdecl _mbsncat (unsigned char *, const unsigned char *, size_t)
 
_ACRTIMP size_t __cdecl _mbsnccnt (const unsigned char *, size_t)
 
_ACRTIMP int __cdecl _mbsncmp (const unsigned char *, const unsigned char *, size_t)
 
_ACRTIMP int __cdecl _mbsncoll (const unsigned char *, const unsigned char *, size_t)
 
_ACRTIMP unsigned char *__cdecl _mbsncpy (unsigned char *, const unsigned char *, size_t)
 
_ACRTIMP errno_t __cdecl _mbsncpy_s (unsigned char *, size_t, const unsigned char *, size_t)
 
_ACRTIMP errno_t __cdecl _mbsncpy_s_l (unsigned char *, size_t, const unsigned char *, size_t, _locale_t)
 
_ACRTIMP unsigned int __cdecl _mbsnextc (const unsigned char *)
 
_ACRTIMP unsigned int __cdecl _mbsnextc_l (const unsigned char *, _locale_t)
 
_ACRTIMP int __cdecl _mbsnicmp (const unsigned char *, const unsigned char *, size_t)
 
_ACRTIMP int __cdecl _mbsnicoll (const unsigned char *, const unsigned char *, size_t)
 
_ACRTIMP unsigned char *__cdecl _mbsninc (const unsigned char *, size_t)
 
_ACRTIMP unsigned char *__cdecl _mbsnset (unsigned char *, unsigned int, size_t)
 
_ACRTIMP unsigned char *__cdecl _mbspbrk (const unsigned char *, const unsigned char *)
 
_ACRTIMP unsigned char *__cdecl _mbsrchr (const unsigned char *, unsigned int)
 
_ACRTIMP unsigned char *__cdecl _mbsrev (unsigned char *)
 
_ACRTIMP unsigned char *__cdecl _mbsset (unsigned char *, unsigned int)
 
_ACRTIMP size_t __cdecl _mbsspn (const unsigned char *, const unsigned char *)
 
_ACRTIMP unsigned char *__cdecl _mbsspnp (const unsigned char *, const unsigned char *)
 
_ACRTIMP unsigned char *__cdecl _mbsstr (const unsigned char *, const unsigned char *)
 
_ACRTIMP unsigned char *__cdecl _mbstok (unsigned char *, const unsigned char *)
 
_ACRTIMP unsigned char *__cdecl _mbstok_l (unsigned char *, const unsigned char *, _locale_t)
 
_ACRTIMP unsigned char *__cdecl _mbsupr (unsigned char *)
 
_ACRTIMP errno_t __cdecl _mbsupr_s (unsigned char *, size_t)
 
_ACRTIMP int __cdecl _ismbblead (unsigned int)
 
_ACRTIMP int __cdecl _ismbblead_l (unsigned int, _locale_t)
 
_ACRTIMP int __cdecl _ismbbtrail (unsigned int)
 
_ACRTIMP int __cdecl _ismbslead (const unsigned char *, const unsigned char *)
 
_ACRTIMP int __cdecl _ismbstrail (const unsigned char *, const unsigned char *)
 

Macro Definition Documentation

◆ _mbccmp

#define _mbccmp (   _cpc1,
  _cpc2 
)    _mbsncmp((_cpc1),(_cpc2),1)

Definition at line 56 of file mbstring.h.

◆ _MBLEADTRAIL_DEFINED

#define _MBLEADTRAIL_DEFINED

Definition at line 117 of file mbstring.h.

◆ _NLSCMP_DEFINED

#define _NLSCMP_DEFINED

Definition at line 29 of file mbstring.h.

◆ _NLSCMPERROR

#define _NLSCMPERROR   ((unsigned int)0x7fffffff)

Definition at line 28 of file mbstring.h.

Function Documentation

◆ _ismbblead()

_ACRTIMP int __cdecl _ismbblead ( unsigned int  c)

Definition at line 2077 of file mbcs.c.

2078{
2079 return _ismbblead_l(c, NULL);
2080}
#define _ismbblead_l(_c, p)
#define NULL
Definition: types.h:112
const GLubyte * c
Definition: glext.h:8905

◆ _ismbblead_l()

_ACRTIMP int __cdecl _ismbblead_l ( unsigned int  c,
_locale_t  locale 
)

Definition at line 2062 of file mbcs.c.

2063{
2064 pthreadmbcinfo mbcinfo;
2065
2066 if(!locale)
2067 mbcinfo = get_mbcinfo();
2068 else
2069 mbcinfo = locale->mbcinfo;
2070
2071 return (mbcinfo->mbctype[(c&0xff) + 1] & _M1) != 0;
2072}
Definition: _locale.h:75
#define _M1
Definition: mbctype.h:38
pthreadmbcinfo CDECL get_mbcinfo(void)
Definition: locale.c:642
unsigned char mbctype[257]
Definition: msvcrt.h:138

◆ _ismbbtrail()

_ACRTIMP int __cdecl _ismbbtrail ( unsigned int  c)

Definition at line 2100 of file mbcs.c.

2101{
2102 return _ismbbtrail_l(c, NULL);
2103}
#define _ismbbtrail_l(_c, p)

◆ _ismbcalnum()

_ACRTIMP int __cdecl _ismbcalnum ( unsigned int  ch)

Definition at line 1950 of file mbcs.c.

1951{
1952 return _ismbcalnum_l( ch, NULL );
1953}
unsigned char ch[4][2]
Definition: console.c:118
int CDECL _ismbcalnum_l(unsigned int ch, _locale_t locale)
Definition: mbcs.c:1942

◆ _ismbcalpha()

_ACRTIMP int __cdecl _ismbcalpha ( unsigned int  ch)

Definition at line 1879 of file mbcs.c.

1880{
1881 return _ismbcalpha_l( ch, NULL );
1882}
int CDECL _ismbcalpha_l(unsigned int ch, _locale_t locale)
Definition: mbcs.c:1871

◆ _ismbcdigit()

_ACRTIMP int __cdecl _ismbcdigit ( unsigned int  ch)

Definition at line 1847 of file mbcs.c.

1848{
1849 return _ismbcdigit_l( ch, NULL );
1850}
int CDECL _ismbcdigit_l(unsigned int ch, _locale_t locale)
Definition: mbcs.c:1839

◆ _ismbcgraph()

_ACRTIMP int __cdecl _ismbcgraph ( unsigned int  ch)

Definition at line 1863 of file mbcs.c.

1864{
1865 return _ismbcgraph_l( ch, NULL );
1866}
int CDECL _ismbcgraph_l(unsigned int ch, _locale_t locale)
Definition: mbcs.c:1855

◆ _ismbchira()

_ACRTIMP int __cdecl _ismbchira ( unsigned int  c)

Definition at line 2026 of file mbcs.c.

2027{
2028 return _ismbchira_l(c, NULL);
2029}
int CDECL _ismbchira_l(unsigned int c, _locale_t locale)
Definition: mbcs.c:2006

Referenced by _mbctokata().

◆ _ismbckata()

_ACRTIMP int __cdecl _ismbckata ( unsigned int  c)

Definition at line 2054 of file mbcs.c.

2055{
2056 return _ismbckata_l(c, NULL);
2057}
int CDECL _ismbckata_l(unsigned int c, _locale_t locale)
Definition: mbcs.c:2034

Referenced by _mbctohira(), and test_ismbckata().

◆ _ismbcl0()

_ACRTIMP int __cdecl _ismbcl0 ( unsigned int  c)

Definition at line 3551 of file mbcs.c.

3552{
3553 return _ismbcl0_l(c, NULL);
3554}
int CDECL _ismbcl0_l(unsigned int c, _locale_t locale)
Definition: mbcs.c:3530

Referenced by test__ismbclx().

◆ _ismbcl1()

_ACRTIMP int __cdecl _ismbcl1 ( unsigned int  c)

Definition at line 3580 of file mbcs.c.

3581{
3582 return _ismbcl1_l(c, NULL);
3583}
int CDECL _ismbcl1_l(unsigned int c, _locale_t locale)
Definition: mbcs.c:3559

Referenced by test__ismbclx().

◆ _ismbcl2()

_ACRTIMP int __cdecl _ismbcl2 ( unsigned int  c)

Definition at line 3609 of file mbcs.c.

3610{
3611 return _ismbcl2_l(c, NULL);
3612}
int CDECL _ismbcl2_l(unsigned int c, _locale_t locale)
Definition: mbcs.c:3588

Referenced by test__ismbclx().

◆ _ismbclegal()

_ACRTIMP int __cdecl _ismbclegal ( unsigned int  c)

Definition at line 2116 of file mbcs.c.

2117{
2118 return _ismbclegal_l(c, NULL);
2119}
int CDECL _ismbclegal_l(unsigned int c, _locale_t locale)
Definition: mbcs.c:2108

Referenced by _ismbcprint(), _mbcjmstojis(), and test_ismbclegal().

◆ _ismbclegal_l()

_ACRTIMP int __cdecl _ismbclegal_l ( unsigned int  c,
_locale_t  locale 
)

Definition at line 2108 of file mbcs.c.

2109{
2111}
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486

Referenced by _ismbcl0_l(), _ismbcl1_l(), _ismbcl2_l(), _ismbclegal(), _mbcjmstojis_l(), and int().

◆ _ismbclower()

_ACRTIMP int __cdecl _ismbclower ( unsigned int  ch)

Definition at line 1895 of file mbcs.c.

1896{
1897 return _ismbclower_l( ch, NULL );
1898}
int CDECL _ismbclower_l(unsigned int ch, _locale_t locale)
Definition: mbcs.c:1887

Referenced by _ismbcalpha(), and _mbctoupper().

◆ _ismbcprint()

_ACRTIMP int __cdecl _ismbcprint ( unsigned int  ch)

Definition at line 1982 of file mbcs.c.

1983{
1984 return _ismbcprint_l( ch, NULL );
1985}
int CDECL _ismbcprint_l(unsigned int ch, _locale_t locale)
Definition: mbcs.c:1974

◆ _ismbcpunct()

_ACRTIMP int __cdecl _ismbcpunct ( unsigned int  ch)

Definition at line 1998 of file mbcs.c.

1999{
2000 return _ismbcpunct_l( ch, NULL );
2001}
int CDECL _ismbcpunct_l(unsigned int ch, _locale_t locale)
Definition: mbcs.c:1990

◆ _ismbcspace()

_ACRTIMP int __cdecl _ismbcspace ( unsigned int  ch)

Definition at line 1966 of file mbcs.c.

1967{
1968 return _ismbcspace_l( ch, NULL );
1969}
int CDECL _ismbcspace_l(unsigned int ch, _locale_t locale)
Definition: mbcs.c:1958

◆ _ismbcsymbol()

_ACRTIMP int __cdecl _ismbcsymbol ( unsigned int  ch)

Definition at line 1934 of file mbcs.c.

1935{
1936 return _ismbcsymbol_l(ch, NULL);
1937}
int CDECL _ismbcsymbol_l(unsigned int ch, _locale_t locale)
Definition: mbcs.c:1919

◆ _ismbcupper()

_ACRTIMP int __cdecl _ismbcupper ( unsigned int  ch)

Definition at line 1911 of file mbcs.c.

1912{
1913 return _ismbcupper_l( ch, NULL );
1914}
int CDECL _ismbcupper_l(unsigned int ch, _locale_t locale)
Definition: mbcs.c:1903

Referenced by _ismbcalpha(), and _mbctolower().

◆ _ismbslead()

_ACRTIMP int __cdecl _ismbslead ( const unsigned char start,
const unsigned char str 
)

Definition at line 2156 of file mbcs.c.

2157{
2158 return _ismbslead_l(start, str, NULL);
2159}
GLuint start
Definition: gl.h:1545
int CDECL _ismbslead_l(const unsigned char *start, const unsigned char *str, _locale_t locale)
Definition: mbcs.c:2124
const WCHAR * str

◆ _ismbstrail()

_ACRTIMP int __cdecl _ismbstrail ( const unsigned char start,
const unsigned char str 
)

Definition at line 2179 of file mbcs.c.

2180{
2181 return _ismbstrail_l(start, str, NULL);
2182}
int CDECL _ismbstrail_l(const unsigned char *start, const unsigned char *str, _locale_t locale)
Definition: mbcs.c:2164

◆ _mbbtombc()

Definition at line 1803 of file mbcs.c.

1804{
1805 return _mbbtombc_l(c, NULL);
1806}
unsigned int CDECL _mbbtombc_l(unsigned int c, _locale_t locale)
Definition: mbcs.c:1773

Referenced by test_mbbtombc().

◆ _mbbtype()

_ACRTIMP int __cdecl _mbbtype ( unsigned char  c,
int  type 
)

Definition at line 2232 of file mbcs.c.

2233{
2234 return _mbbtype_l(c, type, NULL);
2235}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
int CDECL _mbbtype_l(unsigned char c, int type, _locale_t locale)
Definition: mbcs.c:2220

Referenced by test__mbbtype(), and test__mbbtype_l().

◆ _mbbtype_l()

_ACRTIMP int __cdecl _mbbtype_l ( unsigned char  c,
int  type,
_locale_t  locale 
)

Definition at line 2220 of file mbcs.c.

2221{
2222 if (type == 1)
2224 else
2225 return _ismbblead_l(c, locale) ? _MBC_LEAD
2227}
#define _MBC_TRAIL
Definition: mbctype.h:46
#define _MBC_SINGLE
Definition: mbctype.h:44
#define _MBC_LEAD
Definition: mbctype.h:45
#define _MBC_ILLEGAL
Definition: mbctype.h:47
#define _isprint_l(_Char, _Locale)
Definition: ctype.h:651

Referenced by _mbbtype(), _mbsbtype_l(), and test__mbbtype_l().

◆ _mbccpy()

_ACRTIMP void __cdecl _mbccpy ( unsigned char dest,
const unsigned char src 
)

Definition at line 829 of file mbcs.c.

830{
832}
GLenum src
Definition: glext.h:6340
int CDECL _mbccpy_s_l(unsigned char *dest, size_t maxsize, int *copied, const unsigned char *src, _locale_t locale)
Definition: mbcs.c:795
static char * dest
Definition: rtl.c:135

Referenced by test_mbcp().

◆ _mbcjistojms()

_ACRTIMP unsigned int __cdecl _mbcjistojms ( unsigned int  c)

Definition at line 629 of file mbcs.c.

630{
631 return _mbcjistojms_l(c, NULL);
632}
unsigned int CDECL _mbcjistojms_l(unsigned int c, _locale_t locale)
Definition: mbcs.c:590

Referenced by test_mbcjisjms().

◆ _mbcjmstojis()

_ACRTIMP unsigned int __cdecl _mbcjmstojis ( unsigned int  c)

Definition at line 677 of file mbcs.c.

678{
679 return _mbcjmstojis_l(c, NULL);
680}
unsigned int CDECL _mbcjmstojis_l(unsigned int c, _locale_t locale)
Definition: mbcs.c:639

Referenced by test_mbcjmsjis().

◆ _mbclen()

_ACRTIMP size_t __cdecl _mbclen ( const unsigned char str)

Definition at line 693 of file mbcs.c.

694{
695 return _mbclen_l(str, NULL);
696}
size_t CDECL _mbclen_l(const unsigned char *str, _locale_t locale)
Definition: mbcs.c:685

Referenced by test_mbcp().

◆ _mbctohira()

_ACRTIMP unsigned int __cdecl _mbctohira ( unsigned int  c)

Definition at line 3501 of file mbcs.c.

3502{
3503 return _mbctohira_l(c, NULL);
3504}
unsigned int CDECL _mbctohira_l(unsigned int c, _locale_t locale)
Definition: mbcs.c:3491

Referenced by test_mbctohira().

◆ _mbctokata()

_ACRTIMP unsigned int __cdecl _mbctokata ( unsigned int  c)

Definition at line 3522 of file mbcs.c.

3523{
3524 return _mbctokata_l(c, NULL);
3525}
unsigned int CDECL _mbctokata_l(unsigned int c, _locale_t locale)
Definition: mbcs.c:3511

Referenced by test_mbctokata().

◆ _mbctolower()

_ACRTIMP unsigned int __cdecl _mbctolower ( unsigned int  c)

Definition at line 493 of file mbcs.c.

494{
495 return _mbctolower_l(c, NULL);
496}
unsigned int CDECL _mbctolower_l(unsigned int c, _locale_t locale)
Definition: mbcs.c:458

Referenced by _mbslwr().

◆ _mbctombb()

Definition at line 578 of file mbcs.c.

579{
580 return _mbctombb_l(c, NULL);
581}
unsigned int CDECL _mbctombb_l(unsigned int c, _locale_t locale)
Definition: mbcs.c:544

Referenced by test_mbctombb().

◆ _mbctoupper()

_ACRTIMP unsigned int __cdecl _mbctoupper ( unsigned int  c)

Definition at line 536 of file mbcs.c.

537{
538 return _mbctoupper_l(c, NULL);
539}
unsigned int CDECL _mbctoupper_l(unsigned int c, _locale_t locale)
Definition: mbcs.c:501

Referenced by _mbsicmp(), and _mbsicoll().

◆ _mbsbtype()

_ACRTIMP int __cdecl _mbsbtype ( const unsigned char str,
size_t  count 
)

Definition at line 2284 of file mbcs.c.

2285{
2286 return _mbsbtype_l(str, count, NULL);
2287}
GLuint GLuint GLsizei count
Definition: gl.h:1545
int CDECL _mbsbtype_l(const unsigned char *str, size_t count, _locale_t locale)
Definition: mbcs.c:2240

Referenced by test_mbcp().

◆ _mbscat()

_ACRTIMP unsigned char *__cdecl _mbscat ( unsigned char dst,
const unsigned char src 
)

Definition at line 1540 of file mbcs.c.

1541{
1542 strcat( (char *)dst, (const char *)src );
1543 return dst;
1544}
GLenum GLenum dst
Definition: glext.h:6340
strcat
Definition: string.h:92

◆ _mbschr()

Definition at line 1646 of file mbcs.c.

1647{
1648 return _mbschr_l(s, x, NULL);
1649}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLdouble s
Definition: gl.h:2039
unsigned char *CDECL _mbschr_l(const unsigned char *s, unsigned int x, _locale_t locale)
Definition: mbcs.c:1616

Referenced by _mbscspn(), _mbsspn(), _mbsspnp(), and _mbstok_s_l().

◆ _mbscmp()

_ACRTIMP int __cdecl _mbscmp ( const unsigned char str,
const unsigned char cmp 
)

Definition at line 1171 of file mbcs.c.

1172{
1173 return _mbscmp_l(str, cmp, NULL);
1174}
int CDECL _mbscmp_l(const unsigned char *str, const unsigned char *cmp, _locale_t locale)
Definition: mbcs.c:1140
#define cmp(status, error)
Definition: error.c:114

Referenced by test__mbscmp().

◆ _mbscmp_l()

_ACRTIMP int __cdecl _mbscmp_l ( const unsigned char str,
const unsigned char cmp,
_locale_t  locale 
)

Definition at line 1140 of file mbcs.c.

1141{
1142 pthreadmbcinfo mbcinfo;
1143
1144 if (!MSVCRT_CHECK_PMT(str && cmp))
1145 return _NLSCMPERROR;
1146
1147 mbcinfo = locale ? locale->mbcinfo : get_mbcinfo();
1148
1149 if(mbcinfo->ismbcodepage)
1150 {
1151 unsigned int strc, cmpc;
1152 do {
1153 if(!*str)
1154 return *cmp ? -1 : 0;
1155 if(!*cmp)
1156 return 1;
1157 strc = _mbsnextc_l(str, locale);
1158 cmpc = _mbsnextc_l(cmp, locale);
1159 if(strc != cmpc)
1160 return strc < cmpc ? -1 : 1;
1161 str +=(strc > 255) ? 2 : 1;
1162 cmp +=(strc > 255) ? 2 : 1; /* equal, use same increment */
1163 } while(1);
1164 }
1165 return u_strcmp(str, cmp); /* ASCII CP */
1166}
#define _NLSCMPERROR
Definition: mbstring.h:28
#define MSVCRT_CHECK_PMT(x)
Definition: msvcrt.h:378
static int u_strcmp(const unsigned char *s1, const unsigned char *s2)
Definition: mbcs.c:128
unsigned int CDECL _mbsnextc_l(const unsigned char *str, _locale_t locale)
Definition: mbcs.c:440

Referenced by _mbscmp().

◆ _mbscoll()

_ACRTIMP int __cdecl _mbscoll ( const unsigned char str,
const unsigned char cmp 
)

Definition at line 1262 of file mbcs.c.

1263{
1264#if _MSVCR_VER>=60 && _MSVCR_VER<=71
1265 return CompareStringA(get_mbcinfo()->mblcid, 0,
1266 (const char*)str, -1, (const char*)cmp, -1)-CSTR_EQUAL;
1267#else
1268 return _mbsnbcoll_l(str, cmp, INT_MAX, NULL);
1269#endif
1270}
INT WINAPI CompareStringA(LCID lcid, DWORD flags, LPCSTR str1, INT len1, LPCSTR str2, INT len2)
Definition: locale.c:4086
#define INT_MAX
Definition: limits.h:26
int CDECL _mbsnbcoll_l(const unsigned char *str1, const unsigned char *str2, size_t len, _locale_t locale)
Definition: mbcs.c:1227
#define CSTR_EQUAL
Definition: winnls.h:500

◆ _mbscpy()

_ACRTIMP unsigned char *__cdecl _mbscpy ( unsigned char dst,
const unsigned char src 
)

Definition at line 1599 of file mbcs.c.

1600{
1601 strcpy( (char *)dst, (const char *)src );
1602 return dst;
1603}
strcpy
Definition: string.h:131

Referenced by _mbsdup().

◆ _mbscspn()

_ACRTIMP size_t __cdecl _mbscspn ( const unsigned char str,
const unsigned char cmp 
)

Definition at line 2963 of file mbcs.c.

2964{
2965 return _mbscspn_l(str, cmp, NULL);
2966}
size_t CDECL _mbscspn_l(const unsigned char *str, const unsigned char *cmp, _locale_t locale)
Definition: mbcs.c:2935

Referenced by test_mbsspn().

◆ _mbsdec()

_ACRTIMP unsigned char *__cdecl _mbsdec ( const unsigned char start,
const unsigned char cur 
)

Definition at line 2211 of file mbcs.c.

2212{
2213 return _mbsdec_l(start, cur, NULL);
2214}
FxCollectionEntry * cur
unsigned char *CDECL _mbsdec_l(const unsigned char *start, const unsigned char *cur, _locale_t locale)
Definition: mbcs.c:2187

Referenced by previous_character().

◆ _mbsdup()

Definition at line 19 of file mbsdup.c.

20{
21 unsigned char *rv;
22 if (_s == 0)
23 return 0;
24 rv = (unsigned char *)malloc(_mbslen(_s) + 1);
25 if (rv == 0)
26 return 0;
27 _mbscpy(rv, _s);
28 return rv;
29}
#define malloc
Definition: debug_ros.c:4
_ACRTIMP size_t __cdecl _mbslen(const unsigned char *)
Definition: mbcs.c:771
_ACRTIMP unsigned char *__cdecl _mbscpy(unsigned char *, const unsigned char *)
Definition: mbcs.c:1599

◆ _mbsicmp()

_ACRTIMP int __cdecl _mbsicmp ( const unsigned char str,
const unsigned char cmp 
)

Definition at line 1308 of file mbcs.c.

1309{
1310 return _mbsicmp_l(str, cmp, NULL);
1311}
int CDECL _mbsicmp_l(const unsigned char *str, const unsigned char *cmp, _locale_t locale)
Definition: mbcs.c:1275

◆ _mbsicoll()

_ACRTIMP int __cdecl _mbsicoll ( const unsigned char str,
const unsigned char cmp 
)

Definition at line 1214 of file mbcs.c.

1215{
1216#if _MSVCR_VER>=60 && _MSVCR_VER<=71
1217 return CompareStringA(get_mbcinfo()->mblcid, NORM_IGNORECASE,
1218 (const char*)str, -1, (const char*)cmp, -1)-CSTR_EQUAL;
1219#else
1220 return _mbsnbicoll_l(str, cmp, INT_MAX, NULL);
1221#endif
1222}
int CDECL _mbsnbicoll_l(const unsigned char *str1, const unsigned char *str2, size_t len, _locale_t locale)
Definition: mbcs.c:1179
#define NORM_IGNORECASE
Definition: winnls.h:187

◆ _mbsinc()

Definition at line 709 of file mbcs.c.

710{
711 return _mbsinc_l(str, NULL);
712}
unsigned char *CDECL _mbsinc_l(const unsigned char *str, _locale_t locale)
Definition: mbcs.c:701

Referenced by _mbscspn(), _mbsspn(), _mbsspnp(), _mbsstr(), _mbstok(), _mbsupr(), and test_mbcp().

◆ _mbslen()

_ACRTIMP size_t __cdecl _mbslen ( const unsigned char str)

Definition at line 771 of file mbcs.c.

772{
773 return _mbsnlen_l(str, -1, NULL);
774}
size_t CDECL _mbsnlen_l(const unsigned char *str, size_t maxsize, _locale_t locale)
Definition: mbcs.c:740

Referenced by _mbsdup(), _mbsnbcat(), _mbsstr(), and test_mbcp().

◆ _mbslwr()

Definition at line 2712 of file mbcs.c.

2713{
2714 return _mbslwr_l(s, NULL);
2715}
unsigned char *CDECL _mbslwr_l(unsigned char *s, _locale_t locale)
Definition: mbcs.c:2673

◆ _mbslwr_s()

_ACRTIMP errno_t __cdecl _mbslwr_s ( unsigned char str,
size_t  len 
)

Definition at line 2768 of file mbcs.c.

2769{
2770 return _mbslwr_s_l(str, len, NULL);
2771}
GLenum GLsizei len
Definition: glext.h:6722
int CDECL _mbslwr_s_l(unsigned char *s, size_t len, _locale_t locale)
Definition: mbcs.c:2720

◆ _mbsnbcat()

_ACRTIMP unsigned char *__cdecl _mbsnbcat ( unsigned char dst,
const unsigned char src,
size_t  len 
)

Definition at line 2554 of file mbcs.c.

2555{
2556 return _mbsnbcat_l(dst, src, len, NULL);
2557}
unsigned char *CDECL _mbsnbcat_l(unsigned char *dst, const unsigned char *src, size_t len, _locale_t locale)
Definition: mbcs.c:2512

◆ _mbsnbcat_s()

_ACRTIMP errno_t __cdecl _mbsnbcat_s ( unsigned char dst,
size_t  size,
const unsigned char src,
size_t  len 
)

Definition at line 2619 of file mbcs.c.

2620{
2621 return _mbsnbcat_s_l(dst, size, src, len, NULL);
2622}
GLsizeiptr size
Definition: glext.h:5919
int CDECL _mbsnbcat_s_l(unsigned char *dst, size_t size, const unsigned char *src, size_t len, _locale_t locale)
Definition: mbcs.c:2562

◆ _mbsnbcmp()

_ACRTIMP int __cdecl _mbsnbcmp ( const unsigned char str,
const unsigned char cmp,
size_t  len 
)

Definition at line 1419 of file mbcs.c.

1420{
1421 return _mbsnbcmp_l(str, cmp, len, NULL);
1422}
int CDECL _mbsnbcmp_l(const unsigned char *str, const unsigned char *cmp, size_t len, _locale_t locale)
Definition: mbcs.c:1366

◆ _mbsnbcnt()

_ACRTIMP size_t __cdecl _mbsnbcnt ( const unsigned char str,
size_t  len 
)

Definition at line 2504 of file mbcs.c.

2505{
2506 return _mbsnbcnt_l(str, len, NULL);
2507}
size_t CDECL _mbsnbcnt_l(const unsigned char *str, size_t len, _locale_t locale)
Definition: mbcs.c:2472

◆ _mbsnbcoll()

_ACRTIMP int __cdecl _mbsnbcoll ( const unsigned char str1,
const unsigned char str2,
size_t  len 
)

Definition at line 1254 of file mbcs.c.

1255{
1256 return _mbsnbcoll_l(str1, str2, len, NULL);
1257}

◆ _mbsnbcpy()

_ACRTIMP unsigned char *__cdecl _mbsnbcpy ( unsigned char dst,
const unsigned char src,
size_t  n 
)

Definition at line 1132 of file mbcs.c.

1133{
1134 return _mbsnbcpy_l(dst, src, n, NULL);
1135}
GLdouble n
Definition: glext.h:7729
unsigned char *CDECL _mbsnbcpy_l(unsigned char *dst, const unsigned char *src, size_t n, _locale_t locale)
Definition: mbcs.c:1088

Referenced by test_mbcp().

◆ _mbsnbicmp()

_ACRTIMP int __cdecl _mbsnbicmp ( const unsigned char str,
const unsigned char cmp,
size_t  len 
)

Definition at line 1532 of file mbcs.c.

1533{
1534 return _mbsnbicmp_l(str, cmp, len, NULL);
1535}
int CDECL _mbsnbicmp_l(const unsigned char *str, const unsigned char *cmp, size_t len, _locale_t locale)
Definition: mbcs.c:1477

◆ _mbsnbicoll()

_ACRTIMP int __cdecl _mbsnbicoll ( const unsigned char str1,
const unsigned char str2,
size_t  len 
)

Definition at line 1206 of file mbcs.c.

1207{
1208 return _mbsnbicoll_l(str1, str2, len, NULL);
1209}

◆ _mbsnbset()

_ACRTIMP unsigned char *__cdecl _mbsnbset ( unsigned char str,
unsigned int  c,
size_t  len 
)

Definition at line 2372 of file mbcs.c.

2373{
2374 return _mbsnbset_l(str, c, len, NULL);
2375}
unsigned char *CDECL _mbsnbset_l(unsigned char *str, unsigned int c, size_t len, _locale_t locale)
Definition: mbcs.c:2333

◆ _mbsncat()

_ACRTIMP unsigned char *__cdecl _mbsncat ( unsigned char dst,
const unsigned char src,
size_t  len 
)

Definition at line 2665 of file mbcs.c.

2666{
2667 return _mbsncat_l(dst, src, len, NULL);
2668}
unsigned char *CDECL _mbsncat_l(unsigned char *dst, const unsigned char *src, size_t len, _locale_t locale)
Definition: mbcs.c:2627

◆ _mbsnccnt()

_ACRTIMP size_t __cdecl _mbsnccnt ( const unsigned char str,
size_t  len 
)

Definition at line 2463 of file mbcs.c.

2464{
2465 return _mbsnccnt_l(str, len, NULL);
2466}
size_t CDECL _mbsnccnt_l(const unsigned char *str, size_t len, _locale_t locale)
Definition: mbcs.c:2423

◆ _mbsncmp()

_ACRTIMP int __cdecl _mbsncmp ( const unsigned char str,
const unsigned char cmp,
size_t  len 
)

Definition at line 1358 of file mbcs.c.

1359{
1360 return _mbsncmp_l(str, cmp, len, NULL);
1361}
int CDECL _mbsncmp_l(const unsigned char *str, const unsigned char *cmp, size_t len, _locale_t locale)
Definition: mbcs.c:1316

Referenced by _mbsstr(), and START_TEST().

◆ _mbsncoll()

_ACRTIMP int __cdecl _mbsncoll ( const unsigned char str1,
const unsigned char str2,
size_t  n 
)

Definition at line 21 of file mbsncoll.c.

22{
23 unsigned char *s1 = (unsigned char *)str1;
24 unsigned char *s2 = (unsigned char *)str2;
25
26 unsigned short *short_s1, *short_s2;
27
28 int l1, l2;
29
30 if (n == 0)
31 return 0;
32 do {
33
34 if (*s1 == 0)
35 break;
36
37 l1 = _ismbblead(*s1);
38 l2 = _ismbblead(*s2);
39 if ( !l1 && !l2 ) {
40
41 if (*s1 != *s2)
42 return colldif(*s1, *s2);
43 else {
44 s1 += 1;
45 s2 += 1;
46 n--;
47 }
48 }
49 else if ( l1 && l2 ){
50 short_s1 = (unsigned short *)s1;
51 short_s2 = (unsigned short *)s2;
52 if ( *short_s1 != *short_s2 )
53 return colldif(*short_s1, *short_s2);
54 else {
55 s1 += 2;
56 s2 += 2;
57 n--;
58
59 }
60 }
61 else
62 return colldif(*s1, *s2);
63 } while (n > 0);
64 return 0;
65}
_ACRTIMP int __cdecl _ismbblead(unsigned int)
Definition: mbcs.c:2077
int colldif(unsigned short c1, unsigned short c2)
Definition: mbsncoll.c:13
struct S1 s1
PCWSTR s2
Definition: shell32_main.h:38

◆ _mbsncpy()

_ACRTIMP unsigned char *__cdecl _mbsncpy ( unsigned char dst,
const unsigned char src,
size_t  n 
)

Definition at line 986 of file mbcs.c.

987{
988 return _mbsncpy_l(dst, src, n, NULL);
989}
unsigned char *CDECL _mbsncpy_l(unsigned char *dst, const unsigned char *src, size_t n, _locale_t locale)
Definition: mbcs.c:859

Referenced by test_mbcp().

◆ _mbsncpy_s()

_ACRTIMP errno_t __cdecl _mbsncpy_s ( unsigned char ,
size_t  ,
const unsigned char ,
size_t   
)

Referenced by test__mbsncpy_s().

◆ _mbsncpy_s_l()

_ACRTIMP errno_t __cdecl _mbsncpy_s_l ( unsigned char ,
size_t  ,
const unsigned char ,
size_t  ,
_locale_t   
)

◆ _mbsnextc()

_ACRTIMP unsigned int __cdecl _mbsnextc ( const unsigned char str)

Definition at line 450 of file mbcs.c.

451{
452 return _mbsnextc_l(str, NULL);
453}

Referenced by _mbscspn(), _mbsrchr(), _mbsspn(), _mbsspnp(), _mbstok_s_l(), _mbsupr(), and test_mbcp().

◆ _mbsnextc_l()

_ACRTIMP unsigned int __cdecl _mbsnextc_l ( const unsigned char str,
_locale_t  locale 
)

Definition at line 440 of file mbcs.c.

441{
442 if(_ismbblead_l(*str, locale))
443 return *str << 8 | str[1];
444 return *str;
445}

Referenced by _mbschr_l(), _mbscmp_l(), _mbsicmp_l(), _mbslwr_l(), _mbslwr_s_l(), _mbsnbcmp_l(), _mbsnbicmp_l(), _mbsncmp_l(), _mbsnextc(), _mbsnicmp_l(), _mbsrchr_l(), _mbsupr_l(), _mbsupr_s_l(), and int().

◆ _mbsnicmp()

_ACRTIMP int __cdecl _mbsnicmp ( const unsigned char str,
const unsigned char cmp,
size_t  len 
)

Definition at line 1469 of file mbcs.c.

1470{
1471 return _mbsnicmp_l(str, cmp, len, NULL);
1472}
int CDECL _mbsnicmp_l(const unsigned char *str, const unsigned char *cmp, size_t len, _locale_t locale)
Definition: mbcs.c:1429

◆ _mbsnicoll()

_ACRTIMP int __cdecl _mbsnicoll ( const unsigned char s1,
const unsigned char s2,
size_t  n 
)

Definition at line 8 of file mbsnicoll.c.

9{
10 WARN("_mbsnicoll unimplemented\n");
11 return 0;
12}
#define WARN(fmt,...)
Definition: precomp.h:61

◆ _mbsninc()

_ACRTIMP unsigned char *__cdecl _mbsninc ( const unsigned char str,
size_t  num 
)

Definition at line 717 of file mbcs.c.

718{
719 if(!str)
720 return NULL;
721
722 while (num > 0 && *str)
723 {
724 if (_ismbblead(*str))
725 {
726 if (!*(str+1))
727 break;
728 str++;
729 }
730 str++;
731 num--;
732 }
733
734 return (unsigned char*)str;
735}
GLuint GLuint num
Definition: glext.h:9618
int CDECL _ismbblead(unsigned int c)
Definition: mbcs.c:2077

Referenced by test_mbcp().

◆ _mbsnset()

_ACRTIMP unsigned char *__cdecl _mbsnset ( unsigned char str,
unsigned int  c,
size_t  len 
)

Definition at line 2414 of file mbcs.c.

2415{
2416 return _mbsnset_l(str, c, len, NULL);
2417}
unsigned char *CDECL _mbsnset_l(unsigned char *str, unsigned int c, size_t len, _locale_t locale)
Definition: mbcs.c:2380

◆ _mbspbrk()

_ACRTIMP unsigned char *__cdecl _mbspbrk ( const unsigned char str,
const unsigned char accept 
)

Definition at line 3052 of file mbcs.c.

3053{
3054 return _mbspbrk_l(str, accept, NULL);
3055}
unsigned char *CDECL _mbspbrk_l(const unsigned char *str, const unsigned char *accept, _locale_t locale)
Definition: mbcs.c:3019
SOCKET WSAAPI accept(IN SOCKET s, OUT LPSOCKADDR addr, OUT INT FAR *addrlen)
Definition: socklife.c:23

◆ _mbsrchr()

_ACRTIMP unsigned char *__cdecl _mbsrchr ( const unsigned char s,
unsigned int  x 
)

Definition at line 1687 of file mbcs.c.

1688{
1689 return _mbsrchr_l(s, x, NULL);
1690}
unsigned char *CDECL _mbsrchr_l(const unsigned char *s, unsigned int x, _locale_t locale)
Definition: mbcs.c:1654

Referenced by __crt_stdio_path_requires_backslash().

◆ _mbsrev()

_ACRTIMP unsigned char *__cdecl _mbsrev ( unsigned char str)

Definition at line 3011 of file mbcs.c.

3012{
3013 return _mbsrev_l(str, NULL);
3014}
unsigned char *CDECL _mbsrev_l(unsigned char *str, _locale_t locale)
Definition: mbcs.c:2971

Referenced by test_mbsrev().

◆ _mbsset()

_ACRTIMP unsigned char *__cdecl _mbsset ( unsigned char str,
unsigned int  c 
)

Definition at line 2325 of file mbcs.c.

2326{
2327 return _mbsset_l(str, c, NULL);
2328}
unsigned char *CDECL _mbsset_l(unsigned char *str, unsigned int c, _locale_t locale)
Definition: mbcs.c:2293

◆ _mbsspn()

_ACRTIMP size_t __cdecl _mbsspn ( const unsigned char string,
const unsigned char set 
)

Definition at line 2907 of file mbcs.c.

2908{
2909 return _mbsspn_l(string, set, NULL);
2910}
Definition: _set.h:50
size_t CDECL _mbsspn_l(const unsigned char *string, const unsigned char *set, _locale_t locale)
Definition: mbcs.c:2870

Referenced by test_mbsspn().

◆ _mbsspnp()

_ACRTIMP unsigned char *__cdecl _mbsspnp ( const unsigned char string,
const unsigned char set 
)

Definition at line 2927 of file mbcs.c.

2928{
2929 return _mbsspnp_l(string, set, NULL);
2930}
unsigned char *CDECL _mbsspnp_l(const unsigned char *string, const unsigned char *set, _locale_t locale)
Definition: mbcs.c:2915

Referenced by test_mbsspnp().

◆ _mbsstr()

_ACRTIMP unsigned char *__cdecl _mbsstr ( const unsigned char haystack,
const unsigned char needle 
)

Definition at line 1608 of file mbcs.c.

1609{
1610 return (unsigned char *)strstr( (const char *)haystack, (const char *)needle );
1611}
_ACRTIMP char *__cdecl strstr(const char *, const char *)
Definition: string.c:3415
static const char haystack[]
Definition: editor.c:190

Referenced by START_TEST().

◆ _mbstok()

_ACRTIMP unsigned char *__cdecl _mbstok ( unsigned char str,
const unsigned char delim 
)

Definition at line 1758 of file mbcs.c.

1759{
1761
1762#if _MSVCR_VER == 0
1763 if(!str && !data->mbstok_next)
1764 return NULL;
1765#endif
1766
1767 return _mbstok_s_l(str, delim, &data->mbstok_next, NULL);
1768}
thread_data_t *CDECL msvcrt_get_thread_data(void)
Definition: thread.c:45
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
unsigned char *CDECL _mbstok_s_l(unsigned char *str, const unsigned char *delim, unsigned char **ctx, _locale_t locale)
Definition: mbcs.c:1695

Referenced by test__mbstok().

◆ _mbstok_l()

_ACRTIMP unsigned char *__cdecl _mbstok_l ( unsigned char str,
const unsigned char delim,
_locale_t  locale 
)

Definition at line 1749 of file mbcs.c.

1751{
1752 return _mbstok_s_l(str, delim, &msvcrt_get_thread_data()->mbstok_next, locale);
1753}

Referenced by _mbstok().

◆ _mbsupr()

Definition at line 2812 of file mbcs.c.

2813{
2814 return _mbsupr_l(s, NULL);
2815}
unsigned char *CDECL _mbsupr_l(unsigned char *s, _locale_t locale)
Definition: mbcs.c:2776

◆ _mbsupr_s()

_ACRTIMP errno_t __cdecl _mbsupr_s ( unsigned char s,
size_t  len 
)

Definition at line 2862 of file mbcs.c.

2863{
2864 return _mbsupr_s_l(s, len, NULL);
2865}
int CDECL _mbsupr_s_l(unsigned char *s, size_t len, _locale_t locale)
Definition: mbcs.c:2820