Jump to content

UniQueryLocaleObject: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
No edit summary
Line 3: Line 3:


=== Parameters ===
=== Parameters ===
; localeObj - [[OS2 API:DataType:LocaleObject|LocaleObject]] - input : The locale object created from [[OS2_API:UniCreateLocaleObject|UniCreateLocaleObject]].
; 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:
* [[OS2_API:Constant:LC#LC_ALL|LC_ALL]]
* [[LC#LC_ALL|LC_ALL]]
* [[OS2_API:Constant:LC#LC_COLLATE|LC_COLLATE]]
* [[LC#LC_COLLATE|LC_COLLATE]]
* [[OS2_API:Constant:LC#LC_CTYPE|LC_CTYPE]]
* [[LC#LC_CTYPE|LC_CTYPE]]
* [[OS2_API:Constant:LC#LC_MESSAGES|LC_MESSAGES]]
* [[LC#LC_MESSAGES|LC_MESSAGES]]
* [[OS2_API:Constant:LC#LC_MONETARY|LC_MONETARY]]
* [[LC#LC_MONETARY|LC_MONETARY]]
* [[OS2_API:Constant:LC#LC_NUMERIC|LC_NUMERIC]]
* [[LC#LC_NUMERIC|LC_NUMERIC]]
* [[OS2_API:Constant:LC#LC_TIME|LC_TIME]]
* [[LC#LC_TIME|LC_TIME]]
; localeSpecType - integer - input : Values can be:
; localeSpecType - integer - input : Values can be:
* [[OS2_API:Constant:UNI#UNI_MBS_STRING_POINTER|UNI_MBS_STRING_POINTER]]
* [[UNI#UNI_MBS_STRING_POINTER|UNI_MBS_STRING_POINTER]]
* [[OS2_API:Constant:UNI#UNI_TOKEN_POINTER|UNI_TOKEN_POINTER]]
* [[UNI#UNI_TOKEN_POINTER|UNI_TOKEN_POINTER]]
* [[OS2_API:Constant:UNI#UNI_UCS_STRING_POINTER|UNI_UCS_STRING_POINTER]]
* [[UNI#UNI_UCS_STRING_POINTER|UNI_UCS_STRING_POINTER]]
; localeName - [[OS2 API:DataType:VOID|VOID]] - output : Buffer for the locale name.
; 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]]
=== Module ===
=== Define (C/C++) ===
=== Export name/Ordinal ===


=== Calling conversion ===
=== Calling conversion ===
Line 39: Line 33:


=== Example Code ===
=== Example Code ===
  [[OS2 API:DataType:LocaleObject|LocaleObject]] localeObj;
  LocaleObject localeObj;
  integer      category;
  integer      category;
  integer      localeSpecType;
  integer      localeSpecType;
  [[OS2 API:DataType:VOID|VOID]]         localeName;
  VOID        localeName;
  integer      rc;
  integer      rc;
  ...
  ...
Line 49: Line 43:


=== Related Functions ===
=== Related Functions ===
[[OS2 API:UniCreateLocaleObject|UniCreateLocaleObject]]
*[[UniCreateLocaleObject]]
[[OS2 API:UniFreeLocaleObject|UniFreeLocaleObject]]
*[[UniFreeLocaleObject]]


=== Notes ===
=== Notes ===
[[OS2 API:UniQueryLocaleObject|UniQueryLocaleObject]] returns the locale name.  It allocates storage as necessary which is to be released via [[OS2_API:UniFreeMem|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.


When the localeSpecType argument is [[OS2_API:Constant: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 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 [[OS2_API:Constant:UNI#UNI_MBS_STRING_POINTER|UNI_MBS_STRING_POINTER]] or [[OS2_API:Constant: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 [[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 [[OS2_API:Constant:UNI#UNI_MBS_STRING_POINTER|UNI_MBS_STRING_POINTER]] or [[OS2_API:Constant:UNI#UNI_UCS_STRING_POINTER|UNI_UCS_STRING_POINTER]] and the category is [[OS2 API:Constant: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 [[OS2_API:UniCreateLocaleObject|UniCreateLocaleObject]] to create the locale object.
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 [[OS2_API:Constant:UNI#UNI_MBS_STRING_POINTER|UNI_MBS_STRING_POINTER]] or [[OS2_API:Constant:UNI#UNI_UCS_STRING_POINTER|UNI_UCS_STRING_POINTER]] and the category is [[OS2 API:Constant:LC#LC_COLLATE|LC_COLLATE]], [[OS2_API:Constant:LC#LC_CTYPE|LC_CTYPE]], [[OS2_API:Constant:LC#LC_MESSAGES|LC_MESSAGES]], [[OS2_API:Constant:LC#LC_MONETARY|LC_MONETARY]], [[OS2_API:Constant:LC#LC_NUMERIC|LC_NUMERIC]], or [[OS2_API:Constant: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 [[OS2_API:UniCreateLocaleObject|UniCreateLocaleObject]] to create the locale object.
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 [[OS2_API:Constant:NULL|NULL]] pointer, [[OS2_API:UniQueryLocaleObject|UniQueryLocaleObject]] will return a locale specification identifying the respective categories of the default locale.
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]]
[[OS2_API | Back to OS/2 API]]
 
 
[[Category:The OS/2 API Project]]

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

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