From 20923bb2e8235c0e3d72f7c6195523ad0b0a2afa Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 23 Jun 2024 13:29:12 +0200 Subject: grid: refactor: first step towards a more generic range handling --- terminal.h | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index 5033c550..fc654702 100644 --- a/terminal.h +++ b/terminal.h @@ -99,19 +99,30 @@ struct damage { uint16_t lines; }; -struct row_uri_range { - int start; - int end; +struct uri_range_data { uint64_t id; char *uri; }; +struct row_range { + int start; + int end; + + union { + struct uri_range_data uri; + }; +}; + +struct row_ranges { + struct row_range *v; + int size; + int count; +}; + +enum row_range_type {ROW_RANGE_URI}; + struct row_data { - struct { - struct row_uri_range *v; - uint32_t size; - uint32_t count; - } uri_ranges; + struct row_ranges uri_ranges; }; struct row { -- cgit v1.3