The <string.h>
header defines several functions useful for manipulating strings (character arrays) and memory buffers.
Several standard string and memory manipulation functions have Palm OS® specific equivalents; the equivalents are provided for backward compatibility, but the C99 versions are preferred for future development. See Exploring Palm OS: Memory, Databases, and Files for details on the Palm OS specific functions. Table 18.1 lists the C99 functions and their Palm OS equivalents.
Table 18.1 C99 functions and their Palm OS specific equivalents
C99 Function
|
Palm OS Equivalent
|
memmove()
|
MemMove()
|
memset()
|
MemSet()
|
strcat()
|
StrCat()
|
strcmp()
|
StrCompare()
|
strcoll()
|
StrCompare()
|
strcpy()
|
StrCopy()
|
strerror()
|
SysErrString()
|
strerror_r()
|
SysErrString()
|
strlcat()
|
StrLCat()
|
strlcpy()
|
StrLCopy()
|
strlen()
|
StrLen()
|
strncat()
|
StrNCat()
NOTE: StrNCat() has a different meaning for its parameters, so a careful code review is necessary when shifting between strncat() and StrNCat() .
|
strncmp()
|
StrNCompare()
|
strncpy()
|
StrNCopy()
|
strstr()
|
StrStr()
|
For details on SysErrString()
, see Exploring Palm OS: System Management.
The functions listed in Table 18.2 are not internationally safe.
Table 18.2 Functions that are not internationally safe
Function Name
|
Comments
|
strchr()
|
Not multi-byte aware.
|
strcmp()
|
Not multi-byte aware, and not locale sensitive.
|
strcspn()
|
Not multi-byte aware.
|
strlcat()
|
Not multi-byte aware.
|
strlcpy()
|
Not multi-byte aware.
|
strncat()
|
Not multi-byte aware; truncation can occur in the middle of a multi-byte character.
|
strncmp()
|
Not multi-byte aware or local sensitive.
|
strncpy()
|
Not multi-byte aware.
|
strpbrk()
|
Not multi-byte aware.
|
strrchr()
|
Not multi-byte aware.
|
strsep()
|
Not multi-byte aware.
|
strspn()
|
Not multi-byte aware.
|
strstr()
|
Not multi-byte aware.
|
strtok()
|
Not multi-byte aware.
|
strtok_r()
|
Not multi-byte aware.
|
strxfrm()
|
Not yet implemented.
|