strxfrm 中文man頁面
NAME
strxfrm - 轉(zhuǎn)換字符串
總覽 (SYNOPSIS)
#include <string.h> size_t strxfrm(char *dest, const char *src, size_t n);
描述 (DESCRIPTION)
strxfrm() 函數(shù) 把 字符串 src 轉(zhuǎn)換 成 另外 一種 形式. 用 strcmp() 來比較 兩個(gè) 轉(zhuǎn)換后的 字符串 與 用 strcoll() 來比較 它們轉(zhuǎn)換前的 字符串 的 返回值 是 一樣的. 轉(zhuǎn)換后的 字符串的 前 n 個(gè) 字符會(huì)存放于 dest 中. 它是 根據(jù) 程序 當(dāng)前的 區(qū)域選項(xiàng) 中的 LC_COLLATE 來 轉(zhuǎn)換的. (見 setlocale(3)).
返回值 (RETURN VALUE)
strxfrm() 函數(shù) 返回 除去 結(jié)尾的 `\0' 字符, 用來 存儲(chǔ) 轉(zhuǎn)換后的 字符串所 需要的 字節(jié)數(shù). 如果 返回值 大于 或 等于 n, dest 中的 內(nèi)容就是 不確定的.
遵循 (CONFORMING TO)
SVID 3, BSD 4.3, ISO 9899
注意 (NOTES)
如果 區(qū)域選項(xiàng) 是 "POSIX" 或者 "C", 那么 strxfrm() 同用 strncpy() 來 拷貝 字符串 是等價(jià)的.
參見 (SEE ALSO)
bcmp(3), memcmp(3), strcasecmp(3), strcmp(3), strcoll(3), setlocale(3)
#p#
NAME
strxfrm - string transformation
SYNOPSIS
#include <string.h> size_t strxfrm(char *dest, const char *src, size_t n);
DESCRIPTION
The strxfrm() function transforms the src string into a form such that the result of strcmp() on two strings that have been transformed with strxfrm() is the same as the result of strcoll() on the two strings before their transformation. The first n characters of the transformed string are placed in dest. The transformation is based on the program's current locale for category LC_COLLATE. (See setlocale(3)).
RETURN VALUE
The strxfrm() function returns the number of bytes required to store the transformed string in dest excluding the terminating `\0' character. If the value returned is n or more, the contents of dest are indeterminate.
CONFORMING TO
SVID 3, BSD 4.3, ISO 9899
NOTES
In the "POSIX" or "C" locales strxfrm() is equivalent to copying the string with strncpy().
SEE ALSO
bcmp(3), memcmp(3), strcasecmp(3), strcmp(3), strcoll(3), setlocale(3)