mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:23:01 +00:00
Create a branch for audio work
svn path=/branches/audio-bringup/; revision=49478
This commit is contained in:
parent
26c20f3857
commit
5eb25b5c24
20759 changed files with 0 additions and 1141005 deletions
24
lib/sdk/crt/string/strxspn.h
Normal file
24
lib/sdk/crt/string/strxspn.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/* $Id$
|
||||
*/
|
||||
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
size_t _strxspn(const char *s1, const char *s2)
|
||||
{
|
||||
unsigned char char_map[1 << CHAR_BIT * sizeof(char)];
|
||||
const unsigned char * us2 = (const unsigned char *)s2;
|
||||
const unsigned char * str = (const unsigned char *)s1;
|
||||
|
||||
memset(char_map, 0, sizeof(char_map));
|
||||
|
||||
for(; *us2; ++ us2)
|
||||
char_map[*us2 / CHAR_BIT] |= (1 << (*us2 % CHAR_BIT));
|
||||
|
||||
for(; *str; ++ str)
|
||||
if(_x(char_map[*str / CHAR_BIT] & (1 << (*str % CHAR_BIT)))) break;
|
||||
|
||||
return (size_t)str - (size_t)s1;
|
||||
}
|
||||
|
||||
/* EOF */
|
Loading…
Add table
Add a link
Reference in a new issue