Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbGetFieldStatus

Retrieves the changed status of a field handle.

DECLARATION

ULONG ctdbGetFieldStatus(CTHANDLE Handle);

DESCRIPTION

Retrieves the changed status of a field handle. Handle must be a c-treeDB API field handle. The status of a field handle is a bit map describing one or more changes that have occurred with the field object.

RETURN

ctdbGetFieldStatus() returns a bitmap of the following:

Value

Symbolic Constant

Explanation

0x00

CTDBFIELD_OLD

Original field as read from table

0x01

CTDBFIELD_NEW

Field added or inserted

0x02

CTDBFIELD_DEL

Original field deleted

0x04

CTDBFIELD_MOVED

Original field moved

0x10

CTDBFIELD_NAME

Field name changed

0x20

CTDBFIELD_TYPE

Field type changed

0x40

CTDBFIELD_LEN

Field length changed

0x80

CTDBFIELD_RESOURCE

Field resource changed

See Appendix A for a complete listing of valid c-tree Plus error values.

EXAMPLE

/* if field is new delete it */

for (i = 0; i < (NINT) ctdbGetTableFieldCount(hTable); i++)

{

CTHANDLE hField = ctdbGetField(hTable, i);

if (ctdbGetFieldStatus(hField) & CTDBFIELD_NEW)

if (ctdbDelField(hTable, 0) != CTDBRET_OK)

printf("ctdbDelField failed\n");

}

SEE ALSO

ctdbGetIndexStatus(), ctdbGetSegmentStatus()

TOCIndex