ifx_gl_mbsntsbytes - returns number of bytes ignoring trailing spaces

SYNOPSIS

#include <ifxgls.h>
int ifx_gl_mbsntsbytes(gl_mchar_t *mbs, int mbs_byte_length)

DESCRIPTION

This function returns the number of bytes in mbs, not including the trailing space characters. The characters that are not included in the count are the ASCII space character and any multi-byte characters that are equivalent to the ASCII space character. Note that the space characters embedded in the string prior to the series of spaces at the end of the string are included in the count.

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

For example, the following call will return 8,

    ifx_gl_mbsntsbytes("ab cd ef          ")

RETURN VALUES

Returns the number of bytes in mbs, not including the trailing space characters.

ERRORS

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

SEE ALSO

ifx_gl_mbsntslen() ifx_gl_wcsntslen()

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.