UniQueryLocaleObject

From EDM2
Jump to: navigation, search

Get the locale name.

Syntax

UniQueryLocaleObject(localeObj, category, localeSpecType, localeName);

Parameters

localeObj - LocaleObject - input 
The locale object created from UniCreateLocaleObject.
category - integer - input 
The locale category identifier. Values can be:
localeSpecType - integer - input 
Values can be:
localeName - VOID - output 
Buffer for the locale name.

Returns

An integer with values of:

Calling Convention

Cdecl32

Example Code

LocaleObject localeObj;
integer      category;
integer      localeSpecType;
VOID         localeName;
integer      rc;
...
rc = UniQueryLocaleObject(localeObj, category, localeSpecType, localeName);
...

Related Functions

Notes

UniQueryLocaleObject returns the locale name. It allocates storage as necessary which is to be released via UniFreeMem.

The locale name variable will contain a string or a token as dictated by the LocaleSpecType argument.

When the localeSpecType argument is UNI_TOKEN_POINTER and the category is valid, the token that represents the locale value associated with the category argument is returned should the token exist.

When the localeSpecType argument is UNI_MBS_STRING_POINTER or UNI_UCS_STRING_POINTER and the category is valid, the string that represents the locale value associated with the category argument is returned.

When the localeSpecType argument is UNI_MBS_STRING_POINTER or UNI_UCS_STRING_POINTER and the category is LC_ALL, the string that represents the locale value associated with the category argument is returned. The retrieved string can be used in the localeSpec argument in UniCreateLocaleObject to create the locale object.

When the localeSpecType argument is UNI_MBS_STRING_POINTER or UNI_UCS_STRING_POINTER and the category is LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, or LC_TIME, the string that represents the respective locale value associated with the category argument is returned. The retrieved string can be used in the localeSpec argument in UniCreateLocaleObject to create the locale object.

If the locale object contains a NULL pointer, UniQueryLocaleObject will return a locale specification identifying the respective categories of the default locale.

If the locale object is not valid, the content of the locale name variable is undefined and no memory is allocated.

OS Version Introduced

OS/2 Warp