Next: , Up: uniwbrk.h

10.1 Word breaks in a string

The following functions determine the word breaks in a string.

— Function: void u8_wordbreaks (const uint8_t *s, size_t n, char *p)
— Function: void u16_wordbreaks (const uint16_t *s, size_t n, char *p)
— Function: void u32_wordbreaks (const uint32_t *s, size_t n, char *p)
— Function: void ulc_wordbreaks (const char *s, size_t n, char *p)

Determines the word break points in s, an array of n units, and stores the result at p[0..n-1].

p[i] = 1
means that there is a word boundary between s[i-1] and s[i].
p[i] = 0
means that s[i-1] and s[i] must not be separated.
p[0] is always set to 0. If an application wants to consider a word break to be present at the beginning of the string (before s[0]) or at the end of the string (after s[0..n-1]), it has to treat these cases explicitly.