Jump to content

UniQueryChar: Difference between revisions

From EDM2
Created page with "UniQueryChar determines if the character supplied has the attribute(s) requested. ==Syntax== int UniQueryChar (UniChar uc, ULONG attr) ==Parameters== ; uc (UniChar) : The ..."
 
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:


==Parameters==
==Parameters==
; uc  (UniChar) : The Unicode character whose attribute(s) are being examined.  
; uc  ([[UniChar]]) - input : The Unicode character whose attribute(s) are being examined.  
; attr  (ULONG) : The attribute being examined in the Unicode character.  
; attr  ([[ULONG]]) - input : The attribute being examined in the Unicode character.


==Returns==
==Returns==
Return value  (int)  -  returns
;Return value  (int)  -  returns
 
:Return values
; 0 : The specified attribute is false for the specified Unicode character.  
:; 0  
; 1 : The specified attribute is true for the specified Unicode character.  
:: The specified attribute is false for the specified Unicode character.  
:; 1  
:: The specified attribute is true for the specified Unicode character.


==Remarks==
==Remarks==

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 */
)

Related Functions