Character and string library functions

The library contains the following character-manipulation functions. You can use these functions in your C programs to manipulate single characters and strings of bytes and characters, including variable-length expressions of the following data types:
  • varchar
  • fixed-size lvarchar

The internal structure referenced by the lvarchar pointer data type is different from the character representation of a fixed-size lvarchar variable. You must use the ifx_var() functions to manipulate lvarchar pointer variables. For more information about the ifx_var() functions, see The lvarchar pointer and var binary library functions.

The functions whose names begin with by act on and return fixed-length strings of bytes. The functions whose names begin with rst and st (except stchar) operate on and return null-terminated strings. The rdownshift() and rupshift() functions also operate on null-terminated strings but do not return values. When you compile your program with the esql preprocessor, it calls on the linker to link these functions to your program. The following list provides brief descriptions of the character and string library functions and refers you to the pages where detailed information for each function is given.
Function name Description See
bycmpr() Compares two groups of contiguous bytes The bycmpr() function
bycopy() Copies bytes from one area to another The bycopy() function
byfill() Fills an area you specify with a character The byfill() function
byleng() Counts the number of bytes in a string The byleng() function
ldchar() Copies a fixed-length string to a null-terminated string The ldchar() function
rdownshift() Converts all letters to lowercase The rdownshift() function
rstod() Converts a string to a double value The rstod() function
rstoi() Converts a string to a short integer value The rstoi() function
rstol() Converts a string to a 4-byte integer value The rstol() function
rupshift() Converts all letters to uppercase The rtypmsize() function
stcat() Concatenates one string to another The stcat() function
stchar() Copies a null-terminated string to a fixed-length string The stchar() function
stcmpr() Compares two strings The stcmpr() function
stcopy() Copies one string to another string The stcopy() function
stleng() Counts the number of bytes in a string The stleng() function