2008-06-06 17:49:24 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS system libraries
|
|
|
|
* FILE: lib/sdk/crt/mbstring/mbscpn.c
|
|
|
|
* PURPOSE:
|
|
|
|
* PROGRAMER:
|
|
|
|
* UPDATE HISTORY:
|
|
|
|
* 05/30/08: Samuel Serapion adapted from PROJECT C Library
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <precomp.h>
|
2007-03-14 20:24:57 +00:00
|
|
|
#include <mbstring.h>
|
|
|
|
|
|
|
|
/*
|
2008-06-06 17:49:24 +00:00
|
|
|
* @implemented
|
2007-03-14 20:24:57 +00:00
|
|
|
*/
|
2008-06-06 17:49:24 +00:00
|
|
|
size_t _mbscspn (const unsigned char *str1, const unsigned char *str2)
|
2007-03-14 20:24:57 +00:00
|
|
|
{
|
2008-06-06 17:49:24 +00:00
|
|
|
int c;
|
|
|
|
const unsigned char *save = str1;
|
|
|
|
|
|
|
|
while ((c = _mbsnextc (str1))) {
|
|
|
|
|
2010-01-20 22:56:01 +00:00
|
|
|
if (_mbschr (str2, c))
|
2008-06-06 17:49:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
str1 = _mbsinc ((unsigned char *) str1);
|
|
|
|
|
|
|
|
}
|
2007-03-14 20:24:57 +00:00
|
|
|
|
2008-06-06 17:49:24 +00:00
|
|
|
return str1 - save;
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|