The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

m_mysql.cpp File Reference

#include "inspircd.h"
#include <mysql.h>
#include "users.h"
#include "channels.h"
#include "modules.h"
#include "m_sqlv2.h"

Include dependency graph for m_mysql.cpp:

Go to the source code of this file.

Classes

class  ModuleSQL
 MySQL module. More...
class  MySQLresult
 Represents a mysql result set. More...
class  SQLConnection
 Represents a connection to a mysql database. More...
class  DispatcherThread
class  Notifier
 Used by m_mysql to notify one thread when the other has a result. More...

Defines

#define NO_CLIENT_LONG_LONG
#define mysql_field_count   mysql_num_fields

Typedefs

typedef std::map< std::string,
SQLConnection * > 
ConnMap
typedef std::deque< SQLresult * > ResultQueue

Functions

void NotifyMainThread (SQLConnection *connection_with_new_result)
bool HasHost (const SQLhost &host)
bool HostInConf (ConfigReader *conf, const SQLhost &h)
void ClearOldConnections (ConfigReader *conf)
void ClearAllConnections ()
void ConnectDatabases (InspIRCd *ServerInstance, ModuleSQL *Parent)
void LoadDatabases (ConfigReader *conf, InspIRCd *ServerInstance, ModuleSQL *Parent)
char FindCharId (const std::string &id)
ConnMap::iterator GetCharId (char id)

Variables

static NotifierMessagePipe = NULL
int QueueFD = -1
ConnMap Connections


Define Documentation

#define mysql_field_count   mysql_num_fields
 

Definition at line 106 of file m_mysql.cpp.

#define NO_CLIENT_LONG_LONG
 

Definition at line 15 of file m_mysql.cpp.


Typedef Documentation

typedef std::map<std::string, SQLConnection*> ConnMap
 

Definition at line 71 of file m_mysql.cpp.

typedef std::deque<SQLresult*> ResultQueue
 

Definition at line 109 of file m_mysql.cpp.


Function Documentation

void ClearAllConnections  ) 
 

Definition at line 546 of file m_mysql.cpp.

References Connections.

Referenced by ModuleSQL::~ModuleSQL().

void ClearOldConnections ConfigReader conf  ) 
 

Definition at line 531 of file m_mysql.cpp.

References Connections, and HostInConf().

Referenced by LoadDatabases().

void ConnectDatabases InspIRCd ServerInstance,
ModuleSQL Parent
 

Definition at line 556 of file m_mysql.cpp.

References Connections, DEFAULT, Mutex::Lock(), LogManager::Log(), ModuleSQL::LoggingMutex, InspIRCd::Logs, and Mutex::Unlock().

Referenced by LoadDatabases().

char FindCharId const std::string id  ) 
 

Definition at line 601 of file m_mysql.cpp.

References Connections.

Referenced by NotifyMainThread().

ConnMap::iterator GetCharId char  id  ) 
 

Definition at line 614 of file m_mysql.cpp.

References Connections.

Referenced by Notifier::OnDataReady().

bool HasHost const SQLhost host  ) 
 

Definition at line 503 of file m_mysql.cpp.

References Connections.

Referenced by LoadDatabases().

bool HostInConf ConfigReader conf,
const SQLhost h
 

Definition at line 513 of file m_mysql.cpp.

References ConfigReader::Enumerate(), SQLhost::host, SQLhost::id, SQLhost::name, SQLhost::pass, SQLhost::port, ConfigReader::ReadFlag(), ConfigReader::ReadInteger(), ConfigReader::ReadValue(), SQLhost::ssl, and SQLhost::user.

Referenced by ClearOldConnections().

void LoadDatabases ConfigReader conf,
InspIRCd ServerInstance,
ModuleSQL Parent
 

Definition at line 575 of file m_mysql.cpp.

References ClearOldConnections(), ConnectDatabases(), Connections, HasHost(), SQLhost::host, SQLhost::id, SQLhost::name, SQLhost::pass, SQLhost::port, ConfigReader::ReadFlag(), ConfigReader::ReadInteger(), ConfigReader::ReadValue(), SQLhost::ssl, and SQLhost::user.

Referenced by DispatcherThread::Run().

void NotifyMainThread SQLConnection connection_with_new_result  ) 
 

Definition at line 625 of file m_mysql.cpp.

References FindCharId(), SQLConnection::GetID(), and QueueFD.

Referenced by SQLConnection::DoLeadingQuery().


Variable Documentation

ConnMap Connections
 

Definition at line 501 of file m_mysql.cpp.

Referenced by ClearAllConnections(), ClearOldConnections(), ConnectDatabases(), FindCharId(), GetCharId(), HasHost(), LoadDatabases(), Notifier::OnDataReady(), ModuleSQL::OnRequest(), and DispatcherThread::Run().

Notifier* MessagePipe = NULL [static]
 

Definition at line 75 of file m_mysql.cpp.

int QueueFD = -1
 

Definition at line 76 of file m_mysql.cpp.