Addition of hashtable iterator

User print routine

rejig of show users to show dbusers and a new show users command in the debugcli
This commit is contained in:
Mark Riddoch
2013-07-23 12:16:22 +02:00
parent 36f62637c9
commit 016e759b2b
6 changed files with 126 additions and 1 deletions

View File

@ -170,6 +170,20 @@ usersPrint(USERS *users)
void
dcb_usersPrint(DCB *dcb, USERS *users)
{
HASHITERATOR *iter;
char *sep, *user;
dcb_printf(dcb, "Users table data\n");
dcb_hashtable_stats(dcb, users->data);
if ((iter = hashtable_iterator(users->data)) != NULL)
{
dcb_printf(dcb, "User names: ");
sep = "";
while ((user = hashtable_next(iter)) != NULL)
{
dcb_printf(dcb, "%s%s", sep, user);
sep = ", ";
}
dcb_printf(dcb, "\n");
}
}