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 
00026 #define CM_TOPICLOCK 1
00027 #define CM_NOEXTERNAL 2
00028 #define CM_INVITEONLY 4
00029 #define CM_MODERATED 8
00030 #define CM_SECRET 16
00031 #define CM_PRIVATE 32
00032 
00036 class HostItem : public classbase
00037 {
00038  public:
00039         time_t set_time;
00040         char set_by[NICKMAX];
00041         char data[MAXBUF];
00042 
00043         HostItem() { /* stub */ }
00044         virtual ~HostItem() { /* stub */ }
00045 };
00046 
00047 // banlist is inherited from HostList mainly for readability
00048 // reasons only
00049 
00052 class BanItem : public HostItem
00053 {
00054 };
00055 
00056 // same with this...
00057 
00060 class ExemptItem : public HostItem
00061 {
00062 };
00063 
00064 // and this...
00065 
00068 class InviteItem : public HostItem
00069 {
00070 };
00071 
00072 
00077 class ModeParameter : public classbase
00078 {
00079  public:
00080         char mode;
00081         char parameter[MAXBUF];
00082         char channel[CHANMAX];
00083 };
00084 
00087 typedef std::vector<BanItem>    BanList;
00088 
00091 typedef std::vector<ExemptItem> ExemptList;
00092 
00095 typedef std::vector<InviteItem> InviteList;
00096 
00101 class chanrec : public Extensible
00102 {
00103  public:
00106         char name[CHANMAX]; /* channel name */
00110         char custom_modes[MAXMODES];     /* modes handled by modules */
00111 
00115         std::vector<char*> internal_userlist;
00116         
00120         char topic[MAXBUF];
00123         time_t created;
00127         time_t topicset;
00131         char setby[NICKMAX];
00132 
00136         short int limit;
00137         
00141         char key[32];
00142         
00145         char binarymodes;
00146         
00149         BanList bans;
00150         
00153         void SetCustomMode(char mode,bool mode_on);
00154 
00157         void SetCustomModeParam(char mode,char* parameter,bool mode_on);
00158  
00161         bool IsCustomModeSet(char mode);
00162 
00169         std::string GetModeParameter(char mode);
00170 
00176         long GetUserCounter();
00177 
00183         void AddUser(char* castuser);
00184 
00190         void DelUser(char* castuser);
00191 
00199         std::vector<char*> *GetUsers();
00200 
00203         chanrec();
00204 
00205         virtual ~chanrec() { /* stub */ }
00206 };
00207 
00208 /* used to hold a channel and a users modes on that channel, e.g. +v, +h, +o
00209  * needs to come AFTER struct chanrec */
00210 
00211 #define UCMODE_OP      1
00212 #define UCMODE_VOICE   2
00213 #define UCMODE_HOP     4
00214 #define UCMODE_PROTECT 8
00215 #define UCMODE_FOUNDER 16
00216  
00222 class ucrec : public classbase
00223 {
00224  public:
00228         char uc_modes;
00229         
00233         chanrec *channel;
00234 
00235         ucrec() { /* stub */ }
00236         virtual ~ucrec() { /* stub */ }
00237 };
00238 
00239 #endif
00240 

Generated on Fri May 13 15:48:40 2005 for InspIRCd by doxygen 1.3.3