1: #include "../h/rt.h"
   2: 
   3: /*
   4:  * ~x - complement cset x.
   5:  */
   6: 
   7: compl(nargs, arg1, arg0)
   8: int nargs;
   9: struct descrip arg1, arg0;
  10:    {
  11:    DclSave
  12:    register int i;
  13:    union block *bp;
  14:    int *cs, csbuf[CSETSIZE];
  15:    extern struct b_cset *alccset();
  16: 
  17:    SetBound;
  18:    hneed(sizeof(struct b_cset));
  19: 
  20:    /*
  21:     * x must be a cset.
  22:     */
  23:    if (cvcset(&arg1, &cs, csbuf) == NULL)
  24:       runerr(104, &arg1);
  25: 
  26:    /*
  27:     * Allocate a new cset and then copy each cset word from x into
  28:     *  the new cset words, complementing each.
  29:     */
  30:    bp = (union block *) alccset();
  31:    for (i = 0; i < CSETSIZE; i++)
  32:        bp->cset.bits[i] = ~cs[i];
  33: 
  34:    arg0.type = D_CSET;
  35:    BLKLOC(arg0) = bp;
  36:    ClearBound;
  37:    }
  38: 
  39: Opblock(compl,1,"~")

Defined functions

compl defined in line 7; used 1 times
  • in line 39
Last modified: 1984-11-18
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 779
Valid CSS Valid XHTML 1.0 Strict