home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V7 / usr / src / libc / stdio / setbuf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1979-01-10  |  289 b   |  16 lines

  1. #include    <stdio.h>
  2.  
  3. setbuf(iop, buf)
  4. register struct _iobuf *iop;
  5. char *buf;
  6. {
  7.     if (iop->_base != NULL && iop->_flag&_IOMYBUF)
  8.         free(iop->_base);
  9.     iop->_flag &= ~(_IOMYBUF|_IONBF);
  10.     if ((iop->_base = buf) == NULL)
  11.         iop->_flag |= _IONBF;
  12.     else
  13.         iop->_ptr = iop->_base;
  14.     iop->_cnt = 0;
  15. }
  16.