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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
$NetBSD: patch-am,v 1.2 2003/11/11 10:42:32 wiz Exp $
--- fep_vi.c.orig Wed May 29 07:31:27 1991
+++ fep_vi.c
@@ -6,7 +6,17 @@ static char rcsid[]=
#endif lint
#include <stdio.h>
+#include <sys/ioctl.h>
+#ifdef TERMIOS
+#include <termios.h>
+#ifdef __linux__
+#ifndef _POSIX_VDISABLE
+#define _POSIX_VDISABLE '\0'
+#endif
+#endif
+#else
#include <sgtty.h>
+#endif
#include <ctype.h>
#include "fep_defs.h"
#include "fep_glob.h"
@@ -107,7 +117,7 @@ BINDENT viComBindings[] = {
/* ^X-^V */ {"\\^X\\^V", view_buffer},
/* ^X-^X */ {"\\^X\\^X", expand_file_name},
/* ^X-? */ {"\\^X?", show_bindings},
- /* ^X-^C */ {"\\^X\\^C", terminate},
+ /* ^X-^C */ {"\\^X\\^C", (FUNC)terminate},
/* ^X-^D */ {"\\^X\\^D", send_eof},
/* ^X-( */ {"\\^X(", fep_start_script},
/* ^X-) */ {"\\^X)", fep_end_script},
@@ -138,7 +148,7 @@ BINDENT viInsertBindings[] = {
/* ^X-^L */ {"\\^X\\^L", fep_repaint},
/* ^X-^X */ {"\\^X\\^X", expand_file_name},
/* ^X-? */ {"\\^X?", show_bindings},
- /* ^X-^C */ {"\\^X\\^C", terminate},
+ /* ^X-^C */ {"\\^X\\^C", (FUNC)terminate},
/* ^X-^D */ {"\\^X\\^D", send_eof},
/* ^X-^V */ {"\\^X\\^V", view_buffer},
/* ^X-( */ {"\\^X(", fep_start_script},
@@ -161,7 +171,29 @@ FUNC cft[], aft[];
cft[i] = self_insert;
#define import(table,key,fn) if((int)key>0)table[(int)key]=fn
-
+#ifdef TERMIOS
+ /* Now, using cbreak mode
+ import (cft, initial_ttymode.c_cc[VSTART], ignore);
+ import (cft, initial_ttymode.c_cc[VSTOP], ignore);
+ */
+ import (cft, initial_ttymode.c_cc[VINTR], insert_and_flush);
+ import (aft, initial_ttymode.c_cc[VINTR], insert_and_flush);
+ import (cft, initial_ttymode.c_cc[VQUIT], insert_and_flush);
+ import (cft, initial_ttymode.c_cc[VEOF], send_eof);
+#ifdef VSWTC
+ import (cft, initial_ttymode.c_cc[VSWTC], insert_and_flush);
+#endif
+ import (cft, initial_ttymode.c_cc[VSUSP], insert_and_flush);
+#ifdef VDSUSP
+ import (cft, initial_ttymode.c_cc[VDSUSP], self_insert);
+#endif
+ import (cft, initial_ttymode.c_cc[VREPRINT], reprint);
+ import (cft, initial_ttymode.c_cc[VDISCARD], self_insert);
+ import (cft, initial_ttymode.c_cc[VWERASE], delete_previous_word);
+ import (cft, initial_ttymode.c_cc[VLNEXT], literal_next);
+ import (cft, initial_ttymode.c_cc[VERASE], delete_previous_character);
+ import (cft, initial_ttymode.c_cc[VKILL], delete_line);
+#else
/* Now, using cbreak mode
import (cft, tchars_buf.t_startx, ignore);
import (cft, tchars_buf.t_stopc, ignore);
@@ -179,6 +211,7 @@ FUNC cft[], aft[];
import (cft, ltchars_buf.t_lnextc, literal_next);
import (cft, initial_ttymode.sg_erase, delete_previous_character);
import (cft, initial_ttymode.sg_kill, delete_line);
+#endif
#undef import
|