Chameleon

Chameleon Svn Source Tree

Root/tags/2.0/i386/modules/klibc/strxspn.c

Source at commit 1822 created 12 years 5 months ago.
By ifabio, - Added Ati 6570 and 6450 (subdevID and Frambuffer) : http://forge.voodooprojects.org/p/chameleon/issues/220/ - Update Chameleon.xcodeproj
1/*
2 * strpbrk
3 */
4
5#include <limits.h>
6#include "libsaio.h"
7#include "strxspn.h"
8
9
10
11
12size_t __strxspn(const char *s, const char *map, int parity)
13{
14char matchmap[UCHAR_MAX + 1];
15size_t n = 0;
16
17/* Create bitmap */
18memset(matchmap, 0, sizeof matchmap);
19while (*map)
20matchmap[(unsigned char)*map++] = 1;
21
22/* Make sure the null character never matches */
23matchmap[0] = parity;
24
25/* Calculate span length */
26while (matchmap[(unsigned char)*s++] ^ parity)
27n++;
28
29return n;
30}
31

Archive Download this file

Revision: 1822