Annotation of 41BSD/cmd/refer/refer4.c, revision 1.1

1.1     ! root        1: # include "refer..c"
        !             2: static gate = 0;
        !             3: static char buff[LLINE];
        !             4: output (s)
        !             5:        char *s;
        !             6: {
        !             7: if (gate)
        !             8:        fputs(buff,ftemp);
        !             9: else
        !            10:        gate=1;
        !            11: strcpy(buff,s);
        !            12: if (strlen(buff)>LLINE)
        !            13:        err("one buff too big (%d)!", LLINE);
        !            14: }
        !            15: append(s)
        !            16:        char *s;
        !            17: {
        !            18: char *p, *r; int lch;
        !            19: trimnl(buff);
        !            20: for (p=buff; *p; p++)
        !            21:        ;
        !            22: lch = *--p;
        !            23: switch (lch)
        !            24:        {
        !            25:        case '.': case ',':
        !            26:                *p=0;
        !            27:                r="\\*(<";
        !            28:                while (*r) *p++= *r++;
        !            29:                *p++ = lch;
        !            30:                *p=0;
        !            31:        }
        !            32: strcat(buff,s);
        !            33: switch(lch)
        !            34:        {
        !            35:        case '.': case ',':
        !            36:                for(p=buff; *p; p++)
        !            37:                        ;
        !            38:                if (*--p=='\n')*p=0;
        !            39:                r = "\\*(>";
        !            40:                while (*r) *p++ = *r++;
        !            41:                *p++ = lch;
        !            42:                *p++ = '\n';
        !            43:                *p=0;
        !            44:        }
        !            45: if (strlen(buff)>LLINE)
        !            46:        err("output buff too long (%d)", LLINE);
        !            47: }
        !            48: 
        !            49: flout()
        !            50: {
        !            51: if (gate)
        !            52:        fputs(buff,ftemp);
        !            53: gate=0;
        !            54: }
        !            55: 
        !            56: char *
        !            57: trimnl(ln)
        !            58:        char *ln;
        !            59: {
        !            60: register char *p = ln;
        !            61: while (*p) p++;
        !            62: p--;
        !            63: if (*p == '\n') *p=0;
        !            64: return(ln);
        !            65: }

unix.superglobalmegacorp.com

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