int bone_reqchannellist(BONEHANDLE bhnd)

Description
Requests a list of public Bone channels.

Callback
BONE_CALLBACK_CHANNELLIST

Notes
The function parameter is the BONEHANDLE.  A list of public channels will be returned by consecutive calls to the callback.  The callback is called with a NULL channel pointer to signify the end of the list.

Example

bone_setcallback(BONE_CALLBACK_CHANNELLIST, callback_channellist);

if (bone_reqchannellist(bnd))
    printf("Unable to request a channel list (reason %d).\n",bone_getlasterror());

 

void callback_channellist(BONEHANDLE bhnd, const char *channel, char type, int usercount)
{
    if (channel)
    {
        switch(type)
        {
        case BONE_API_CHANNEL_STANDARD:
            printf("Standard channel %s contains %d users.\n", channel, usercount);
            break;
        case BONE_API_CHANNEL_INVITEONLY:
            printf("Invite only channel %s contains %d users.\n", channel, usercount);
            break;
        case BONE_API_CHANNEL_PASSWORDED:
            printf("Password protected channel %s contains %d users.\n", channel, usercount);
            break;
        case BONE_API_CHANNEL_UNKNOWN:
            printf("Channel %s contains %d users.\n", channel, usercount);
            break;
        }
    }
}