Jump to content

UniQueryLocaleObject: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
== UniQueryLocaleObject ==
Get the locale name.
; UniQueryLocaleObject(localeObj, category, localeSpecType, localeName) : Get the locale name.
UniQueryLocaleObject(localeObj, category, localeSpecType, localeName)


=== Parameters ===
=== Parameters ===
Line 17: Line 17:
* [[UNI#UNI_UCS_STRING_POINTER|UNI_UCS_STRING_POINTER]]
* [[UNI#UNI_UCS_STRING_POINTER|UNI_UCS_STRING_POINTER]]
; localeName - [[VOID]] - output : Buffer for the locale name.
; localeName - [[VOID]] - output : Buffer for the locale name.
=== Constants ===
None


=== Returns ===
=== Returns ===
An integer with values of:
An integer with values of:
* [[OS2 API:Unicode:error#ULS_BADOBJECT|ULS_BADOBJECT]]
*[[Unicode Errors|ULS_BADOBJECT]]
* [[OS2 API:Unicode:error#ULS_NOMEMORY|ULS_NOMEMORY]]
*[[Unicode Errors|ULS_NOMEMORY]]
* [[OS2 API:Unicode:error#ULS_NOTOKEN|ULS_NOTOKEN]]
*[[Unicode Errors|ULS_NOTOKEN]]
* [[OS2 API:Unicode:error#ULS_SUCCESS|ULS_SUCCESS]]
*[[Unicode Errors|ULS_SUCCESS]]
* [[OS2 API:Unicode:error#ULS_UNSUPPORTED|ULS_UNSUPPORTED]]
*[[Unicode Errors|ULS_UNSUPPORTED]]


=== Calling Convention ===
=== Calling Convention ===
Line 47: Line 44:


=== Notes ===
=== Notes ===
UniQueryLocaleObject returns the locale name. It allocates storage as necessary which is to be released via [[UniFreeMem]].
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.
The locale name variable will contain a string or a token as dictated by the LocaleSpecType argument.

Revision as of 13:57, 19 January 2017

Get the locale name.

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 arguement 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 arguement 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 arguement 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