Switch from bioq_insert_tail() to bioqdisksort(). When the kernel is
[dragonfly.git] / contrib / nvi / ip / ip_term.c
blob28e686dddd288b42819115fb53cee8410ca9476f
1 /*-
2 * Copyright (c) 1996
3 * Keith Bostic. All rights reserved.
5 * See the LICENSE file for redistribution information.
6 */
8 #include "config.h"
10 #ifndef lint
11 static const char sccsid[] = "@(#)ip_term.c 8.2 (Berkeley) 10/13/96";
12 #endif /* not lint */
14 #include <sys/types.h>
15 #include <sys/queue.h>
17 #include <bitstring.h>
18 #include <stdio.h>
20 #include "../common/common.h"
21 #include "ip.h"
24 * ip_term_init --
25 * Initialize the terminal special keys.
27 * PUBLIC: int ip_term_init __P((SCR *));
29 int
30 ip_term_init(sp)
31 SCR *sp;
33 SEQ *qp;
36 * Rework any function key mappings that were set before the
37 * screen was initialized.
39 for (qp = sp->gp->seqq.lh_first; qp != NULL; qp = qp->q.le_next)
40 if (F_ISSET(qp, SEQ_FUNCMAP))
41 (void)ip_fmap(sp, qp->stype,
42 qp->input, qp->ilen, qp->output, qp->olen);
43 return (0);
47 * ip_term_end --
48 * End the special keys defined by the termcap/terminfo entry.
50 * PUBLIC: int ip_term_end __P((GS *));
52 int
53 ip_term_end(gp)
54 GS *gp;
56 SEQ *qp, *nqp;
58 /* Delete screen specific mappings. */
59 for (qp = gp->seqq.lh_first; qp != NULL; qp = nqp) {
60 nqp = qp->q.le_next;
61 if (F_ISSET(qp, SEQ_SCREEN))
62 (void)seq_mdel(qp);
64 return (0);
68 * ip_fmap --
69 * Map a function key.
71 * PUBLIC: int ip_fmap __P((SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t));
73 int
74 ip_fmap(sp, stype, from, flen, to, tlen)
75 SCR *sp;
76 seq_t stype;
77 CHAR_T *from, *to;
78 size_t flen, tlen;
80 /* Bind a function key to a string sequence. */
81 return (1);
85 * ip_optchange --
86 * IP screen specific "option changed" routine.
88 * PUBLIC: int ip_optchange __P((SCR *, int, char *, u_long *));
90 int
91 ip_optchange(sp, opt, str, valp)
92 SCR *sp;
93 int opt;
94 char *str;
95 u_long *valp;
97 switch (opt) {
98 case O_COLUMNS:
99 case O_LINES:
100 F_SET(sp->gp, G_SRESTART);
101 F_CLR(sp, SC_SCR_EX | SC_SCR_VI);
102 break;
103 case O_TERM:
104 msgq(sp, M_ERR, "The screen type may not be changed");
105 return (1);
107 return (0);