From owner-svn-src-head@FreeBSD.ORG Thu Jun 21 12:52:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4ECEA1065674; Thu, 21 Jun 2012 12:52:16 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F7B88FC15; Thu, 21 Jun 2012 12:52:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5LCqGfn013787; Thu, 21 Jun 2012 12:52:16 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LCqF8U013782; Thu, 21 Jun 2012 12:52:15 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201206211252.q5LCqF8U013782@svn.freebsd.org> From: Isabell Long Date: Thu, 21 Jun 2012 12:52:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237393 - head/lib/libc/string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 12:52:16 -0000 Author: issyl0 (doc committer) Date: Thu Jun 21 12:52:15 2012 New Revision: 237393 URL: http://svn.freebsd.org/changeset/base/237393 Log: Add more locale-specific functions to the relevant man pages: - libc/string/strcoll.3 - libc/string/strstr.3 - libc/string/strxfrm.3 - libc/string/strcasecmp.3 Reviewed by: theraven, gabor Approved by: gabor (mentor) MFC after: 5 days Modified: head/lib/libc/string/strcasecmp.3 head/lib/libc/string/strcoll.3 head/lib/libc/string/strstr.3 head/lib/libc/string/strxfrm.3 Modified: head/lib/libc/string/strcasecmp.3 ============================================================================== --- head/lib/libc/string/strcasecmp.3 Thu Jun 21 12:51:24 2012 (r237392) +++ head/lib/libc/string/strcasecmp.3 Thu Jun 21 12:52:15 2012 (r237393) @@ -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: head/lib/libc/string/strcoll.3 ============================================================================== --- head/lib/libc/string/strcoll.3 Thu Jun 21 12:51:24 2012 (r237392) +++ head/lib/libc/string/strcoll.3 Thu Jun 21 12:52:15 2012 (r237393) @@ -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: head/lib/libc/string/strstr.3 ============================================================================== --- head/lib/libc/string/strstr.3 Thu Jun 21 12:51:24 2012 (r237392) +++ head/lib/libc/string/strstr.3 Thu Jun 21 12:52:15 2012 (r237393) @@ -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: head/lib/libc/string/strxfrm.3 ============================================================================== --- head/lib/libc/string/strxfrm.3 Thu Jun 21 12:51:24 2012 (r237392) +++ head/lib/libc/string/strxfrm.3 Thu Jun 21 12:52:15 2012 (r237393) @@ -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 .