wstring(3I)
NAME
wstring, wscasecmp, wsncasecmp, wscat, wsncat, wsdup, wscmp, wsncmp, wscpy, wsncpy, wslen, wschr, wsrchr, wspbrk, wsspn, wscspn, wstok, windex, wrindex, wscol − Process Code string operations
SYNOPSIS
cc [ flag ... ] file ... −lw [ library ... ]
#include <widec.h>
int wscasecmp(const wchar_t ∗s1, const wchar_t ∗s2);
int wsncasecmp(const wchar_t ∗s1, const wchar_t ∗s2, int n);
wchar_t ∗wscat(wchar_t ∗dst, const wchar_t ∗src);
wchar_t ∗wsncat(wchar_t ∗dst, const wchar_t ∗src, int n);
wchar_t ∗wschr(const wchar_t ∗s, wchar_t c);
wchar_t ∗wsrchr(const wchar_t ∗s, wchar_t c);
int wscmp(const wchar_t ∗s1, const wchar_t ∗s2);
int wsncmp(const wchar_t ∗s1, const wchar_t ∗s2, size_t n);
wchar_t ∗wscpy(wchar_t ∗dst, const wchar_t ∗src);
wchar_t ∗wsncpy(wchar_t ∗dst, const wchar_t ∗src, size_t n);
size_t wscspn(const wchar_t ∗s1, const wchar_t ∗s2);
size_t wsspn(const wchar_t ∗s1, const wchar_t ∗s2);
wchar_t ∗wsdup(const wchar_t ∗s);
wchar_t ∗windex(const wchar_t ∗s, wchar_t c);
wchar_t ∗wrindex(const wchar_t ∗s, wchar_t c);
size_t wslen(const wchar_t ∗s);
wchar_t ∗wspbrk(const wchar_t ∗s1, const wchar_t ∗s2);
wchar_t ∗wstok(wchar_t ∗s1, const wchar_t ∗s2);
int wscol(const wchar_t ∗s);
MT-LEVEL
MT-Safe
DESCRIPTION
These functions operate on Process Code strings terminated by wchar_t NULL characters. During appending or copying, these routines do not check for an overflow condition of the receiving string. In the following, s, s1, and s2 point to Process Code strings terminated by a wchar_t NULL.
wscasecmp() compares its arguments, ignoring case, and returns an integer greater than, equal to, or less than 0, according as s1 is lexicographically greater than, equal to, or less than s2. wsncasecmp() makes the same comparison but compares at most n Process Code characters. The four Extended Unix Code (EUC) codesets are ordered from lowest to highest as 0, 2, 3, 1 when characters from different codesets are compared.
wscat() appends a copy of string src to the end of string dst. wsncat() appends n or less Process Code characters (less if it overflows or if n is greater than src). Both functions return a pointer to the new wchar_t null-terminated dst.
wschr() returns a pointer to the first occurrence of a Process Code character c in string s, or a NULL pointer if c does not occur in the string. wsrchr() returns a pointer to the last occurrence of a Process Code character c in string s, or a NULL pointer if c does not occur in the string. The wchar_t NULL character terminating a string is considered to be part of the string.
wscmp() compares its arguments and returns an integer greater than, equal to, or less than 0, according as s1 is lexicographically greater than, equal to, or less than s2. wsncmp() makes the same comparison but compares at most n Process Code characters. The four Extended Unix Code (EUC) codesets are ordered from lowest to highest as 0, 2, 3, 1 when characters from different codesets are compared.
wscpy() copies string src to dst, stopping after the wchar_t NULL character has been copied. wsncpy() copies exactly n Process Code characters, truncating or wchar_t NULL -padding src. The result will not be NULL -terminated if the length of src is n Process Code characters or more. Each function returns dst.
wscspn() returns the length of the first occurrence in string s1 of a span of Process Code characters not from string s2. wsspn() returns the length of the first occurrence in string s1 of a span of Process Code consisting entirely of characters from string s2.
wsdup() returns a pointer to a new Process Code string which is a duplicate of the string pointed to by s. The space for the new string is obtained using malloc(3C). If the new string cannot be created, a NULL pointer is returned.
windex() and wrindex() behave the same as wschr()and wsrchr(), respectively.
wslen() returns the number of Process Code characters in s, not including the terminating wchar_t NULL character.
wspbrk() returns a pointer to the first occurrence in string s1 of any Process Code character from string s2, or a NULL pointer if no Process Code character from s2 exists in s1.
wstok() considers the string s1 to consist of a sequence of zero or more text tokens separated by spans of one or more Process Code characters from the separator string s2. The first call (with the pointer s1 specified) returns a pointer to the first Process Code character of the first token, and writes a wchar_t NULL character into s1 immediately following the returned token. The function keeps track of its position in the string between separate calls, so that subsequent calls (which must be made with the first argument a NULL pointer) will progress through string s1 until no tokens remain. The separator string s2 may be different from call to call. When there are no tokens remaining in s1, a NULL pointer is returned.
wscol() returns the screen display width (in columns) of the Process Code string s.
SEE ALSO
SunOS 5.2 — Last change: 22 Jan 1993