wstring(3W) DG/UX R4.11MU05 wstring(3W)
NAME
wstring: wscat, wsncat, wscmp, wsncmp, wscpy, wsncpy, wslen, wschr,
wsrchr, wspbrk, wsspn, wscspn, wstok, wstostr, strtows - wchart
string operations and type transformation
SYNOPSIS
#include <widec.h>
wchart *wscat(wchart *s1, const wchart *s2);
wchart *wsncat(wchart *s1, const wchart *s2, int n);
int wscmp(const wchart *s1, const wchart *s2);
int wsncmp(const wchart *s1, const wchart *s2, int n);
wchart *wscpy(wchart *s1, const wchart *s2);
wchart *wsncpy(wchart *s1, const wchart *s2, int n);
int wslen(const wchart *s);
wchart *wschr(const wchart *s, int c);
wchart *wsrchr(const wchart *s, int c);
wchart *wspbrk(const wchart *s1, const wchart *s2);
int wsspn(const wchart *s1, const wchart *s2);
int wscspn(const wchart *s1, const wchart *s2);
wchart *wstok(wchart *s1, const wchart *s2);
char *wstostr(char *s1, const wchart *s2);
wchart *strtows(wchart *s1, const char *s2);
DESCRIPTION
The arguments s1, s2, and s point to wchart strings (that is, arrays
of wchart characters terminated by a wchart null character). The
functions wscat, wsncat, wscpy, and wsncpy all modify s1. These
functions do not check for an overflow condition of the array pointed
to by s1.
wscat appends a copy of the wchart string s2 to the end of the
wchart string s1. wsncat appends at most n wchart characters.
Each function returns s1.
wscmp compares its arguments and returns an integer less than, equal
to, or greater than 0, depending on whether s1 is less than, equal
to, or greater than s2. wsncmp makes the same comparison but looks
at most at n wchart characters.
wscpy copies wchart string s2 to s1, stopping after the wchart null
character has been copied. wsncpy copies exactly n wchart
characters, truncating s2 or adding wchart null characters to s1, if
necessary. The result will not be wchart null-terminated if the
length of s2 is n or more. Each function returns s1.
wslen returns the number of wchart characters in s, not including
the terminating wchart null character.
wschr and wsrchr return a pointer to the first and last occurrence,
respectively, of wchart character c in wchart string s, or a null
pointer, if c does not occur in the string. The wchart null
character terminating a string is considered to be part of the
string.
wspbrk returns a pointer to the first occurrence in wchart string s1
of any wchart character from wchart string s2, or a null pointer if
there is no wchart character from s2 in s1.
wsspn returns the length of the initial segment of wchart string s1,
which consists entirely of wchart characters from wchart string s2.
wscspn returns the length of the initial segment of wchart string
s1, which does not consist entirely of wchart characters from
wchart string s2.
wstok treats the wchart string s1 as a sequence of zero or more text
tokens, separated by spans of one or more wchart characters from the
separator wchart string s2. The first call (with the pointer s1
specified) returns a pointer to the first wchart character of the
first token, and writes a wchart null character into s1 immediately
following the returned token. The function keeps track of its
position in the wchart string between separate calls, so that
subsequent calls (which must be made with the first argument a null
pointer) will progress through the wchart string s1 immediately
following that token. Similarly, subsequent calls will progress
through the wchart string s1 until no tokens remain. The wchart
separator string s2 may be different from call to call. A null
pointer is returned when no token remains in s1.
wstostr transforms wchart characters in wchart string s2 into EUC,
and transfers them to character string s1, stopping after the wchart
null character has been processed.
strtows transforms EUC in character string s2 into wchart
characters, and transfers those to wchart string s1, stopping after
the null character has been processed.
Errors
On success, wstostr and strtows return s1. If an illegal byte
sequence is detected, a null pointer is returned and errno is set to
EILSEQ.
NOTICES
Use the equivalent wcs* functions as documented in section 3C.
REFERENCES
malloc(3C), malloc(3X) widec(3W)
Licensed material--property of copyright holder(s)