ncurses 4.1
[ncurses.git] / ncurses / lib_insdel.c
1
2 /***************************************************************************
3 *                            COPYRIGHT NOTICE                              *
4 ****************************************************************************
5 *                ncurses is copyright (C) 1992-1995                        *
6 *                          Zeyd M. Ben-Halim                               *
7 *                          zmbenhal@netcom.com                             *
8 *                          Eric S. Raymond                                 *
9 *                          esr@snark.thyrsus.com                           *
10 *                                                                          *
11 *        Permission is hereby granted to reproduce and distribute ncurses  *
12 *        by any means and for any fee, whether alone or as part of a       *
13 *        larger distribution, in source or in binary form, PROVIDED        *
14 *        this notice is included with any such distribution, and is not    *
15 *        removed from any of its header files. Mention of ncurses in any   *
16 *        applications linked with it is highly appreciated.                *
17 *                                                                          *
18 *        ncurses comes AS IS with no warranty, implied or expressed.       *
19 *                                                                          *
20 ***************************************************************************/
21
22 /*
23 **      lib_insdel.c
24 **
25 **      The routine winsdelln(win, n).
26 **  positive n insert n lines above current line
27 **  negative n delete n lines starting from current line
28 **
29 */
30
31 #include <curses.priv.h>
32
33 MODULE_ID("$Id")
34
35 int
36 winsdelln(WINDOW *win, int n)
37 {
38         T((T_CALLED("winsdel(%p,%d)"), win, n));
39
40         if (n == 0)
41                 returnCode(OK);
42
43         _nc_scroll_window(win, -n, win->_cury, win->_maxy);
44         touchline(win, win->_cury, win->_maxy - win->_cury + 1);
45
46         _nc_synchook(win);
47         returnCode(OK);
48 }