int bone_joinchannel(BONEHANDLE bhnd, const char *channelname, int inviteonly, const char *password)

Description
Joins a Bone channel.

Callback
BONE_CALLBACK_CHANNELSUB

Notes
The function parameters are the BONEHANDLE and channel to join, as well as information about the type of channel if you are creating it.  The channelname should begin with pound (#).  inviteonly should be nonzero for true, and 0 for false.  password is a null terminated string containing the password you wish to set for joining this channel, or an empty string if you do not wish to have a channel password.

A channel cannot be both invite only and passworded.  If both are set, inviteonly will take precedence.  Additionally, inviteonly and password will only take effect if you are creating the channel (e.g. the first person in it).

Example

if (bone_setcallback(BONE_CALLBACK_CHANNELSUB, callback_chansub))
    printf("Unable to set callback (reason %d).\n", bone_getlasterror());
if (bone_setcallback(BONE_CALLBACK_CHANNELADDUSER, callback_adduser))
    printf("Unable to set callback (reason %d).\n", bone_getlasterror());

if (bone_joinchannel(bhnd, "#bone", 0, "goodpass"))
    printf("Unable to join channel (reason %d).\n", bone_getlasterror());

void callback_chansub(BONEHANDLE bhnd, const char *channel, int errorcode)
{
        printf("Unable to join channel (reason %d).\n", errorcode);
}

void callback_adduser(BONEHANDLE bhnd, const char *channel, const char *username)
{
    printf("%s just entered %s.\n", username, channel);
}