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

 
Output of file : CSLESS.C contained in archive : CSRC2.ZIP
/*
* c s l e s s . c
*/

/*)LIBRARY
*/

#ifdef DOCUMENTATION

title csless Remove an Element From a Cset
index Remove an element from a cset

synopsis

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

CSET *
csless(cs,c)
CSET *cs;
int c;

description

The element c, which is generally a character, is removed from the
cset cs if it is a member. If c is not a member, cs is unchanged.
This call modifies the actual cset cs, whatever the value of csunique.

cs itself is returned.

Note: c is not validated; c < 0 or c >= cs may cause random bits
in memory to be changed. However, csmask is used to control unwanted
sign extension - see cset().

bugs

author

Jerry Leichter

#endif

/*
)EDITLEVEL=00
* Edit history
* 0.0 16-Jul-82 JSL Invention
*/

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

CSET *
csless(cs,c)
register CSET *cs;
int c;
{
if ((int)cs & 1) /* Complemented cset */
return(cscomp(cswith(cscomp(cs),c)));
/* Use DeMorgan's law */
cs->table[c & csmask] &= ~cs->mask; /* Remove it */
return(cs);
}


  3 Responses to “Category : C Source Code
Archive   : CSRC2.ZIP
Filename : CSLESS.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/