ANSI C compatible string routines
[UCS-2 Character/String API]

ANSI C compatible string routines correspond to string manupulation routines in the ANSI C standard. More...

Functions

UCS2API ucs2char_tucs2cat (ucs2char_t *dst, const ucs2char_t *src)
 Concatenate two strings.
UCS2API ucs2char_tucs2chr (const ucs2char_t *str, ucs2char_t c)
 Search for the first occurrence of a character in a string.
UCS2API int ucs2cmp (const ucs2char_t *x, const ucs2char_t *y)
 Compare two strings.
UCS2API ucs2char_tucs2cpy (ucs2char_t *dst, const ucs2char_t *src)
 Copy a string.
UCS2API size_t ucs2cspn (const ucs2char_t *str, const ucs2char_t *charset)
 Count the number of characters not appearing in a character set.
UCS2API size_t ucs2len (const ucs2char_t *str)
 Count the length of a string.
UCS2API ucs2char_tucs2ncat (ucs2char_t *dst, const ucs2char_t *src, size_t n)
 Concatenate two strings (no more than the maximum length).
UCS2API int ucs2ncmp (const ucs2char_t *x, const ucs2char_t *y, size_t n)
 Compare two strings (no longer than the maximum length).
UCS2API ucs2char_tucs2ncpy (ucs2char_t *dst, const ucs2char_t *src, size_t n)
 Copy a string (no more than the maximum length).
UCS2API ucs2char_tucs2pbrk (const ucs2char_t *str, const ucs2char_t *charset)
 Find a character in a string that belongs to a character set.
UCS2API ucs2char_tucs2rchr (const ucs2char_t *str, ucs2char_t c)
 Search for the last occurrence of a character in a string.
UCS2API size_t ucs2spn (const ucs2char_t *str, const ucs2char_t *charset)
 Find a character in a string that does not belong to a character set.
UCS2API ucs2char_tucs2str (const ucs2char_t *str, const ucs2char_t *substr)
 Find a substring in a string.

Detailed Description

ANSI C compatible string routines correspond to string manupulation routines in the ANSI C standard.

The following ANSI C functions are not defined in this API subset: strcoll, strerror, strtok, strxfrm.


Function Documentation

UCS2API ucs2char_t* ucs2cat ( ucs2char_t dst,
const ucs2char_t src 
)

Concatenate two strings.

Parameters:
dst The pointer to the destination of a string.
src The pointer to the source of a string.
Return values:
ucs2char_t* The pointer to the destination string.

UCS2API ucs2char_t* ucs2chr ( const ucs2char_t str,
ucs2char_t  c 
)

Search for the first occurrence of a character in a string.

Parameters:
str The pointer to the string in which c is searched.
c The target character.
Return values:
ucs2char_t* The pointer to the character c in str, or NULL if c does not occur in str.

UCS2API int ucs2cmp ( const ucs2char_t x,
const ucs2char_t y 
)

Compare two strings.

Parameters:
x The pointer to a string.
y The pointer to another string.
Return values:
int A positive value if x is greater than y; a negative value if x is smaller than y; zero if x is identical to y.

UCS2API ucs2char_t* ucs2cpy ( ucs2char_t dst,
const ucs2char_t src 
)

Copy a string.

Parameters:
dst The pointer to the destination of a string.
src The pointer to the source of a string.
Return values:
ucs2char_t* The pointer to the destination string.

UCS2API size_t ucs2cspn ( const ucs2char_t str,
const ucs2char_t charset 
)

Count the number of characters not appearing in a character set.

Parameters:
str The pointer to a string.
charset The pointer to a character set.
Return values:
size_t The number of characters from the beginning of str in which any character in charset appear for the first time, or the length of str if such a character does not exist.

UCS2API size_t ucs2len ( const ucs2char_t str  ) 

Count the length of a string.

Parameters:
str The pointer to a string.
Return values:
size_t The number of characters in str.

UCS2API ucs2char_t* ucs2ncat ( ucs2char_t dst,
const ucs2char_t src,
size_t  n 
)

Concatenate two strings (no more than the maximum length).

Parameters:
dst The pointer to the destination of a string.
src The pointer to the source of a string.
n The number of characters to be concatenated.
Return values:
ucs2char_t* The pointer to the destination string.

UCS2API int ucs2ncmp ( const ucs2char_t x,
const ucs2char_t y,
size_t  n 
)

Compare two strings (no longer than the maximum length).

Parameters:
x The pointer to a string.
y The pointer to another string.
n The number of characters to be compared.
Return values:
int A positive value if x is greater than y; a negative value if x is smaller than y; zero if x is identical to y.

UCS2API ucs2char_t* ucs2ncpy ( ucs2char_t dst,
const ucs2char_t src,
size_t  n 
)

Copy a string (no more than the maximum length).

Parameters:
dst The pointer to the destination of a string.
src The pointer to the source of a string.
n The number of characters to be copied.
Return values:
ucs2char_t* The pointer to the destination string.

UCS2API ucs2char_t* ucs2pbrk ( const ucs2char_t str,
const ucs2char_t charset 
)

Find a character in a string that belongs to a character set.

Parameters:
str The pointer to the string where charset is searched.
charset The pointer to a character set.
Return values:
ucs2char_t* The pointer to the character in str that belongs to charset, or NULL if such a character does not exist.

UCS2API ucs2char_t* ucs2rchr ( const ucs2char_t str,
ucs2char_t  c 
)

Search for the last occurrence of a character in a string.

Parameters:
str The pointer to the string in which c is searched.
c The target character.
Return values:
ucs2char_t* The pointer to the character c in str, or NULL if c does not occur in str.

UCS2API size_t ucs2spn ( const ucs2char_t str,
const ucs2char_t charset 
)

Find a character in a string that does not belong to a character set.

Parameters:
str The pointer to the string where charset is searched.
charset The pointer to a character set.
Return values:
ucs2char_t* The pointer to the character in str that does not belong to charset, or NULL if such a character does not exist.

UCS2API ucs2char_t* ucs2str ( const ucs2char_t str,
const ucs2char_t substr 
)

Find a substring in a string.

Parameters:
str The pointer to the string where substr is searched.
substr The pointer to the substring.
Return values:
ucs2char_t* The pointer to the character where substr begins in str for the first time, or NULL if str does not contain substr.