Annotation of 41BSD/lib/libpc/INCT.c, revision 1.1.1.1

1.1       root        1: /* Copyright (c) 1979 Regents of the University of California */
                      2: 
                      3: static char sccsid[] = "@(#)INCT.c 1.1 10/29/80";
                      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: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.