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

Generated on Fri May 13 15:48:40 2005 for InspIRCd by +
Generated on Sun May 15 17:02:04 2005 for InspIRCd by doxygen 1.3.3
-- cgit v1.2.3