/* See LICENSE file for copyright and license details. */ #ifndef LIBCHARCONV_H #define LIBCHARCONV_H #include #include enum libcharconv_result { LIBCHARCONV_NO_CONVERT, LIBCHARCONV_CONVERTED, LIBCHARCONV_INDETERMINATE, LIBCHARCONV_CONVERT_IF_END }; /** * Convert * 'w' to WHITE SHOGI PIECE, * 'b' to BLACK SHOGI PIECE, * 'W' to TURNED WHITE SHOGI PIECE, and * 'B' to TURNED BLACK SHOGI PIECE * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_shogi(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Convert '1' through '6' to DIE FACE-1 through DIE FACE-6 * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_dice(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Convert * '0' to WHITE CIRCLE, * '1' to WHITE CIRCLE WITH DOT RIGHT, and * '2' to WHITE CIRCLE WITH TWO DOTS * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_go_white(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Convert * '0' to BLACK CIRCLE, * '1' to BLACK CIRCLE WITH WHITE DOT RIGHT, and * '2' to BLACK CIRCLE WITH TWO WHITE DOTS * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_go_black(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Convert * 'm' and '1' to WHITE DRAUGHTS MAN, * 'k' and '2' to WHITE DRAUGHTS KING, * 'M' to BLACK DRAUGHTS MAN, and * 'K' to BLACK DRAUGHTS KING * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_draughts(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Convert 'a' through 'z' and 'A' through 'Z' * to REGION INDICATOR SYMBOL LETTER A through * REGION INDICATOR SYMBOL LETTER Z * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_region_indicators(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Convert ' ' through '~' to * TAG SPACE through TAG TILDE * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_tags(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Convert * 'f', 'F', 'w', and 'W' to FEMALE SIGN, * 'm' and 'M' to MALE SIGN, and * 'i' and 'I' to MERCURY (intersex sign) * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_gender_symbols(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion in opposite direction * of the other functions * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_latin(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to Cypriot * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_cypriot(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to MATHEMATICAL BOLD * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_bold(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to MATHEMATICAL ITALIC * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_italic(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to MATHEMATICAL BOLD ITALIC * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_bold_italic(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to MATHEMATICAL MONOSPACE * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_monospace(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from DIGITs to SEGMENTED DIGITs * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_segmented(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to MATHEMATICAL SANS-SERIF * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_sans_serif(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to MATHEMATICAL SANS-SERIF BOLD * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_sans_serif_bold(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to MATHEMATICAL SANS-SERIF ITALIC * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_sans_serif_italic(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to MATHEMATICAL SANS-SERIF BOLD ITALIC * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_sans_serif_bold_italic(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to MATHEMATICAL DOUBLE-STRUCK * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_double_struck(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to DOUBLE-STRUCK ITALIC * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_double_struck_italic(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to MATHEMATICAL FRAKTUR * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_fraktur(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to MATHEMATICAL BOLD FRAKTUR * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_bold_fraktur(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to MATHEMATICAL SCRIPT * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_script(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to MATHEMATICAL BOLD SCRIPT * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_bold_script(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to Buhid * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_buhid(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Convert * "obj" to OBJECT REPLACEMENT CHARACTER, and * "?" to REPLACEMENT CHARACTER * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_replacement(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Convert alphanumerics to bracketed form * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_bracketed(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Convert numbers to VARIATION SELECTORs * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_variation_selectors(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Convert to superscript * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_superscript(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Convert to subscript * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_subscript(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to Lydian * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_lydian(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Preforms convertion from Latin to Lycian * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_lycian(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Convert a pair of [0, 6]-digits to domino tiles, * or "##" to the back of a domino tiles. The tile * will be horizontal by default, but '|' or '-' can * be added between the two symbols to select * horizontal ('|') or vertical ('-') orientation * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_domino_tiles_horizontal(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); /** * Convert a pair of [0, 6]-digits to domino tiles, * or "##" to the back of a domino tiles. The tile * will be vertical by default, but '|' or '-' can * be added between the two symbols to select * horizontal ('|') or vertical ('-') orientation * * @param s Text to convert * @param slen The number of bytes available in `s` * @param n Output parameter for the number of consumed bytes * @param cp Output buffer for the codepoints * @param ncp Input parameter for the number of codepoints that * fit in `cp`, and output parameter for the number * of output codepoints (if it exceeds the original * value of `ncp`, a larger buffer is needed) * @return LIBCHARCONV_NO_CONVERT: * `*n` is the number of bytes from the beginning * of `s` that cannot be converted * LIBCHARCONV_CONVERTED: * `*n` is the number of bytes from the beginning * of `s` that was converted to a codepoint which * is stored in `*cp` * LIBCHARCONV_INDETERMINATE: * If all text has been input, no more can be * converted, otherwise more of the text most * be made available before the function can * determine whether the beginning of `s` can be * converted or what it should be converted to * LIBCHARCONV_CONVERT_IF_END: * As LIBCHARCONV_CONVERTED the entire text has * been input, as LIBCHARCONV_INDETERMINATE * otherwise */ enum libcharconv_result libcharconv_domino_tiles_vertical(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); #endif