libutf: clean up comments

This commit is contained in:
dtb
2024-05-29 19:56:41 -06:00
parent 146ea609b6
commit 55fdca9123
2 changed files with 24 additions and 15 deletions

View File

@@ -9,9 +9,29 @@ typedef unsigned long int rune_t;
#endif
#include <stddef.h> /* size_t */
/* Reverses the order of the bytes in the 32-bit value c. */
rune_t swab32(rune_t c);
/* Returns the byte length of a valid UTF-8 rune. */
size_t utf8_size(rune_t c);
/* Returns the UTF-32BE codepoint of the UTF-8 rune c. */
rune_t utf8_to_utf32be(rune_t c);
/* Stores the UTF-8 rune c as bytes to the memory span s. s should point to a
* big enough memory span of chars in which to store c, a (possibly invalid)
* UTF-8 rune. Returns a pointer to the memory location after the last written
* byte. Returns NULL if n is not 0 and n is less than the number of bytes that
* will be written. */
char *utf8_to_chars(rune_t c, char *s, size_t n);
/* Returns the UTF-8 encoding of the UTF-32BE codepoint c. m is the minimum
* amount of bytes into which to encode the codepoint c. If m is greater than
* 0, this function may return overlong-encoded UTF-8. */
rune_t utf32be_to_utf8(rune_t c, size_t m);
/* Returns the UTF-32BE codepoint of the UTF-32LE codepoint c. */
rune_t utf32be_to_utf32le(rune_t c);
/* Returns the UTF-32LE codepoint of the UTF-32BE codepoint c. */
rune_t utf32le_to_utf32be(rune_t c);