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.3 (Berkeley) 3/15/86
   7:  */
   8: 
   9: # ifndef FILE
  10: #define BUFSIZ  1024
  11: extern  struct  _iobuf {
  12:     int _cnt;
  13:     char    *_ptr;      /* should be unsigned char */
  14:     char    *_base;     /* ditto */
  15:     int _bufsiz;
  16:     short   _flag;
  17:     char    _file;      /* should be short */
  18: } _iob[];
  19: 
  20: #define _IOREAD 01
  21: #define _IOWRT  02
  22: #define _IONBF  04
  23: #define _IOMYBUF    010
  24: #define _IOEOF  020
  25: #define _IOERR  040
  26: #define _IOSTRG 0100
  27: #define _IOLBF  0200
  28: #define _IORW   0400
  29: #define NULL    0
  30: #define FILE    struct _iobuf
  31: #define EOF (-1)
  32: 
  33: #define stdin   (&_iob[0])
  34: #define stdout  (&_iob[1])
  35: #define stderr  (&_iob[2])
  36: #ifndef lint
  37: #define getc(p)     (--(p)->_cnt>=0? (int)(*(unsigned char *)(p)->_ptr++):_filbuf(p))
  38: #endif not lint
  39: #define getchar()   getc(stdin)
  40: #ifndef lint
  41: #define putc(x, p)  (--(p)->_cnt >= 0 ?\
  42:     (int)(*(unsigned char *)(p)->_ptr++ = (x)) :\
  43:     (((p)->_flag & _IOLBF) && -(p)->_cnt < (p)->_bufsiz ?\
  44:         ((*(p)->_ptr = (x)) != '\n' ?\
  45:             (int)(*(unsigned char *)(p)->_ptr++) :\
  46:             _flsbuf(*(unsigned char *)(p)->_ptr, p)) :\
  47:         _flsbuf((unsigned char)(x), p)))
  48: #endif not lint
  49: #define putchar(x)  putc(x,stdout)
  50: #define feof(p)     (((p)->_flag&_IOEOF)!=0)
  51: #define ferror(p)   (((p)->_flag&_IOERR)!=0)
  52: #define fileno(p)   ((p)->_file)
  53: #define clearerr(p) ((p)->_flag &= ~(_IOERR|_IOEOF))
  54: 
  55: FILE    *fopen();
  56: FILE    *fdopen();
  57: FILE    *freopen();
  58: FILE    *popen();
  59: long    ftell();
  60: char    *fgets();
  61: char    *gets();
  62: #ifdef vax
  63: char    *sprintf();     /* too painful to do right */
  64: #endif
  65: # endif

Defined struct's

_iobuf defined in line 11; never used

Defined macros

BUFSIZ defined in line 10; never used
EOF defined in line 31; never used
FILE defined in line 30; used 5 times
NULL defined in line 29; never used
_IOEOF defined in line 24; used 2 times
_IOERR defined in line 25; used 2 times
_IOLBF defined in line 27; used 1 times
  • in line 43
_IOMYBUF defined in line 23; never used
_IONBF defined in line 22; never used
_IOREAD defined in line 20; never used
_IORW defined in line 28; never used
_IOSTRG defined in line 26; never used
_IOWRT defined in line 21; never used
clearerr defined in line 53; never used
feof defined in line 50; never used
ferror defined in line 51; never used
fileno defined in line 52; never used
getc defined in line 37; used 1 times
  • in line 39
getchar defined in line 39; never used
putc defined in line 41; used 1 times
  • in line 49
putchar defined in line 49; never used
stderr defined in line 35; never used
stdin defined in line 33; used 1 times
  • in line 39
stdout defined in line 34; used 1 times
  • in line 49
Last modified: 1986-03-16
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1474
Valid CSS Valid XHTML 1.0 Strict