diff options
author | Bruno Haible <bruno@clisp.org> | 2021-12-29 20:01:09 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2021-12-29 20:01:34 +0100 |
commit | b1936b2a75e6ce4f85642836abb71c14800516be (patch) | |
tree | 3d20f520e79e214febe4bdbe50c99da94bef5a25 | |
parent | 729c31ed79c77b2e670b45fa383a0509eaba66d8 (diff) | |
download | libunistring-b1936b2a75e6ce4f85642836abb71c14800516be.tar.gz |
doc: Update for new behaviour of line breaking functions.
* doc/unilbrk.texi (unilbrk.h): Document UC_BREAK_CR_BEFORE_LF. Mention
that this value can occur in the array returned by
u*_possible_linebreaks and u*_width_linebreaks.
* NEWS: Mention the change.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | doc/unilbrk.texi | 18 |
3 files changed, 25 insertions, 5 deletions
@@ -1,3 +1,11 @@ +2021-12-29 Bruno Haible <bruno@clisp.org> + + doc: Update for new behaviour of line breaking functions. + * doc/unilbrk.texi (unilbrk.h): Document UC_BREAK_CR_BEFORE_LF. Mention + that this value can occur in the array returned by + u*_possible_linebreaks and u*_width_linebreaks. + * NEWS: Mention the change. + 2021-12-26 Bruno Haible <bruno@clisp.org> doc: Update for Unicode 10.0.0. @@ -2,6 +2,10 @@ New in 0.9.11: * The license has changed from "LGPLv3+ or GPLv2" to "LGPLv3+ or GPLv2+". * The functions u8_uctomb, u16_uctomb, u32_uctomb now support strings larger than 2 GiB by taking an 'n' argument of type ptrdiff_t (instead of int). +* The functions u*_possible_linebreaks and u*_width_linebreaks now make it + easier to work with strings that contain CR-LF sequences: In this case, + in the returned array, it will return UC_BREAK_CR_BEFORE_LF followed by + UC_BREAK_MANDATORY (instead of twice UC_BREAK_MANDATORY). * Fixed multithread-safety bugs on Cygwin, native Windows, and Haiku. New in 0.9.10: diff --git a/doc/unilbrk.texi b/doc/unilbrk.texi index 91e5863..c068704 100644 --- a/doc/unilbrk.texi +++ b/doc/unilbrk.texi @@ -20,6 +20,12 @@ following meanings: This value indicates that @code{@var{s}[@var{i}]} is a line break character. @end deftypevr +@deftypevr Constant int UC_BREAK_CR_BEFORE_LF +This value is a variant of @code{UC_BREAK_MANDATORY}. It indicates that +@code{@var{s}[@var{i}]} is a CR character and that @code{@var{s}[@var{i+1}]} +is a LF character. +@end deftypevr + @deftypevr Constant int UC_BREAK_POSSIBLE This value indicates that a line break may be inserted between @code{@var{s}[@var{i}-1]} and @code{@var{s}[@var{i}]}. @@ -51,8 +57,9 @@ possible. @deftypefunx void ulc_possible_linebreaks (const@tie{}char@tie{}*@var{s}, size_t@tie{}@var{n}, const@tie{}char@tie{}*@var{encoding}, char@tie{}*@var{p}) Determines the line break points in @var{s}, and stores the result at @code{@var{p}[0..@var{n}-1]}. Every @code{@var{p}[@var{i}]} is assigned one of -the values @code{UC_BREAK_MANDATORY}, @code{UC_BREAK_POSSIBLE}, -@code{UC_BREAK_HYPHENATION}, @code{UC_BREAK_PROHIBITED}. +the values @code{UC_BREAK_MANDATORY}, @code{UC_BREAK_CR_BEFORE_LF}, +@code{UC_BREAK_POSSIBLE}, @code{UC_BREAK_HYPHENATION}, +@code{UC_BREAK_PROHIBITED}. @end deftypefun The following functions determine where line breaks should be inserted so that @@ -82,7 +89,8 @@ The given @var{encoding} is used for disambiguating widths in @code{uc_width}. Returns the column after the end of the string, and stores the result at @code{@var{p}[0..@var{n}-1]}. Every @code{@var{p}[@var{i}]} is assigned one of -the values @code{UC_BREAK_MANDATORY}, @code{UC_BREAK_POSSIBLE}, -@code{UC_BREAK_HYPHENATION}, @code{UC_BREAK_PROHIBITED}. Here the value -@code{UC_BREAK_POSSIBLE} indicates that a line break @emph{should} be inserted. +the values @code{UC_BREAK_MANDATORY}, @code{UC_BREAK_CR_BEFORE_LF}, +@code{UC_BREAK_POSSIBLE}, @code{UC_BREAK_HYPHENATION}, +@code{UC_BREAK_PROHIBITED}. Here the value @code{UC_BREAK_POSSIBLE} indicates +that a line break @emph{should} be inserted. @end deftypefun |