From cd9f9a8add02597a2998ba74b803ed3fbf81314c Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 27 Nov 2005 01:44:46 +0000 Subject: Added new documentation git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1966 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/channels_8cpp-source.html | 455 +++++++++++++++--------------- 1 file changed, 225 insertions(+), 230 deletions(-) (limited to 'docs/module-doc/channels_8cpp-source.html') diff --git a/docs/module-doc/channels_8cpp-source.html b/docs/module-doc/channels_8cpp-source.html index 91c8beca5..d99c7dae0 100644 --- a/docs/module-doc/channels_8cpp-source.html +++ b/docs/module-doc/channels_8cpp-source.html @@ -1,237 +1,232 @@ - + InspIRCd: channels.cpp Source File - -
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members
-

channels.cpp

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 using namespace std;
-00018 
-00019 #include "inspircd_config.h"
-00020 #include "inspircd.h"
-00021 #include "inspircd_io.h"
-00022 #include "inspircd_util.h"
-00023 #include <unistd.h>
-00024 #include <sys/errno.h>
-00025 #include <sys/ioctl.h>
-00026 #include <sys/utsname.h>
-00027 #include <time.h>
-00028 #include <string>
-00029 #ifdef GCC3
-00030 #include <ext/hash_map>
-00031 #else
-00032 #include <hash_map>
-00033 #endif
-00034 #include <map>
-00035 #include <sstream>
-00036 #include <vector>
-00037 #include <deque>
-00038 #include "connection.h"
-00039 #include "users.h"
-00040 #include "servers.h"
-00041 #include "ctables.h"
-00042 #include "globals.h"
-00043 #include "modules.h"
-00044 #include "dynamic.h"
-00045 #include "wildcard.h"
-00046 #include "message.h"
-00047 #include "mode.h"
-00048 #include "xline.h"
-00049 #include "inspstring.h"
-00050 #include "helperfuncs.h"
-00051 
-00052 #ifdef GCC3
-00053 #define nspace __gnu_cxx
-00054 #else
-00055 #define nspace std
-00056 #endif
-00057 
-00058 extern int MODCOUNT;
-00059 extern std::vector<Module*> modules;
-00060 extern std::vector<ircd_module*> factory;
-00061 
-00062 extern int LogLevel;
-00063 extern char ServerName[MAXBUF];
-00064 extern char Network[MAXBUF];
-00065 extern char ServerDesc[MAXBUF];
-00066 extern char AdminName[MAXBUF];
-00067 extern char AdminEmail[MAXBUF];
-00068 extern char AdminNick[MAXBUF];
-00069 extern char diepass[MAXBUF];
-00070 extern char restartpass[MAXBUF];
-00071 extern char motd[MAXBUF];
-00072 extern char rules[MAXBUF];
-00073 extern char list[MAXBUF];
-00074 extern char PrefixQuit[MAXBUF];
-00075 extern char DieValue[MAXBUF];
-00076 
-00077 extern int debugging;
-00078 extern int WHOWAS_STALE;
-00079 extern int WHOWAS_MAX;
-00080 extern int DieDelay;
-00081 extern time_t startup_time;
-00082 extern int NetBufferSize;
-00083 int MaxWhoResults;
-00084 extern time_t nb_start;
-00085 
-00086 extern std::vector<std::string> module_names;
-00087 
-00088 extern int boundPortCount;
-00089 extern int portCount;
-00090 extern int SERVERportCount;
-00091 extern int ports[MAXSOCKS];
-00092 extern int defaultRoute;
-00093 
-00094 extern std::vector<long> auth_cookies;
-00095 extern std::stringstream config_f;
-00096 
-00097 extern serverrec* me[32];
-00098 
-00099 extern FILE *log_file;
-00100 
-00101 extern time_t TIME;
-00102 
-00103 using namespace std;
-00104 
-00105 std::vector<ModeParameter> custom_mode_params;
-00106 
-00107 chanrec::chanrec()
-00108 {
-00109         strcpy(name,"");
-00110         strcpy(custom_modes,"");
-00111         strcpy(topic,"");
-00112         strcpy(setby,"");
-00113         strcpy(key,"");
-00114         created = topicset = limit = 0;
-00115         binarymodes = 0;
-00116         internal_userlist.clear();
-00117 }
-00118 
-00119 void chanrec::SetCustomMode(char mode,bool mode_on)
-00120 {
-00121         if (mode_on) {
-00122                 static char m[3];
-00123                 m[0] = mode;
-00124                 m[1] = '\0';
-00125                 if (!strchr(this->custom_modes,mode))
-00126                 {
-00127                         strlcat(custom_modes,m,MAXMODES);
-00128                 }
-00129                 log(DEBUG,"Custom mode %c set",mode);
-00130         }
-00131         else {
-00132 
-00133                 std::string a = this->custom_modes;
-00134                 int pos = a.find(mode);
-00135                 a.erase(pos,1);
-00136                 strncpy(this->custom_modes,a.c_str(),MAXMODES);
-00137 
-00138                 log(DEBUG,"Custom mode %c removed: modelist='%s'",mode,this->custom_modes);
-00139                 this->SetCustomModeParam(mode,"",false);
-00140         }
-00141 }
-00142 
-00143 
-00144 void chanrec::SetCustomModeParam(char mode,char* parameter,bool mode_on)
-00145 {
-00146 
-00147         log(DEBUG,"SetCustomModeParam called");
-00148         ModeParameter M;
-00149         M.mode = mode;
-00150         strlcpy(M.channel,this->name,CHANMAX);
-00151         strlcpy(M.parameter,parameter,MAXBUF);
-00152         if (mode_on)
-00153         {
-00154                 log(DEBUG,"Custom mode parameter %c %s added",mode,parameter);
-00155                 custom_mode_params.push_back(M);
-00156         }
-00157         else
-00158         {
-00159                 if (custom_mode_params.size())
-00160                 {
-00161                         for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
-00162                         {
-00163                                 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
-00164                                 {
-00165                                         log(DEBUG,"Custom mode parameter %c %s removed",mode,parameter);
-00166                                         custom_mode_params.erase(i);
-00167                                         return;
-00168                                 }
-00169                         }
-00170                 }
-00171                 log(DEBUG,"*** BUG *** Attempt to remove non-existent mode parameter!");
-00172         }
-00173 }
-00174 
-00175 bool chanrec::IsCustomModeSet(char mode)
-00176 {
-00177         log(DEBUG,"Checking ISCustomModeSet: %c %s",mode,this->custom_modes);
-00178         return (strchr(this->custom_modes,mode) != 0);
-00179 }
-00180 
-00181 std::string chanrec::GetModeParameter(char mode)
-00182 {
-00183         if (custom_mode_params.size())
-00184         {
-00185                 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
-00186                 {
-00187                         if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
-00188                         {
-00189                                 return i->parameter;
-00190                         }
-00191                 }
-00192         }
-00193         return "";
-00194 }
-00195 
-00196 long chanrec::GetUserCounter()
-00197 {
-00198         return (this->internal_userlist.size());
-00199 }
-00200 
-00201 void chanrec::AddUser(char* castuser)
-00202 {
-00203         internal_userlist.push_back(castuser);
-00204         log(DEBUG,"Added casted user to channel's internal list");
-00205 }
-00206 
-00207 void chanrec::DelUser(char* castuser)
-00208 {
-00209         for (std::vector<char*>::iterator a = internal_userlist.begin(); a < internal_userlist.end(); a++)
-00210         {
-00211                 if (*a == castuser)
-00212                 {
-00213                         log(DEBUG,"Removed casted user from channel's internal list");
-00214                         internal_userlist.erase(a);
-00215                         return;
-00216                 }
-00217         }
-00218         log(DEBUG,"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!",name);
-00219 }
-00220 
-00221 std::vector<char*> *chanrec::GetUsers()
-00222 {
-00223         return &internal_userlist;
-00224 }
-

