2008-06-06 17:49:24 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS system libraries
|
2015-09-19 13:50:57 +00:00
|
|
|
* FILE: lib/sdk/crt/mbstring/mbscspn.c
|
2008-06-06 17:49:24 +00:00
|
|
|
* PURPOSE:
|
2021-06-11 12:29:21 +00:00
|
|
|
* PROGRAMER:
|
2008-06-06 17:49:24 +00:00
|
|
|
* 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
|
|
|
}
|