aboutsummaryrefslogtreecommitdiffstats
path: root/libcmap.h
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-12-21 14:16:03 +0100
committerMattias Andrée <m@maandree.se>2025-12-21 14:16:03 +0100
commitd362e0d6f299eb1626ee316deaca0207b207f67c (patch)
treebbf8ab1ee9cfd0bb3e876cb545d98397d9dc4f2f /libcmap.h
parentFix truncation issue in libcmap_sprintf_range, and add LIBCMAP_ULTIMATE_CODEPOINT and LIBCMAP_UNIVERSE_RANGE (diff)
downloadlibcmap-d362e0d6f299eb1626ee316deaca0207b207f67c.tar.gz
libcmap-d362e0d6f299eb1626ee316deaca0207b207f67c.tar.bz2
libcmap-d362e0d6f299eb1626ee316deaca0207b207f67c.tar.xz
Add LIBCMAP_RANGE_SIZE
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libcmap.h')
-rw-r--r--libcmap.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libcmap.h b/libcmap.h
index 78c0a53..c02857b 100644
--- a/libcmap.h
+++ b/libcmap.h
@@ -17,6 +17,8 @@
#define LIBCMAP_ULTIMATE_CODEPOINT UINT32_C(0x10FFFF)
#define LIBCMAP_UNIVERSE_RANGE {0, LIBCMAP_ULTIMATE_CODEPOINT}
+#define LIBCMAP_RANGE_SIZE(RANGE) ((size_t)((RANGE)->last - (RANGE)->first + 1U))
+
struct libcmap_range {
uint32_t first;