xref: /csrg-svn/sys/libkern/scanc.c (revision 54173)
1*54173Sbostic /*-
2*54173Sbostic  * Copyright (c) 1992 The Regents of the University of California.
3*54173Sbostic  * All rights reserved.
4*54173Sbostic  *
5*54173Sbostic  * %sccs.include.redist.c%
6*54173Sbostic  *
7*54173Sbostic  *	@(#)scanc.c	7.1 (Berkeley) 06/20/92
8*54173Sbostic  */
9*54173Sbostic 
10*54173Sbostic int
11*54173Sbostic scanc(size, cp, table, mask)
12*54173Sbostic 	unsigned int size;
13*54173Sbostic 	register unsigned char *cp, table[];
14*54173Sbostic 	register unsigned char mask;
15*54173Sbostic {
16*54173Sbostic 	register unsigned char *end;
17*54173Sbostic 
18*54173Sbostic 	for (end = &cp[size]; cp < end && (table[*cp] & mask) == 0; ++cp);
19*54173Sbostic 	return (end - cp);
20*54173Sbostic }
21