2007-03-14 20:24:57 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS system libraries
|
2008-12-18 18:58:43 +00:00
|
|
|
* FILE: lib/sdk/crt/mbstring/ismblead.c
|
|
|
|
* PURPOSE: Checks for a leading byte
|
|
|
|
* PROGRAMERS:
|
|
|
|
* Copyright 1999 Ariadne, Taiji Yamada
|
|
|
|
* Copyright 1999 Alexandre Julliard
|
|
|
|
* Copyright 2000 Jon Griffths
|
|
|
|
* Copyright 2008 Samuel Serapion adapted from PROJECT C Library
|
2008-06-06 17:49:24 +00:00
|
|
|
*
|
2007-03-14 20:24:57 +00:00
|
|
|
*/
|
|
|
|
|
2008-06-06 17:49:24 +00:00
|
|
|
#include <precomp.h>
|
2008-12-18 18:58:43 +00:00
|
|
|
#include <mbctype.h>
|
2007-03-14 20:24:57 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
int _ismbblead(unsigned int c)
|
|
|
|
{
|
2012-12-09 11:42:02 +00:00
|
|
|
return (get_mbcinfo()->mbctype[(c&0xff) + 1] & _M1) != 0;
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2008-12-18 18:58:43 +00:00
|
|
|
int _ismbslead( const unsigned char *start, const unsigned char *str)
|
2007-03-14 20:24:57 +00:00
|
|
|
{
|
2008-12-18 18:58:43 +00:00
|
|
|
int lead = 0;
|
|
|
|
|
|
|
|
/* Lead bytes can also be trail bytes so we need to analyse the string
|
|
|
|
*/
|
|
|
|
while (start <= str)
|
|
|
|
{
|
|
|
|
if (!*start)
|
|
|
|
return 0;
|
|
|
|
lead = !lead && _ismbblead(*start);
|
|
|
|
start++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return lead ? -1 : 0;
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|
|
|
|
|
2008-05-28 21:08:23 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
Update excpt.h, fcntl.h, float.h, math.c, mbctype.h, setjmp.h, share.h, stddef.h, stdio.h, stdlib.h, string.h, wchar.h from ming64
- fix __p__mbctype()
- add some stuff to wine/exception.h that was formerly in except.h, but doesn't belong there
- inlcude intrin.h from _mingw.h
svn path=/trunk/; revision=38252
2008-12-21 22:43:46 +00:00
|
|
|
unsigned char *__p__mbctype(void)
|
2008-05-28 21:08:23 +00:00
|
|
|
{
|
2012-12-09 11:42:02 +00:00
|
|
|
return get_mbcinfo()->mbctype;
|
2008-05-28 21:08:23 +00:00
|
|
|
}
|
|
|
|
|
2008-06-06 17:49:24 +00:00
|
|
|
|