diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-24 02:34:33 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-24 02:34:33 +0000 |
commit | 66f0cd6469d2643858c2fcd14726d362696bd68d (patch) | |
tree | 8c3743570ae0a16431fb8f6713023c73e21f1e2f /docs/man/man3/chanrec.3 | |
parent | 609873a2abf96a67b29eec1b37cc81c31857376b (diff) |
New methods, new docs
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1484 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'docs/man/man3/chanrec.3')
-rw-r--r-- | docs/man/man3/chanrec.3 | 220 |
1 files changed, 110 insertions, 110 deletions
diff --git a/docs/man/man3/chanrec.3 b/docs/man/man3/chanrec.3 index 0831e46b3..69ac8c35d 100644 --- a/docs/man/man3/chanrec.3 +++ b/docs/man/man3/chanrec.3 @@ -1,4 +1,4 @@ -.TH "chanrec" 3 "15 May 2005" "InspIRCd" \" -*- nroff -*- +.TH "chanrec" 3 "24 May 2005" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -114,21 +114,21 @@ Definition at line 101 of file channels.h. .PP .SS "chanrec::chanrec ()" .PP -Creates a channel record and initialises it with default values. Definition at line 108 of file channels.cpp. +Creates a channel record and initialises it with default values. Definition at line 107 of file channels.cpp. .PP References binarymodes, created, custom_modes, internal_userlist, key, limit, name, setby, topic, and topicset. .PP .nf -109 { -110 strcpy(name,''); -111 strcpy(custom_modes,''); -112 strcpy(topic,''); -113 strcpy(setby,''); -114 strcpy(key,''); -115 created = topicset = limit = 0; -116 binarymodes = 0; -117 internal_userlist.clear(); -118 } +108 { +109 strcpy(name,''); +110 strcpy(custom_modes,''); +111 strcpy(topic,''); +112 strcpy(setby,''); +113 strcpy(key,''); +114 created = topicset = limit = 0; +115 binarymodes = 0; +116 internal_userlist.clear(); +117 } .fi .SS "virtual chanrec::~\fBchanrec\fP ()\fC [inline, virtual]\fP" .PP @@ -141,161 +141,161 @@ Definition at line 205 of file channels.h. .PP .SS "void chanrec::AddUser (char * castuser)" .PP -Add a user pointer to the internal reference list The data inserted into the reference list is a table as it is an arbitary pointer compared to other users by its memory address, as this is a very fast 32 or 64 bit integer comparison. Definition at line 202 of file channels.cpp. +Add a user pointer to the internal reference list The data inserted into the reference list is a table as it is an arbitary pointer compared to other users by its memory address, as this is a very fast 32 or 64 bit integer comparison. Definition at line 201 of file channels.cpp. .PP References DEBUG, and internal_userlist. .PP .nf -203 { -204 internal_userlist.push_back(castuser); -205 log(DEBUG,'Added casted user to channel's internal list'); -206 } +202 { +203 internal_userlist.push_back(castuser); +204 log(DEBUG,'Added casted user to channel's internal list'); +205 } .fi .SS "void chanrec::DelUser (char * castuser)" .PP -Delete a user pointer to the internal reference list The data removed from the reference list is a table as it is an arbitary pointer compared to other users by its memory address, as this is a very fast 32 or 64 bit integer comparison. Definition at line 208 of file channels.cpp. +Delete a user pointer to the internal reference list The data removed from the reference list is a table as it is an arbitary pointer compared to other users by its memory address, as this is a very fast 32 or 64 bit integer comparison. Definition at line 207 of file channels.cpp. .PP References DEBUG, internal_userlist, and name. .PP .nf -209 { -210 for (std::vector<char*>::iterator a = internal_userlist.begin(); a < internal_userlist.end(); a++) -211 { -212 if (*a == castuser) -213 { -214 log(DEBUG,'Removed casted user from channel's internal list'); -215 internal_userlist.erase(a); -216 return; -217 } -218 } -219 log(DEBUG,'BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!',name); -220 } +208 { +209 for (std::vector<char*>::iterator a = internal_userlist.begin(); a < internal_userlist.end(); a++) +210 { +211 if (*a == castuser) +212 { +213 log(DEBUG,'Removed casted user from channel's internal list'); +214 internal_userlist.erase(a); +215 return; +216 } +217 } +218 log(DEBUG,'BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!',name); +219 } .fi .SS "std::string chanrec::GetModeParameter (char mode)" .PP -Returns the parameter for a custom mode on a channel. For example if '+L #foo' is set, and you pass this method 'L', it will return '#foo'. If the mode is not set on the channel, or the mode has no parameters associated with it, it will return an empty string.Definition at line 182 of file channels.cpp. +Returns the parameter for a custom mode on a channel. For example if '+L #foo' is set, and you pass this method 'L', it will return '#foo'. If the mode is not set on the channel, or the mode has no parameters associated with it, it will return an empty string.Definition at line 181 of file channels.cpp. .PP References custom_mode_params. .PP .nf -183 { -184 if (custom_mode_params.size()) -185 { -186 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++) -187 { -188 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel))) -189 { -190 return i->parameter; -191 } -192 } -193 } -194 return ''; -195 } +182 { +183 if (custom_mode_params.size()) +184 { +185 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++) +186 { +187 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel))) +188 { +189 return i->parameter; +190 } +191 } +192 } +193 return ''; +194 } .fi .SS "long chanrec::GetUserCounter ()" .PP -Obtain the channel 'user counter' This returns the channel reference counter, which is initialized to 0 when the channel is created and incremented/decremented upon joins, parts quits and kicks. Definition at line 197 of file channels.cpp. +Obtain the channel 'user counter' This returns the channel reference counter, which is initialized to 0 when the channel is created and incremented/decremented upon joins, parts quits and kicks. Definition at line 196 of file channels.cpp. .PP References internal_userlist. .PP .nf -198 { -199 return (this->internal_userlist.size()); -200 } +197 { +198 return (this->internal_userlist.size()); +199 } .fi .SS "std::vector< char * > * chanrec::GetUsers ()" .PP -Obrain the internal reference list The internal reference list contains a list of userrec* cast to char*. These are used for rapid comparison to determine channel membership for PRIVMSG, NOTICE, QUIT, PART etc. The resulting pointer to the vector should be considered readonly and only modified via AddUser and DelUser.Definition at line 222 of file channels.cpp. +Obrain the internal reference list The internal reference list contains a list of userrec* cast to char*. These are used for rapid comparison to determine channel membership for PRIVMSG, NOTICE, QUIT, PART etc. The resulting pointer to the vector should be considered readonly and only modified via AddUser and DelUser.Definition at line 221 of file channels.cpp. .PP References internal_userlist. .PP Referenced by Server::GetUsers(). .PP .nf -223 { -224 return &internal_userlist; -225 } +222 { +223 return &internal_userlist; +224 } .fi .SS "bool chanrec::IsCustomModeSet (char mode)" .PP -Returns true if a custom mode is set on a channel. Definition at line 176 of file channels.cpp. +Returns true if a custom mode is set on a channel. Definition at line 175 of file channels.cpp. .PP References DEBUG. .PP .nf -177 { -178 log(DEBUG,'Checking ISCustomModeSet: %c %s',mode,this->custom_modes); -179 return (strchr(this->custom_modes,mode) != 0); -180 } +176 { +177 log(DEBUG,'Checking ISCustomModeSet: %c %s',mode,this->custom_modes); +178 return (strchr(this->custom_modes,mode) != 0); +179 } .fi .SS "void chanrec::SetCustomMode (char mode, bool mode_on)" .PP -Sets or unsets a custom mode in the channels info. Definition at line 120 of file channels.cpp. +Sets or unsets a custom mode in the channels info. Definition at line 119 of file channels.cpp. .PP References custom_modes, DEBUG, and SetCustomModeParam(). .PP .nf -121 { -122 if (mode_on) { -123 static char m[3]; -124 m[0] = mode; -125 m[1] = '\0'; -126 if (!strchr(this->custom_modes,mode)) -127 { -128 strlcat(custom_modes,m,MAXMODES); -129 } -130 log(DEBUG,'Custom mode %c set',mode); -131 } -132 else { -133 -134 std::string a = this->custom_modes; -135 int pos = a.find(mode); -136 a.erase(pos,1); -137 strncpy(this->custom_modes,a.c_str(),MAXMODES); -138 -139 log(DEBUG,'Custom mode %c removed: modelist='%s'',mode,this->custom_modes); -140 this->SetCustomModeParam(mode,'',false); -141 } -142 } +120 { +121 if (mode_on) { +122 static char m[3]; +123 m[0] = mode; +124 m[1] = '\0'; +125 if (!strchr(this->custom_modes,mode)) +126 { +127 strlcat(custom_modes,m,MAXMODES); +128 } +129 log(DEBUG,'Custom mode %c set',mode); +130 } +131 else { +132 +133 std::string a = this->custom_modes; +134 int pos = a.find(mode); +135 a.erase(pos,1); +136 strncpy(this->custom_modes,a.c_str(),MAXMODES); +137 +138 log(DEBUG,'Custom mode %c removed: modelist='%s'',mode,this->custom_modes); +139 this->SetCustomModeParam(mode,'',false); +140 } +141 } .fi .SS "void chanrec::SetCustomModeParam (char mode, char * parameter, bool mode_on)" .PP -Sets or unsets the parameters for a custom mode in a channels info. Definition at line 145 of file channels.cpp. +Sets or unsets the parameters for a custom mode in a channels info. Definition at line 144 of file channels.cpp. .PP References ModeParameter::channel, custom_mode_params, DEBUG, ModeParameter::mode, and ModeParameter::parameter. .PP Referenced by SetCustomMode(). .PP .nf -146 { -147 -148 log(DEBUG,'SetCustomModeParam called'); -149 ModeParameter M; -150 M.mode = mode; -151 strlcpy(M.channel,this->name,CHANMAX); -152 strlcpy(M.parameter,parameter,MAXBUF); -153 if (mode_on) -154 { -155 log(DEBUG,'Custom mode parameter %c %s added',mode,parameter); -156 custom_mode_params.push_back(M); -157 } -158 else -159 { -160 if (custom_mode_params.size()) -161 { -162 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++) -163 { -164 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel))) -165 { -166 log(DEBUG,'Custom mode parameter %c %s removed',mode,parameter); -167 custom_mode_params.erase(i); -168 return; -169 } -170 } -171 } -172 log(DEBUG,'*** BUG *** Attempt to remove non-existent mode parameter!'); -173 } -174 } +145 { +146 +147 log(DEBUG,'SetCustomModeParam called'); +148 ModeParameter M; +149 M.mode = mode; +150 strlcpy(M.channel,this->name,CHANMAX); +151 strlcpy(M.parameter,parameter,MAXBUF); +152 if (mode_on) +153 { +154 log(DEBUG,'Custom mode parameter %c %s added',mode,parameter); +155 custom_mode_params.push_back(M); +156 } +157 else +158 { +159 if (custom_mode_params.size()) +160 { +161 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++) +162 { +163 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel))) +164 { +165 log(DEBUG,'Custom mode parameter %c %s removed',mode,parameter); +166 custom_mode_params.erase(i); +167 return; +168 } +169 } +170 } +171 log(DEBUG,'*** BUG *** Attempt to remove non-existent mode parameter!'); +172 } +173 } .fi .SH "Member Data Documentation" .PP |