Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

Specifying a Unicode Key Segment with CTSEG_UNCSEG

If a key segment is a Unicode segment, but the segment mode is not one of the CTSEG_SCHSEG modes or the segment field is not one of the Unicode field types, the segment mode must also specify the Unicode segment modifier CTSEG_UNCSEG. For example, assume the CT_FSTRING field contains a UTF-8 string:

Notice an Extended Key Segment definition must be created for the segment. Please refer to section Extended Key Segment Definition below. If no extended key segment definition is provided at the time of the table creation, c-treeDB will create an extended key segment with default values. Please refer to the Default Extended Key Segment Definition section below.

Previous Topic

Next Topic


hField = ctdbAddField(hTable, "customer", CT_FSTRING, 40);

if ((ctdbAddSegment(hIndex, hField, CTSEG_SCHSEG | CTSEG_UNCSEG)) == NULL)

printf("ctdbAddSegment failed with error %d\n", ctdbGetError(hIndex));