From d8760ab5cf8378fa50e48453149e96a1392253e2 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 15 Sep 2024 19:20:44 +0200 Subject: Shorten the string view type names --- include/unicode/prop.h | 6 +++--- include/unicode/string.h | 48 ++++++++++++++++++++++++------------------------ 2 files changed, 27 insertions(+), 27 deletions(-) (limited to 'include/unicode') diff --git a/include/unicode/prop.h b/include/unicode/prop.h index e11aa21..a3498f0 100644 --- a/include/unicode/prop.h +++ b/include/unicode/prop.h @@ -1117,7 +1117,7 @@ enum uprop_wb : uint_least8_t { }; /* Not a Unicode property; but a nice-to-have */ -[[_mlib_pure]] struct u8view uprop_blkname(enum uprop_blk); +[[_mlib_pure]] u8view_t uprop_blkname(enum uprop_blk); [[_mlib_pure]] double uprop_get_nv(rune); [[_mlib_pure]] enum uprop_age uprop_get_age(rune); @@ -1159,8 +1159,8 @@ enum uprop_wb : uint_least8_t { [[_mlib_pure]] struct rview uprop_get_nfkc_scf(rune); [[_mlib_pure]] struct rview uprop_get_tc(rune, struct tcctx); [[_mlib_pure]] struct rview uprop_get_uc(rune, struct ucctx); -[[_mlib_pure]] struct u8view uprop_get_na1(rune); -[[_mlib_pure]] struct u8view uprop_get_na(rune); +[[_mlib_pure]] u8view_t uprop_get_na1(rune); +[[_mlib_pure]] u8view_t uprop_get_na(rune); [[_mlib_pure]] struct uprop_sc_view uprop_get_scx(rune); /* PROP PREDICATES START */ diff --git a/include/unicode/string.h b/include/unicode/string.h index 6908fe7..7d62171 100644 --- a/include/unicode/string.h +++ b/include/unicode/string.h @@ -30,47 +30,47 @@ enum normform { /* clang-format on */ -[[nodiscard]] size_t u8wdth(struct u8view, int); -[[nodiscard]] size_t u8gcnt(struct u8view); -[[nodiscard]] size_t u8wcnt(struct u8view); -[[nodiscard]] size_t u8wcnt_human(struct u8view); -size_t u8gnext(struct u8view *, struct u8view *); -size_t u8wnext(struct u8view *, struct u8view *); -size_t u8wnext_human(struct u8view *, struct u8view *); -[[nodiscard]] char8_t *u8casefold(size_t *, struct u8view, enum caseflags, +[[nodiscard]] size_t u8wdth(u8view_t, int); +[[nodiscard]] size_t u8gcnt(u8view_t); +[[nodiscard]] size_t u8wcnt(u8view_t); +[[nodiscard]] size_t u8wcnt_human(u8view_t); +size_t u8gnext(u8view_t *, u8view_t *); +size_t u8wnext(u8view_t *, u8view_t *); +size_t u8wnext_human(u8view_t *, u8view_t *); +[[nodiscard]] char8_t *u8casefold(size_t *, u8view_t, enum caseflags, alloc_fn, void *); -[[nodiscard]] char8_t *u8lower(size_t *, struct u8view, enum caseflags, +[[nodiscard]] char8_t *u8lower(size_t *, u8view_t, enum caseflags, alloc_fn, void *); -[[nodiscard]] char8_t *u8title(size_t *, struct u8view, enum caseflags, +[[nodiscard]] char8_t *u8title(size_t *, u8view_t, enum caseflags, alloc_fn, void *); -[[nodiscard]] char8_t *u8upper(size_t *, struct u8view, enum caseflags, +[[nodiscard]] char8_t *u8upper(size_t *, u8view_t, enum caseflags, alloc_fn, void *); -[[nodiscard]] char8_t *u8norm(size_t *, struct u8view, alloc_fn, void *, +[[nodiscard]] char8_t *u8norm(size_t *, u8view_t, alloc_fn, void *, enum normform); /* Encoding-generic macros */ -#define ucswdth(sv, ts) _Generic((sv), struct u8view: u8wdth)((sv), (ts)) -#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)) -#define ucsgnext(g, sv) _Generic((sv), struct u8view *: u8gnext)((g), (sv)) -#define ucswnext(g, sv) _Generic((sv), struct u8view *: u8wnext)((g), (sv)) +#define ucswdth(sv, ts) _Generic((sv), u8view_t: u8wdth)((sv), (ts)) +#define ucsgcnt(sv) _Generic((sv), u8view_t: u8gcnt)((sv)) +#define ucswcnt(sv) _Generic((sv), u8view_t: u8wcnt)((sv)) +#define ucswcnt_human(sv) _Generic((sv), u8view_t: u8wcnt_human)((sv)) +#define ucsgnext(g, sv) _Generic((sv), u8view_t *: u8gnext)((g), (sv)) +#define ucswnext(g, sv) _Generic((sv), u8view_t *: u8wnext)((g), (sv)) #define ucswnext_human(g, sv) \ - _Generic((sv), struct u8view *: u8wnext_human)((g), (sv)) + _Generic((sv), u8view_t *: u8wnext_human)((g), (sv)) #define ucscasefold(dstn, sv, flags, alloc, ctx) \ - _Generic((sv), struct u8view: u8casefold)((dstn), (sv), (flags), (alloc), \ + _Generic((sv), u8view_t: u8casefold)((dstn), (sv), (flags), (alloc), \ (ctx)) #define ucslower(dstn, sv, flags, alloc, ctx) \ - _Generic((sv), struct u8view: u8lower)((dstn), (sv), (flags), (alloc), \ + _Generic((sv), u8view_t: u8lower)((dstn), (sv), (flags), (alloc), \ (ctx)) #define ucstitle(dstn, sv, flags, alloc, ctx) \ - _Generic((sv), struct u8view: u8title)((dstn), (sv), (flags), (alloc), \ + _Generic((sv), u8view_t: u8title)((dstn), (sv), (flags), (alloc), \ (ctx)) #define ucsupper(dstn, sv, flags, alloc, ctx) \ - _Generic((sv), struct u8view: u8upper)((dstn), (sv), (flags), (alloc), \ + _Generic((sv), u8view_t: u8upper)((dstn), (sv), (flags), (alloc), \ (ctx)) #define ucsnorm(dstn, sv, alloc, ctx, nf) \ - _Generic((sv), struct u8view: u8norm)((dstn), (sv), (alloc), (ctx), (nf)) + _Generic((sv), u8view_t: u8norm)((dstn), (sv), (alloc), (ctx), (nf)) constexpr double U8CASEFOLD_SCALE = 3; constexpr double U8LOWER_SCALE = 1.5; -- cgit v1.2.3