aboutsummaryrefslogtreecommitdiff
path: root/ncurses/base/lib_nl.c
diff options
context:
space:
mode:
Diffstat (limited to 'ncurses/base/lib_nl.c')
-rw-r--r--ncurses/base/lib_nl.c46
1 files changed, 31 insertions, 15 deletions
diff --git a/ncurses/base/lib_nl.c b/ncurses/base/lib_nl.c
index 32515da0be81..34254871c985 100644
--- a/ncurses/base/lib_nl.c
+++ b/ncurses/base/lib_nl.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -29,6 +29,8 @@
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
/*
@@ -42,38 +44,52 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_nl.c,v 1.8 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_nl.c,v 1.12 2009/10/24 22:05:55 tom Exp $")
#ifdef __EMX__
#include <io.h>
#endif
NCURSES_EXPORT(int)
-nl(void)
+NCURSES_SP_NAME(nl) (NCURSES_SP_DCL0)
{
- T((T_CALLED("nl()")));
-
- SP->_nl = TRUE;
-
+ T((T_CALLED("nl(%p)"), (void *) SP_PARM));
+ if (0 == SP_PARM)
+ returnCode(ERR);
+ SP_PARM->_nl = TRUE;
#ifdef __EMX__
_nc_flush();
- _fsetmode(NC_OUTPUT, "t");
+ _fsetmode(NC_OUTPUT(SP_PARM), "t");
#endif
-
returnCode(OK);
}
+#if NCURSES_SP_FUNCS
NCURSES_EXPORT(int)
-nonl(void)
+nl(void)
{
- T((T_CALLED("nonl()")));
-
- SP->_nl = FALSE;
+ return NCURSES_SP_NAME(nl) (CURRENT_SCREEN);
+}
+#endif
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(nonl) (NCURSES_SP_DCL0)
+{
+ T((T_CALLED("nonl(%p)"), (void *) SP_PARM));
+ if (0 == SP_PARM)
+ returnCode(ERR);
+ SP_PARM->_nl = FALSE;
#ifdef __EMX__
_nc_flush();
- _fsetmode(NC_OUTPUT, "b");
+ _fsetmode(NC_OUTPUT(SP_PARM), "b");
#endif
-
returnCode(OK);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+nonl(void)
+{
+ return NCURSES_SP_NAME(nonl) (CURRENT_SCREEN);
+}
+#endif