aboutsummaryrefslogtreecommitdiff
path: root/pkg/utilities/nttools/tedit/display/screen/kend.x
blob: 5713005285335644e08a6761a11b209df8fa2c05 (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
46
47
48
49
include	<fset.h>

# K_END -- Terminate keyboard
#
# B.Simon	23-Jan-89	Original

procedure k_end ()

#--
include	"screen.com"

int	klen
int	strlen()

begin
	# Restore keyboard to original state and end raw mode

	if (ttyin != NULL) {
	    if (term != NULL) {
		klen = strlen (ke)
		if (klen > 0)
		    call ttywrite (ttyout, term, ke, klen, 1)
	    }
	    call fseti (ttyin, F_RAW, NO)
	}

	# Release dynamic memory

	if (keytab != NULL)
	    call mfree (keytab, TY_INT)

	if (htext != NULL)
	    call mfree (htext, TY_CHAR)
	
end

# K_ERROR -- Procedure called on error exit

procedure k_error (status)

int	status		# i: Error status
#--

begin
	if (status != OK) {
	    call k_end
	    call ps_end
	}
end