ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/include/channel.h
Revision: 3940
Committed: Tue Jun 10 19:27:34 2014 UTC (9 years, 9 months ago) by michael
Content type: text/x-chdr
File size: 4963 byte(s)
Log Message:
- Renamed set_channel_topic() to channel_set_topic()

File Contents

# Content
1 /*
2 * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3 *
4 * Copyright (c) 1997-2014 ircd-hybrid development team
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19 * USA
20 */
21
22 /*! \file channel.h
23 * \brief Responsible for managing channels, members, bans and topics
24 * \version $Id$
25 */
26
27 #ifndef INCLUDED_channel_h
28 #define INCLUDED_channel_h
29
30 #include "ircd_defs.h" /* KEYLEN, CHANNELLEN */
31
32 /* channel visible */
33 #define ShowChannel(v,c) (PubChannel(c) || IsMember((v),(c)))
34
35 #define IsMember(who, chan) ((find_channel_link(who, chan)) ? 1 : 0)
36 #define AddMemberFlag(x, y) ((x)->flags |= (y))
37 #define DelMemberFlag(x, y) ((x)->flags &= ~(y))
38
39 #define FLOOD_NOTICED 1
40 #define JOIN_FLOOD_NOTICED 2
41
42 #define SetFloodNoticed(x) ((x)->flags |= FLOOD_NOTICED)
43 #define IsSetFloodNoticed(x) ((x)->flags & FLOOD_NOTICED)
44 #define ClearFloodNoticed(x) ((x)->flags &= ~FLOOD_NOTICED)
45
46 #define SetJoinFloodNoticed(x) ((x)->flags |= JOIN_FLOOD_NOTICED)
47 #define IsSetJoinFloodNoticed(x) ((x)->flags & JOIN_FLOOD_NOTICED)
48 #define ClearJoinFloodNoticed(x) ((x)->flags &= ~JOIN_FLOOD_NOTICED)
49
50 struct Client;
51
52 /*! \brief Mode structure for channels */
53 struct Mode
54 {
55 unsigned int mode; /*!< simple modes */
56 unsigned int limit; /*!< +l userlimit */
57 char key[KEYLEN + 1]; /*!< +k key */
58 };
59
60 /*! \brief Channel structure */
61 struct Channel
62 {
63 dlink_node node;
64
65 struct Channel *hnextch;
66 struct Mode mode;
67
68 char topic[TOPICLEN + 1];
69 char topic_info[USERHOST_REPLYLEN];
70
71 time_t channelts;
72 time_t topic_time;
73 time_t last_knock; /*!< don't allow knock to flood */
74 time_t last_join_time;
75 time_t last_invite; /*!< don't allow INVITE to flood */
76 time_t first_received_message_time; /*!< channel flood control */
77 unsigned int flags;
78 int received_number_of_privmsgs;
79
80 dlink_list members;
81 dlink_list invites;
82 dlink_list banlist;
83 dlink_list exceptlist;
84 dlink_list invexlist;
85
86 float number_joined;
87
88 char chname[CHANNELLEN + 1];
89 };
90
91 /*! \brief Membership structure */
92 struct Membership
93 {
94 dlink_node channode; /*!< link to chptr->members */
95 dlink_node usernode; /*!< link to source_p->channel */
96 struct Channel *chptr; /*!< Channel pointer */
97 struct Client *client_p; /*!< Client pointer */
98 unsigned int flags; /*!< user/channel flags, e.g. CHFL_CHANOP */
99 };
100
101 /*! \brief Ban structure. Used for b/e/I n!u\@h masks */
102 struct Ban
103 {
104 dlink_node node;
105 char *name;
106 char *user;
107 char *host;
108 char *who;
109 size_t len;
110 time_t when;
111 struct irc_ssaddr addr;
112 int bits;
113 int type;
114 };
115
116 extern dlink_list global_channel_list;
117
118 extern int check_channel_name(const char *, const int);
119 extern int can_send(struct Channel *, struct Client *, struct Membership *, const char *);
120 extern int is_banned(const struct Channel *, const struct Client *);
121 extern int can_join(struct Client *, struct Channel *, const char *);
122 extern int has_member_flags(const struct Membership *, const unsigned int);
123
124 extern void channel_do_join(struct Client *, char *, char *);
125 extern void channel_do_join_0(struct Client *);
126 extern void channel_do_part(struct Client *, char *, char *);
127 extern void remove_ban(struct Ban *, dlink_list *);
128 extern void channel_init(void);
129 extern void add_user_to_channel(struct Channel *, struct Client *,
130 unsigned int, int);
131 extern void remove_user_from_channel(struct Membership *);
132 extern void channel_member_names(struct Client *, struct Channel *, int);
133 extern void add_invite(struct Channel *, struct Client *);
134 extern void del_invite(struct Channel *, struct Client *);
135 extern void send_channel_modes(struct Client *, struct Channel *);
136 extern void channel_modes(struct Channel *, struct Client *, char *, char *);
137 extern void check_spambot_warning(struct Client *, const char *);
138 extern void check_splitmode(void *);
139 extern void free_channel_list(dlink_list *);
140 extern void destroy_channel(struct Channel *);
141 extern void channel_set_topic(struct Channel *, const char *, const char *, time_t, int);
142
143 extern const char *get_member_status(const struct Membership *, const int);
144
145 extern struct Channel *make_channel(const char *);
146 extern struct Membership *find_channel_link(struct Client *, struct Channel *);
147 #endif /* INCLUDED_channel_h */

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision