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.9 2001/06/25 15:19:24 skimo Exp $ (Berkeley) $Date: 2001/06/25 15:19:24 $";
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 *));
37 * Rework any function key mappings that were set before the
38 * screen was initialized.
40 for (qp
= sp
->gp
->seqq
.lh_first
; qp
!= NULL
; qp
= qp
->q
.le_next
)
41 if (F_ISSET(qp
, SEQ_FUNCMAP
))
42 (void)ip_fmap(sp
, qp
->stype
,
43 qp
->input
, qp
->ilen
, qp
->output
, qp
->olen
);
49 * End the special keys defined by the termcap/terminfo entry.
51 * PUBLIC: int ip_term_end __P((GS *));
58 /* Delete screen specific mappings. */
59 for (qp
= gp
->seqq
.lh_first
; qp
!= NULL
; qp
= nqp
) {
61 if (F_ISSET(qp
, SEQ_SCREEN
))
71 * PUBLIC: int ip_fmap __P((SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t));
74 ip_fmap(SCR
*sp
, seq_t stype
, CHAR_T
*from
, size_t flen
, CHAR_T
*to
, size_t tlen
)
76 /* Bind a function key to a string sequence. */
82 * IP screen specific "option changed" routine.
84 * PUBLIC: int ip_optchange __P((SCR *, int, char *, u_long *));
87 ip_optchange(SCR
*sp
, int offset
, char *str
, u_long
*valp
)
91 IP_PRIVATE
*ipp
= IPP(sp
);
98 F_SET(sp
->gp
, G_SRESTART
);
99 F_CLR(sp
, SC_SCR_EX
| SC_SCR_VI
);
102 /* Called with "ip_curses"; previously wasn't shown
103 * because switching to EX wasn't allowed
104 msgq(sp, M_ERR, "The screen type may not be changed");
109 opt
= optlist
+ offset
;
123 ipb
.len2
= strlen(str
) + 1;
128 ipb
.code
= SI_EDITOPT
;
129 ipb
.str1
= (char*)opt
->name
;
130 ipb
.len1
= STRLEN(opt
->name
) * sizeof(CHAR_T
);
132 (void)vi_send(ipp
->o_fd
, "ab1", &ipb
);