Commit | Line | Data |
---|---|---|
6e1c93d0 | 1 | /* |
2f14f200 KB |
2 | * Copyright (c) 1981 Regents of the University of California. |
3 | * All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms are permitted | |
6 | * provided that this notice is preserved and that due credit is given | |
7 | * to the University of California at Berkeley. The name of the University | |
8 | * may not be used to endorse or promote products derived from this | |
9 | * software without specific prior written permission. This software | |
10 | * is provided ``as is'' without express or implied warranty. | |
6e1c93d0 DF |
11 | */ |
12 | ||
13 | #ifndef lint | |
2f14f200 KB |
14 | static char sccsid[] = "@(#)deleteln.c 5.2 (Berkeley) %G%"; |
15 | #endif /* not lint */ | |
6e1c93d0 | 16 | |
62a5fc29 KA |
17 | # include "curses.ext" |
18 | ||
19 | /* | |
20 | * This routine deletes a line from the screen. It leaves | |
21 | * (_cury,_curx) unchanged. | |
22 | * | |
62a5fc29 KA |
23 | */ |
24 | wdeleteln(win) | |
d45d8bdb JB |
25 | reg WINDOW *win; |
26 | { | |
62a5fc29 KA |
27 | reg char *temp; |
28 | reg int y; | |
29 | reg char *end; | |
d45d8bdb | 30 | reg int x; |
62a5fc29 | 31 | |
d45d8bdb JB |
32 | # ifdef DEBUG |
33 | fprintf(outf, "DELETELN(%0.2o)\n", win); | |
34 | # endif | |
62a5fc29 | 35 | temp = win->_y[win->_cury]; |
8da28f22 | 36 | for (y = win->_cury; y < win->_maxy - 1; y++) { |
d45d8bdb JB |
37 | if (win->_orig == NULL) |
38 | win->_y[y] = win->_y[y + 1]; | |
39 | else | |
40 | bcopy(win->_y[y + 1], win->_y[y], win->_maxx); | |
41 | touchline(win, y, 0, win->_maxx - 1); | |
62a5fc29 | 42 | } |
d45d8bdb JB |
43 | if (win->_orig == NULL) |
44 | win->_y[y] = temp; | |
45 | else | |
46 | temp = win->_y[y]; | |
62a5fc29 KA |
47 | for (end = &temp[win->_maxx]; temp < end; ) |
48 | *temp++ = ' '; | |
d45d8bdb JB |
49 | touchline(win, win->_cury, 0, win->_maxx - 1); |
50 | if (win->_orig == NULL) | |
51 | _id_subwins(win); | |
52 | return OK; | |
62a5fc29 | 53 | } |