aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/error.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.h')
-rw-r--r--src/error.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/error.h b/src/error.h
index 1306feb..19b707e 100644
--- a/src/error.h
+++ b/src/error.h
@@ -42,6 +42,7 @@ typedef enum {
TECO_ERROR_SYNTAX,
TECO_ERROR_MODIFIER,
TECO_ERROR_ARGEXPECTED,
+ TECO_ERROR_RADIX,
TECO_ERROR_LABEL,
TECO_ERROR_CODEPOINT,
TECO_ERROR_MOVE,
@@ -95,6 +96,14 @@ teco_error_argexpected_set(GError **error, const gchar *cmd)
}
static inline void
+teco_error_radix_set(GError **error, gchar chr, teco_int_t radix)
+{
+ g_set_error(error, TECO_ERROR, TECO_ERROR_RADIX,
+ "Digit \"%c\" not allowed in radix %" TECO_INT_FORMAT,
+ chr, radix);
+}
+
+static inline void
teco_error_label_set(GError **error, const gchar *name, gsize len)
{
g_autofree gchar *label_printable = teco_string_echo(name, len);