ctdbFirstDatabase
Get the name and path of the first database in a session dictionary.
Declaration
CTDBRET ctdbFirstDatabase(CTHANDLE Handle, pTEXT Name,
VRLEN NameSize, pTEXT Path, VRLEN PathSize)
Description
ctdbFirstDatabase() gets the name and path of the first database in the specified session dictionary.
ctdbFirstDatabase(), in conjunction with ctdbNextDatabase(), may be used to obtain the names and paths of all Databases in this session dictionary. ctdbGetDatabaseCount() may be used to retrieve the total number of databases in the session dictionary.
Returns
ctdbFirstDatabase() returns CTDBRET_OK on success, or INOT_ERR (101) if there are no databases in the session dictionary, 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
ctdbNextDatabase(), ctdbGetDatabaseCount(), ctdbFindDatabase(), ctdbFirstTable()