change to allow any type of files
[unix-history] / usr / src / usr.bin / pascal / libpc / INCT.c
CommitLineData
d1d41cd7
KM
1/* Copyright (c) 1979 Regents of the University of California */
2
492cc5d3 3static char sccsid[] = "@(#)INCT.c 1.2 %G%";
d1d41cd7
KM
4
5#include "h00vars.h"
6
492cc5d3 7bool
d1d41cd7
KM
8INCT(element, paircnt, singcnt, data)
9
492cc5d3
KM
10 register long element; /* element to find */
11 long paircnt; /* number of pairs to check */
12 long singcnt; /* number of singles to check */
13 long data; /* paircnt plus singcnt bounds */
d1d41cd7 14{
492cc5d3 15 register long *dataptr = &data;
d1d41cd7
KM
16 register int cnt;
17
d1d41cd7
KM
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}