1 if [ "$ENCODING" = "utf8" ]; then
3 ARRAYTYPE="UTF-8-encoded string"
9 ARRAYTYPE="codepoint array"
12 DATATYPE="uint_least32_t"
17 .Dt GRAPHEME_TO_$(printf "%s%s" "$CASE" "$SUFFIX" | tr [:lower:] [:upper:]) 3
20 .Nm grapheme_to_${CASE}${SUFFIX}
21 .Nd convert ${ARRAYTYPE} to ${CASE}
25 .Fn grapheme_to_${CASE}${SUFFIX} "const ${DATATYPE} *src" "size_t srclen" "${DATATYPE} *dest" "size_t destlen"
28 .Fn grapheme_to_${CASE}${SUFFIX}
29 function converts the ${ARRAYTYPE}
31 to ${CASE} and writes the result to
44 (stdint.h is already included by grapheme.h) the ${ARRAYTYPE}
46 is interpreted to be NUL-terminated and processing stops when a
47 NUL-byte is encountered.
49 For $(if [ "$ENCODING" != "utf8" ]; then printf "UTF-8-encoded"; else printf "non-UTF-8"; fi) input data
50 .Xr grapheme_to_${CASE}${ANTISUFFIX} 3
54 .Fn grapheme_to_${CASE}${SUFFIX}
55 function returns the number of ${UNIT}s in the array resulting
60 is not large enough or
65 .Xr grapheme_to_${CASE}${ANTISUFFIX} 3 ,
68 .Fn grapheme_to_${CASE}${SUFFIX}
69 is compliant with the Unicode ${UNICODE_VERSION} specification.
71 .An Laslo Hunhold Aq Mt dev@frign.de