Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

modules.h File Reference

#include "dynamic.h"
#include "base.h"
#include "ctables.h"
#include "socket.h"
#include <string>
#include <deque>
#include <sstream>

Include dependency graph for modules.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Version
 Holds a module's Version information The four members (set by the constructor only) indicate details as to the version number of a module. More...
class  Admin
 Holds /ADMIN data This class contains the admin details of the local server. More...
class  ModuleMessage
 The ModuleMessage class is the base class of Request and Event This class is used to represent a basic data structure which is passed between modules for safe inter-module communications. More...
class  Request
 The Request class is a unicast message directed at a given module. More...
class  Event
 The Event class is a unicast message directed at all modules. More...
class  ExtMode
 Holds an extended mode's details. More...
class  Module
 Base class for all InspIRCd modules This class is the base class for InspIRCd modules. More...
class  Server
 Allows server output and query functions This class contains methods which allow a module to query the state of the irc server, and produce output to users and other servers. More...
class  ConfigReader
 Allows reading of values from configuration files This class allows a module to read from either the main configuration file (inspircd.conf) or from a module-specified configuration file. More...
class  FileReader
 Caches a text file into memory and can be used to retrieve lines from it. More...
class  ModuleFactory
 Instantiates classes inherited from Module This class creates a class inherited from type Module, using new. More...

Defines

#define DEBUG   10
 log levels
#define VERBOSE   20
#define DEFAULT   30
#define SPARSE   40
#define NONE   50
#define MT_CHANNEL   1
 Used with OnExtendedMode() method of modules.
#define MT_CLIENT   2
#define MT_SERVER   3
#define ACR_DEFAULT   0
 Used with OnAccessCheck() method of modules.
#define ACR_DENY   1
#define ACR_ALLOW   2
#define AC_KICK   0
#define AC_DEOP   1
#define AC_OP   2
#define AC_VOICE   3
#define AC_DEVOICE   4
#define AC_HALFOP   5
#define AC_DEHALFOP   6
#define AC_INVITE   7
#define AC_GENERAL_MODE   8
#define VF_STATIC   1
 Used to define a set of behavior bits for a module.
#define VF_VENDOR   2
#define VF_SERVICEPROVIDER   4
#define VF_COMMON   8
#define FOREACH_MOD   for (int _i = 0; _i <= MODCOUNT; _i++) modules[_i]->
#define FOREACH_RESULT(x)
#define FD_MAGIC_NUMBER   -42
#define IS_LOCAL(x)   (x->fd > -1)
#define IS_REMOTE(x)   (x->fd < 0)
#define IS_MODULE_CREATED(x)   (x->fd == FD_MAGIC_NUMBER)
#define WM_AND   1
#define WM_OR   2
#define TYPE_USER   1
#define TYPE_CHANNEL   2
#define TYPE_SERVER   3
#define CONF_NOT_A_NUMBER   0x000010
#define CONF_NOT_UNSIGNED   0x000080
#define CONF_VALUE_NOT_FOUND   0x000100
#define CONF_FILE_NOT_FOUND   0x000200

Typedefs

typedef std::deque< std::stringfile_cache
 Low level definition of a FileReader classes file cache area.
typedef file_cache string_list
typedef std::deque< userrec * > chanuserlist
 Holds a list of users in a channel.
typedef DLLFactory< ModuleFactoryircd_module

Functions

bool ModeDefined (char c, int i)
bool ModeDefinedOper (char c, int i)
int ModeDefinedOn (char c, int i)
int ModeDefinedOff (char c, int i)
void ModeMakeList (char modechar)
bool ModeIsListMode (char modechar, int type)


Define Documentation

#define AC_DEHALFOP   6
 

Definition at line 46 of file modules.h.

#define AC_DEOP   1
 

Definition at line 41 of file modules.h.

#define AC_DEVOICE   4
 

Definition at line 44 of file modules.h.

#define AC_GENERAL_MODE   8
 

Definition at line 48 of file modules.h.

#define AC_HALFOP   5
 

Definition at line 45 of file modules.h.

#define AC_INVITE   7
 

Definition at line 47 of file modules.h.

#define AC_KICK   0
 

Definition at line 40 of file modules.h.

Referenced by kick_channel().

#define AC_OP   2
 

Definition at line 42 of file modules.h.

#define AC_VOICE   3
 

Definition at line 43 of file modules.h.

#define ACR_ALLOW   2
 

Definition at line 39 of file modules.h.

#define ACR_DEFAULT   0
 

Used with OnAccessCheck() method of modules.

Definition at line 37 of file modules.h.

Referenced by kick_channel(), and Module::OnAccessCheck().

#define ACR_DENY   1
 

Definition at line 38 of file modules.h.

Referenced by kick_channel().

#define CONF_FILE_NOT_FOUND   0x000200
 

Definition at line 1541 of file modules.h.

Referenced by ConfigReader::ConfigReader().

#define CONF_NOT_A_NUMBER   0x000010
 

Definition at line 1538 of file modules.h.

Referenced by ConfigReader::ReadInteger().

#define CONF_NOT_UNSIGNED   0x000080
 

Definition at line 1539 of file modules.h.

Referenced by ConfigReader::ReadInteger().

#define CONF_VALUE_NOT_FOUND   0x000100
 

Definition at line 1540 of file modules.h.

Referenced by ConfigReader::ReadFlag(), ConfigReader::ReadInteger(), and ConfigReader::ReadValue().

#define DEBUG   10
 

log levels

