UniQueryLocaleObject: Difference between revisions
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
=== Parameters === | === Parameters === | ||
; localeObj - [[ | ; localeObj - [[LocaleObject]] - input : The locale object created from [[UniCreateLocaleObject]]. | ||
; category - integer - input : The locale category identifier. Values can be: | ; 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. | ||
=== Constants === | === Constants === | ||
Line 28: | Line 28: | ||
* [[OS2 API:Unicode:error#ULS_SUCCESS|ULS_SUCCESS]] | * [[OS2 API:Unicode:error#ULS_SUCCESS|ULS_SUCCESS]] | ||
* [[OS2 API:Unicode:error#ULS_UNSUPPORTED|ULS_UNSUPPORTED]] | * [[OS2 API:Unicode:error#ULS_UNSUPPORTED|ULS_UNSUPPORTED]] | ||
=== Calling conversion === | === Calling conversion === | ||
Line 39: | Line 33: | ||
=== Example Code === | === Example Code === | ||
LocaleObject localeObj; | |||
integer category; | integer category; | ||
integer localeSpecType; | integer localeSpecType; | ||
VOID localeName; | |||
integer rc; | integer rc; | ||
... | ... | ||
Line 49: | Line 43: | ||
=== 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 arguement is [[ | When the localeSpecType arguement 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 arguement is [[ | When the localeSpecType arguement 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 arguement is [[ | When the localeSpecType arguement 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 72: | Line 66: | ||
OS/2 Warp | OS/2 Warp | ||
[[Category:Uni]] | |||
[[Category: |
Revision as of 01:08, 5 December 2016
UniQueryLocaleObject
- UniQueryLocaleObject(localeObj, category, localeSpecType, localeName)
- Get the locale name.
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.
Constants
None
Returns
An integer with values of:
Calling conversion
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