Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jun 2012 10:05:46 +0000 (UTC)
From:      Isabell Long <issyl0@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r237699 - stable/9/lib/libc/string
Message-ID:  <201206281005.q5SA5kui066627@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: issyl0 (doc committer)
Date: Thu Jun 28 10:05:45 2012
New Revision: 237699
URL: http://svn.freebsd.org/changeset/base/237699

Log:
  Merge head revisions 237393, 237409:
    Locale-specific man page edits:
      - libc/string/strcoll.3
      - libc/string/strstr.3
      - libc/string/strxfrm.3
      - libc/string/strcasecmp.3
      - libc/string/Makefile.inc
  
  Approved by:	gabor (mentor)

Modified:
  stable/9/lib/libc/string/Makefile.inc
  stable/9/lib/libc/string/strcasecmp.3
  stable/9/lib/libc/string/strcoll.3
  stable/9/lib/libc/string/strstr.3
  stable/9/lib/libc/string/strxfrm.3
Directory Properties:
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/string/Makefile.inc
==============================================================================
--- stable/9/lib/libc/string/Makefile.inc	Thu Jun 28 09:18:11 2012	(r237698)
+++ stable/9/lib/libc/string/Makefile.inc	Thu Jun 28 10:05:45 2012	(r237699)
@@ -42,10 +42,13 @@ MLINKS+=ffs.3 ffsl.3 \
 	ffs.3 flsll.3
 MLINKS+=index.3 rindex.3
 MLINKS+=memchr.3 memrchr.3
-MLINKS+=strcasecmp.3 strncasecmp.3
+MLINKS+=strcasecmp.3 strncasecmp.3 \
+	strcasecmp.3 strcasecmp_l.3 \
+	strcasecmp.3 strncasecmp_l.3
 MLINKS+=strcat.3 strncat.3
 MLINKS+=strchr.3 strrchr.3
 MLINKS+=strcmp.3 strncmp.3
+MLINKS+=strcoll.3 strcoll_l.3
 MLINKS+=strcpy.3 stpcpy.3 \
 	strcpy.3 stpncpy.3 \
 	strcpy.3 strncpy.3
@@ -57,8 +60,10 @@ MLINKS+=strerror.3 perror.3 \
 MLINKS+=strlcpy.3 strlcat.3
 MLINKS+=strlen.3 strnlen.3
 MLINKS+=strstr.3 strcasestr.3 \
-	strstr.3 strnstr.3
+	strstr.3 strnstr.3 \
+	strstr.3 strcasestr_l.3
 MLINKS+=strtok.3 strtok_r.3
+MLINKS+=strxfrm.3 strxfrm_l.3
 MLINKS+=wmemchr.3 wcpcpy.3 \
 	wmemchr.3 wcpncpy.3 \
 	wmemchr.3 wcscasecmp.3 \

Modified: stable/9/lib/libc/string/strcasecmp.3
==============================================================================
--- stable/9/lib/libc/string/strcasecmp.3	Thu Jun 28 09:18:11 2012	(r237698)
+++ stable/9/lib/libc/string/strcasecmp.3	Thu Jun 28 10:05:45 2012	(r237699)
@@ -45,6 +45,12 @@
 .Fn strcasecmp "const char *s1" "const char *s2"
 .Ft int
 .Fn strncasecmp "const char *s1" "const char *s2" "size_t len"
+.In string.h
+.In xlocale.h
+.Ft int
+.Fn strcasecmp_l "const char *s1" "const char *s2" "locale_t loc"
+.Ft int
+.Fn strncasecmp_l "const char *s1" "const char *s2" "site_t len" "locale_t loc"
 .Sh DESCRIPTION
 The
 .Fn strcasecmp
@@ -58,16 +64,22 @@ and
 .Pp
 The
 .Fn strncasecmp
-compares at most
+function compares at most
 .Fa len
 characters.
-.Sh RETURN VALUES
 The
+.Fn strcasecmp_l
+and
+.Fn strncasecmp_l
+functions do the same as their non-locale versions above, but take an
+explicit locale rather than using the current locale.
+.Sh RETURN VALUES
+The functions
 .Fn strcasecmp
 and
 .Fn strncasecmp
 return an integer greater than, equal to, or less than 0,
-according as
+depending on whether
 .Fa s1
 is lexicographically greater than, equal to, or less than
 .Fa s2
