Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

TransformXtdSegment

Creates a binary sort key (segment) using an extended key segment definition.

Short Name

XFMKSEGDEF()

Type

ISAM Data Definition

Declaration

NINT TransformXtdSegment(NINT seghnd, pVOID src, NINT srclen,

NINT srctyp, pVOID dest, NINT destlen)

Description

Most applications will not have a reason to call TransformXtdSegment() unless the application needs to create a Unicode binary sort key outside of the normal ISAM processing.

Creates a binary sort key (segment) using an extended key segment definition.

seghnd

Handle returned by PutXtdKeySegmentDef() or GetXtdKeySegmentDef().

src

Pointer to data used to construct segment.

srclen

Size in bytes of the region pointed by src. However, srclen is ignored unless kseg_ssiz was set to ctKSEG_SSIZ_PROVIDED.

srctyp

srctyp should be set to one of the c-tree field types (e.g., CT_STRING or CT_UNICODE). However, srctyp is ignored unless kseg_styp was set to ctKSEG_STYP_PROVIDED.

dest

Pointer to region in which binary sort key is constructed.

destlen

Size in bytes of the region pointed to by dest.

Return

If successful, it returns the number of bytes used for the binary sort key. Returns a negative value upon error, where the absolute value of the return value is the error code. The most common errors are shown below.

445

SDAT_ERR

No source data to create key segment.

446

BMOD_ERR

The handle references an extended key segment definition not supported by the executable.

694

NUNC_ERR

Executable does not support ICU Unicode, but a UNCSEG modifier has been encountered.

700

OSEG_ERR

Could not process key segment definition.

701

CSEG_ERR

Could not process the kseg_comp options. This could occur if more than one of a set of mutually exclusive options are combined.

702

ASEG_ERR

An error occurred when attempting to process one of the special attribute options.

703

HSEG_ERR

Invalid key segment handle.

704

SSEG_ERR

No source type provided when kseg_styp has been set to ctKSEG_STYP_PROVIDED. If this error occurs, it is likely to occur during the first use (say with an AddRecord() or AddVRecord() or OpenIFile()) of the extended key segment.

706

NSEG_ERR

Zero bytes of binary sort key were generated. Possibly an all NULL source.

707

USEG_ERR

There is no extended key segment definition to use.

708

MBSP_ERR

Multibyte/Unicode file names are not supported.

709

MBNM_ERR

A badly formed multibyte/Unicode file name has been encountered.

710

MBFM_ERR

A multibyte/Unicode variant is not supported (e.g., UTF32).

See c-tree Error Codes for a complete listing of valid c-tree error values.

Example

See the API example in Unicode Support.

See also

AddRecord(), AddVRecord(), OpenIFile(), GetXtdKeySegmentDef(), PutXtdKeySegmentDef()

TOCIndex