xref: /csrg-svn/lib/libcurses/delch.c (revision 67082)
122658Sdist /*
2*67082Sbostic  * Copyright (c) 1981, 1993, 1994
361264Sbostic  *	The Regents of the University of California.  All rights reserved.
434677Sbostic  *
542653Sbostic  * %sccs.include.redist.c%
622658Sdist  */
722658Sdist 
822658Sdist #ifndef lint
9*67082Sbostic static char sccsid[] = "@(#)delch.c	8.2 (Berkeley) 05/04/94";
1055953Sbostic #endif	/* not lint */
1122658Sdist 
1258047Selan #include <string.h>
133535Sarnold 
14*67082Sbostic #include "curses.h"
15*67082Sbostic 
163535Sarnold /*
1755953Sbostic  * wdelch --
1856238Selan  *	Do an insert-char on the line, leaving (cury, curx) unchanged.
193535Sarnold  */
2055953Sbostic int
wdelch(win)213535Sarnold wdelch(win)
2255953Sbostic 	register WINDOW *win;
2355953Sbostic {
2456647Selan 	register __LDATA *end, *temp1, *temp2;
253535Sarnold 
2656238Selan 	end = &win->lines[win->cury]->line[win->maxx - 1];
2756238Selan 	temp1 = &win->lines[win->cury]->line[win->curx];
283737Sarnold 	temp2 = temp1 + 1;
2956596Selan 	while (temp1 < end) {
3058041Selan 		(void)memcpy(temp1, temp2, sizeof(__LDATA));
3156596Selan 		temp1++, temp2++;
3256596Selan 	}
3356647Selan 	temp1->ch = ' ';
3456647Selan 	temp1->attr = 0;
3556650Selan 	__touchline(win, win->cury, win->curx, win->maxx - 1, 0);
3657472Sbostic 	return (OK);
373535Sarnold }
38