home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 1.ddi / CLIB1.ZIP / SETUPIO.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  1.4 KB  |  39 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - setupio.c
  3.  *-----------------------------------------------------------------------*/
  4.  
  5. /*[]------------------------------------------------------------[]*/
  6. /*|                                                              |*/
  7. /*|     Turbo C Run Time Library - Version 3.0                   |*/
  8. /*|                                                              |*/
  9. /*|                                                              |*/
  10. /*|     Copyright (c) 1987,1988,1990 by Borland International    |*/
  11. /*|     All Rights Reserved.                                     |*/
  12. /*|                                                              |*/
  13. /*[]------------------------------------------------------------[]*/
  14.  
  15. #pragma inline 
  16.  
  17. #include <stdio.h>
  18. #include <_stdio.h>
  19. #include <io.h>
  20.  
  21. void near _setupio( void )
  22.   {
  23.   if( !isatty( stdin->fd ) )  stdin->flags &= ~_F_TERM;
  24.   setvbuf( stdin, NULL, (stdin->flags & _F_TERM) ? _IOLBF : _IOFBF, BUFSIZ );
  25.  
  26.   if( !isatty( stdout->fd ) )  stdout->flags &= ~_F_TERM;
  27.   setvbuf( stdout, NULL, (stdout->flags & _F_TERM) ? _IONBF : _IOFBF, BUFSIZ );
  28.   }
  29.  
  30. /* #pragma startup _setupio 2 */
  31.  
  32. asm _INIT_     SEGMENT WORD PUBLIC 'INITDATA'
  33. asm         db      0
  34. asm         db      2
  35. asm         dw      offset _setupio
  36. asm         dw      0
  37. asm _INIT_  ENDS
  38.  
  39.