diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | doc/unistr.texi | 15 |
2 files changed, 20 insertions, 0 deletions
@@ -1,5 +1,10 @@ 2008-04-05 Bruno Haible <bruno@clisp.org> + * doc/unistr.texi (Elementary string functions): Document + u{8,16,32}_cmp2. + +2008-04-05 Bruno Haible <bruno@clisp.org> + * doc/libunistring.texi (func, posixfunc): New macros. Use them where appropriate. * doc/unistr.texi: Likewise. diff --git a/doc/unistr.texi b/doc/unistr.texi index b2f83b8..32e97e9 100644 --- a/doc/unistr.texi +++ b/doc/unistr.texi @@ -169,6 +169,21 @@ This function is similar to @posixfunc{memcmp}, except that it operates on Unicode strings. @end deftypefun +The following function compares two Unicode strings of possibly different +lengths. + +@deftypefun int u8_cmp2 (const uint8_t *@var{s1}, size_t @var{n1}, const uint8_t *@var{s2}, size_t @var{n2}) +@deftypefunx int u16_cmp2 (const uint16_t *@var{s1}, size_t @var{n1}, const uint16_t *@var{s2}, size_t @var{n2}) +@deftypefunx int u32_cmp2 (const uint32_t *@var{s1}, size_t @var{n1}, const uint32_t *@var{s2}, size_t @var{n2}) +Compares @var{s1} and @var{s2}, lexicographically. +Returns a negative value if @var{s1} compares smaller than @var{s2}, +a positive value if @var{s1} compares larger than @var{s2}, or 0 if +they compare equal. + +This function is similar to @func{memcmp2}, except that it operates on +Unicode strings. +@end deftypefun + The following function searches for a given Unicode character. @deftypefun {uint8_t *} u8_chr (const uint8_t *@var{s}, size_t @var{n}, ucs4_t @var{uc}) |