OSDN Git Service

d878868fde00986859387802503afafacd497fdd
[linuxjm/LDP_man-pages.git] / original / man3 / strxfrm.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\"     386BSD man pages
29 .\" Modified Sun Jul 25 10:41:28 1993 by Rik Faith (faith@cs.unc.edu)
30 .TH STRXFRM 3  2012-05-10 "GNU" "Linux Programmer's Manual"
31 .SH NAME
32 strxfrm \- string transformation
33 .SH SYNOPSIS
34 .nf
35 .B #include <string.h>
36 .sp
37 .BI "size_t strxfrm(char *" dest ", const char *" src ", size_t " n );
38 .fi
39 .SH DESCRIPTION
40 The
41 .BR strxfrm ()
42 function transforms the
43 .I src
44 string into a
45 form such that the result of
46 .BR strcmp (3)
47 on two strings that have
48 been transformed with
49 .BR strxfrm ()
50 is the same as the result of
51 .BR strcoll (3)
52 on the two strings before their transformation.
53 The first
54 .I n
55 bytes of the transformed string are placed in
56 .IR dest .
57 The transformation is based on the program's current
58 locale for category
59 .BR LC_COLLATE .
60 (See
61 .BR setlocale (3)).
62 .SH RETURN VALUE
63 The
64 .BR strxfrm ()
65 function returns the number of bytes required to
66 store the transformed string in
67 .I dest
68 excluding the
69 terminating null byte (\(aq\\0\(aq).
70 If the value returned is
71 .I n
72 or more, the
73 contents of
74 .I dest
75 are indeterminate.
76 .SH CONFORMING TO
77 SVr4, 4.3BSD, C89, C99.
78 .SH NOTES
79 In the
80 .IR POSIX
81 or
82 .IR C
83 locales
84 .BR strxfrm ()
85 is equivalent to
86 copying the string with
87 .BR strncpy (3).
88 .SH SEE ALSO
89 .BR bcmp (3),
90 .BR memcmp (3),
91 .BR setlocale (3),
92 .BR strcasecmp (3),
93 .BR strcmp (3),
94 .BR strcoll (3),
95 .BR string (3)
96 .SH COLOPHON
97 This page is part of release 3.67 of the Linux
98 .I man-pages
99 project.
100 A description of the project,
101 information about reporting bugs,
102 and the latest version of this page,
103 can be found at
104 \%http://www.kernel.org/doc/man\-pages/.