Jump to content

UniQueryUconvObject: Difference between revisions

From EDM2
UniQueryUconvObject created
 
Ak120 (talk | contribs)
mNo edit summary
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== UniQueryUconvObject ==
; UniQueryUconvObject(uconvObj, uconvAttr, uconvAttrLen, startingBytes, moreBytes, charRange) :
Queries the attributes of the conversion object.
Queries the attributes of the conversion object.
=== Syntax ===
UniQueryUconvObject(uconvObj, uconvAttr, uconvAttrLen, startingBytes, moreBytes, charRange)


=== Parameters ===
=== Parameters ===
; uconvObj - [[OS2 API:DataType:UconvObject|UconvObject]] - input :
;uconvObj - [[UconvObject]] - input : The conversion object created from [[UniCreateUconvObject]].
The conversion object created from [[OS2_API:UniCreateUconvObject|UniCreateUconvObject]].
;uconvAttr - [[uconv_attribute_t]] - output : Receives the attribute information.
; uconvAttr - [[OS2 API:DataType:uconv_attribute_t|uconv_attribute_t]] - output :
;uconvAttrLen - (size_t) - input : Size of the attribute item.  It must be, at minimum, be the size of the [[uconv_attribute_t]] structure.
Receives the attribute information.
;startingBytes - [[CHAR]] - output : Get the array of beginning byte of a multi-byte character set. For some forms of stateful code pages, the length is based on state and not the returned table. If this parameter is NULL, no value is returned.  Each byte has one of the following values:
; uconvAttrLen - (size_t) - input :
*1 Single-byte character.
Size of the attribute item.  It must be, at minimum, be the size of the [[OS2_API:DataType:uconv_attribute_t|uconv_attribute_t]] structure.
*2 Double-byte character.
; startingBytes - [[OS2 API:DataType:CHAR|CHAR]] - output :
*3 Triple-byte character.
Get the array of beginning byte of a multi-byte character set. For some forms of stateful code pages, the length is based on state and not the returned table. If this parameter is NULL, no value is returned.  Each byte has one of the following values:
*4 Quad-byte character.
* 1 Single-byte character.
*255 Invalid code point for this codepage.
* 2 Double-byte character.
;moreBytes - [[CHAR]] - output : Array indicating the secondary byte is in a multi-byte sequence; used to allocate buffers.  Values for bytes are:
* 3 Triple-byte character.
*0 Not used as a secondary character.
* 255 Code point.
*1 Is used as a secondary character.
; moreBytes - [[OS2 API:DataType:CHAR|CHAR]] - output :
  Note - some codepages may not set this flag correctly.
Array indicating the secondary byte is in a multi-byte sequence; used to allocate buffers.  Values for bytes are:
; charRange - [[udcrange_t]] - output : Set of ranges of characters that is the user-defined character range.
* 0 Not used as a secondary character.
* 1 Is used as a secondary character.
; charRange - [[OS2 API:DataType:udcrange_t|udcrange_t]] - output :
Set of ranges of characters that is the user-defined character range.


