Annotation of researchv10no/cmd/refer/refer4.c, revision 1.1.1.1

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

unix.superglobalmegacorp.com

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