home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1996 December / CD_shareware_12-96.iso / DOS / Programa / CCDL122.ZIP / CLIBS / IO / WRITEBUF.C < prev   
Encoding:
C/C++ Source or Header  |  1996-07-26  |  396 b   |  19 lines

  1. #include <stdio.h>
  2.  
  3. int _writebuf(FILE *stream)
  4. {
  5.     if ((stream->flags & _F_IN) || (( stream->flags & _F_OUT) && stream->curp >=stream->bsize + stream->buffer)) {
  6.         if (fflush(stream))
  7.             return EOF;
  8.         goto join;
  9.     }
  10.     else {
  11.         if (!(stream->flags & _F_OUT)) {
  12. join:
  13.             stream->flags &= ~(_F_IN | _F_OUT);
  14.             stream->level = 0;
  15.             stream->curp = stream->buffer;
  16.         }
  17.     }
  18.     return 0;
  19. }