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;
struct dlist flatlist_node;
struct dlist channel_links;
+ int linkcount;
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