/*
 *				c s c o m p . c
 */

/*)LIBRARY
*/

#ifdef	DOCUMENTATION

title	cscomp	Complement a Cset
index		Complement a cset (macro)
index		Complement a cset (real function)

synopsis

	 #ifdef vms
	 #include "c:cset.h"
	 #else
	 #include <cset.h>
	 #endif

	 CSET *
	 cscomp(cs)
	 CSET *cs;

	 CSET *
	 _cscomp(cs)
	 CSET *cs;

description

	cscomp() returns a cset whose members are exactly those characters
	not in cs.  It is a macro, is extremely fast, and requires no memory
	beyond cs itself.

	_cscomp() does the same thing, but is a real function.  Further,
	unlike cscomp(), it will return a unique cset if csunique is TRUE.

internal

	The macro form simply complements the address passed to it, which
	is a pointer to a cset descriptor.  It is assumed that such a pointer
	always corresponds to an even address - true in most implementations.
	(Note that the cset descriptor is in space gotten from malloc().)
	Hence, the bottom bit of a cset descriptor pointer can be used to
	determine whether the cset is complemented or not.

bugs

author

	Jerry Leichter

#endif

/*
)EDITLEVEL=03
 * Edit history
 * 0.0 14-Jul-82 JSL	Invention
 */

#ifdef vms
#include "c:cset.h"
#else
#include <cset.h>
#endif

CSET *
_cscomp(cs)
register CSET *cs;
{
	cs = cscomp(cs);			/* Let macro work	*/
	return(csunique ? cscopy(cs) : cs);	/* Copy if needed...	*/
}
