Annotation of 43BSD/contrib/icon/functions/pos.c, revision 1.1

1.1     ! root        1: #include "../h/rt.h"
        !             2: 
        !             3: /*
        !             4:  * pos(i) - test if &pos is at position i in &subject.
        !             5:  */
        !             6: Xpos(nargs, arg1, arg0)
        !             7: int nargs;
        !             8: struct descrip arg1, arg0;
        !             9:    {
        !            10:    register int i;
        !            11:    long l;
        !            12: 
        !            13:    /*
        !            14:     * i must be an integer.
        !            15:     */
        !            16:    if (cvint(&arg1, &l) == NULL)
        !            17:       runerr(101, &arg1);
        !            18: 
        !            19:    /*
        !            20:     * Fail if &pos isn't equivalent to i, return i otherwise.
        !            21:     */
        !            22:    if ((i = cvpos(l, STRLEN(k_subject))) != k_pos)
        !            23:       fail();
        !            24:    arg0.type = D_INTEGER;
        !            25:    INTVAL(arg0) = i;
        !            26:    }
        !            27: 
        !            28: Procblock(pos,1)

unix.superglobalmegacorp.com

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