2 * CRTDLL multi-byte string functions
4 * Copyright 1999 Alexandre Julliard
10 DEFAULT_DEBUG_CHANNEL(crtdll);
13 /*********************************************************************
14 * _mbsicmp (CRTDLL.204)
16 int __cdecl CRTDLL__mbsicmp(unsigned char *x,unsigned char *y)
23 /* FIXME: MBCS handling... */
32 /*********************************************************************
33 * CRTDLL__mbsinc (CRTDLL.205)
35 LPSTR __cdecl CRTDLL__mbsinc( LPCSTR str )
37 if (IsDBCSLeadByte( *str )) str++;
38 return (LPSTR)(str + 1);
42 /*********************************************************************
43 * CRTDLL__mbslen (CRTDLL.206)
45 INT __cdecl CRTDLL__mbslen( LPCSTR str )
48 for (len = 0; *str; len++, str++) if (IsDBCSLeadByte(str[0]) && str[1]) str++;
54 /*********************************************************************
55 * _mbsrchr (CRTDLL.223)
57 LPSTR __cdecl CRTDLL__mbsrchr(LPSTR s,CHAR x)
59 /* FIXME: handle multibyte strings */
64 /*********************************************************************
65 * CRTDLL_mbtowc (CRTDLL.430)
67 INT __cdecl CRTDLL_mbtowc( WCHAR *dst, LPCSTR str, INT n )
71 if (!MultiByteToWideChar( CP_ACP, 0, str, n, dst, 1 )) return 0;
72 /* return the number of bytes from src that have been used */
74 if (n >= 2 && IsDBCSLeadByte(*str) && str[1]) return 2;
79 /*********************************************************************
82 * Copy one multibyte character to another
84 VOID __cdecl CRTDLL__mbccpy(LPSTR dest, LPSTR src)
86 FIXME("MBCS copy treated as ASCII\n");