ReactOS 0.4.15-dev-7788-g1ad9096
strxspn.h File Reference
#include <limits.h>
#include <string.h>
Include dependency graph for strxspn.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

size_t __cdecl _strxspn (const char *s1, const char *s2)
 

Function Documentation

◆ _strxspn()

size_t __cdecl _strxspn ( const char s1,
const char s2 
)

Definition at line 5 of file strxspn.h.

6{
7 unsigned char char_map[1 << CHAR_BIT * sizeof(char)];
8 const unsigned char * us2 = (const unsigned char *)s2;
9 const unsigned char * str = (const unsigned char *)s1;
10
11 memset(char_map, 0, sizeof(char_map));
12
13 for(; *us2; ++ us2)
14 char_map[*us2 / CHAR_BIT] |= (1 << (*us2 % CHAR_BIT));
15
16 for(; *str; ++ str)
17 if(_x(char_map[*str / CHAR_BIT] & (1 << (*str % CHAR_BIT)))) break;
18
19 return (size_t)str - (size_t)s1;
20}
#define _x(oid)
unsigned char
Definition: typeof.h:29
#define CHAR_BIT
Definition: urlcache.c:62
__kernel_size_t size_t
Definition: linux.h:237
struct S1 s1
struct S2 s2
const WCHAR * str
#define memset(x, y, z)
Definition: compat.h:39