Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbGetHandleType

Retrieves the handle type.

DECLARATION

NINT ctdbGetHandleType(CTHANDLE Handle);

DESCRIPTION

ctdbGetHandleType() retrieves the handle type. Handle can be any valid c-treeDB API handle.

RETURN

ctdbGetHandleType() return one of the following values:

Value

Symbolic Constant

0

NULL or invalid Handle.

0x0db1

CTDB_SESSION_HANDLE_ID

0x0db2

CTDB_DATABASE_HANDLE_ID

0x0db3

CTDB_TABLE_HANDLE_ID

0x0db4

CTDB_RECORD_HANDLE_ID

0x0db5

CTDB_INDEX_HANDLE_ID

0x0db6

CTDB_FIELD_HANDLE_ID

0x0db7

CTDB_SEGMENT_HANDLE_ID

If the Handle parameter passed to ctdbGetHandleType() is NULL or invalid, ctdbGetHandleType() returns 0.

EXAMPLE

pCTDBSESSION pSession;


if (ctdbGetHandleType(Handle) == CTDB+_RECORD_HANDLE_ID)

pSession = ((pCTDBRECORD)Handle)->pSession;

SEE ALSO

ctdbGetLocalTag(), ctdbSetLocalTag()

TOCIndex