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_IS_$(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_is_${CASE}${SUFFIX}
21 3448adb0 2022-11-02 op .Nd check if ${ARRAYTYPE} is ${CASE}
23 3448adb0 2022-11-02 op .In grapheme.h
25 3448adb0 2022-11-02 op .Fn grapheme_is_${CASE}${SUFFIX} "const ${DATATYPE} *str" "size_t len" "size_t *caselen"
26 3448adb0 2022-11-02 op .Sh DESCRIPTION
28 3448adb0 2022-11-02 op .Fn grapheme_is_${CASE}${SUFFIX}
29 3448adb0 2022-11-02 op function checks if the ${ARRAYTYPE}
31 3448adb0 2022-11-02 op is ${CASE} and writes the length of the matching ${CASE}-sequence to the integer pointed to by
42 3448adb0 2022-11-02 op (stdint.h is already included by grapheme.h) the ${ARRAYTYPE}
44 3448adb0 2022-11-02 op is interpreted to be NUL-terminated and processing stops when a
45 3448adb0 2022-11-02 op NUL-byte is encountered.
47 3448adb0 2022-11-02 op For $(if [ "$ENCODING" != "utf8" ]; then printf "UTF-8-encoded"; else printf "non-UTF-8"; fi) input data
48 3448adb0 2022-11-02 op .Xr grapheme_is_${CASE}${ANTISUFFIX} 3
49 3448adb0 2022-11-02 op can be used instead.
50 3448adb0 2022-11-02 op .Sh RETURN VALUES
52 3448adb0 2022-11-02 op .Fn grapheme_is_${CASE}${SUFFIX}
53 3448adb0 2022-11-02 op function returns
55 3448adb0 2022-11-02 op if the ${ARRAYTYPE}
57 3448adb0 2022-11-02 op is ${CASE}, otherwise
60 3448adb0 2022-11-02 op .Xr grapheme_is_${CASE}${ANTISUFFIX} 3 ,
61 3448adb0 2022-11-02 op .Xr libgrapheme 7
63 3448adb0 2022-11-02 op .Fn grapheme_is_${CASE}${SUFFIX}
64 3448adb0 2022-11-02 op is compliant with the Unicode ${UNICODE_VERSION} specification.
66 3448adb0 2022-11-02 op .An Laslo Hunhold Aq Mt dev@frign.de