1 3448adb0 2022-11-02 op if [ "$ENCODING" = "utf8" ]; then
3 3448adb0 2022-11-02 op ARRAYTYPE="UTF-8-encoded string"
6 3448adb0 2022-11-02 op DATATYPE="char"
8 3448adb0 2022-11-02 op UNIT="codepoint"
9 3448adb0 2022-11-02 op ARRAYTYPE="codepoint array"
11 3448adb0 2022-11-02 op ANTISUFFIX="_utf8"
12 3448adb0 2022-11-02 op DATATYPE="uint_least32_t"
16 3448adb0 2022-11-02 op .Dd ${MAN_DATE}
17 3448adb0 2022-11-02 op .Dt GRAPHEME_TO_$(printf "%s%s" "$CASE" "$SUFFIX" | tr [:lower:] [:upper:]) 3
18 3448adb0 2022-11-02 op .Os suckless.org
20 3448adb0 2022-11-02 op .Nm grapheme_to_${CASE}${SUFFIX}
21 3448adb0 2022-11-02 op .Nd convert ${ARRAYTYPE} to ${CASE}
23 3448adb0 2022-11-02 op .In grapheme.h
25 3448adb0 2022-11-02 op .Fn grapheme_to_${CASE}${SUFFIX} "const ${DATATYPE} *src" "size_t srclen" "${DATATYPE} *dest" "size_t destlen"
26 3448adb0 2022-11-02 op .Sh DESCRIPTION
28 3448adb0 2022-11-02 op .Fn grapheme_to_${CASE}${SUFFIX}
29 3448adb0 2022-11-02 op function converts the ${ARRAYTYPE}
31 3448adb0 2022-11-02 op to ${CASE} and writes the result to
44 3448adb0 2022-11-02 op (stdint.h is already included by grapheme.h) the ${ARRAYTYPE}
46 3448adb0 2022-11-02 op is interpreted to be NUL-terminated and processing stops when a
47 3448adb0 2022-11-02 op NUL-byte is encountered.
49 3448adb0 2022-11-02 op For $(if [ "$ENCODING" != "utf8" ]; then printf "UTF-8-encoded"; else printf "non-UTF-8"; fi) input data
50 3448adb0 2022-11-02 op .Xr grapheme_to_${CASE}${ANTISUFFIX} 3
51 3448adb0 2022-11-02 op can be used instead.
52 3448adb0 2022-11-02 op .Sh RETURN VALUES
54 3448adb0 2022-11-02 op .Fn grapheme_to_${CASE}${SUFFIX}
55 3448adb0 2022-11-02 op function returns the number of ${UNIT}s in the array resulting
56 3448adb0 2022-11-02 op from converting
58 3448adb0 2022-11-02 op to ${CASE}, even if
60 3448adb0 2022-11-02 op is not large enough or
65 3448adb0 2022-11-02 op .Xr grapheme_to_${CASE}${ANTISUFFIX} 3 ,
66 3448adb0 2022-11-02 op .Xr libgrapheme 7
68 3448adb0 2022-11-02 op .Fn grapheme_to_${CASE}${SUFFIX}
69 3448adb0 2022-11-02 op is compliant with the Unicode ${UNICODE_VERSION} specification.
71 3448adb0 2022-11-02 op .An Laslo Hunhold Aq Mt dev@frign.de