Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbAllocTable

Allocate a new table handle.

Declaration

CTHANDLE ctdbAllocTable(CTHANDLE Handle)

Description

ctdbAllocTable() allocates memory and initializes a new table handle and associates that handle with the database specified by Handle. Before any operation on a table can take place, the application must allocate a table handle.

  • Handle [in] the database handle, previously allocated by calling ctdbAllocDatabase(). Note that this handle does not need to be connected to a database when ctdbAllocTable() is called.

The next step after calling this function is generally to call ctdbOpenTable(). The table handle is released by calling ctdbFreeTable(). Do not release the table handle by calling the C runtime library function free().

Returns

ctdbAllocTable() returns the table handle on success or NULL on failure.

Example


CTSESSION_TYPE ctdbsess=CTSESSION_CTDB;

CTHANDLE hSession = ctdbAllocSession(ctdbsess);

CTHANDLE hDatabase = ctdbAllocDatabase(hSession);

CTHANDLE hTable = ctdbAllocTable(hDatabase);

See also

ctdbAllocDatabase(), ctdbFreeTable()

TOCIndex