X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fchannel.h;h=e20bfad6ec9919c0e266010eddcef6d707208904;hb=c26a4b9cbad862bce96e3dadcfaa85f7e2223de3;hp=d63d53262c21d9299ad63fc9eef68183847de14e;hpb=46d18f60766f997d0ca37c5937f58c0c06477932;p=umurmur.git diff --git a/src/channel.h b/src/channel.h index d63d532..e20bfad 100644 --- a/src/channel.h +++ b/src/channel.h @@ -37,9 +37,10 @@ typedef struct channel { int id; - char name[MAX_TEXT]; - char desc[MAX_TEXT]; + char *name; + char *desc; struct channel *parent; + bool_t temporary, noenter; struct dlist node; struct dlist subs; struct dlist clients; @@ -48,17 +49,27 @@ typedef struct channel { struct dlist link_node; } channel_t; +typedef struct { + channel_t *chan; + struct dlist node; +} channellist_t; + void Chan_init(); void Chan_free(); void Chan_addChannel(channel_t *parent, channel_t *sub); void Chan_removeChannel(channel_t *c); void Chan_addClient(channel_t *c, client_t *client); void Chan_removeClient(channel_t *c, client_t *client); -void Chan_playerJoin(channel_t *ch, client_t *client); -void Chan_playerJoin_id(int channelid, client_t *client); -void Chan_iterate(channel_t **channelpptr); +int Chan_userJoin(channel_t *ch, client_t *client); +int Chan_userJoin_id(int channelid, client_t *client); +int Chan_userLeave(client_t *client); +bool_t Chan_userJoin_id_test(int channelid); +channel_t *Chan_iterate(channel_t **channelpptr); +channel_t *Chan_iterate_siblings(channel_t *parent, channel_t **channelpptr); channel_t *Chan_createChannel(const char *name, const char *desc); channel_t *Chan_fromId(int channelid); void Chan_freeChannel(channel_t *ch); +void Chan_buildTreeList(channel_t *ch, struct dlist *head); +void Chan_freeTreeList(struct dlist *head); #endif