OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [string/] [strcspn.c] - Rev 1765

Compare with Previous | Blame | View Log

/* strcspn.c */
 
/* from Schumacher's Atari library, improved */
 
#include <string.h>
 
size_t strcspn(string, set)
register char *string;
char *set;
/*
 *	Return the length of the sub-string of <string> that consists
 *	entirely of characters not found in <set>.  The terminating '\0'
 *	in <set> is not considered part of the match set.  If the first
 *	character if <string> is in <set>, 0 is returned.
 */
{
    register char *setptr;
    char *start;
 
    start = string;
    while (*string)
    {
	setptr = set;
	do
	    if (*setptr == *string)
		goto break2;
	while (*setptr++);
	++string;
    }
break2:
    return string - start;
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.