Generated on Mon May 30 05:15:18 2005 for InspIRCd by + + + +

channels.cpp

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 using namespace std;
+00018 
+00019 #include "inspircd_config.h"
+00020 #include "inspircd.h"
+00021 #include "inspircd_io.h"
+00022 #include "inspircd_util.h"
+00023 #include <unistd.h>
+00024 #include <sys/errno.h>
+00025 #include <sys/ioctl.h>
+00026 #include <sys/utsname.h>
+00027 #include <time.h>
+00028 #include <string>
+00029 #ifdef GCC3
+00030 #include <ext/hash_map>
+00031 #else
+00032 #include <hash_map>
+00033 #endif
+00034 #include <map>
+00035 #include <sstream>
+00036 #include <vector>
+00037 #include <deque>
+00038 #include "users.h"
+00039 #include "ctables.h"
+00040 #include "globals.h"
+00041 #include "modules.h"
+00042 #include "dynamic.h"
+00043 #include "wildcard.h"
+00044 #include "message.h"
+00045 #include "mode.h"
+00046 #include "xline.h"
+00047 #include "inspstring.h"
+00048 #include "helperfuncs.h"
+00049 
+00050 #ifdef GCC3
+00051 #define nspace __gnu_cxx
+00052 #else
+00053 #define nspace std
+00054 #endif
+00055 
+00056 extern int MODCOUNT;
+00057 extern std::vector<Module*> modules;
+00058 extern std::vector<ircd_module*> factory;
+00059 
+00060 extern int LogLevel;
+00061 extern char ServerName[MAXBUF];
+00062 extern char Network[MAXBUF];
+00063 extern char ServerDesc[MAXBUF];
+00064 extern char AdminName[MAXBUF];
+00065 extern char AdminEmail[MAXBUF];
+00066 extern char AdminNick[MAXBUF];
+00067 extern char diepass[MAXBUF];
+00068 extern char restartpass[MAXBUF];
+00069 extern char motd[MAXBUF];
+00070 extern char rules[MAXBUF];
+00071 extern char list[MAXBUF];
+00072 extern char PrefixQuit[MAXBUF];
+00073 extern char DieValue[MAXBUF];
+00074 
+00075 extern int debugging;
+00076 extern int WHOWAS_STALE;
+00077 extern int WHOWAS_MAX;
+00078 extern int DieDelay;
+00079 extern time_t startup_time;
+00080 extern int NetBufferSize;
+00081 int MaxWhoResults;
+00082 extern time_t nb_start;
+00083 
+00084 extern std::vector<std::string> module_names;
+00085 
+00086 extern int boundPortCount;
+00087 extern int portCount;
+00088 
+00089 extern int ports[MAXSOCKS];
+00090 
+00091 extern std::stringstream config_f;
+00092 
+00093 extern FILE *log_file;
+00094 
+00095 extern time_t TIME;
+00096 
+00097 using namespace std;
+00098 
+00099 std::vector<ModeParameter> custom_mode_params;
+00100 
+00101 chanrec::chanrec()
+00102 {
+00103         strcpy(name,"");
+00104         strcpy(custom_modes,"");
+00105         strcpy(topic,"");
+00106         strcpy(setby,"");
+00107         strcpy(key,"");
+00108         created = topicset = limit = 0;
+00109         binarymodes = 0;
+00110         internal_userlist.clear();
+00111 }
+00112 
+00113 void chanrec::SetCustomMode(char mode,bool mode_on)
+00114 {
+00115         if (mode_on) {
+00116                 static char m[3];
+00117                 m[0] = mode;
+00118                 m[1] = '\0';
+00119                 if (!strchr(this->custom_modes,mode))
+00120                 {
+00121                         strlcat(custom_modes,m,MAXMODES);
+00122                 }
+00123                 log(DEBUG,"Custom mode %c set",mode);
+00124         }
+00125         else {
+00126 
+00127                 std::string a = this->custom_modes;
+00128                 int pos = a.find(mode);
+00129                 a.erase(pos,1);
+00130                 strncpy(this->custom_modes,a.c_str(),MAXMODES);
+00131 
+00132                 log(DEBUG,"Custom mode %c removed: modelist='%s'",mode,this->custom_modes);
+00133                 this->SetCustomModeParam(mode,"",false);
+00134         }
+00135 }
+00136 
+00137 
+00138 void chanrec::SetCustomModeParam(char mode,char* parameter,bool mode_on)
+00139 {
+00140 
+00141         log(DEBUG,"SetCustomModeParam called");
+00142         ModeParameter M;
+00143         M.mode = mode;
+00144         strlcpy(M.channel,this->name,CHANMAX);
+00145         strlcpy(M.parameter,parameter,MAXBUF);
+00146         if (mode_on)
+00147         {
+00148                 log(DEBUG,"Custom mode parameter %c %s added",mode,parameter);
+00149                 custom_mode_params.push_back(M);
+00150         }
+00151         else
+00152         {
+00153                 if (custom_mode_params.size())
+00154                 {
+00155                         for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
+00156                         {
+00157                                 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
+00158                                 {
+00159                                         log(DEBUG,"Custom mode parameter %c %s removed",mode,parameter);
+00160                                         custom_mode_params.erase(i);
+00161                                         return;
+00162                                 }
+00163                         }
+00164                 }
+00165                 log(DEBUG,"*** BUG *** Attempt to remove non-existent mode parameter!");
+00166         }
+00167 }
+00168 
+00169 bool chanrec::IsCustomModeSet(char mode)
+00170 {
+00171         log(DEBUG,"Checking ISCustomModeSet: %c %s",mode,this->custom_modes);
+00172         return (strchr(this->custom_modes,mode) != 0);
+00173 }
+00174 
+00175 std::string chanrec::GetModeParameter(char mode)
+00176 {
+00177         if (custom_mode_params.size())
+00178         {
+00179                 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
+00180                 {
+00181                         if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
+00182                         {
+00183                                 return i->parameter;
+00184                         }
+00185                 }
+00186         }
+00187         return "";
+00188 }
+00189 
+00190 long chanrec::GetUserCounter()
+00191 {
+00192         return (this->internal_userlist.size());
+00193 }
+00194 
+00195 void chanrec::AddUser(char* castuser)
+00196 {
+00197         internal_userlist.push_back(castuser);
+00198         log(DEBUG,"Added casted user to channel's internal list");
+00199 }
+00200 
+00201 void chanrec::DelUser(char* castuser)
+00202 {
+00203         for (std::vector<char*>::iterator a = internal_userlist.begin(); a < internal_userlist.end(); a++)
+00204         {
+00205                 if (*a == castuser)
+00206                 {
+00207                         log(DEBUG,"Removed casted user from channel's internal list");
+00208                         internal_userlist.erase(a);
+00209                         return;
+00210                 }
+00211         }
+00212         log(DEBUG,"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!",name);
+00213 }
+00214 
+00215 std::vector<char*> *chanrec::GetUsers()
+00216 {
+00217         return &internal_userlist;
+00218 }
+

Generated on Sun Nov 27 01:43:24 2005 for InspIRCd by  -doxygen -1.3.3
+doxygen 1.4.4-20050815
-- cgit v1.2.3