/*************************************************************** MPU-CTYPE.C Strict UCS-2 character classification functions. PART OF : MPUIO - library . NOTE : Classification is deterministic and does not depend on the process locale. Surrogate code units U+D800..U+DFFF are never classified. Copyright (C) 2000 - 2026 by Andrey V.Kosteltsev. All Rights Reserved. ***************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include static int __mpu_ucs2_has_property( __mpu_char16_t c, unsigned char property ) { if( c >= 0xd800U && c <= 0xdfffU ) return( 0 ); return( (__mpu_ucs2_ctype[(unsigned)c] & property) != 0 ); } int mpu_ucs2_isalpha( __mpu_char16_t c ) { return( __mpu_ucs2_has_property( c, __MPU_UCS2_ALPHA ) ); } int mpu_ucs2_isupper( __mpu_char16_t c ) { return( __mpu_ucs2_has_property( c, __MPU_UCS2_UPPER ) ); } int mpu_ucs2_islower( __mpu_char16_t c ) { return( __mpu_ucs2_has_property( c, __MPU_UCS2_LOWER ) ); } int mpu_ucs2_isdigit( __mpu_char16_t c ) { return( __mpu_ucs2_has_property( c, __MPU_UCS2_DIGIT ) ); } int mpu_ucs2_is_xid_start( __mpu_char16_t c ) { return( __mpu_ucs2_has_property( c, __MPU_UCS2_XID_START ) ); } int mpu_ucs2_is_xid_continue( __mpu_char16_t c ) { return( __mpu_ucs2_has_property( c, __MPU_UCS2_XID_CONTINUE ) ); }