4 Revision 1.1 2003/01/26 23:52:59 brain
5 Modified documentation for base classes
8 Revision 1.1.1.1 2003/01/23 19:45:58 brain
9 InspIRCd second source tree
11 Revision 1.7 2003/01/22 00:44:26 brain
12 Added documentation comments
14 Revision 1.6 2003/01/21 21:11:17 brain
17 Revision 1.5 2003/01/16 20:11:55 brain
18 fixed some ugly pointer bugs (thanks dblack and a|KK|y!)
20 Revision 1.4 2003/01/15 22:47:44 brain
21 Changed user and channel structs to classes (finally)
26 #include "inspircd_config.h"
30 #ifndef __CHANNELS_H__
31 #define __CHANNELS_H__
33 /** Holds an entry for a ban list, exemption list, or invite list.
34 * This class contains a single element in a channel list, such as a banlist.
43 HostItem() { /* stub */ }
44 virtual ~HostItem() { /* stub */ }
47 // banlist is inherited from HostList mainly for readability
50 /** A subclass of HostItem designed to hold channel bans (+b)
52 class BanItem : public HostItem
58 /** A subclass of HostItem designed to hold channel exempts (+e)
60 class ExemptItem : public HostItem
66 /** A subclass of HostItem designed to hold channel invites (+I)
68 class InviteItem : public HostItem
73 /** Holds a complete ban list
75 typedef vector<BanItem> BanList;
77 /** Holds a complete exempt list
79 typedef vector<ExemptItem> ExemptList;
81 /** Holds a complete invite list
83 typedef vector<InviteItem> InviteList;
85 /** Holds all relevent information for a channel.
86 * This class represents a channel, and contains its name, modes, time created, topic, topic set time,
87 * etc, and an instance of the BanList type.
92 /** The channels name.
94 char name[CHANMAX]; /* channel name */
95 /** Custom modes for the channel.
96 * Plugins may use this field in any way they see fit.
98 char custom_modes[MAXMODES]; /* modes handled by modules */
100 * If this is an empty string, no channel topic is set.
106 /** Time topic was set.
107 * If no topic was ever set, this will be equal to chanrec::created
110 /** The last user to set the topic.
111 * If this member is an empty string, no topic was ever set.
115 /** Contains the channel user limit.
116 * If this value is zero, there is no limit in place.
120 /** Contains the channel key.
121 * If this value is an empty string, there is no channel key in place.
125 /** Nonzero if the mode +t is set.
129 /** Nonzero if the mode +n is set.
131 short int noexternal;
133 /** Nonzero if the mode +i is set.
135 short int inviteonly;
137 /** Nonzero if the mode +m is set.
141 /** Nonzero if the mode +s is set.
142 * This value cannot be set at the same time as chanrec::c_private
146 /** Nonzero if the mode +p is set.
147 * This value cannot be set at the same time as chanrec::secret
151 /** The list of all bans set on the channel.
155 /** Creates a channel record and initialises it with default values
160 strcpy(custom_modes,"");
164 created = topicset = limit = 0;
165 topiclock = noexternal = inviteonly = moderated = secret = c_private = false;
168 virtual ~chanrec() { /* stub */ }
171 /* used to hold a channel and a users modes on that channel, e.g. +v, +h, +o
172 * needs to come AFTER struct chanrec */
175 #define UCMODE_VOICE 2
177 #define UCMODE_PROTECT 8
178 #define UCMODE_FOUNDER 16
180 /** Holds a user's modes on a channel
181 * This class associates a users privilages with a channel by creating a pointer link between
182 * a userrec and chanrec class. The uc_modes member holds a bitmask of which privilages the user
183 * has on the channel, such as op, voice, etc.
188 /** Contains a bitmask of the UCMODE_OP ... UCMODE_FOUNDER values.
189 * If this value is zero, the user has no privilages upon the channel.
193 /** Points to the channel record where the given modes apply.
194 * If the record is not in use, this value will be NULL.
198 ucrec() { /* stub */ }
199 virtual ~ucrec() { /* stub */ }