Miscellaneous string routines
[UCS-2 Character/String API]

Non ANSI C compatible string routines. More...

Functions

UCS2API ucs2char_tucs2dup (const ucs2char_t *str)
 Duplicate a string.
UCS2API ucs2char_tucs2ndup (const ucs2char_t *str, size_t length)
 Duplicate a string no longer than the specified length.
UCS2API ucs2char_tucs2lwr (ucs2char_t *str)
 Convert a string to lowercase.
UCS2API ucs2char_tucs2upr (ucs2char_t *str)
 Convert a string to uppercase.
UCS2API int ucs2icmp (const ucs2char_t *x, const ucs2char_t *y)
 Compare two strings incasesensitively.
UCS2API int ucs2incmp (const ucs2char_t *x, const ucs2char_t *y, size_t n)
 Compare two strings incasesensitively (no longer than the maximum length).
UCS2API ucs2char_tucs2strip (ucs2char_t *str)
 Strip whitespace characters at the head and tail of a string.

Detailed Description

Non ANSI C compatible string routines.


Function Documentation

UCS2API ucs2char_t* ucs2dup ( const ucs2char_t str  ) 

Duplicate a string.

Parameters:
str The pointer to a string.
Return values:
ucs2char_t* The pointer to the duplicated string. Call ucs2free() to free the memory block allocated by this function.

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

Compare two strings incasesensitively.

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 int ucs2incmp ( const ucs2char_t x,
const ucs2char_t y,
size_t  n 
)

Compare two strings incasesensitively (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* ucs2lwr ( ucs2char_t str  ) 

Convert a string to lowercase.

Given str argument, this function converts uppercase letters in the string to lowercase and overwrites the resultant string on the same buffer pointed by the str argument.

Parameters:
str The pointer to a string.
Return values:
ucs2char_t* The pointer to the string, which is the same value as str.

UCS2API ucs2char_t* ucs2ndup ( const ucs2char_t str,
size_t  length 
)

Duplicate a string no longer than the specified length.

Parameters:
str The pointer to a string.
length The maximum length of the duplicated string.
Return values:
ucs2char_t* The pointer to the duplicated string. Call ucs2free() to free the memory block allocated by this function.

UCS2API ucs2char_t* ucs2strip ( ucs2char_t str  ) 

Strip whitespace characters at the head and tail of a string.

Given str argument, this function trims whilespace characters at the head and tail of the string and overwrites the resultant string on the same buffer pointed by the str argument.

Parameters:
str The pointer to a string.
Return values:
ucs2char_t* The pointer to the string, which is the same value as str.

UCS2API ucs2char_t* ucs2upr ( ucs2char_t str  ) 

Convert a string to uppercase.

Given str argument, this function converts lowercase letters in the string to uppercase and overwrites the resultant string on the same buffer pointed by the str argument.

Parameters:
str The pointer to a string.
Return values:
ucs2char_t* The pointer to the string, which is the same value as str.