lib_nl.c revision 50276
155682Smarkm/****************************************************************************
2233294Sstas * Copyright (c) 1998 Free Software Foundation, Inc.                        *
355682Smarkm *                                                                          *
455682Smarkm * Permission is hereby granted, free of charge, to any person obtaining a  *
5233294Sstas * copy of this software and associated documentation files (the            *
655682Smarkm * "Software"), to deal in the Software without restriction, including      *
755682Smarkm * without limitation the rights to use, copy, modify, merge, publish,      *
855682Smarkm * distribute, distribute with modifications, sublicense, and/or sell       *
9233294Sstas * copies of the Software, and to permit persons to whom the Software is    *
1055682Smarkm * furnished to do so, subject to the following conditions:                 *
1155682Smarkm *                                                                          *
12233294Sstas * The above copyright notice and this permission notice shall be included  *
1355682Smarkm * in all copies or substantial portions of the Software.                   *
1455682Smarkm *                                                                          *
1555682Smarkm * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16233294Sstas * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
1755682Smarkm * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
1855682Smarkm * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
1955682Smarkm * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20233294Sstas * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
2155682Smarkm * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
2255682Smarkm *                                                                          *
2355682Smarkm * Except as contained in this notice, the name(s) of the above copyright   *
2455682Smarkm * holders shall not be used in advertising or otherwise to promote the     *
2555682Smarkm * sale, use or other dealings in this Software without prior written       *
2655682Smarkm * authorization.                                                           *
2755682Smarkm ****************************************************************************/
2855682Smarkm
2955682Smarkm/****************************************************************************
3055682Smarkm *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
3155682Smarkm *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
3255682Smarkm ****************************************************************************/
3355682Smarkm
3455682Smarkm
3555682Smarkm/*
3655682Smarkm *	nl.c
3772445Sassar *
3855682Smarkm *	Routines:
3955682Smarkm *		nl()
4055682Smarkm *		nonl()
4155682Smarkm *
4255682Smarkm */
4355682Smarkm
4455682Smarkm#include <curses.priv.h>
4555682Smarkm
4655682SmarkmMODULE_ID("$Id: lib_nl.c,v 1.3 1998/10/14 15:14:08 Alexander.V.Lukyanov Exp $")
4755682Smarkm
4855682Smarkm#ifdef __EMX__
4955682Smarkm#include <io.h>
50233294Sstas#include <fcntl.h>
5155682Smarkm#endif
5255682Smarkm
5355682Smarkmint nl(void)
5455682Smarkm{
5555682Smarkm	T((T_CALLED("nl()")));
5655682Smarkm
5755682Smarkm	SP->_nl = TRUE;
5855682Smarkm
5955682Smarkm#ifdef __EMX__
6055682Smarkm	fflush(SP->_ofp);
6155682Smarkm	_fsetmode(SP->_ofp, "t");
6255682Smarkm#endif
6355682Smarkm
6455682Smarkm	returnCode(OK);
6555682Smarkm}
6655682Smarkm
6755682Smarkmint nonl(void)
6855682Smarkm{
6955682Smarkm	T((T_CALLED("nonl()")));
7055682Smarkm
7155682Smarkm	SP->_nl = FALSE;
7255682Smarkm
7355682Smarkm#ifdef __EMX__
7455682Smarkm	fflush(SP->_ofp);
7555682Smarkm	_fsetmode(SP->_ofp, "b");
7655682Smarkm#endif
7755682Smarkm
78	returnCode(OK);
79}
80