Annotation of xinu/sys/ttyputc.c, revision 1.1.1.1

1.1       root        1: /* ttyputc.c - ttyputc */
                      2: 
                      3: #include <conf.h>
                      4: #include <kernel.h>
                      5: #include <tty.h>
                      6: #include <io.h>
                      7: #include <slu.h>
                      8: 
                      9: /*------------------------------------------------------------------------
                     10:  *  ttyputc - write one character to a tty device
                     11:  *------------------------------------------------------------------------
                     12:  */
                     13: ttyputc(devptr, ch )
                     14: struct devsw   *devptr;
                     15: char   ch;
                     16: {
                     17:        struct  tty   *iptr;
                     18:        PStype  ps;
                     19: 
                     20:        iptr = &tty[devptr->dvminor];
                     21:         if ( ch==NEWLINE && iptr->ocrlf )
                     22:                 ttyputc(devptr,RETURN);
                     23:        disable(ps);
                     24:        wait(iptr->osem);               /* wait for space in queue      */
                     25:        iptr->obuff[iptr->ohead++] = ch;
                     26:        if (iptr->ohead >= OBUFLEN)
                     27:                iptr->ohead = 0;
                     28:        (iptr->ioaddr)->ctstat = SLUENABLE;
                     29:        restore(ps);
                     30:        return(OK);
                     31: }

unix.superglobalmegacorp.com

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