@@ -77,6 +89,11 @@ The comparison is done using unsigned ch
 .Sq Li \e200
 is greater than
 .Ql \e0 .
+The functions
+.Fn strcasecmp_l
+and
+.Fn strncasecmp_l
+do the same but take explicit locales.
 .Sh SEE ALSO
 .Xr bcmp 3 ,
 .Xr memcmp 3 ,

Modified: stable/9/lib/libc/string/strcoll.3
==============================================================================
--- stable/9/lib/libc/string/strcoll.3	Thu Jun 28 09:18:11 2012	(r237698)
+++ stable/9/lib/libc/string/strcoll.3	Thu Jun 28 10:05:45 2012	(r237699)
@@ -44,6 +44,8 @@
 .In string.h
 .Ft int
 .Fn strcoll "const char *s1" "const char *s2"
+.Ft int
+.Fn strcoll_l "const char *s1" "const char *s2" "locale_t loc"
 .Sh DESCRIPTION
 The
 .Fn strcoll
@@ -54,7 +56,7 @@ and
 .Fa s2
 according to the current locale collation
 and returns an integer greater than, equal to, or less than 0,
-according as
+depending on whether
 .Fa s1
 is greater than, equal to, or less than
 .Fa s2 .
@@ -62,6 +64,9 @@ If information about the current locale 
 the value of
 .Fn strcmp s1 s2
 is returned.
+The
+.Fn strcoll_l
+function uses an explicit locale argument rather than the system locale.
 .Sh SEE ALSO
 .Xr setlocale 3 ,
 .Xr strcmp 3 ,
@@ -70,6 +75,9 @@ is returned.
 .Sh STANDARDS
 The
 .Fn strcoll
-function
-conforms to
+function conforms to
 .St -isoC .
+The
+.Fn strcoll_l
+function conforms to
+.St -p1003.1-2008 .

Modified: stable/9/lib/libc/string/strstr.3
==============================================================================
--- stable/9/lib/libc/string/strstr.3	Thu Jun 28 09:18:11 2012	(r237698)
+++ stable/9/lib/libc/string/strstr.3	Thu Jun 28 10:05:45 2012	(r237699)
@@ -49,6 +49,10 @@
 .Fn strcasestr "const char *big" "const char *little"
 .Ft char *
 .Fn strnstr "const char *big" "const char *little" "size_t len"
+.In string.h
+.In xlocale.h
+.Ft char *
+.Fn strcasestr_l "const char *big" "const char *little" "locale_t loc"
 .Sh DESCRIPTION
 The
 .Fn strstr
@@ -65,6 +69,12 @@ function is similar to
 but ignores the case of both strings.
 .Pp
 The
+.Fn strcasestr_l
+function does the same as
+.Fn strcasestr
+but takes an explicit locale rather than using the current locale.
+.Pp
+The
 .Fn strnstr
 function
 locates the first occurrence of the null-terminated string

Modified: stable/9/lib/libc/string/strxfrm.3
==============================================================================
--- stable/9/lib/libc/string/strxfrm.3	Thu Jun 28 09:18:11 2012	(r237698)
+++ stable/9/lib/libc/string/strxfrm.3	Thu Jun 28 10:05:45 2012	(r237699)
@@ -44,6 +44,8 @@
 .In string.h
 .Ft size_t
 .Fn strxfrm "char * restrict dst" "const char * restrict src" "size_t n"
+.Ft size_t
+.Fn strxfrm_l "char * restrict dst" "const char *restrict src" "size_t n" "locale_t loc"
 .Sh DESCRIPTION
 The
 .Fn strxfrm
@@ -73,10 +75,16 @@ after
 is equal to comparing
 two original strings with
 .Fn strcoll .
+.Pp
+.Fn strxfrm_l
+does the same, however takes an explicit locale rather than the global
+locale.
 .Sh RETURN VALUES
 Upon successful completion,
 .Fn strxfrm
-returns the length of the transformed string not including
+and
+.Fn strxfrm_l
+return the length of the transformed string not including
 the terminating null character.
 If this value is
 .Fa n
@@ -94,3 +102,7 @@ The
 function
 conforms to
 .St -isoC .
+The
+.Fn strxfrm_l
+function conforms to
+.St -p1003.1-2008 .



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206281005.q5SA5kui066627>