ZNC  trunk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Variables
main.h File Reference
#include <znc/zncconfig.h>
#include <znc/version.h>
+ Include dependency graph for main.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define NOTHING   &ZNC_NO_NEED_TO_DO_ANYTHING_ON_MODULE_CALL_EXITER
 
#define ALLMODULECALL(macFUNC, macEXITER)
 
#define _GLOBALMODULECALL(macFUNC, macUSER, macNETWORK, macCLIENT, macEXITER)
 
#define _USERMODULECALL(macFUNC, macUSER, macNETWORK, macCLIENT, macEXITER)
 
#define NETWORKMODULECALL(macFUNC, macUSER, macNETWORK, macCLIENT, macEXITER)
 
#define GLOBALMODULECALL(macFUNC, macEXITER)   _GLOBALMODULECALL(macFUNC, nullptr, nullptr, nullptr, macEXITER)
 
#define USERMODULECALL(macFUNC, macUSER, macCLIENT, macEXITER)   _USERMODULECALL(macFUNC, macUSER, nullptr, macCLIENT, macEXITER)
 

Variables

bool ZNC_NO_NEED_TO_DO_ANYTHING_ON_MODULE_CALL_EXITER
 

Macro Definition Documentation

#define _GLOBALMODULECALL (   macFUNC,
  macUSER,
  macNETWORK,
  macCLIENT,
  macEXITER 
)
Value:
do { \
CModules& GMods = CZNC::Get().GetModules(); \
CUser* pOldGUser = GMods.GetUser(); \
CIRCNetwork* pOldGNetwork = GMods.GetNetwork(); \
CClient* pOldGClient = GMods.GetClient(); \
GMods.SetUser(macUSER); \
GMods.SetNetwork(macNETWORK); \
GMods.SetClient(macCLIENT); \
if (GMods.macFUNC) { \
GMods.SetUser(pOldGUser); \
GMods.SetNetwork(pOldGNetwork); \
GMods.SetClient(pOldGClient); \
*macEXITER = true; \
} \
GMods.SetUser(pOldGUser); \
GMods.SetNetwork(pOldGNetwork); \
GMods.SetClient(pOldGClient); \
} while (false)
static CZNC & Get()
CUser * GetUser() const
Definition: Modules.h:1394
CModules & GetModules()
Definition: znc.h:141
#define _USERMODULECALL (   macFUNC,
  macUSER,
  macNETWORK,
  macCLIENT,
  macEXITER 
)
Value:
do { \
bool bGlobalExited = false; \
_GLOBALMODULECALL(macFUNC, macUSER, macNETWORK, macCLIENT, \
&bGlobalExited); \
if (bGlobalExited) { \
*macEXITER = true; \
break; \
} \
if (macUSER != nullptr) { \
CModules& UMods = macUSER->GetModules(); \
CIRCNetwork* pOldUNetwork = UMods.GetNetwork(); \
CClient* pOldUClient = UMods.GetClient(); \
UMods.SetNetwork(macNETWORK); \
UMods.SetClient(macCLIENT); \
if (UMods.macFUNC) { \
UMods.SetNetwork(pOldUNetwork); \
UMods.SetClient(pOldUClient); \
*macEXITER = true; \
} \
UMods.SetNetwork(pOldUNetwork); \
UMods.SetClient(pOldUClient); \
} \
} while (false)
#define _GLOBALMODULECALL(macFUNC, macUSER, macNETWORK, macCLIENT, macEXITER)
Definition: main.h:56
#define ALLMODULECALL (   macFUNC,
  macEXITER 
)
Value:
do { \
CModules& GMods = CZNC::Get().GetModules(); \
bool bAllExit = false; \
if (GMods.macFUNC) { \
bAllExit = true; \
} else { \
const map<CString, CUser*>& mUsers = CZNC::Get().GetUserMap(); \
map<CString, CUser*>::const_iterator it; \
for (it = mUsers.begin(); it != mUsers.end(); ++it) { \
CModules& UMods = it->second->GetModules(); \
if (UMods.macFUNC) { \
bAllExit = true; \
break; \
} \
const vector<CIRCNetwork*>& mNets = it->second->GetNetworks(); \
vector<CIRCNetwork*>::const_iterator it2; \
for (it2 = mNets.begin(); it2 != mNets.end(); ++it2) { \
CModules& NMods = (*it2)->GetModules(); \
if (NMods.macFUNC) { \
bAllExit = true; \
break; \
} \
} \
if (bAllExit) break; \
} \
} \
if (bAllExit) *macEXITER = true; \
} while (false)
static CZNC & Get()
const std::map< CString, CUser * > & GetUserMap() const
Definition: znc.h:200
CModules & GetModules()
Definition: znc.h:141
#define GLOBALMODULECALL (   macFUNC,
  macEXITER 
)    _GLOBALMODULECALL(macFUNC, nullptr, nullptr, nullptr, macEXITER)
#define NETWORKMODULECALL (   macFUNC,
  macUSER,
  macNETWORK,
  macCLIENT,
  macEXITER 
)
Value:
do { \
bool bUserExited = false; \
_USERMODULECALL(macFUNC, macUSER, macNETWORK, macCLIENT, \
&bUserExited); \
if (bUserExited) { \
*macEXITER = true; \
break; \
} \
if (macNETWORK != nullptr) { \
CModules& NMods = macNETWORK->GetModules(); \
CClient* pOldNClient = NMods.GetClient(); \
NMods.SetClient(macCLIENT); \
if (NMods.macFUNC) { \
NMods.SetClient(pOldNClient); \
*macEXITER = true; \
} \
NMods.SetClient(pOldNClient); \
} \
} while (false)
#define _USERMODULECALL(macFUNC, macUSER, macNETWORK, macCLIENT, macEXITER)
Definition: main.h:76
#define USERMODULECALL (   macFUNC,
  macUSER,
  macCLIENT,
  macEXITER 
)    _USERMODULECALL(macFUNC, macUSER, nullptr, macCLIENT, macEXITER)

Variable Documentation

bool ZNC_NO_NEED_TO_DO_ANYTHING_ON_MODULE_CALL_EXITER