Annotation of cci/usr/include/stdio.h, revision 1.1.1.2

1.1.1.2 ! root        1: /*
        !             2:  * Copyright (c) 1980 Regents of the University of California.
        !             3:  * All rights reserved.  The Berkeley software License Agreement
        !             4:  * specifies the terms and conditions for redistribution.
        !             5:  *
        !             6:  *     @(#)stdio.h     5.1 (Berkeley) 5/30/85
        !             7:  */
        !             8: 
1.1       root        9: # ifndef FILE
1.1.1.2 ! root       10: #define        BUFSIZ  1024
        !            11: #define        _NFILE  64
1.1       root       12: extern struct  _iobuf {
                     13:        int     _cnt;
1.1.1.2 ! root       14:        char    *_ptr;          /* should be unsigned char */
        !            15:        char    *_base;         /* ditto */
1.1       root       16:        int     _bufsiz;
                     17:        short   _flag;
1.1.1.2 ! root       18:        char    _file;          /* should be short */
1.1       root       19: } _iob[_NFILE];
                     20: 
                     21: #define        _IOREAD 01
                     22: #define        _IOWRT  02
                     23: #define        _IONBF  04
                     24: #define        _IOMYBUF        010
                     25: #define        _IOEOF  020
                     26: #define        _IOERR  040
                     27: #define        _IOSTRG 0100
                     28: #define        _IOLBF  0200
                     29: #define        _IORW   0400
                     30: #define        NULL    0
                     31: #define        FILE    struct _iobuf
                     32: #define        EOF     (-1)
                     33: 
                     34: #define        stdin   (&_iob[0])
                     35: #define        stdout  (&_iob[1])
                     36: #define        stderr  (&_iob[2])
1.1.1.2 ! root       37: #define        getc(p)         (--(p)->_cnt>=0? (int)(*(unsigned char *)(p)->_ptr++):_filbuf(p))
1.1       root       38: #define        getchar()       getc(stdin)
1.1.1.2 ! root       39: #define putc(x, p)     (--(p)->_cnt >= 0 ?\
        !            40:        (int)(*(unsigned char *)(p)->_ptr++ = (x)) :\
        !            41:        (((p)->_flag & _IOLBF) && -(p)->_cnt < (p)->_bufsiz ?\
        !            42:                ((*(p)->_ptr = (x)) != '\n' ?\
        !            43:                        (int)(*(unsigned char *)(p)->_ptr++) :\
        !            44:                        _flsbuf(*(unsigned char *)(p)->_ptr, p)) :\
        !            45:                _flsbuf((unsigned char)(x), p)))
1.1       root       46: #define        putchar(x)      putc(x,stdout)
                     47: #define        feof(p)         (((p)->_flag&_IOEOF)!=0)
                     48: #define        ferror(p)       (((p)->_flag&_IOERR)!=0)
                     49: #define        fileno(p)       ((p)->_file)
                     50: 
                     51: FILE   *fopen();
                     52: FILE   *fdopen();
                     53: FILE   *freopen();
1.1.1.2 ! root       54: FILE   *popen();
1.1       root       55: long   ftell();
1.1.1.2 ! root       56: long   fseek();
1.1       root       57: char   *fgets();
                     58: #ifdef vax
                     59: char   *sprintf();             /* too painful to do right */
                     60: #endif
1.1.1.2 ! root       61: # endif

unix.superglobalmegacorp.com

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