Annotation of 42BSD/usr.lib/libU77/putc_.c, revision 1.1.1.1

1.1       root        1: /*
                      2: char id_putc[] = "@(#)putc_.c  1.3";
                      3:  *
                      4:  * write a character to the standard output
                      5:  *
                      6:  * calling sequence:
                      7:  *     integer putc
                      8:  *     ierror =  putc (char)
                      9:  * where:
                     10:  *     char will be sent to the standard output, usually the terminal
                     11:  *     ierror will be 0 if successful; a system error code otherwise.
                     12:  */
                     13: 
                     14: #include       "../libI77/f_errno.h"
                     15: #include       "../libI77/fiodefs.h"
                     16: 
                     17: extern unit units[];   /* logical units table from iolib */
                     18: 
                     19: long putc_(c, clen)
                     20: char *c; long clen;
                     21: {
                     22:        int     i;
                     23:        unit    *lu;
                     24: 
                     25:        lu = &units[STDOUT];
                     26:        if (!lu->ufd)
                     27:                return((long)(errno=F_ERNOPEN));
                     28:        if (!lu->uwrt && ! nowwriting(lu))
                     29:                return((long)errno);
                     30:        putc (*c, lu->ufd);
                     31:        if (ferror(lu->ufd))
                     32:        {
                     33:                i = errno;
                     34:                clearerr(lu->ufd);
                     35:                return((long)i);
                     36:        }
                     37:        return(0L);
                     38: }

unix.superglobalmegacorp.com

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