ReactOS
0.4.16-dev-329-g9223134
ismblead.c
Go to the documentation of this file.
1
/*
2
* COPYRIGHT: See COPYING in the top level directory
3
* PROJECT: ReactOS system libraries
4
* FILE: lib/sdk/crt/mbstring/ismblead.c
5
* PURPOSE: Checks for a leading byte
6
* PROGRAMERS:
7
* Copyright 1999 Ariadne, Taiji Yamada
8
* Copyright 1999 Alexandre Julliard
9
* Copyright 2000 Jon Griffths
10
* Copyright 2008 Samuel Serapion adapted from PROJECT C Library
11
*
12
*/
13
14
#include <precomp.h>
15
#include <
mbctype.h
>
16
17
/*
18
* @implemented
19
*/
20
int
_ismbblead
(
unsigned
int
c
)
21
{
22
return
(
get_mbcinfo
()->mbctype[(
c
&0xff) + 1] &
_M1
) != 0;
23
}
24
25
/*
26
* @implemented
27
*/
28
int
_ismbslead
(
const
unsigned
char
*
start
,
const
unsigned
char
*
str
)
29
{
30
int
lead = 0;
31
32
/* Lead bytes can also be trail bytes so we need to analyse the string
33
*/
34
while
(
start
<=
str
)
35
{
36
if
(!*
start
)
37
return
0;
38
lead = !lead &&
_ismbblead
(*
start
);
39
start
++;
40
}
41
42
return
lead ? -1 : 0;
43
}
44
45
/*
46
* @implemented
47
*/
48
unsigned
char
*
__p__mbctype
(
void
)
49
{
50
return
get_mbcinfo
()->
mbctype
;
51
}
52
53
start
GLuint start
Definition:
gl.h:1545
c
const GLubyte * c
Definition:
glext.h:8905
_ismbblead
int _ismbblead(unsigned int c)
Definition:
ismblead.c:20
__p__mbctype
unsigned char * __p__mbctype(void)
Definition:
ismblead.c:48
_ismbslead
int _ismbslead(const unsigned char *start, const unsigned char *str)
Definition:
ismblead.c:28
mbctype.h
get_mbcinfo
MSVCRT_pthreadmbcinfo get_mbcinfo(void)
Definition:
locale.c:366
_M1
#define _M1
Definition:
msvcrt.h:817
str
const WCHAR * str
Definition:
rpc_transport.c:2724
MSVCRT_threadmbcinfostruct::mbctype
unsigned char mbctype[257]
Definition:
msvcrt.h:143
sdk
lib
crt
mbstring
ismblead.c
Generated on Sun Dec 8 2024 06:13:32 for ReactOS by
1.9.6