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.7 2000/07/11 15:11:00 skimo Exp $ (Berkeley) $Date: 2000/07/11 15:11:00 $";
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
)
101 IP_PRIVATE
*ipp
= IPP(sp
);
106 F_SET(sp
->gp
, G_SRESTART
);
107 F_CLR(sp
, SC_SCR_EX
| SC_SCR_VI
);
110 /* Called with "ip_curses"; previously wasn't shown
111 * because switching to EX wasn't allowed
112 msgq(sp, M_ERR, "The screen type may not be changed");
117 opt
= optlist
+ offset
;
131 ipb
.len2
= strlen(str
) + 1;
136 ipb
.code
= SI_EDITOPT
;
137 ipb
.str1
= opt
->name
;
138 ipb
.len1
= strlen(opt
->name
);
140 (void)vi_send(ipp
->o_fd
, "ab1", &ipb
);