Commit | Line | Data |
---|---|---|
a16e27c5 KM |
1 | /* Copyright (c) 1979 Regents of the University of California */ |
2 | ||
3 | static char sccsid[] = "@(#)IN.c 1.1 %G%"; | |
4 | ||
5 | #include "h00vars.h" | |
6 | ||
7 | IN(element, lower, upper, setptr) | |
8 | ||
9 | int element; /* element to check */ | |
10 | int lower; /* lowest element of set */ | |
11 | int upper; /* upper - lower of set */ | |
12 | char setptr[]; /* pointer to set */ | |
13 | { | |
14 | int indx; | |
15 | ||
16 | if ((indx = element - lower) < 0 || indx > upper) | |
17 | return FALSE; | |
18 | if (setptr[indx / BITSPERBYTE] & (1 << (indx % BITSPERBYTE))) | |
19 | return TRUE; | |
20 | return FALSE; | |
21 | } |