X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=docs%2Fmodule-doc%2Fchannels_8cpp-source.html;h=feec5850bfa99dfd9c1fb38c6840ae827925012f;hb=654ff4ae2f06704de2beb1050021c8196f693cb5;hp=8bb5e3ede89f496194bc6a0678ae232431629d83;hpb=59a2c6c2d96a4557cd885fefcbce97f490962692;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/docs/module-doc/channels_8cpp-source.html b/docs/module-doc/channels_8cpp-source.html index 8bb5e3ede..feec5850b 100644 --- a/docs/module-doc/channels_8cpp-source.html +++ b/docs/module-doc/channels_8cpp-source.html @@ -1,114 +1,212 @@ -channels.cpp Source File +InspIRCd: channels.cpp Source File - -
-Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  
-

channels.cpp

Go to the documentation of this file.
00001 #include "inspircd_config.h" 
-00002 #include "channels.h"
-00003 #include "inspircd.h"
-00004 #include <stdio.h>
-00005 #include <string>
-00006 #include <vector>
-00007 
-00008 using namespace std;
-00009 
-00010 std::vector<ModeParameter> custom_mode_params;
-00011 
-00012 chanrec::chanrec()
-00013 {
-00014         strcpy(name,"");
-00015         strcpy(custom_modes,"");
-00016         strcpy(topic,"");
-00017         strcpy(setby,"");
-00018         strcpy(key,"");
-00019         created = topicset = limit = 0;
-00020         topiclock = noexternal = inviteonly = moderated = secret = c_private = false;
-00021 }
-00022 
-00023 void chanrec::SetCustomMode(char mode,bool mode_on)
-00024 {
-00025         if (mode_on) {
-00026                 char m[3];
-00027                 m[0] = mode;
-00028                 m[1] = '\0';
-00029                 if (!strchr(this->custom_modes,mode))
-00030                 {
-00031                         strncat(custom_modes,m,MAXMODES);
-00032                 }
-00033                 log(DEBUG,"Custom mode %c set",mode);
-00034         }
-00035         else {
-00036                 char temp[MAXBUF];
-00037                 int count = 0;
-00038                 for (int q = 0; q < strlen(custom_modes); q++) {
-00039                         if (custom_modes[q] != mode) {
-00040                                 temp[count++] = mode;
-00041                         }
-00042                 }
-00043                 temp[count] = '\0';
-00044                 strncpy(custom_modes,temp,MAXMODES);
-00045                 log(DEBUG,"Custom mode %c removed",mode);
-00046                 this->SetCustomModeParam(mode,"",false);
-00047         }
-00048 }
-00049 
-00050 void chanrec::SetCustomModeParam(char mode,char* parameter,bool mode_on)
-00051 {
-00052 
-00053         log(DEBUG,"SetCustomModeParam called");
-00054         ModeParameter M;
-00055         M.mode = mode;
-00056         strcpy(M.channel,this->name);
-00057         strcpy(M.parameter,parameter);
-00058         if (mode_on)
-00059         {
-00060                 log(DEBUG,"Custom mode parameter %c %s added",mode,parameter);
-00061                 custom_mode_params.push_back(M);
-00062         }
-00063         else
-00064         {
-00065                 if (custom_mode_params.size())
-00066                 {
-00067                         for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
-00068                         {
-00069                                 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
-00070                                 {
-00071                                         log(DEBUG,"Custom mode parameter %c %s removed",mode,parameter);
-00072                                         custom_mode_params.erase(i);
-00073                                         return;
-00074                                 }
-00075                         }
-00076                 }
-00077                 log(DEBUG,"*** BUG *** Attempt to remove non-existent mode parameter!");
-00078         }
-00079 }
-00080 
-00081 bool chanrec::IsCustomModeSet(char mode)
-00082 {
-00083         log(DEBUG,"Checking ISCustomModeSet: %c %s",mode,this->custom_modes);
-00084         return (strchr(this->custom_modes,mode) != 0);
-00085 }
-00086 
-00087 std::string chanrec::GetModeParameter(char mode)
-00088 {
-00089         if (custom_mode_params.size())
-00090         {
-00091                 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
-00092                 {
-00093                         if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
-00094                         {
-00095                                 return std::string(i->parameter);
-00096                         }
-00097                 }
-00098         }
-00099         return std::string("");
-00100 }
-

Generated on Tue Apr 6 21:13:19 2004 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 #include "inspircd.h"
+00018 #include "inspircd_io.h"
+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 UDPportCount;
+00097 extern int ports[MAXSOCKS];
+00098 extern int defaultRoute;
+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         topiclock = noexternal = inviteonly = moderated = secret = c_private = false;
+00122 }
+00123 
+00124 void chanrec::SetCustomMode(char mode,bool mode_on)
+00125 {
+00126         if (mode_on) {
+00127                 char m[3];
+00128                 m[0] = mode;
+00129                 m[1] = '\0';
+00130                 if (!strchr(this->custom_modes,mode))
+00131                 {
+00132                         strlcat(custom_modes,m,MAXMODES);
+00133                 }
+00134                 log(DEBUG,"Custom mode %c set",mode);
+00135         }
+00136         else {
+00137 
+00138                 std::string a = this->custom_modes;
+00139                 int pos = a.find(mode);
+00140                 a.erase(pos,1);
+00141                 strncpy(this->custom_modes,a.c_str(),MAXMODES);
+00142 
+00143                 log(DEBUG,"Custom mode %c removed: modelist='%s'",mode,this->custom_modes);
+00144                 this->SetCustomModeParam(mode,"",false);
+00145         }
+00146 }
+00147 
+00148 
+00149 void chanrec::SetCustomModeParam(char mode,char* parameter,bool mode_on)
+00150 {
+00151 
+00152         log(DEBUG,"SetCustomModeParam called");
+00153         ModeParameter M;
+00154         M.mode = mode;
+00155         strlcpy(M.channel,this->name,CHANMAX);
+00156         strlcpy(M.parameter,parameter,MAXBUF);
+00157         if (mode_on)
+00158         {
+00159                 log(DEBUG,"Custom mode parameter %c %s added",mode,parameter);
+00160                 custom_mode_params.push_back(M);
+00161         }
+00162         else
+00163         {
+00164                 if (custom_mode_params.size())
+00165                 {
+00166                         for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
+00167                         {
+00168                                 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
+00169                                 {
+00170                                         log(DEBUG,"Custom mode parameter %c %s removed",mode,parameter);
+00171                                         custom_mode_params.erase(i);
+00172                                         return;
+00173                                 }
+00174                         }
+00175                 }
+00176                 log(DEBUG,"*** BUG *** Attempt to remove non-existent mode parameter!");
+00177         }
+00178 }
+00179 
+00180 bool chanrec::IsCustomModeSet(char mode)
+00181 {
+00182         log(DEBUG,"Checking ISCustomModeSet: %c %s",mode,this->custom_modes);
+00183         return (strchr(this->custom_modes,mode) != 0);
+00184 }
+00185 
+00186 std::string chanrec::GetModeParameter(char mode)
+00187 {
+00188         if (custom_mode_params.size())
+00189         {
+00190                 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
+00191                 {
+00192                         if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
+00193                         {
+00194                                 return std::string(i->parameter);
+00195                         }
+00196                 }
+00197         }
+00198         return std::string("");
+00199 }
+

Generated on Wed Apr 13 13:06:51 2005 for InspIRCd by -doxygen1.3-rc3
+doxygen +1.3.3