.so header
.he /SETS(3C)/Kreider OS-9 C Library/SETS(3C)/
.sh NAME
.bb
allocset, addc2set, adds2set, rmfmset, smember, union,
sintersect, sdifference, copyset, dupset

Set operations
.eb
.sh SYNOPSIS
.bb
char *allocset(s, c)
char *s, *p;

char *addc2set(s, c)
char *s c;

char *adds2set(s, p)
char *s p;

char *rmfrmset(s, c)
char *s, c;

smember(s, c)
char *s, c;

char *sunion(s1, s2)
char s1[], s2[];

char *sintersect(s1, s2)
char s1[], s2[];

char *sdifference(s1, s2)
char s1[], s2[];

char *copyset(s1, s2)
char s1[], s2[];

char *dupset(s)
char s[];
.eb
.sh DESCRIPTION
.db \fBALLOCSET\fP allocates memory for a set consisting of an array of 32 bytes
(256 bits).
If successful, it returns a pointer to the set, or \fInull\fP if not successful.
This array is then operated on with the following functions.
.sp \fBADDC2SET\fP adds the character \fIc\fP to the set \fIs.\fP No error is possible.
Adding a single character or any value in the range 0 - 255 decimal is the
same as ORing the bit that corresponds to the numeric value of that character,
i.e., adding a character 'A' to the set will set bit number $41, 65 decimal.
.sp \fBADDS2SET\fP adds the string \fIp\fP to the set \fIs.\fP No error is possible. The string \fIp\fP is added to the set in that same manner as \fBADDC2SET\fP above, but the entire string of bits is added in a bit-by-bit progression.
.sp \fBRMFMSET\fP removes character \fIc\fP from the set \fIs.\fP Again, no error is possible.
Removing a character from the set amounts to ANDing the bit at the position
corresponding to the numeric value of the character as in \fBADDC2SET\fP above, but is the reverse procedure.
.sp \fBSMEMBER\fP returns TRUE if character \fIc\fP is a member of set \fIs,\fP or returns FALSE if it is not a member.
.sp \fBSUNION\fP merges a second set \fIs2\fP into the first set \fIs1.\f
.sp \fBSINTERSECT\fP returns any elements that only exist in both sets \fIs1\fP and \fIs2.\f
.sp \fBSDIFFERENCE\fP returns unigue elements of both sets that are in the first set, \fIs1.\f
.sp \fBCOPYSET\fP duplicates the second set, \fIs2,\fP into the first set, \fIs1.\f
.sp \fBDUPSET\fP allocates memory for a new set, and then copies set \fIs\fP into that memory area.
.ed
