Category : C Source Code
Archive   : CSRC2.ZIP
Filename : CSCOMP.C

 
Output of file : CSCOMP.C contained in archive : CSRC2.ZIP
/*
* 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
#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
#endif

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


  3 Responses to “Category : C Source Code
Archive   : CSRC2.ZIP
Filename : CSCOMP.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/