KVIrc 5.2.6
Developer APIs
libkvicontext.cpp File Reference
#include "KviModule.h"
#include "KviLocale.h"
#include "KviQString.h"
#include "KviWindow.h"
#include "KviMainWindow.h"
#include "KviConsoleWindow.h"
#include "KviApplication.h"
#include "KviIrcServer.h"
#include "KviIrcNetwork.h"
#include "KviIrcContext.h"
#include "KviIrcConnection.h"
#include "KviIrcConnectionServerInfo.h"
#include "KviIrcConnectionUserInfo.h"
#include "KviIrcConnectionTarget.h"
#include "KviIrcConnectionStatistics.h"
#include "KviIrcLink.h"
#include "KviIrcSocket.h"

Macros

#define GET_CONNECTION_FROM_STANDARD_PARAMS
 
#define GET_CONSOLE_FROM_STANDARD_PARAMS
 
#define STANDARD_IRC_CONNECTION_TARGET_PARAMETER(_fncName, _setCall)
 
#define STANDARD_SERVERINFO_TARGET_PARAMETER(_fncName, _setCall)
 

Functions

static bool context_kvs_cmd_clearQueue (KviKvsModuleCommandCall *c)
 
static bool context_kvs_fnc_getSSLCertInfo (KviKvsModuleFunctionCall *c)
 
static bool context_kvs_fnc_list (KviKvsModuleFunctionCall *c)
 
static bool context_kvs_fnc_queueSize (KviKvsModuleFunctionCall *c)
 
static bool context_module_cleanup (KviModule *)
 
static bool context_module_init (KviModule *m)
 
returnValue () -> setString(pConnection->target() ->network() ->name())) STANDARD_IRC_CONNECTION_TARGET_PARAMETER(context_kvs_fnc_serverHostName, c->returnValue() ->setString(pConnection->currentServerName())) STANDARD_IRC_CONNECTION_TARGET_PARAMETER(context_kvs_fnc_serverdbServerHostName, c->returnValue() ->setString(pConnection->target() ->server() ->hostName())) STANDARD_IRC_CONNECTION_TARGET_PARAMETER(context_kvs_fnc_serverIpAddress, c->returnValue() ->setString(pConnection->target() ->server() ->ip())) STANDARD_IRC_CONNECTION_TARGET_PARAMETER(context_kvs_fnc_serverIsIPV6, c->returnValue() ->setBoolean(pConnection->target() ->server() ->isIPv6())) STANDARD_IRC_CONNECTION_TARGET_PARAMETER(context_kvs_fnc_serverIsSSL, c->returnValue() ->setBoolean(pConnection->target() ->server() ->useSSL())) STANDARD_SERVERINFO_TARGET_PARAMETER(context_kvs_fnc_serverSoftware, c->returnValue() ->setString(pConnection->serverInfo() ->software())) STANDARD_IRC_CONNECTION_TARGET_PARAMETER(context_kvs_fnc_serverPassword, c->returnValue() ->setString(pConnection->target() ->server() ->password())) STANDARD_IRC_CONNECTION_TARGET_PARAMETER(context_kvs_fnc_serverPort, c->returnValue() ->setInteger(pConnection->target() ->server() ->port())) static bool context_kvs_fnc_state(KviKvsModuleFunctionCall *c)
 
 STANDARD_IRC_CONNECTION_TARGET_PARAMETER (context_kvs_fnc_connectionStartTime, c->returnValue() ->setInteger((kvs_int_t)(pConnection->statistics() ->connectionStartTime()));) STANDARD_IRC_CONNECTION_TARGET_PARAMETER(context_kvs_fnc_lastMessageTime
 
 STANDARD_IRC_CONNECTION_TARGET_PARAMETER (context_kvs_fnc_networkName, c->returnValue() ->setString(pConnection->currentNetworkName())) STANDARD_IRC_CONNECTION_TARGET_PARAMETER(context_kvs_fnc_serverdbNetworkName
 

Macro Definition Documentation

◆ GET_CONNECTION_FROM_STANDARD_PARAMS

#define GET_CONNECTION_FROM_STANDARD_PARAMS
Value:
GET_CONSOLE_FROM_STANDARD_PARAMS \
KviIrcConnection * pConnection = nullptr; \
if(pConsole) \
pConnection = pConsole->context()->connection();

Referenced by context_kvs_fnc_queueSize().

◆ GET_CONSOLE_FROM_STANDARD_PARAMS

#define GET_CONSOLE_FROM_STANDARD_PARAMS
Value:
kvs_uint_t iContextId; \
KVSM_PARAMETERS_BEGIN(c) \
KVSM_PARAMETER("irc_context_id", KVS_PT_UINT, KVS_PF_OPTIONAL, iContextId) \
KVSM_PARAMETERS_END(c) \
KviConsoleWindow * pConsole = nullptr; \
if(c->parameterCount() > 0) \
pConsole = g_pApp->findConsole(iContextId); \
else \
pConsole = c->window()->console();
KVIRC_API KviApplication * g_pApp
Definition KviApplication.cpp:161
@ KVS_PT_UINT
Definition KviKvsParameterProcessor.h:58
#define KVS_PF_OPTIONAL
Definition KviKvsParameterProcessor.h:142
kvi_u64_t kvs_uint_t
Definition KviKvsTypes.h:34
Definition KviConsoleWindow.h:74

Referenced by returnValue().

◆ STANDARD_IRC_CONNECTION_TARGET_PARAMETER

#define STANDARD_IRC_CONNECTION_TARGET_PARAMETER ( _fncName,
_setCall )
Value:
static bool _fncName(KviKvsModuleFunctionCall * c) \
{ \
GET_CONNECTION_FROM_STANDARD_PARAMS \
if(pConnection) \
{ \
if(pConnection->target()) \
{ \
_setCall; \
return true; \
} \
} \
c->returnValue()->setNothing(); \
return true; \
}
Definition KviKvsModuleInterface.h:112

Referenced by returnValue(), STANDARD_IRC_CONNECTION_TARGET_PARAMETER(), and STANDARD_IRC_CONNECTION_TARGET_PARAMETER().

◆ STANDARD_SERVERINFO_TARGET_PARAMETER

#define STANDARD_SERVERINFO_TARGET_PARAMETER ( _fncName,
_setCall )
Value:
static bool _fncName(KviKvsModuleFunctionCall * c) \
{ \
GET_CONNECTION_FROM_STANDARD_PARAMS \
if(pConnection) \
{ \
if(pConnection->serverInfo()) \
{ \
_setCall; \
return true; \
} \
} \
c->returnValue()->setNothing(); \
return true; \
}

