The ifx_gl_mbschr() function
The ifx_gl_mbschr() function searches for the first occurrence of a character in a multibyte-character string.
Syntax
#include <ifxgls.h>
...
gl_mchar_t *ifx_gl_mbschr(mbs, mbs_byte_length, mb, mb_byte_limit)
gl_mchar_t *mbs;
int mbs_byte_length;
gl_mchar_t *mb;
int mb_byte_limit;
- mbs
- A pointer to the multibyte-character string in which the function searches for mb.
- mbs_byte_length
- The integer number of bytes in the mbs string. If mbs_byte_length is the value IFX_GL_NULL, the function assumes that mbs1 is a null-terminated string.
- mb
- A pointer to the multibyte character to search for in mbs.
- mb_byte_limit
- The number of bytes to read from the mb character to try to form a complete multibyte character. If mb_byte_limit is IFX_GL_NO_LIMIT, the ifx_gl_mbschr() function reads as many bytes as necessary from mb to form a complete character.
Valid in client application | Valid in DataBlade® UDR |
---|---|
Yes | Yes |
Usage
The ifx_gl_mbschr() function locates the first occurrence of mb in the multibyte string mbs.
Return values
- gl_mchar_t *
- A pointer to the first occurrence of mb in mbs.
- NULL
- Either mb was not found in mbs (the ifx_gl_lc_errno() error number is set to 0); or the function was not successful, and the error number is set to indicate the cause. See the Errors section.
Errors
If an error occurred, this function
returns NULL and sets the ifx_gl_lc_errno() error
number to one of the following values.
- IFX_GL_EILSEQ
- The *mb value is an invalid multibyte character, or *mbs contains an invalid multibyte character.
- IFX_GL_EINVAL
- The function cannot determine whether mb is a valid multibyte character because it would need to read more than mb_byte_limit bytes from mb, or the function cannot determine whether the last character of mbs is a valid multibyte character because it would need to read more than mbs_byte_length bytes from mbs. If mb_byte_limit is less than or equal to 0, this function always returns this error.
- IFX_GL_PARAMERR
- The mbs_byte_length is not equal to IFX_GL_NULL and is not greater than or equal to 0.