| 1 | /* Copyright (c) 1979 Regents of the University of California */ |
| 2 | |
| 3 | static char sccsid[] = "@(#)INCT.c 1.1 %G%"; |
| 4 | |
| 5 | #include "h00vars.h" |
| 6 | |
| 7 | INCT(element, paircnt, singcnt, data) |
| 8 | |
| 9 | register int element; /* element to find */ |
| 10 | int paircnt; /* number of pairs to check */ |
| 11 | int singcnt; /* number of singles to check */ |
| 12 | int data; /* paircnt plus singcnt bounds */ |
| 13 | { |
| 14 | register int *dataptr; |
| 15 | register int cnt; |
| 16 | |
| 17 | dataptr = &data; |
| 18 | for (cnt = 0; cnt < paircnt; cnt++) { |
| 19 | if (element > *dataptr++) { |
| 20 | dataptr++; |
| 21 | continue; |
| 22 | } |
| 23 | if (element >= *dataptr++) { |
| 24 | return TRUE; |
| 25 | } |
| 26 | } |
| 27 | for (cnt = 0; cnt < singcnt; cnt++) { |
| 28 | if (element == *dataptr++) { |
| 29 | return TRUE; |
| 30 | } |
| 31 | } |
| 32 | return FALSE; |
| 33 | } |