Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbNextDatabase

Get the name and path of the next database in this session dictionary.

Declaration

CTDBRET ctdbNextDatabase(CTHANDLE Handle, pTEXT Name, VRLEN NameSize,

pTEXT Path, VRLEN PathSize)

Description

ctdbNextDatabase() gets the name and path of the next database in this session dictionary.

  • Handle [in] the session handle.
  • Name [out] receives the database name.
  • NameSize [in] Name size in bytes. If Name is not large enough to receive the database name, ctdbNextDatabase() will return CTDBRET_ARGSMALL (4006).
  • Path [out] receives the database path, if the name is located and it is large enough to hold the path.
  • PathSize [in] Path size in bytes. If Path is not large enough to receive the database path, ctdbNextDatabase() will return CTDBRET_ARGSMALL (4006).

Use ctdbNextDatabase() with ctdbFirstDatabase() to obtain the names and paths of all the databases that are in this session dictionary. Use ctdbGetDatabaseCount() to retrieve the total number of databases in the session dictionary.

Returns

ctdbNextDatabase() returns CTDBRET_OK on success, or INOT_ERR (101) after the last database in the session dictionary has been retrieved, or a c-tree error code on failure.

Example


ctdbFirstDatabase(hSession, name, sizeof(name), path, sizeof(path));

do {

printf("\n\nDatabase: %s (%s)\n", path, name);

}

while (

ctdbNextDatabase(hSession, name, sizeof(name), path, sizeof(path))

== CTDBRET_OK );


See also

ctdbFirstDatabase(), ctdbFindDatabase(), ctdbGetDatabaseCount()

TOCIndex