Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

PutXtdKeySegmentDef

Defines an extended key segment for a Server, an application, a data file, an index file, or a particular index segment.

Short Name

PUTKSEGDEF()

Type

ISAM Data Definition

Declaration

NINT PutXtdKeySegmentDef(FILNO filno, NINT segno, pctKSEGDEF pkdef)

Description

PutXtdKeySegmentDef() defines an extended key segment for a Server, an application, a data file, an index file, or a particular index segment. The pkdef parameter points to a definition to be created in a call to PutXtdKeySegmentDef(). The filno and segno parameters determine where the definition is to be stored, as follows:

filno

segno

Interpretation

ctKSEGserver

ignored

Create server default definition.

ctKSEGapplic

ignored

Create application default definition.

datno

ignored

Create data file level definition.

keyno

ctKSEGindex

Create index file level definition.

keyno

0, 1, 2, ...

Create specific segment definition.

Return

PutXtdKeySegmentDef() returns a handle for the definition if successful.

PutXtdKeySegmentDef() 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. See c-tree Error Codes in the c-tree Programmer’s Reference Guide for a complete listing of valid c-tree error values.

Value

Symbolic Constant

Explanation

62

LERR_ERR

PutXtdKeySegmentDef() called for a data or index file requires the file to be opened exclusively. A just created file is in exclusive mode, regardless of the specified file mode, until it is closed and re-opened.

437

DADR_ERR

NULL pkdef argument.

445

SDAT_ERR

No source data to create key segment.

446

BMOD_ERR

Improper filno or segno values if the handle references an extended key segment definition not supported by the executable.

589

LADM_ERR

Only an ADMIN group member may set a Server default (i.e., ctKSEGserver).

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 in a call to TransformXtdSegment() or in a call to GetXtdKeySegmentDef() when the ctKSEGhandle option is used and the segno parameter should be set to a valid extended 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.

705

DSEG_ERR

An extended key segment definition already exists at the level implied by the PutXtdKeySegmentDef() call.

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).

Example

See the API example in the chapter titled “Unicode Support”.

See also

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

TOCIndex