xref: /original-bsd/lib/libcurses/delch.c (revision 4ba124f7)
1 /*
2  * Copyright (c) 1981, 1993, 1994
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)delch.c	8.2 (Berkeley) 05/04/94";
10 #endif	/* not lint */
11 
12 #include <string.h>
13 
14 #include "curses.h"
15 
16 /*
17  * wdelch --
18  *	Do an insert-char on the line, leaving (cury, curx) unchanged.
19  */
20 int
21 wdelch(win)
22 	register WINDOW *win;
23 {
24 	register __LDATA *end, *temp1, *temp2;
25 
26 	end = &win->lines[win->cury]->line[win->maxx - 1];
27 	temp1 = &win->lines[win->cury]->line[win->curx];
28 	temp2 = temp1 + 1;
29 	while (temp1 < end) {
30 		(void)memcpy(temp1, temp2, sizeof(__LDATA));
31 		temp1++, temp2++;
32 	}
33 	temp1->ch = ' ';
34 	temp1->attr = 0;
35 	__touchline(win, win->cury, win->curx, win->maxx - 1, 0);
36 	return (OK);
37 }
38