aboutsummaryrefslogtreecommitdiff
path: root/include/unicode
diff options
context:
space:
mode:
Diffstat (limited to 'include/unicode')
-rw-r--r--include/unicode/prop.h1
-rw-r--r--include/unicode/string.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/include/unicode/prop.h b/include/unicode/prop.h
index a7e90ad..e11aa21 100644
--- a/include/unicode/prop.h
+++ b/include/unicode/prop.h
@@ -1144,6 +1144,7 @@ enum uprop_wb : uint_least8_t {
[[_mlib_pure]] enum uprop_sc uprop_get_sc(rune);
[[_mlib_pure]] enum uprop_vo uprop_get_vo(rune);
[[_mlib_pure]] enum uprop_wb uprop_get_wb(rune);
+[[_mlib_pure]] int uprop_get_wdth(rune);
[[_mlib_pure]] rune uprop_get_bmg(rune);
[[_mlib_pure]] rune uprop_get_bpb(rune);
[[_mlib_pure]] rune uprop_get_equideo(rune);
diff --git a/include/unicode/string.h b/include/unicode/string.h
index 975e4eb..ed082a1 100644
--- a/include/unicode/string.h
+++ b/include/unicode/string.h
@@ -30,6 +30,7 @@ enum normform {
/* clang-format on */
+[[nodiscard]] size_t u8wdth(struct u8view);
[[nodiscard]] size_t u8gcnt(struct u8view);
[[nodiscard]] size_t u8wcnt(struct u8view);
[[nodiscard]] size_t u8wcnt_human(struct u8view);
@@ -48,6 +49,7 @@ size_t u8wnext_human(struct u8view *, struct u8view *);
enum normform);
/* Encoding-generic macros */
+#define ucswdth(sv) _Generic((sv), struct u8view: u8wdth)((sv))
#define ucsgcnt(sv) _Generic((sv), struct u8view: u8gcnt)((sv))
#define ucswcnt(sv) _Generic((sv), struct u8view: u8wcnt)((sv))
#define ucswcnt_human(sv) _Generic((sv), struct u8view: u8wcnt_human)((sv))