Annotation of researchv10no/cmd/twig/io.c, revision 1.1.1.1

1.1       root        1: #include "common.h"
                      2: #define MAXINTONLINE 10
                      3: static int intcnt, intonline, firstint;
                      4: 
                      5: oreset()
                      6: {
                      7:        intcnt = 0;
                      8:        intonline = 0;
                      9:        firstint = 1;
                     10: }
                     11: 
                     12: ointcnt() { return(intcnt); }
                     13: 
                     14: oputint(i)
                     15: {
                     16:        if(!firstint) putc(',', outfile);
                     17:        else firstint = 0;
                     18:        fprintf(outfile, "%d", i);
                     19:        intonline++;
                     20:        intcnt++;
                     21:        if(intonline >= MAXINTONLINE) { putc('\n', outfile); intonline = 0; }
                     22: }
                     23: 
                     24: oputoct(i)
                     25: {
                     26:        if(!firstint) putc(',', outfile);
                     27:        else firstint = 0;
                     28:        fprintf(outfile, "0%o", i);
                     29:        intonline++;
                     30:        intcnt++;
                     31:        if(intonline >= MAXINTONLINE) { putc('\n', outfile); intonline = 0; }
                     32: }

unix.superglobalmegacorp.com

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