3 * Keith Bostic. All rights reserved.
5 * See the LICENSE file for redistribution information.
11 static const char sccsid
[] = "$Id: ip_term.c,v 8.5 1996/12/18 10:28:04 bostic Exp $ (Berkeley) $Date: 1996/12/18 10:28:04 $";
14 #include <sys/types.h>
15 #include <sys/queue.h>
17 #include <bitstring.h>
21 #include "../common/common.h"
22 #include "../ipc/ip.h"
27 * Initialize the terminal special keys.
29 * PUBLIC: int ip_term_init __P((SCR *));
38 * Rework any function key mappings that were set before the
39 * screen was initialized.
41 for (qp
= sp
->gp
->seqq
.lh_first
; qp
!= NULL
; qp
= qp
->q
.le_next
)
42 if (F_ISSET(qp
, SEQ_FUNCMAP
))
43 (void)ip_fmap(sp
, qp
->stype
,
44 qp
->input
, qp
->ilen
, qp
->output
, qp
->olen
);
50 * End the special keys defined by the termcap/terminfo entry.
52 * PUBLIC: int ip_term_end __P((GS *));
60 /* Delete screen specific mappings. */
61 for (qp
= gp
->seqq
.lh_first
; qp
!= NULL
; qp
= nqp
) {
63 if (F_ISSET(qp
, SEQ_SCREEN
))
73 * PUBLIC: int ip_fmap __P((SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t));
76 ip_fmap(sp
, stype
, from
, flen
, to
, tlen
)
82 /* Bind a function key to a string sequence. */
88 * IP screen specific "option changed" routine.
90 * PUBLIC: int ip_optchange __P((SCR *, int, char *, u_long *));
93 ip_optchange(sp
, offset
, str
, valp
)
105 F_SET(sp
->gp
, G_SRESTART
);
106 F_CLR(sp
, SC_SCR_EX
| SC_SCR_VI
);
109 msgq(sp
, M_ERR
, "The screen type may not be changed");
113 opt
= optlist
+ offset
;
127 ipb
.len2
= strlen(str
) + 1;
132 ipb
.code
= SI_EDITOPT
;
133 ipb
.str1
= opt
->name
;
134 ipb
.len1
= strlen(opt
->name
);
136 (void)vi_send("ab1", &ipb
);