The ifx_gl_ismalpha() function

The ifx_gl_ismalpha() function determines whether a multibyte character contains an alphabetic character.

Syntax

#include <ifxgls.h>
...
int ifx_gl_ismalpha(mb, mb_byte_limit)
       gl_mchar_t *mb;
       int mb_byte_limit;
mb
A pointer to the multibyte character whose character classification you want to determine.
mb_byte_limit
The integer number of bytes to read from mb to try to form a complete multibyte character. If mb_byte_limit is IFX_GL_NO_LIMIT, the ifx_gl_ismalpha() function reads as many bytes as necessary from mb to form a complete character. For more information about mb_byte_limit, see Multibyte-character termination.
Valid in client application Valid in DataBlade® UDR
Yes Yes

Usage

The ifx_gl_ismalpha() function tests whether mb is in the alpha character class according to the rules of the current locale. The alpha class contains all characters from the upper and lower classes. In addition to the uppercase and lowercase Latin-based characters, this class includes any alphabetic characters that the locale might define, including:
  • Asian ideographic characters; for example, Kanji characters.
  • Asian phonetic characters; for example, single-byte and multibyte Katakana and Hiragana characters.
  • non-ASCII digit characters (see the digit class).
  • Latin-based alphabetic characters that do not have a case-equivalent character.
  • user-defined characters.
  • vendor-defined characters.

Characters in the alpha class are also in the graph and print classes. No characters in the digit, blank, space, punct, or cntrl classes are in the alpha class.

To determine the case of an alphabetic multibyte character, you can use the ifx_gl_ismupper() and ifx_gl_ismlower()functions. Use the function ifx_gl_ismalnum() to test whether a multibyte character is an alphabetic character or a digit.

Locale information

The LC_CTYPE category of the current locale affects the behavior of this function because it defines the alpha character class.

Return values

>0
The *mb character is in the alpha character class.
0
The function was not successful, and the error number is set to indicate the cause. See the Errors section.

Errors

This function does not return a unique value to indicate an error. If an error occurred, the function returns 0 and sets the ifx_gl_lc_errno() error number to one of the following values.
IFX_GL_EILSEQ
The *mb value is not a valid 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. If mb_byte_limit is less than or equal to 0, this function always returns this error. For more information about this error, see Keep multibyte strings consistent.