Updated: 2022/Sep/29

Please read Privacy Policy. It's for your privacy.


SCANC(9)                   Kernel Developer's Manual                  SCANC(9)

NAME
     scanc - use byte string as lookup table index

SYNOPSIS
     #include <lib/libkern/libkern.h>

     int
     scanc(u_int size, const u_char *cp, const u_char table[], int mask);

DESCRIPTION
     The scanc() function scans the byte string cp, whose length is size.  A
     character in the string is used as an index in the 256-byte table.  If a
     bitwise-AND of the byte from the table and mask isn't zero or the string
     is exhausted, the scan stops.

RETURN VALUES
     The scanc() function returns the length of the rest of the string,
     including the character which made the scan stop.  If the scanc()
     function exhausted the string, it returns 0.

HISTORY
     The scanc() function emulates a VAX instruction with the same name.

NetBSD 10.99                    April 24, 2013                    NetBSD 10.99