Previous Topic

Next Topic

Next Active Database

ctdbGetNextActiveDatabase() retrieves the database handle of the next active database. When no more active databases exist, ctdbGetNextActiveDatabase() returns NULL.

/* Display all active databases */
void DisplayActiveDatabases(CTHANDLE hSesssion)
{
   VRLEN hScan;
   CTHANDLE hDatabase;

   if ((hDatabase = ctdbGetFirstActiveDatabase(hSession, &hScan)) != NULL)
   {
      do
      {
         printf(“Database: %s Path: %s\n”, ctdbGetDatabaseName(hDatabase),
            ctdbGetDatabasePath(hDatabase));
         hDatabase = ctdbGetNextActiveDatabase(hSession, &hScan);
      }
      while (hDatabase != NULL;
   }
}