]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_nl.c
ncurses 5.7 - patch 20090221
[ncurses.git] / ncurses / base / lib_nl.c
index 75d4a638148d6547327cfaff9b2aa2292ea8b8e3..9a05ab8bc73583f025c0ef9c3c25921adb1f0bb3 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998 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            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
 /****************************************************************************
  *  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                    *
  ****************************************************************************/
 
  ****************************************************************************/
 
-
 /*
  *     nl.c
  *
 /*
  *     nl.c
  *
 
 #include <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_nl.c,v 1.4 1999/10/22 22:31:51 tom Exp $")
+MODULE_ID("$Id: lib_nl.c,v 1.10 2009/02/21 20:58:21 tom Exp $")
 
 #ifdef __EMX__
 #include <io.h>
 
 #ifdef __EMX__
 #include <io.h>
-#include <fcntl.h>
 #endif
 
 #endif
 
-int nl(void)
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(nl) (NCURSES_SP_DCL0)
 {
 {
-       T((T_CALLED("nl()")));
-
-       SP->_nl = TRUE;
-
+    T((T_CALLED("nl(%p)"), SP_PARM));
+    if (0 == SP_PARM)
+       returnCode(ERR);
+    SP_PARM->_nl = TRUE;
 #ifdef __EMX__
 #ifdef __EMX__
-       _nc_flush();
-       _fsetmode(NC_OUTPUT, "t");
+    _nc_flush();
+    _fsetmode(NC_OUTPUT, "t");
 #endif
 #endif
-
-       returnCode(OK);
+    returnCode(OK);
 }
 
 }
 
-int nonl(void)
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+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)"), SP_PARM));
+    if (0 == SP_PARM)
+       returnCode(ERR);
+    SP_PARM->_nl = FALSE;
 #ifdef __EMX__
 #ifdef __EMX__
-       _nc_flush();
-       _fsetmode(NC_OUTPUT, "b");
+    _nc_flush();
+    _fsetmode(NC_OUTPUT, "b");
 #endif
 #endif
+    returnCode(OK);
+}
 
 
-       returnCode(OK);
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+nonl(void)
+{
+    return NCURSES_SP_NAME(nonl) (CURRENT_SCREEN);
 }
 }
+#endif