📄 strxfrm.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>strxfrm</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_009_249"> </a>NAME</h4><blockquote>strxfrm - string transformation</blockquote><h4><a name = "tag_000_009_250"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="string.h.html">string.h</a>>size_t strxfrm(char *<i>s1</i>, const char *<i>s2</i>, size_t <i>n</i>);</code></pre></blockquote><h4><a name = "tag_000_009_251"> </a>DESCRIPTION</h4><blockquote>The<i>strxfrm()</i>function transforms the string pointed to by<i>s2</i>and places the resulting string into the array pointed to by<i>s1</i>.The transformation is such that if<i><a href="strcmp.html">strcmp()</a></i>is applied to two transformed strings, it returns a value greater than, equalto or less than 0, corresponding to the result of<i><a href="strcoll.html">strcoll()</a></i>applied to the same two original strings. No more than<i>n</i>bytes are placed into the resulting array pointed to by<i>s1</i>,including the terminating null byte. If<i>n</i>is 0,<i>s1</i>is permitted to be a null pointer. If copying takes place between objectsthat overlap, the behaviour is undefined.<p>The<i>strxfrm()</i>function will not change the setting of <b>errno</b>if successful.<p>Because no return value is reserved to indicate an error, anapplication wishing to check for error situations should set<i>errno</i>to 0, then call<i><a href="strcoll.html">strcoll()</a></i>,then check<i>errno</i>.</blockquote><h4><a name = "tag_000_009_252"> </a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>strxfrm()</i>returns the length of the transformed string (not including the terminatingnull byte). If the value returned is<i>n</i>or more, the contents of the array pointed to by<i>s1</i>are indeterminate.<p>On error,<i>strxfrm()</i>may set<i>errno</i>but no return value is reserved to indicate an error.</blockquote><h4><a name = "tag_000_009_253"> </a>ERRORS</h4><blockquote>The<i>strxfrm()</i>function may fail if:<dl compact><dt>[EINVAL]<dd>The string pointed to bythe<i>s2</i>argument contains characters outside the domain of the collatingsequence.</dl></blockquote><h4><a name = "tag_000_009_254"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_009_255"> </a>APPLICATION USAGE</h4><blockquote>The transformation function is such that two transformed stringscan be ordered by<i><a href="strcmp.html">strcmp()</a></i>as appropriate to collating sequence information in theprogram's locale (category <a href="../xbd/locale.html#tag_005_003_002">LC_COLLATE</a>).<p>The fact that when<i>n</i>is 0,<i>s1</i>is permitted to be a null pointer, is useful to determine the size of the<i>s1</i>array prior to making the transformation.</blockquote><h4><a name = "tag_000_009_256"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_009_257"> </a>SEE ALSO</h4><blockquote><i><a href="strcmp.html">strcmp()</a></i>,<i><a href="strcoll.html">strcoll()</a></i>,<i><a href="string.h.html"><string.h></a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from the ISO C standard.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -