The ifx_gl_ismxdigit() function

The ifx_gl_ismxdigit() function determines whether a multibyte character contains a hexadecimal digit.

Syntax

#include <ifxgls.h>
...
int ifx_gl_ismxdigit(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_ismxdigit() 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_ismxdigit() function tests whether mb is in the xdigit character class according to the rules of the current locale. The xdigit character class contains:
  • the 10 ASCII digit characters (ASCII 0x030 to 0x039).
  • the characters A through F.
  • the characters a through f.

Any multibyte versions or alternative representations of these hexadecimal digits that the locale might define (for example, Hindi or Kanji digits) are not in this class. Instead, they are in the alpha class.

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

To determine whether a multibyte character contains a decimal digit, you can use the ifx_gl_ismdigit() function. Use the ifx_gl_ismalnum() function to test whether a multibyte character contains 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 xdigit character class.

Return values

>0
The mb character is in the xdigit 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.