Documentation

c-treeDB API for C

Previous Topic

Next Topic

Segment Modes

By default, the preferred segment modes (see Index segment modes) sort in ascending order. This can be changed to descending sort order by OR-ing CTSEG_DESCENDING with the segment mode. If a custom sort order is desired, OR the segment mode with CTSEG_ALTSEG instead.

The preferred segment modes make c-treeDB-based tables fully compatible with ISAM/Low-Level applications and/or FairCom DB SQL applications.

c-treeDB Segment Modes

c-treeDB .NET
Segment Modes


Explanation

CTSEG_SCHSEG

SCHSEG_SEG

Absolute field number

CTSEG_USCHSEG

USCHSEG_SEG

Absolute field number - uppercase

CTSEG_VSCHSEG

VSCHSEG_SEG

Absolute field number - pad strings

CTSEG_UVSCHSEG

UVSCHSEG_SEG

Absolute field number - pad strings upper

CTSEG_SCHSRL

SCHSRL_SEG

Absolute field number - auto increment

CTSEG_DESCENDING

DESCENDING_SEG

Descending segment mode

CTSEG_ALTSEG

ALTSEG_SEG

Alternative collating sequence

CTSEG_ENDSEG

ENDSEG_SEG

END segment mode

The other segment modes are kept for compatibility with existing FairCom DB applications. Advanced c-treeDB functions like ctdbAlterTable() may not work properly if the segment mode is not one of the preferred segment modes.

You may specify these segment modes with ctdbAddSegmentEx(), which expects an absolute record offset where the segment is to start (instead of a field indicator), the length in bytes of the segment, and the segment mode.

c-treeDB Segment Modes

c-treeDB .NET
Segment Modes


Explanation

CTSEG_REGSEG

REGSEG_SEG

Absolute byte offset - No transformation

CTSEG_INTSEG

INTSEG_SEG

Absolute byte offset - unsigned int/long

CTSEG_UREGSEG

UREGSEG_SEG

Absolute byte offset - uppercase

CTSEG_SRLSEG

SRLSEG_SEG

Absolute byte offset - auto increment

CTSEG_VARSEG

VARSEG_SEG

Relative field number

CTSEG_UVARSEG

UVARSEG_SEG

Relative field number - uppercase

CTSEG_SGNSEG

SGNSEG_SEG

Absolute byte offset - signed int/long

CTSEG_FLTSEG

FLTSEG_SEG

Absolute byte offset - float/double

CTSEG_DECSEG

DECSEG_SEG

Absolute byte offset - not yet implemented

CTSEG_BCDSEG

BCDSEG_SEG

Absolute byte offset - not yet implemented

CTSEG_DESCENDING

DESCENDING_SEG

Descending segment mode

CTSEG_ALTSEG

ALTSEG_SEG

Alternative collating sequence

c-treeDB .NET Segment Modes are defined in the SET_MODE enum.

See also Index segment modes.

TOCIndex