Definition at line 23 of file modules.h.

#define DEFAULT   30
 

Definition at line 25 of file modules.h.

#define FD_MAGIC_NUMBER   -42
 

Definition at line 102 of file modules.h.

Referenced by Server::PseudoToUser(), and Server::UserToPseudo().

#define FOREACH_MOD   for (int _i = 0; _i <= MODCOUNT; _i++) modules[_i]->
 

Definition at line 82 of file modules.h.

Referenced by del_channel(), ForceChan(), FullConnectUser(), kick_channel(), kill_link(), kill_link_silent(), and Event::Send().

#define FOREACH_RESULT  ) 
 

Value:

{ MOD_RESULT = 0; \
                        for (int _i = 0; _i <= MODCOUNT; _i++) { \
                        int res = modules[_i]->x ; \
                        if (res != 0) { \
                                MOD_RESULT = res; \
                                break; \
                        } \
                } \
        }

Definition at line 90 of file modules.h.

Referenced by add_channel(), force_nickchange(), and kick_channel().

#define IS_LOCAL  )     (x->fd > -1)
 

Definition at line 106 of file modules.h.

#define IS_MODULE_CREATED  )     (x->fd == FD_MAGIC_NUMBER)
 

Definition at line 108 of file modules.h.

#define IS_REMOTE  )     (x->fd < 0)
 

Definition at line 107 of file modules.h.

#define MT_CHANNEL   1
 

Used with OnExtendedMode() method of modules.

Definition at line 31 of file modules.h.

Referenced by Server::AddExtendedListMode(), and ModeMakeList().

#define MT_CLIENT   2
 

Definition at line 32 of file modules.h.

Referenced by Server::AddExtendedMode().

#define MT_SERVER   3
 

Definition at line 33 of file modules.h.

Referenced by Server::AddExtendedMode().

#define NONE   50
 

Definition at line 27 of file modules.h.

#define SPARSE   40
 

Definition at line 26 of file modules.h.

#define TYPE_CHANNEL   2
 

Definition at line 118 of file modules.h.

#define TYPE_SERVER   3
 

Definition at line 119 of file modules.h.

#define TYPE_USER   1
 

Definition at line 117 of file modules.h.

#define VERBOSE   20
 

Definition at line 24 of file modules.h.

#define VF_COMMON   8
 

Definition at line 55 of file modules.h.

#define VF_SERVICEPROVIDER   4
 

Definition at line 54 of file modules.h.

#define VF_STATIC   1
 

Used to define a set of behavior bits for a module.

Definition at line 52 of file modules.h.

#define VF_VENDOR   2
 

Definition at line 53 of file modules.h.

Referenced by Module::GetVersion().

#define WM_AND   1
 

Definition at line 112 of file modules.h.

#define WM_OR   2
 

Definition at line 113 of file modules.h.


Typedef Documentation

typedef std::deque<userrec*> chanuserlist
 

Holds a list of users in a channel.

Definition at line 75 of file modules.h.

typedef std::deque<std::string> file_cache
 

Low level definition of a FileReader classes file cache area.

Definition at line 66 of file modules.h.

typedef DLLFactory<ModuleFactory> ircd_module
 

Definition at line 1707 of file modules.h.

typedef file_cache string_list
 

Definition at line 71 of file modules.h.


Function Documentation

bool ModeDefined char  c,
int  i
 

Definition at line 70 of file modules.cpp.

References EMode.

Referenced by DoAddExtendedMode().

00071 {
00072         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00073         {
00074                 if ((i->modechar == modechar) && (i->type == type))
00075                 {
00076                         return true;
00077                 }
00078         }
00079         return false;
00080 }

int ModeDefinedOff char  c,
int  i
 

Definition at line 120 of file modules.cpp.

References EMode.

00121 {
00122         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00123         {
00124                 if ((i->modechar == modechar) && (i->type == type))
00125                 {
00126                         return i->params_when_off;
00127                 }
00128         }
00129         return 0;
00130 }

int ModeDefinedOn char  c,
int  i
 

Definition at line 107 of file modules.cpp.

References EMode.

00108 {
00109         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00110         {
00111                 if ((i->modechar == modechar) && (i->type == type))
00112                 {
00113                         return i->params_when_on;
00114                 }
00115         }
00116         return 0;
00117 }

bool ModeDefinedOper char  c,
int  i
 

Definition at line 94 of file modules.cpp.

References EMode.

00095 {
00096         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00097         {
00098                 if ((i->modechar == modechar) && (i->type == type) && (i->needsoper == true))
00099                 {
00100                         return true;
00101                 }
00102         }
00103         return false;
00104 }

bool ModeIsListMode char  modechar,
int  type
 

Definition at line 82 of file modules.cpp.

References EMode.

00083 {
00084         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00085         {
00086                 if ((i->modechar == modechar) && (i->type == type) && (i->list == true))
00087                 {
00088                         return true;
00089                 }
00090         }
00091         return false;
00092 }

void ModeMakeList char  modechar  ) 
 

Definition at line 143 of file modules.cpp.

References EMode, and MT_CHANNEL.

Referenced by Server::AddExtendedListMode().

00144 {
00145         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
00146         {
00147                 if ((i->modechar == modechar) && (i->type == MT_CHANNEL))
00148                 {
00149                         i->list = true;
00150                         return;
00151                 }
00152         }
00153         return;
00154 }


Generated on Mon Dec 19 18:05:20 2005 for InspIRCd by  doxygen 1.4.4-20050815