Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ wcstring(3) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mbstring

string

NCstring



WCSTRING(3,L)               AIX Technical Reference               WCSTRING(3,L)



-------------------------------------------------------------------------------
wcstring



PURPOSE

Performs operations on wide character strings.

LIBRARY

Standard I/O Library (libc.a)

SYNTAX

#include <mbcs.h>




      wchar_t *wcscat (s1, s2)            int *wcsncmp (s1, s2, n)
      wchar_t *s1;                        const wchar_t *s1, *s2;
      const wchar_t *s2;                  size_t n;

      wchar_t *wcschr (s, c)              wchar_t *wcsncpy (s1, s2, n).
      const wchar_t *s;                   wchar_t *s1;
      wchar_t c;                          const wchar_t *s2;
                                          size_t n;
      int wcscmp (s1, s2)
      const wchar_t *s1, *s2;             wchar_t *wcspbrk (s1, s2)
                                          const wchar_t *s1, *s2;
      wchar_t *wcscpy (s1, s2)
      wchar_t *s1;                        wchar_t *wcsrchr (s, c)
      const wchar_t *s2;                  const wchar_t *s;
                                          wchar_t *c;
      size_t wcscspn (s1, s2)
      const wchar_t *s1, *s2;             size_t wcsspn (s1, s2)
                                          const wchar_t *s1, *s2;
      size_t *wcslen (s)
      const wchar_t *s;                   wchar_t *wcstok (s1, s2)
                                          wchar_t *s1;
      wchar_t *wcsncat (s1, s2, n)        const wchar_t *s2;
      wchar_t (s2)
      const wchar_t *s2;                  wchar_t *wcswcs (s1, s2)
      size_t n;                           const wchar_t *s1, *s2;



DESCRIPTION

The wcscat subroutine appends a copy of the wide character string pointed to by
s2 (including the terminating NULL character) to the end of the wide character



Processed November 7, 1990       WCSTRING(3,L)                                1





WCSTRING(3,L)               AIX Technical Reference               WCSTRING(3,L)



string pointed to by s2.  The initial wide character of s2 overwrites the NULL
character at the end of s1.  If copying takes place between objects that
overlap, the behavior is undefined.

The wcschr subroutine locates the first occurrence of c in the wide character
string pointed to by s.  The terminating NULL character is considered to be
part of the string.

The wcscmp subroutine compares the wide character string pointed to by s1 to
the wide character string pointed to by s2.  The comparison is based on the
binary ordering of wide characters.  This comparison is independent of the
current locale.

The wcscpy subroutine copies the wide characters pointed to by s2 (including
the terminating NULL character) into the wide character array pointed to by s1.
If copying takes place between objects that overlap, the behavior is undefined.

The wcscspn subroutine computes the length of the maximum initial segment of
the wide character string pointed to by s1, which consists entirely of wide
characters not from the string pointed to by s2.

The wcslen subroutine computes the length of a wide character string pointed to
by s.

The wcsncat subroutine appends not more than n wide characters (a NULL
character and characters that follow it are not appended) from the wide
character array pointed to by s2 to the end of the wide character string
pointed to by s1.  The initial wide characters of s2 overwrites the NULL
character at the end of s1.  A terminating NULL character is always appended to
the result.  If copying takes place between objects that overlap, the behavior
is undefined.

The wcsncmp subroutine compares not more than n wide characters (characters
that follow a NULL are not compared) from the wide character array pointed to
by s1 to the wide character array pointed to by s2.

The wcsncpy subroutine copies not more than n wide characters (characters that
follow a NULL character are not copied) from the wide character array pointed
to by s2 into the wide character array pointed to by s1.  If copying takes
place between objects that overlap, the behavior is undefined.

The wcspbrk subroutine locates the first occurrence in the string pointed to by
s1 of any wide character from the wide character string pointed to by s2.

The wcsrchr subroutine locates the last occurrence of c in the wide character
string pointed to by s.  The terminating NULL character is considered to be
part of the string.

The wcsspn subroutine computes the length of the maximum initial segment of the
wide character string pointed to by s1,  which consists entirely of wide
characters from the wide character string pointed to by s2.




Processed November 7, 1990       WCSTRING(3,L)                                2





WCSTRING(3,L)               AIX Technical Reference               WCSTRING(3,L)



The wcstok subroutine breaks the wide character string pointed to by s1 into a
sequence of tokens, each of which is delimited by a wide character from the
wide character string pointed to by s2.  The first call in the sequence has s1
as its first argument, and is followed by calls with a NULL pointer as their
first argument.  The separator string pointed to by s2 may be different from
call to call.

The first call in the sequence searches the string pointed to by s1 for the
first character that is not contained in the current separator string pointed
to by s2.  If no such character is found, then there are no tokens in the
string pointed to by s1 and the wcstok subroutine returns a NULL pointer.  If
such a character is found, it is the start of the first token.

The wcstok subroutine then searches from there for a character that is
contained in the current separator string.  If no such character is found, the
current token extends to the end of the string pointed to by s1, and subsequent
searches for a token will return a NULL pointer.  If such a character is found,
it is overwritten by a NULL character, which terminates the current token.  The
wcstok subroutine saves a pointer to the following character, from which the
next search for a token will start.

Each subsequent call, with a NULL pointer as the value of the first argument,
starts searching from the saved pointer and behaves as described above.  The
saved pointer will not be changed as a side effect of calling any other library
routine in libc.a.

The wcswcs subroutine locates the first occurrence in the wide character string
pointed to by s1 of the sequence of wide characters (excluding the terminating
NULL character) in the wide character string pointed to by s2.

RETURN VALUE

The wcscat, wcscpy, wcsncat, and wcsncpy subroutines return the value of s1.

The wcschr subroutine returns a pointer to the located wide character, or a
NULL pointer if the character does not occur in the string.

The wcscmp returns an integer greater than, equal to, or less than zero if the
wide character string pointed to by s1 is greater than, equal to or less than
the wide character string pointed to by s2.

The wcscspn and wcsspn subroutines return the length of the segment.

The wcslen subroutine returns the number of wide characters that precede the
terminating NULL character.

The wcsncmp subroutine is similar to wcscmp, except no more than the first N
wide characters of s1 or s2 are considered in the comparison.

The wcspbrk subroutine returns a pointer to the first wide character, or a NULL
pointer if no wide character from the wide character string from s2 occurs in
s1.



Processed November 7, 1990       WCSTRING(3,L)                                3





WCSTRING(3,L)               AIX Technical Reference               WCSTRING(3,L)




The wcsrchr subroutine returns a pointer to the wide character, or a NULL
pointer if c does not occur in the wide character string.

The wcstok subroutine returns a pointer to the first wide character of the next
token, or a NULL pointer if there is no token.

The wcswcs subroutine returns a pointer to the located wide character string,
or a NULL pointer if the string is not found.  If s2 points to a wide character
string with zero length, the subroutine returns s1.

RELATED INFORMATION

In this book:  "mbstring,"  "string," and "NCstring."

AIX Guide to Multibyte Character Set (MBCS) Support.







































Processed November 7, 1990       WCSTRING(3,L)                                4



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026