UniQueryLower
Appearance
UniQueryLower queries a Unicode character's lowercase (lower) attribute.
Syntax
UniQueryLower (const LocaleObject locale_object, UniChar uc)
Parameters
- locale_object (const LocaleObject)
- A locale object created by UniCreateLocaleObject or NULL.
- uc (UniChar)
- The Unicode character to query.
Returns
- Return value (int)
- returns
- 0
- The result of the test is false.
- 1
- The result of the test is true.
Remarks
This function provides the functionality of UniCreateAttrObject, UniQueryCharAttr, and UniFreeAttrObject as an atomic operation for the invariant attributes.
The locale may be specified as NULL to indicate default Unicode character attributes
Example
Format call.
#include <unidef.h> int UniQueryLower ( const LocaleObject locale_object, /* I - Locale object */ UniChar uc /* I - Character to query */ )
This example shows how to query character attributes.
#include <stdio.h> #include <unidef.h> int main(void) { LocaleObject locale_object = NULL; int result = 0; int rc = ULS_SUCCESS; UniChar uni_char = L'd'; /* Unicode lowercase Latin letter d */ /*****************************************************************/ /* Assumes LANG environment variable set to a valid locale name, */ /* such as fr_FR */ /*****************************************************************/ rc = UniCreateLocaleObject(UNI_UCS_STRING_POINTER, (UniChar *)L"", &locale_object); if (rc != ULS_SUCCESS) { printf("UniCreateLocaleObject error: return code = %u\n", rc); return 1; } /* Query character attribute */ result = UniQueryLower(locale_object, uni_char); if (result) printf("UniChar character %04X is a lowercase character\n", uni_char); else printf("UniChar character %04X is not a lowercase character\n", uni_char); return ULS_SUCCESS; }