00001 /* 00002 00003 $Log$ 00003 Revision 1.4 2003/01/27 00:22:39 brain 00003 Modified documentation 00003 00004 Revision 1.2 2003/01/26 23:52:59 brain 00005 Modified documentation for base classes 00006 Added base classes 00007 00008 Revision 1.1.1.1 2003/01/23 19:45:58 brain 00009 InspIRCd second source tree 00010 00011 Revision 1.7 2003/01/22 00:44:26 brain 00012 Added documentation comments 00013 00014 Revision 1.6 2003/01/21 21:11:17 brain 00015 Added documentation 00016 00017 Revision 1.5 2003/01/16 20:11:55 brain 00018 fixed some ugly pointer bugs (thanks dblack and a|KK|y!) 00019 00020 Revision 1.4 2003/01/15 22:47:44 brain 00021 Changed user and channel structs to classes (finally) 00022 00023 00024 */ 00025 00026 #include "inspircd_config.h" 00027 #include "base.h" 00028 #include <time.h> 00029 #include <vector> 00030 00031 #ifndef __CHANNELS_H__ 00032 #define __CHANNELS_H__ 00033 00037 class HostItem : public classbase 00038 { 00039 public: 00040 time_t set_time; 00041 char set_by[NICKMAX]; 00042 char data[MAXBUF]; 00043 00044 HostItem() { /* stub */ } 00045 virtual ~HostItem() { /* stub */ } 00046 }; 00047 00048 // banlist is inherited from HostList mainly for readability 00049 // reasons only 00050 00053 class BanItem : public HostItem 00054 { 00055 }; 00056 00057 // same with this... 00058 00061 class ExemptItem : public HostItem 00062 { 00063 }; 00064 00065 // and this... 00066 00069 class InviteItem : public HostItem 00070 { 00071 }; 00072 00073 00076 typedef vector<BanItem> BanList; 00077 00080 typedef vector<ExemptItem> ExemptList; 00081 00084 typedef vector<InviteItem> InviteList; 00085 00090 class chanrec : public classbase 00091 { 00092 public: 00095 char name[CHANMAX]; /* channel name */ 00099 char custom_modes[MAXMODES]; /* modes handled by modules */ 00103 char topic[MAXBUF]; 00106 time_t created; 00110 time_t topicset; 00114 char setby[NICKMAX]; 00115 00119 long limit; 00120 00124 char key[32]; 00125 00128 short int topiclock; 00129 00132 short int noexternal; 00133 00136 short int inviteonly; 00137 00140 short int moderated; 00141 00145 short int secret; 00146 00150 short int c_private; 00151 00154 BanList bans; 00155 00158 chanrec() 00159 { 00160 strcpy(name,""); 00161 strcpy(custom_modes,""); 00162 strcpy(topic,""); 00163 strcpy(setby,""); 00164 strcpy(key,""); 00165 created = topicset = limit = 0; 00166 topiclock = noexternal = inviteonly = moderated = secret = c_private = false; 00167 } 00168 00169 virtual ~chanrec() { /* stub */ } 00170 }; 00171 00172 /* used to hold a channel and a users modes on that channel, e.g. +v, +h, +o 00173 * needs to come AFTER struct chanrec */ 00174 00175 #define UCMODE_OP 1 00176 #define UCMODE_VOICE 2 00177 #define UCMODE_HOP 4 00178 #define UCMODE_PROTECT 8 00179 #define UCMODE_FOUNDER 16 00180 00186 class ucrec : public classbase 00187 { 00188 public: 00192 long uc_modes; 00193 00197 chanrec *channel; 00198 00199 ucrec() { /* stub */ } 00200 virtual ~ucrec() { /* stub */ } 00201 }; 00202 00203 #endif 00204