home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
c
/
cnews016.arc
/
SETS.ARC
/
SETSOURC.ARC
/
INSET.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-03-09
|
664b
|
26 lines
#include <stdio.h>
#include <stdarg.h>
#include "sets.h"
/***************************************************************************/
boolean in_set(set *aset, int entity)
/***************************************************************************/
/* Determines if entity is a member. */
{
int bit,i;
/* check to see if the set has that many words & members */
if(entity > aset->set_size)
return FALSE;
/* get the bit */
bit = entity % MEMBERS_PER_WORD;
/* get the right word */
i = entity / MEMBERS_PER_WORD;
/* detect the bit */
return (aset->word[i] & (1 << bit)) ? TRUE : FALSE;
} /* end in_set */