home *** CD-ROM | disk | FTP | other *** search
- /*-----------------------------------------------------------------------*
- * filename - setupio.c
- *-----------------------------------------------------------------------*/
-
- /*[]------------------------------------------------------------[]*/
- /*| |*/
- /*| Turbo C Run Time Library - Version 3.0 |*/
- /*| |*/
- /*| |*/
- /*| Copyright (c) 1987,1988,1990 by Borland International |*/
- /*| All Rights Reserved. |*/
- /*| |*/
- /*[]------------------------------------------------------------[]*/
-
- #pragma inline
-
- #include <stdio.h>
- #include <_stdio.h>
- #include <io.h>
-
- void near _setupio( void )
- {
- if( !isatty( stdin->fd ) ) stdin->flags &= ~_F_TERM;
- setvbuf( stdin, NULL, (stdin->flags & _F_TERM) ? _IOLBF : _IOFBF, BUFSIZ );
-
- if( !isatty( stdout->fd ) ) stdout->flags &= ~_F_TERM;
- setvbuf( stdout, NULL, (stdout->flags & _F_TERM) ? _IONBF : _IOFBF, BUFSIZ );
- }
-
- /* #pragma startup _setupio 2 */
-
- asm _INIT_ SEGMENT WORD PUBLIC 'INITDATA'
- asm db 0
- asm db 2
- asm dw offset _setupio
- asm dw 0
- asm _INIT_ ENDS
-
-