scanc.c (348238dbd42306d9fb5d89ab393b840572cfeb0f) | scanc.c (4a8dea8cf97aab33f4e6a11afcc64dd9562f3bfd) |
---|---|
1/*- 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 21 unchanged lines hidden (view full) --- 30 */ 31 32#include <sys/cdefs.h> 33__FBSDID("$FreeBSD$"); 34 35#include <sys/libkern.h> 36 37int | 1/*- 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 21 unchanged lines hidden (view full) --- 30 */ 31 32#include <sys/cdefs.h> 33__FBSDID("$FreeBSD$"); 34 35#include <sys/libkern.h> 36 37int |
38scanc(size, cp, table, mask0) 39 u_int size; 40 const u_char *cp, table[]; 41 int mask0; | 38scanc(u_int size, const u_char *cp, const u_char table[], int mask0) |
42{ 43 const u_char *end; 44 u_char mask; 45 46 mask = mask0; 47 for (end = &cp[size]; cp < end; ++cp) { 48 if (table[*cp] & mask) 49 break; 50 } 51 return (end - cp); 52} | 39{ 40 const u_char *end; 41 u_char mask; 42 43 mask = mask0; 44 for (end = &cp[size]; cp < end; ++cp) { 45 if (table[*cp] & mask) 46 break; 47 } 48 return (end - cp); 49} |