ifx_gl_mbspbrk - find multi-byte character in multi-byte string

SYNOPSIS

#include <ifxgls.h>
gl_mchar_t *ifx_gl_mbspbrk(gl_mchar_t *mbs1, int mbs1_byte_length,
		           gl_mchar_t *mbs2, int mbs2_byte_length)

DESCRIPTION

This function searches for the first occurrence in the multi-byte string mbs1 of any multi-byte character from the string mbs2.

If mbs1_byte_length is the value IFX_GL_NULL then the function will assume that mbs1 is a null-terminated string; otherwise the function assumes that mbs1_byte_length is the number of bytes in mbs1. If mbs2_byte_length is the value IFX_GL_NULL then the function will assume that mbs2 is a null-terminated string; otherwise the function assumes that mbs2_byte_length is the number of bytes in mbs2. See Multi-Byte Character String Termination for more general information about these lengths.

RETURN VALUES

This function returns the pointer to the first occurrence in mbs1 of any character from mbs2. If no character in mbs2 is not found in mbs1, then this function returns NULL and sets ifx_gl_lc_errno() to zero.

ERRORS

If an error has occurred, this function returns NULL and sets ifx_gl_lc_errno() to one of the following,
[IFX_GL_PARAMERR]
Either mbs1_byte_length is not equal to IFX_GL_NULL and is not greater than or equal to zero, or mbs2_byte_length is not equal to IFX_GL_NULL and is not greater than or equal to zero.
[IFX_GL_TERMMISMAT]
Either mbs1_byte_length is equal to IFX_GL_NULL and mbs2_byte_length is greater than or equal to zero or mbs1_byte_length is greater than or equal to zero and mbs2_byte_length is equal to IFX_GL_NULL
[IFX_GL_EILSEQ]
Either mbs1 or mbs2 contains an invalid multi-byte character
[IFX_GL_EINVAL]
Either the function cannot determine whether the last character of mbs1 is a valid multi-byte character, because it would need to read more than mbs1_byte_length bytes from mbs1, or the function cannot determine whether the last character of mbs2 is a valid multi-byte character, because it would need to read more than mbs2_byte_length bytes from mbs2. See Keeping Multi-Byte Strings Consistent for more information about this error.

SEE ALSO

ifx_gl_mbschr() ifx_gl_mbsrchr() ifx_gl_wcschr() ifx_gl_wcsrchr() ifx_gl_wcspbrk()

ACKNOWLEDGEMENT

Portions of this description were derived from the X/Open CAE Specification: "System Interfaces and Headers, Issue 4"; X/Open Document Number: C202; ISBN: 1-872630-47-2; Published by X/Open Company Ltd., U.K.