summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/teken/teken.c4
-rw-r--r--sys/teken/teken_scs.h30
-rw-r--r--sys/teken/teken_subr.h22
3 files changed, 14 insertions, 42 deletions
diff --git a/sys/teken/teken.c b/sys/teken/teken.c
index c928510b86d9..f44969dcbb7e 100644
--- a/sys/teken/teken.c
+++ b/sys/teken/teken.c
@@ -196,13 +196,13 @@ teken_input_char(teken_t *t, teken_char_t c)
if (t->t_stateflags & TS_CONS25)
t->t_nextstate(t, c);
else
- teken_scs_switch(t, 1);
+ t->t_curscs = 1;
break;
case '\x0F':
if (t->t_stateflags & TS_CONS25)
t->t_nextstate(t, c);
else
- teken_scs_switch(t, 0);
+ t->t_curscs = 0;
break;
case '\r':
teken_subr_carriage_return(t);
diff --git a/sys/teken/teken_scs.h b/sys/teken/teken_scs.h
index 5f42aa41c052..815e1d7f6680 100644
--- a/sys/teken/teken_scs.h
+++ b/sys/teken/teken_scs.h
@@ -26,35 +26,7 @@
* $FreeBSD$
*/
-static void
-teken_scs_set(teken_t *t, unsigned int g, teken_scs_t *ts)
-{
-
- t->t_scs[g] = ts;
-}
-
-static void
-teken_scs_switch(teken_t *t, unsigned int g)
-{
-
- t->t_curscs = g;
-}
-
-static void
-teken_scs_restore(teken_t *t)
-{
-
- t->t_scs[t->t_curscs] = t->t_saved_curscs;
-}
-
-static void
-teken_scs_save(teken_t *t)
-{
-
- t->t_saved_curscs = t->t_scs[t->t_curscs];
-}
-
-static teken_char_t
+static inline teken_char_t
teken_scs_process(teken_t *t, teken_char_t c)
{
diff --git a/sys/teken/teken_subr.h b/sys/teken/teken_subr.h
index 7d8cd0cbe935..0332770d34a1 100644
--- a/sys/teken/teken_subr.h
+++ b/sys/teken/teken_subr.h
@@ -540,42 +540,42 @@ static void
teken_subr_g0_scs_special_graphics(teken_t *t __unused)
{
- teken_scs_set(t, 0, teken_scs_special_graphics);
+ t->t_scs[0] = teken_scs_special_graphics;
}
static void
teken_subr_g0_scs_uk_national(teken_t *t __unused)
{
- teken_scs_set(t, 0, teken_scs_uk_national);
+ t->t_scs[0] = teken_scs_uk_national;
}
static void
teken_subr_g0_scs_us_ascii(teken_t *t __unused)
{
- teken_scs_set(t, 0, teken_scs_us_ascii);
+ t->t_scs[0] = teken_scs_us_ascii;
}
static void
teken_subr_g1_scs_special_graphics(teken_t *t __unused)
{
- teken_scs_set(t, 1, teken_scs_special_graphics);
+ t->t_scs[1] = teken_scs_special_graphics;
}
static void
teken_subr_g1_scs_uk_national(teken_t *t __unused)
{
- teken_scs_set(t, 1, teken_scs_uk_national);
+ t->t_scs[1] = teken_scs_uk_national;
}
static void
teken_subr_g1_scs_us_ascii(teken_t *t __unused)
{
- teken_scs_set(t, 1, teken_scs_us_ascii);
+ t->t_scs[1] = teken_scs_us_ascii;
}
static void
@@ -962,9 +962,9 @@ teken_subr_do_reset(teken_t *t)
t->t_stateflags &= TS_8BIT|TS_CONS25;
t->t_stateflags |= TS_AUTOWRAP;
- teken_scs_set(t, 0, teken_scs_us_ascii);
- teken_scs_set(t, 1, teken_scs_us_ascii);
- teken_scs_switch(t, 0);
+ t->t_scs[0] = teken_scs_us_ascii;
+ t->t_scs[1] = teken_scs_us_ascii;
+ t->t_curscs = 0;
teken_subr_save_cursor(t);
teken_tab_default(t);
@@ -986,8 +986,8 @@ teken_subr_restore_cursor(teken_t *t)
t->t_cursor = t->t_saved_cursor;
t->t_curattr = t->t_saved_curattr;
+ t->t_scs[t->t_curscs] = t->t_saved_curscs;
t->t_stateflags &= ~TS_WRAPPED;
- teken_scs_restore(t);
teken_funcs_cursor(t);
}
@@ -1010,7 +1010,7 @@ teken_subr_save_cursor(teken_t *t)
t->t_saved_cursor = t->t_cursor;
t->t_saved_curattr = t->t_curattr;
- teken_scs_save(t);
+ t->t_saved_curscs = t->t_scs[t->t_curscs];
}
static void