summaryrefslogtreecommitdiffstats
path: root/private/crt32/mbstring/mbsnextc.c
blob: 6ab8f9b12e7b58a0c73dbfe941eb10292832f45b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*** 
*mbsnextc.c - Get the next character in an MBCS string.
*
*	Copyright (c) 1985-1992, Microsoft Corporation.  All rights reserved.
*
*Purpose:
*	To return the value of the next character in an MBCS string.
*
*Revision History:
*	11-19-92  KRS	Ported from 16-bit sources.
*
*******************************************************************************/

#ifdef _MBCS
#include <cruntime.h>
#include <mbdata.h>
#include <mbctype.h>
#include <mbstring.h>


/*** 
*_mbsnextc:  Returns the next character in a string.
*
*Purpose:
*	To return the value of the next character in an MBCS string.
*	Does not advance pointer to the next character.
*
*Entry:
*	unsigned char *s = string
*
*Exit:
*	unsigned int next = next character.
*
*Exceptions:
*
*******************************************************************************/

unsigned int _CRTAPI1 _mbsnextc(s)
const unsigned char *s;
{
	unsigned int  next = 0;

	if (_ISLEADBYTE(*s))
	    next = ((unsigned int) *s++) << 8;

	next += (unsigned int) *s;

	return(next);
}
#endif	/* _MBCS */