Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

channels.h

Go to the documentation of this file.
00001 /*       +------------------------------------+
00002  *       | Inspire Internet Relay Chat Daemon |
00003  *       +------------------------------------+
00004  *
00005  *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
00006  *                       E-mail:
00007  *                <brain@chatspike.net>
00008  *                <Craig@chatspike.net>
00009  *     
00010  * Written by Craig Edwards, Craig McLure, and others.
00011  * This program is free but copyrighted software; see
00012  *            the file COPYING for details.
00013  *
00014  * ---------------------------------------------------
00015  */
00016 
00017 #include "inspircd_config.h"
00018 #include "base.h"
00019 #include <time.h>
00020 #include <vector>
00021 #include <string>
00022 
00023 #ifndef __CHANNELS_H__
00024 #define __CHANNELS_H__
00025 
00029 class HostItem : public classbase
00030 {
00031  public:
00032         time_t set_time;
00033         char set_by[NICKMAX];
00034         char data[MAXBUF];
00035 
00036         HostItem() { /* stub */ }
00037         virtual ~HostItem() { /* stub */ }
00038 };
00039 
00040 // banlist is inherited from HostList mainly for readability
00041 // reasons only
00042 
00045 class BanItem : public HostItem
00046 {
00047 };
00048 
00049 // same with this...
00050 
00053 class ExemptItem : public HostItem
00054 {
00055 };
00056 
00057 // and this...
00058 
00061 class InviteItem : public HostItem
00062 {
00063 };
00064 
00065 
00070 class ModeParameter : public classbase
00071 {
00072  public:
00073         char mode;
00074         char parameter[MAXBUF];
00075         char channel[CHANMAX];
00076 };
00077 
00080 typedef std::vector<BanItem>    BanList;
00081 
00084 typedef std::vector<ExemptItem> ExemptList;
00085 
00088 typedef std::vector<InviteItem> InviteList;
00089 
00094 class chanrec : public Extensible
00095 {
00096  public:
00099         char name[CHANMAX]; /* channel name */
00103         char custom_modes[MAXMODES];     /* modes handled by modules */
00104         
00108         char topic[MAXBUF];
00111         time_t created;
00115         time_t topicset;
00119         char setby[NICKMAX];
00120 
00124         long limit;
00125         
00129         char key[32];
00130         
00133         short int topiclock;
00134         
00137         short int noexternal;
00138         
00141         short int inviteonly;
00142         
00145         short int moderated;
00146         
00150         short int secret;
00151         
00155         short int c_private;
00156         
00159         BanList bans;
00160         
00163         void SetCustomMode(char mode,bool mode_on);
00164 
00167         void SetCustomModeParam(char mode,char* parameter,bool mode_on);
00168  
00171         bool IsCustomModeSet(char mode);
00172 
00179         std::string GetModeParameter(char mode);
00180 
00183         chanrec();
00184 
00185         virtual ~chanrec() { /* stub */ }
00186 };
00187 
00188 /* used to hold a channel and a users modes on that channel, e.g. +v, +h, +o
00189  * needs to come AFTER struct chanrec */
00190 
00191 #define UCMODE_OP      1
00192 #define UCMODE_VOICE   2
00193 #define UCMODE_HOP     4
00194 #define UCMODE_PROTECT 8
00195 #define UCMODE_FOUNDER 16
00196  
00202 class ucrec : public classbase
00203 {
00204  public:
00208         long uc_modes;
00209         
00213         chanrec *channel;
00214 
00215         ucrec() { /* stub */ }
00216         virtual ~ucrec() { /* stub */ }
00217 };
00218 
00219 #endif
00220 

Generated on Thu Apr 7 20:14:20 2005 for InspIRCd by doxygen 1.3.3