aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/error.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-09-12 13:33:18 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-09-12 16:42:08 +0200
commit73d574b71a10d4661ada20275cafde75aff6c1ba (patch)
tree10ba478542edd4f428120c3609f8dfbe8fb79137 /src/error.h
parentfe26d83c69c9da6594ba7e27aacc185faa1be161 (diff)
downloadsciteco-73d574b71a10d4661ada20275cafde75aff6c1ba.tar.gz
teco_string_get_coord() returns character offsets now (refs #5)
* This is used for error messages (TECO macro stackframes), so it's important to display columns in characters. * Program counters are in bytes and therefore everywhere gsize. This is by glib convention.
Diffstat (limited to 'src/error.h')
-rw-r--r--src/error.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/error.h b/src/error.h
index 7543d02..b12ec80 100644
--- a/src/error.h
+++ b/src/error.h
@@ -143,7 +143,11 @@ teco_error_return_set(GError **error, guint args)
extern guint teco_error_pos, teco_error_line, teco_error_column;
-void teco_error_set_coord(const gchar *str, guint pos);
+static inline void
+teco_error_set_coord(const gchar *str, gsize pos)
+{
+ teco_string_get_coord(str, pos, &teco_error_pos, &teco_error_line, &teco_error_column);
+}
void teco_error_display_short(const GError *error);
void teco_error_display_full(const GError *error);