Referenced by returnValue().

Function Documentation

◆ context_kvs_cmd_clearQueue()

static bool context_kvs_cmd_clearQueue ( KviKvsModuleCommandCall * c)
static

◆ context_kvs_fnc_getSSLCertInfo()

◆ context_kvs_fnc_list()

◆ context_kvs_fnc_queueSize()

◆ context_module_cleanup()

static bool context_module_cleanup ( KviModule * )
static

◆ context_module_init()

◆ returnValue()

c returnValue ( ) -> setString(pConnection->target() ->network() ->name())) STANDARD_IRC_CONNECTION_TARGET_PARAMETER(context_kvs_fnc_serverHostName, c->returnValue() ->setString(pConnection->currentServerName())) STANDARD_IRC_CONNECTION_TARGET_PARAMETER(context_kvs_fnc_serverdbServerHostName, c->returnValue() ->setString(pConnection->target() ->server() ->hostName())) STANDARD_IRC_CONNECTION_TARGET_PARAMETER(context_kvs_fnc_serverIpAddress, c->returnValue() ->setString(pConnection->target() ->server() ->ip())) STANDARD_IRC_CONNECTION_TARGET_PARAMETER(context_kvs_fnc_serverIsIPV6, c->returnValue() ->setBoolean(pConnection->target() ->server() ->isIPv6())) STANDARD_IRC_CONNECTION_TARGET_PARAMETER(context_kvs_fnc_serverIsSSL, c->returnValue() ->setBoolean(pConnection->target() ->server() ->useSSL())) STANDARD_SERVERINFO_TARGET_PARAMETER(context_kvs_fnc_serverSoftware, c->returnValue() ->setString(pConnection->serverInfo() ->software())) STANDARD_IRC_CONNECTION_TARGET_PARAMETER(context_kvs_fnc_serverPassword, c->returnValue() ->setString(pConnection->target() ->server() ->password())) STANDARD_IRC_CONNECTION_TARGET_PARAMETER(context_kvs_fnc_serverPort, c->returnValue() ->setInteger(pConnection->target() ->server() ->port())) static bool context_kvs_fnc_state(KviKvsModuleFunctionCall *c)

◆ STANDARD_IRC_CONNECTION_TARGET_PARAMETER() [1/2]

STANDARD_IRC_CONNECTION_TARGET_PARAMETER ( context_kvs_fnc_connectionStartTime ,
c->returnValue() ->setInteger((kvs_int_t)(pConnection->statistics() ->connectionStartTime()));  )

◆ STANDARD_IRC_CONNECTION_TARGET_PARAMETER() [2/2]

STANDARD_IRC_CONNECTION_TARGET_PARAMETER ( context_kvs_fnc_networkName ,
c-> returnValue) ->setString(pConnection->currentNetworkName() )