diff options
| author | Mattias Andrée <m@maandree.se> | 2026-01-25 09:57:16 +0100 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-01-25 09:57:16 +0100 |
| commit | e9b19895c2322f1b9753f67fbe3124eb99bcfe16 (patch) | |
| tree | 62b61c7c0ca6f4565097dede120da5c04423b6cd /libcharconv.h | |
| parent | Add crop marks (diff) | |
| download | charconv-e9b19895c2322f1b9753f67fbe3124eb99bcfe16.tar.gz charconv-e9b19895c2322f1b9753f67fbe3124eb99bcfe16.tar.bz2 charconv-e9b19895c2322f1b9753f67fbe3124eb99bcfe16.tar.xz | |
Add braille
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libcharconv.h')
| -rw-r--r-- | libcharconv.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libcharconv.h b/libcharconv.h index 5b165b6..613ef1b 100644 --- a/libcharconv.h +++ b/libcharconv.h @@ -1278,4 +1278,39 @@ enum libcharconv_result libcharconv_ocr(const char *s, size_t slen, size_t *n, u enum libcharconv_result libcharconv_crop_marks(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); +/** + * Convert sequences of unique [1, 8]-digits to BRAILLE PATTERNs, + * a sequence can be empty (for the blank pattern), each + * sequence can be (and the empty sequence must be) termianted + * by a DIGIT ZERO + * + * @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_braille(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp); + + #endif |
