xref: /csrg-svn/sys/libkern/scanc.c (revision 54184)
154173Sbostic /*-
254173Sbostic  * Copyright (c) 1992 The Regents of the University of California.
354173Sbostic  * All rights reserved.
454173Sbostic  *
554173Sbostic  * %sccs.include.redist.c%
654173Sbostic  *
7*54184Sbostic  *	@(#)scanc.c	7.3 (Berkeley) 06/21/92
854173Sbostic  */
954173Sbostic 
10*54184Sbostic #include "libkern.h"
11*54184Sbostic 
1254173Sbostic int
1354180Storek scanc(size, cp, table, mask0)
14*54184Sbostic 	u_int size;
15*54184Sbostic 	register u_char *cp, table[];
1654180Storek 	int mask0;
1754173Sbostic {
18*54184Sbostic 	register u_char *end;
19*54184Sbostic 	register u_char mask;
2054173Sbostic 
2154180Storek 	mask = mask0;
2254173Sbostic 	for (end = &cp[size]; cp < end && (table[*cp] & mask) == 0; ++cp);
2354173Sbostic 	return (end - cp);
2454173Sbostic }
25