=== Constants ===
=== Constants ===
Line 28: Line 25:
=== Returns ===
=== Returns ===
An integer with value(s) of:
An integer with value(s) of:
* [[OS2 API:Unicode:error#ULS_SUCCESS|ULS_SUCCESS]]
* [[Unicode Errors#ULS_BADOBJECT|ULS_BADOBJECT]]
* [[Unicode Errors#ULS_SUCCESS|ULS_SUCCESS]]


=== Module ===
=== Calling Convention ===
 
=== Define (C/C++) ===
 
=== Export name/Ordinal ===
 
=== Calling conversion ===
[[Cdecl32]]
[[Cdecl32]]


=== Example Code ===
=== Example Code ===
  [[OS2 API:DataType:UconvObject|UconvObject]]       uconvObj;
  UconvObject      uconvObj;
  [[OS2 API:DataType:uconv_attribute_t|uconv_attribute_t]] uconvAttr;
  uconv_attribute_t uconvAttr;
  size_t            uconvAttrLen;
  size_t            uconvAttrLen;
  [[OS2 API:DataType:CHAR|CHAR]][256]        startingBytes;
  CHAR[256]        startingBytes;
  [[OS2 API:DataType:CHAR|CHAR]][256]        moreBytes;
  CHAR[256]        moreBytes;
  [[OS2 API:DataType:udcrange_t|udcrange_t]]       charRange;
  udcrange_t[32]   charRange;
  integer          rc;
  integer          rc;
  ...
  ...
Line 52: Line 44:


=== Related Functions ===
=== Related Functions ===
[[OS2 API:UniCreateUconvObject|UniCreateUconvObject]]
*[[UniCreateUconvObject]]
[[OS2 API:UniFreeUconvObject|UniFreeUconvObject]]
*[[UniFreeUconvObject]]
[[OS2 API:UniSetUconvObject|UniSetUconvObject]]
*[[UniSetUconvObject]]


=== Notes ===
=== Notes ===
This function queries the given conversion object for its attributes and characteristics.
This function queries the given conversion object for its attributes and characteristics.


The substitution character attributes specify how to handle situations where there are no identical characters for a given element. This function can be used to query the substitution characters used by the conversion.
The substitution character attributes specify how to handle situations where there are no identical characters for a given element. This function can be used to query the substitution characters used by the conversion.


Some are static and bound by the conversion table; others can be set via [[OS2_API:UniSetUconvObject|UniSetUconvObject]].
Some are static and bound by the conversion table; others can be set via [[UniSetUconvObject]].


The uconvAttr, startingBytes, moreBytes, or charRange parameters, when set to [[OS2 API:Constant:NULL|NULL]], will return no data.
The uconvAttr, startingBytes, moreBytes, or charRange parameters, when set to [[NULL]], will return no data.


See [[OS2 API:DataType:uconv_attribute_t|uconv_attribute_t]] for the conversion object attributes; it indicates which fields can be queried and which can be set via [[OS2 API:UniSetUconvObject|UniSetUconvObject]].
See [[uconv_attribute_t]] for the conversion object attributes; it indicates which fields can be queried and which can be set via [[UniSetUconvObject]].


=== OS Version Introduced ===
=== OS Version Introduced ===
OS/2 Warp
OS/2 Warp
[[Category:Uni]]

Latest revision as of 18:06, 4 December 2019

Queries the attributes of the conversion object.

Syntax

UniQueryUconvObject(uconvObj, uconvAttr, uconvAttrLen, startingBytes, moreBytes, charRange)

Parameters

uconvObj - UconvObject - input
The conversion object created from UniCreateUconvObject.
uconvAttr - uconv_attribute_t - output
Receives the attribute information.
uconvAttrLen - (size_t) - input
Size of the attribute item. It must be, at minimum, be the size of the uconv_attribute_t structure.
startingBytes - CHAR - output
Get the array of beginning byte of a multi-byte character set. For some forms of stateful code pages, the length is based on state and not the returned table. If this parameter is NULL, no value is returned. Each byte has one of the following values:
  • 1 Single-byte character.
  • 2 Double-byte character.
  • 3 Triple-byte character.
  • 4 Quad-byte character.
  • 255 Invalid code point for this codepage.
moreBytes - CHAR - output
Array indicating the secondary byte is in a multi-byte sequence; used to allocate buffers. Values for bytes are:
  • 0 Not used as a secondary character.
  • 1 Is used as a secondary character.
  Note - some codepages may not set this flag correctly.
charRange - udcrange_t - output
Set of ranges of characters that is the user-defined character range.

Constants

None

Returns

An integer with value(s) of:

Calling Convention

Cdecl32

Example Code

UconvObject       uconvObj;
uconv_attribute_t uconvAttr;
size_t            uconvAttrLen;
CHAR[256]         startingBytes;
CHAR[256]         moreBytes;
udcrange_t[32]    charRange;
integer           rc;
...
rc = UniQueryUconvObject(uconvObj, uconvAttr, uconvAttrLen, startingBytes, moreBytes, charRange);
...

Related Functions

Notes

This function queries the given conversion object for its attributes and characteristics.

The substitution character attributes specify how to handle situations where there are no identical characters for a given element. This function can be used to query the substitution characters used by the conversion.

Some are static and bound by the conversion table; others can be set via UniSetUconvObject.

The uconvAttr, startingBytes, moreBytes, or charRange parameters, when set to NULL, will return no data.

See uconv_attribute_t for the conversion object attributes; it indicates which fields can be queried and which can be set via UniSetUconvObject.

OS Version Introduced

OS/2 Warp