UniQueryLocaleObject: Difference between revisions
m type correction |
mNo edit summary |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== | Get the locale name. | ||
=== Syntax === | |||
UniQueryLocaleObject(localeObj, category, localeSpecType, localeName); | |||
=== Parameters === | === Parameters === | ||
; localeObj - [[ | ; localeObj - [[LocaleObject]] - input : The locale object created from [[UniCreateLocaleObject]]. | ||
; category - integer - input : The locale category identifier. | ; category - integer - input : The locale category identifier. Values can be: | ||
* [[ | * [[LC#LC_ALL|LC_ALL]] | ||
* [[ | * [[LC#LC_COLLATE|LC_COLLATE]] | ||
* [[ | * [[LC#LC_CTYPE|LC_CTYPE]] | ||
* [[ | * [[LC#LC_MESSAGES|LC_MESSAGES]] | ||
* [[ | * [[LC#LC_MONETARY|LC_MONETARY]] | ||
* [[ | * [[LC#LC_NUMERIC|LC_NUMERIC]] | ||
* [[ | * [[LC#LC_TIME|LC_TIME]] | ||
; localeSpecType - integer - input : Values can be: | ; localeSpecType - integer - input : Values can be: | ||
* [[ | * [[UNI#UNI_MBS_STRING_POINTER|UNI_MBS_STRING_POINTER]] | ||
* [[ | * [[UNI#UNI_TOKEN_POINTER|UNI_TOKEN_POINTER]] | ||
* [[ | * [[UNI#UNI_UCS_STRING_POINTER|UNI_UCS_STRING_POINTER]] | ||
; localeName - [[ | ; localeName - [[VOID]] - output : Buffer for the locale name. | ||
=== Returns === | === Returns === | ||
An integer with values of: | An integer with values of: | ||
* [[ | *[[Unicode Errors|ULS_BADOBJECT]] | ||
* [[ | *[[Unicode Errors|ULS_NOMEMORY]] | ||
* [[ | *[[Unicode Errors|ULS_NOTOKEN]] | ||
* [[ | *[[Unicode Errors|ULS_SUCCESS]] | ||
* [[ | *[[Unicode Errors|ULS_UNSUPPORTED]] | ||
=== Calling Convention === | |||
=== Calling | |||
[[Cdecl32]] | [[Cdecl32]] | ||
=== Example Code === | === Example Code === | ||
LocaleObject localeObj; | |||
integer category; | integer category; | ||
integer localeSpecType; | integer localeSpecType; | ||
VOID localeName; | |||
integer rc; | integer rc; | ||
... | ... | ||
Line 49: | Line 42: | ||
=== Related Functions === | === Related Functions === | ||
[[ | *[[UniCreateLocaleObject]] | ||
[[ | *[[UniFreeLocaleObject]] | ||
=== Notes === | === 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. | The locale name variable will contain a string or a token as dictated by the LocaleSpecType argument. | ||
When the localeSpecType argument is [[ | When the localeSpecType argument is [[UNI#UNI_TOKEN_POINTER|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 | When the localeSpecType argument is [[UNI#UNI_MBS_STRING_POINTER|UNI_MBS_STRING_POINTER]] or [[UNI#UNI_UCS_STRING_POINTER|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 | When the localeSpecType argument is [[UNI#UNI_MBS_STRING_POINTER|UNI_MBS_STRING_POINTER]] or [[UNI#UNI_UCS_STRING_POINTER|UNI_UCS_STRING_POINTER]] and the category is [[LC#LC_ALL|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 | When the localeSpecType argument is [[UNI#UNI_MBS_STRING_POINTER|UNI_MBS_STRING_POINTER]] or [[UNI#UNI_UCS_STRING_POINTER|UNI_UCS_STRING_POINTER]] and the category is [[LC#LC_COLLATE|LC_COLLATE]], [[LC#LC_CTYPE|LC_CTYPE]], [[LC#LC_MESSAGES|LC_MESSAGES]], [[LC#LC_MONETARY|LC_MONETARY]], [[LC#LC_NUMERIC|LC_NUMERIC]], or [[LC#LC_TIME|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 [[ | 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. | If the locale object is not valid, the content of the locale name variable is undefined and no memory is allocated. | ||
Line 71: | Line 64: | ||
=== OS Version Introduced === | === OS Version Introduced === | ||
OS/2 Warp | OS/2 Warp | ||
[[Category:Uni]] |
Latest revision as of 00:22, 2 March 2018
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
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