UniQueryAttr

UniQueryAttr returns the value associated with the attribute name supplied by the user.

Syntax
UniQueryAttr (attrName)

Parameters

 * attrName (UniChar*): The name of a character attribute.

Returns
Return value (ULONG)

If the attribute name is known, the function returns the attribute value. Otherwise, 0 is returned.

Remarks
This function provides the numeric value for the standard attributes such as alpha, graph, and number. In addition, this function provides the numeric value for other attributes such as hiragana, diacritic, halfwidth etc. The table below contains the valid attribute names. Valid names are all in lower case.

Attributes whose names begin with a lower-case letter may be ORed together. Attribute names that have a leading _ or # character represent classes of characters; these attributes must be tested as individual attributes.

Symbolic names beginning with "C1_" are provided as aliases for several POSIX attributes for Win32 compatibility.

Example
This example shows how to query character attribute values using the character attributes. 
 * 1) include 
 * 2) include 

int main(void) {

char   name[33]; UniChar uname[33]; UniChar * up; char   * cp; ulong  rc;

/* Ask the user for an attribute name */ printf("Enter attribute name:"); scanf("%s", &name); if (strlen(name) > 32) return 1;

/* Convert name to unicode */ cp = name; up = uname; while (*cp) { *up++ = (UniChar)(*cp++); }   *up = 0;

/* Query the attribute and print the value */ rc = UniQueryAttr(tolower(uname)); if (rc == 0) { printf("UniQueryAttr error: return code = %u\n", rc); return 1; } else printf("%s attribute = %x\n", name, rc);

return ULS_SUCCESS; } 

Related Functions

 * UniQueryChar
 * UniQueryCharAttr
 * UniQueryCharType