aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/stdio-commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio-commands.c')
-rw-r--r--src/stdio-commands.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/stdio-commands.c b/src/stdio-commands.c
index 565f442..abb6566 100644
--- a/src/stdio-commands.c
+++ b/src/stdio-commands.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012-2025 Robin Haberkorn
+ * Copyright (C) 2012-2026 Robin Haberkorn
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -118,7 +118,7 @@ teco_print(teco_machine_main_t *ctx, guint radix, GError **error)
* then octal and finally in hexadecimal.
* This won't happen e.g. in a loop that is closed on the command-line.
*/
-TECO_DECLARE_STATE(teco_state_print_octal);
+static teco_state_t teco_state_print_octal;
static gboolean
teco_state_print_decimal_initial(teco_machine_main_t *ctx, GError **error)
@@ -168,6 +168,7 @@ teco_state_print_decimal_end_of_macro(teco_machine_main_t *ctx, GError **error)
TECO_DEFINE_STATE_START(teco_state_print_decimal,
.initial_cb = (teco_state_initial_cb_t)teco_state_print_decimal_initial,
+ .input_cb = (teco_state_input_cb_t)teco_state_print_decimal_input,
.end_of_macro_cb = (teco_state_end_of_macro_cb_t)
teco_state_print_decimal_end_of_macro
);
@@ -224,8 +225,9 @@ teco_state_print_octal_end_of_macro(teco_machine_main_t *ctx, GError **error)
return TRUE;
}
-TECO_DEFINE_STATE_START(teco_state_print_octal,
+static TECO_DEFINE_STATE_START(teco_state_print_octal,
.initial_cb = (teco_state_initial_cb_t)teco_state_print_octal_initial,
+ .input_cb = (teco_state_input_cb_t)teco_state_print_octal_input,
.end_of_macro_cb = (teco_state_end_of_macro_cb_t)
teco_state_print_octal_end_of_macro
);
@@ -251,9 +253,9 @@ teco_state_print_string_initial(teco_machine_main_t *ctx, GError **error)
}
static teco_state_t *
-teco_state_print_string_done(teco_machine_main_t *ctx, const teco_string_t *str, GError **error)
+teco_state_print_string_done(teco_machine_main_t *ctx, teco_string_t str, GError **error)
{
- teco_interface_msg_literal(TECO_MSG_USER, str->data, str->len);
+ teco_interface_msg_literal(TECO_MSG_USER, str.data, str.len);
return &teco_state_start;
}
@@ -282,7 +284,8 @@ teco_state_print_string_done(teco_machine_main_t *ctx, const teco_string_t *str,
* ^EUq, ^E<...> and case folding.
*/
TECO_DEFINE_STATE_EXPECTSTRING(teco_state_print_string,
- .initial_cb = (teco_state_initial_cb_t)teco_state_print_string_initial
+ .initial_cb = (teco_state_initial_cb_t)teco_state_print_string_initial,
+ .expectstring.done_cb = teco_state_print_string_done
);
/*$ T type typeout