aboutsummaryrefslogtreecommitdiff
path: root/pkg/utilities/nttools/tedit/display/curses/clrtoeol.x
blob: 2c42a64e682b1674cf1706cf43c02c1e68d1492e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
include "../curses.h"
include "window.h"

# CLRTOEOL -- Clear window to end of current line
#
# B.Simon	01-Oct-90	Original

procedure clrtoeol ()

#--

begin
	call wclrtoeol (STDSCR)
end

procedure wclrtoeol (win)

int	win		# i: Window descriptor
#--
include "window.com"

int	blank, rect[RSIZE]
pointer	pwin

data	blank	/ ' ' /

begin
	pwin = warray[win]

	# Construct the rectangle consisting of the remainder of the
	# current line and fill with blanks

	RTOP(rect) = WIN_TOP(pwin) + WIN_CURROW(pwin) - 1
	RLEFT(rect) = WIN_LEFT(pwin) + WIN_CURCOL(pwin) - 1
	RBOT(rect) = RTOP(rect)
	RRIGHT(rect) = WIN_RIGHT(pwin)
	call ps_fill (rect, blank, WIN_ATRIB(pwin))

	# Move the cursor to the new end of the line

	if (WIN_LEAVE(pwin) == NO)
	    call ps_setcur (WIN_TOP(pwin)+WIN_CURROW(pwin)-1,
			    WIN_LEFT(pwin)+WIN_CURCOL(pwin)-1)

end