mirror of
https://github.com/reactos/reactos.git
synced 2025-07-26 01:13:53 +00:00

- TSVN choked repeatedly when attempting to merge ~9000 revs into the branch (tried 3 times on 2 different computers) - If someone wants to delete aicom-network-fixes, they are welcome to - Lesson learned: Letting a branch get thousands of revs out of date is a horrible idea svn path=/branches/aicom-network-branch/; revision=44353
45 lines
812 B
C
45 lines
812 B
C
/*
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
* PROJECT: ReactOS system libraries
|
|
* FILE: lib/crt/??????
|
|
* PURPOSE: Unknown
|
|
* PROGRAMER: Unknown
|
|
* UPDATE HISTORY:
|
|
* 25/11/05: Added license header
|
|
*/
|
|
|
|
#include <precomp.h>
|
|
|
|
|
|
/*
|
|
* @implemented
|
|
*/
|
|
|
|
int mbtowc (wchar_t *charptr, const char *address, size_t number)
|
|
{
|
|
int bytes;
|
|
|
|
if (address == 0)
|
|
return 0;
|
|
|
|
if ((bytes = mblen (address, number)) < 0)
|
|
return bytes;
|
|
|
|
if (charptr) {
|
|
switch (bytes) {
|
|
case 0:
|
|
if (number > 0)
|
|
*charptr = (wchar_t) '\0';
|
|
break;
|
|
case 1:
|
|
*charptr = (wchar_t) ((unsigned char) address[0]);
|
|
break;
|
|
case 2:
|
|
*charptr = (wchar_t) (((unsigned char) address[0] << 8)
|
|
| (unsigned char) address[1]);
|
|
break;
|
|
}
|
|
}
|
|
|
|
return bytes;
|
|
}
|