4 Revision 1.2 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"
31 #ifndef __CHANNELS_H__
32 #define __CHANNELS_H__
34 /** Holds an entry for a ban list, exemption list, or invite list.
35 * This class contains a single element in a channel list, such as a banlist.
37 class HostItem : public classbase
44 HostItem() { /* stub */ }
45 virtual ~HostItem() { /* stub */ }
48 // banlist is inherited from HostList mainly for readability
51 /** A subclass of HostItem designed to hold channel bans (+b)
53 class BanItem : public HostItem
59 /** A subclass of HostItem designed to hold channel exempts (+e)
61 class ExemptItem : public HostItem
67 /** A subclass of HostItem designed to hold channel invites (+I)
69 class InviteItem : public HostItem
74 /** Holds a complete ban list
76 typedef vector<BanItem> BanList;
78 /** Holds a complete exempt list
80 typedef vector<ExemptItem> ExemptList;
82 /** Holds a complete invite list
84 typedef vector<InviteItem> InviteList;
86 /** Holds all relevent information for a channel.
87 * This class represents a channel, and contains its name, modes, time created, topic, topic set time,
88 * etc, and an instance of the BanList type.
90 class chanrec : public classbase
93 /** The channels name.
95 char name[CHANMAX]; /* channel name */
96 /** Custom modes for the channel.
97 * Plugins may use this field in any way they see fit.
99 char custom_modes[MAXMODES]; /* modes handled by modules */
101 * If this is an empty string, no channel topic is set.
107 /** Time topic was set.
108 * If no topic was ever set, this will be equal to chanrec::created
111 /** The last user to set the topic.
112 * If this member is an empty string, no topic was ever set.
116 /** Contains the channel user limit.
117 * If this value is zero, there is no limit in place.
121 /** Contains the channel key.
122 * If this value is an empty string, there is no channel key in place.
126 /** Nonzero if the mode +t is set.
130 /** Nonzero if the mode +n is set.
132 short int noexternal;
134 /** Nonzero if the mode +i is set.
136 short int inviteonly;
138 /** Nonzero if the mode +m is set.
142 /** Nonzero if the mode +s is set.
143 * This value cannot be set at the same time as chanrec::c_private
147 /** Nonzero if the mode +p is set.
148 * This value cannot be set at the same time as chanrec::secret
152 /** The list of all bans set on the channel.
156 /** Creates a channel record and initialises it with default values
161 strcpy(custom_modes,"");
165 created = topicset = limit = 0;
166 topiclock = noexternal = inviteonly = moderated = secret = c_private = false;
169 virtual ~chanrec() { /* stub */ }
172 /* used to hold a channel and a users modes on that channel, e.g. +v, +h, +o
173 * needs to come AFTER struct chanrec */
176 #define UCMODE_VOICE 2
178 #define UCMODE_PROTECT 8
179 #define UCMODE_FOUNDER 16
181 /** Holds a user's modes on a channel
182 * This class associates a users privilages with a channel by creating a pointer link between
183 * a userrec and chanrec class. The uc_modes member holds a bitmask of which privilages the user
184 * has on the channel, such as op, voice, etc.
186 class ucrec : public classbase
189 /** Contains a bitmask of the UCMODE_OP ... UCMODE_FOUNDER values.
190 * If this value is zero, the user has no privilages upon the channel.
194 /** Points to the channel record where the given modes apply.
195 * If the record is not in use, this value will be NULL.
199 ucrec() { /* stub */ }
200 virtual ~ucrec() { /* stub */ }