UniQueryChar: Difference between revisions
Appearance
Line 10: | Line 10: | ||
==Returns== | ==Returns== | ||
;Return value (int) - returns | ;Return value (int) - returns | ||
:Return values | |||
:; 0 | :; 0 | ||
:: The specified attribute is false for the specified Unicode character. | :: The specified attribute is false for the specified Unicode character. |
Latest revision as of 21:55, 10 December 2023
UniQueryChar determines if the character supplied has the attribute(s) requested.
Syntax
int UniQueryChar (UniChar uc, ULONG attr)
Parameters
- uc (UniChar) - input
- The Unicode character whose attribute(s) are being examined.
- attr (ULONG) - input
- The attribute being examined in the Unicode character.
Returns
- Return value (int) - returns
- Return values
- 0
- The specified attribute is false for the specified Unicode character.
- 1
- The specified attribute is true for the specified Unicode character.
Remarks
This function takes the attributes supplied by the caller and tests the character to determine if they are true for that Unicode character. Attribute values are listed under UniQueryAttr; only the standard POSIX attributes (CT_* or C1_*) may be used.
Example
This example shows how to query if a character has particular attributes.
#include <stdio.h> #include <unidef.h> int main(void) { int result = 0; UniChar uni_char = L'A'; /* Unicode A character */ /* Query character for upper case and graphic attributes */ result = UniQueryChar(uni_char, C1_UPPER | C1_GRAPH); if (result) printf("UniChar is upper case and a graphic character\n"); else printf("UniChar is not upper case and a graphic character\n"_; return ULS_SUCCESS; }
Format
#include <unidef.h> int UniQueryChar ( UniChar uc, /* I - Character to query */ ULONG attr /* I - Symbolic attribute name */ )