Annotation of 43BSD/contrib/icon/operators/compl.c, revision 1.1.1.1

1.1       root        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,"~")

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.