ReactOS  0.4.14-dev-854-gb9426a3
mbstowcs.c
Go to the documentation of this file.
1 #include <precomp.h>
2 
3 /*********************************************************************
4  * _mbstowcs_l
5  */
6 size_t CDECL _mbstowcs_l(wchar_t *wcstr, const char *mbstr,
7  size_t count, _locale_t locale)
8 {
10  size_t i, size;
11 
12  if(!locale)
13  locinfo = get_locinfo();
14  else
15  locinfo = ((MSVCRT__locale_t)locale)->locinfo;
16 
17  /* Ignore count parameter */
18  if(!wcstr)
19  return MultiByteToWideChar(locinfo->lc_codepage, 0, mbstr, -1, NULL, 0)-1;
20 
21  for(i=0, size=0; i<count; i++) {
22  if(mbstr[size] == '\0')
23  break;
24 
25  size += (_isleadbyte_l((unsigned char)mbstr[size], locale) ? 2 : 1);
26  }
27 
28  size = MultiByteToWideChar(locinfo->lc_codepage, 0,
29  mbstr, size, wcstr, count);
30 
31  if(size<count && wcstr)
32  wcstr[size] = '\0';
33 
34  return size;
35 }
36 
37 /*
38  * @implemented
39  */
40 size_t mbstowcs (wchar_t *widechar, const char *multibyte, size_t number)
41 {
42  return _mbstowcs_l(widechar, multibyte, number, NULL);
43 }
struct MSVCRT_localeinfo_struct * MSVCRT__locale_t
size_t CDECL _mbstowcs_l(wchar_t *wcstr, const char *mbstr, size_t count, _locale_t locale)
Definition: mbstowcs.c:6
GLuint GLuint GLsizei count
Definition: gl.h:1545
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
Definition: _locale.h:75
static size_t double number
Definition: printf.c:69
smooth NULL
Definition: ftsmooth.c:416
#define get_locinfo()
Definition: winesup.h:25
GLsizeiptr size
Definition: glext.h:5919
else locinfo
Definition: scanf.h:159
#define CDECL
Definition: compat.h:21
#define MultiByteToWideChar
Definition: compat.h:100
size_t mbstowcs(wchar_t *widechar, const char *multibyte, size_t number)
Definition: mbstowcs.c:40
_Check_return_ _CRTIMP int __cdecl _isleadbyte_l(_In_ int _C, _In_opt_ _locale_t _Locale)