本文整理汇总了C++中sendto_realops函数的典型用法代码示例。如果您正苦于以下问题:C++ sendto_realops函数的具体用法?C++ sendto_realops怎么用?C++ sendto_realops使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sendto_realops函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ircncmp
int
ircncmp (const char *s1, const char *s2, int n)
{
const unsigned char *str1 = (const unsigned char *) s1;
const unsigned char *str2 = (const unsigned char *) s2;
if (!s1 || !s2)
{
sendto_realops ("ircncmp called with s1=%s s2=%s", s1 ? s1 : "(NULL)",
s2 ? s2 : "NULL");
sendto_realops
("Please report to the development team! [email protected]");
return 1;
}
while (touppertab[*str1] == touppertab[*str2])
{
str1++;
str2++;
n--;
if (n == 0 || (*str1 == '\0' && *str2 == '\0'))
return 0;
}
return 1;
}
示例2: irccmp_lex
/*
* irccmp_lex - case insensitive comparison of two 0 terminated strings.
*
* returns 0, if s1 equal to s2
* <0, if s1 lexicographically less than s2
* >0, if s1 lexicographically greater than s2
*/
int
irccmp_lex (const char *s1, const char *s2)
{
const unsigned char *str1 = (const unsigned char *) s1;
const unsigned char *str2 = (const unsigned char *) s2;
int res;
if (!s1 || !s2)
{
sendto_realops ("irccmp_lex called with s1=%s s2=%s",
s1 ? s1 : "(NULL)", s2 ? s2 : "NULL");
sendto_realops
("Please report to the development team! [email protected]");
return 1;
}
/*
* More often than not we wont have to bother about case
* so lets not waste cycles on touppertab and looping
*/
if (s1 == s2)
{
return 0;
}
while ((res = touppertab[*str1] - touppertab[*str2]) == 0)
{
if (*str1 == '\0')
return 0;
str1++;
str2++;
}
return (res);
}
示例3: MOD_UNLOAD
/* Called when module is unloaded */
DLLFUNC int MOD_UNLOAD(m_pingpong)(int module_unload)
{
if (del_Command(MSG_PING, TOK_PING, m_ping) < 0)
{
sendto_realops("Failed to delete command ping when unloading %s",
MOD_HEADER(m_pingpong).name);
}
if (del_Command(MSG_PONG, TOK_PONG, m_pong) < 0)
{
sendto_realops("Failed to delete command pong when unloading %s",
MOD_HEADER(m_pingpong).name);
}
return MOD_SUCCESS;
}
示例4: memcpy
/*
** zip_buffer
** Zip the content of cptr->zip->outbuf and of the buffer,
** put anything left in cptr->zip->outbuf, update cptr->zip->outcount
**
** if flush is set, then all available data will be compressed,
** otherwise, compression only occurs if there's enough to compress,
** or if we are reaching the maximum allowed size during a connect burst.
**
** will return the uncompressed buffer, length will be updated.
** if a fatal error occurs, length will be set to -1
*/
char *zip_buffer(aClient *cptr, char *buffer, int *length, int flush)
{
z_stream *zout = cptr->zip->out;
int r;
if (buffer)
{
/* concatenate buffer in cptr->zip->outbuf */
memcpy((void *)(cptr->zip->outbuf + cptr->zip->outcount), (void *)buffer,
*length );
cptr->zip->outcount += *length;
}
*length = 0;
#if 0
if (!flush && ((cptr->zip->outcount < ZIP_MINIMUM) ||
((cptr->zip->outcount < (ZIP_MAXIMUM - BUFSIZE)) &&
CBurst(cptr))))
/* Implement this? more efficient? or not? -- Syzop */
#else
if (!flush && (cptr->zip->outcount < ZIP_MINIMUM))
#endif
return((char *)NULL);
zout->next_in = (Bytef *) cptr->zip->outbuf;
zout->avail_in = cptr->zip->outcount;
zout->next_out = (Bytef *) zipbuf;
zout->avail_out = ZIP_BUFFER_SIZE;
switch (r = deflate(zout, Z_PARTIAL_FLUSH))
{
case Z_OK:
if (zout->avail_in)
{
/* can this occur?? I hope not... */
sendto_realops("deflate() didn't process all available data!");
}
cptr->zip->outcount = 0;
*length = ZIP_BUFFER_SIZE - zout->avail_out;
return zipbuf;
default: /* error ! */
sendto_realops("deflate() error(%d): %s", r, (zout->msg) ? zout->msg : "?");
*length = -1;
break;
}
return((char *)NULL);
}
示例5: MOD_UNLOAD
/* Called when module is unloaded */
DLLFUNC int MOD_UNLOAD(m_sendumode)(int module_unload)
{
if (del_Command(MSG_SENDUMODE, TOK_SENDUMODE, m_sendumode) < 0)
{
sendto_realops("Failed to delete command sendumode when unloading %s",
MOD_HEADER(m_sendumode).name);
}
if (del_Command(MSG_SMO, TOK_SMO, m_sendumode) < 0)
{
sendto_realops("Failed to delete command smo when unloading %s",
MOD_HEADER(m_sendumode).name);
}
return MOD_SUCCESS;
}
示例6: MOD_INIT
/* This is called on module init, before Server Ready */
DLLFUNC int MOD_INIT(m_dummy)(ModuleInfo *modinfo)
{
CmodeInfo req;
ircd_log(LOG_ERROR, "debug: mod_init called from chmodetst module");
ModuleSetOptions(modinfo->handle, MOD_OPT_PERM);
sendto_realops("chmodetst loading...");
/* TODO: load mode here */
/* +w doesn't do anything, it's just for testing */
memset(&req, 0, sizeof(req));
req.paracount = 0;
req.is_ok = extcmode_default_requirechop;
req.flag = 'w';
ModeTest = CmodeAdd(modinfo->handle, req, &EXTCMODE_TEST);
/* +y doesn't do anything except that you can set/unset it with a
* numeric parameter (1-100)
*/
memset(&req, 0, sizeof(req));
req.paracount = 1;
req.is_ok = modey_is_ok;
req.put_param = modey_put_param;
req.get_param = modey_get_param;
req.conv_param = modey_conv_param;
req.free_param = modey_free_param;
req.sjoin_check = modey_sjoin_check;
req.dup_struct = modey_dup_struct;
req.flag = 'y';
ModeTest2 = CmodeAdd(modinfo->handle, req, &EXTCMODE_TEST2);
return MOD_SUCCESS;
}
示例7: m_svinfo
/*
* m_svinfo - SVINFO message handler
* parv[0] = sender prefix
* parv[1] = TS_CURRENT for the server
* parv[2] = TS_MIN for the server
* parv[3] = clock ts
*/
int m_svinfo(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
{
aConfItem *aconf;
time_t remote_ts = 0;
struct Client *acptr;
if (MyConnect(sptr) && IsUnknown(sptr))
return exit_client(sptr, sptr, sptr, "Need SERVER before SVINFO");
if (!IsServer(sptr) || !MyConnect(sptr) || parc < 3)
return 0;
if (TS_CURRENT < atoi(parv[2]) || atoi(parv[1]) < TS_MIN)
{
/*
* a server with the wrong TS version connected; since we're
* TS_ONLY we can't fall back to the non-TS protocol so
* we drop the link -orabidoo
*/
#ifdef HIDE_SERVERS_IPS
sendto_realops("Link %s dropped, incompatible TS protocol version (%s,%s)",
get_client_name(sptr,MASK_IP), parv[1], parv[2]);
#else
sendto_realops("Link %s dropped, incompatible TS protocol version (%s,%s)",
get_client_name(sptr, TRUE), parv[1], parv[2]);
#endif
return exit_client(sptr, sptr, sptr, "Incompatible TS version");
}
if(parc>3)
{
remote_ts = atol(parv[3]);
if (UseIRCNTP && (remote_ts > 0))
{
if(IsService(cptr) ||
((aconf = find_conf_host(cptr->confs, sptr->name, CONF_HUB))
&& !(acptr = find_server(ServicesServer))))
{
ircntp_offset = remote_ts - time(NULL);
sendto_realops("Adjusting IRCNTP offset to %d",
ircntp_offset);
}
}
}
return 0;
}
示例8: MOD_UNLOAD
DLLFUNC int MOD_UNLOAD(m_restrictcolors)(int module_unload)
{
HookDel(CheckMsg);
CmodeDel(ModeRcolors);
ircd_log(LOG_ERROR, "debug: mod_unload called from m_restrictcolors");
sendto_realops("unloading m_restrictcolors");
return MOD_SUCCESS;
}
示例9: MOD_UNLOAD
DLLFUNC int MOD_UNLOAD(m_addmotd)(int module_unload)
{
if (del_Command(MSG_ADDMOTD, TOK_ADDMOTD, m_addmotd) < 0)
{
sendto_realops("Failed to delete commands when unloading %s",
MOD_HEADER(m_addmotd).name);
}
return MOD_SUCCESS;
}
示例10: MOD_UNLOAD
DLLFUNC int MOD_UNLOAD(m_svssno)(int module_unload)
{
if (del_Command(MSG_SVSSNO, TOK_SVSSNO, m_svssno) < 0 || del_Command(MSG_SVS2SNO, TOK_SVS2SNO, m_svs2sno) < 0)
{
sendto_realops("Failed to delete commands when unloading %s",
MOD_HEADER(m_svssno).name);
}
return MOD_SUCCESS;
}
示例11: MOD_UNLOAD
/* Called when module is unloaded */
DLLFUNC int MOD_UNLOAD(m_dummy)(int module_unload)
{
if (del_Command(MSG_DUMMY, TOK_DUMMY, m_dummy) < 0)
{
sendto_realops("Failed to delete commands when unloading %s",
MOD_HEADER(m_dummy).name);
}
return MOD_SUCCESS;
}
示例12: MOD_UNLOAD
/* Called when module is unloaded */
DLLFUNC int MOD_UNLOAD(m_rakill)(int module_unload)
{
if (del_Command(MSG_RAKILL, TOK_RAKILL, m_rakill) < 0)
{
sendto_realops("Failed to delete commands when unloading %s",
MOD_HEADER(m_rakill).name);
}
return MOD_SUCCESS;
}
示例13: MOD_UNLOAD
DLLFUNC int MOD_UNLOAD(m_chgident)(int module_unload)
{
if (del_Command(MSG_CHGIDENT, TOK_CHGIDENT, m_chgident) < 0)
{
sendto_realops("Failed to delete commands when unloading %s",
MOD_HEADER(m_chgident).name);
}
return MOD_SUCCESS;
}
示例14: MOD_UNLOAD
/* Called when module is unloaded */
DLLFUNC int MOD_UNLOAD(m_unsqline)(int module_unload)
{
if (del_Command(MSG_UNSQLINE, TOK_UNSQLINE, m_unsqline) < 0)
{
sendto_realops("Failed to delete commands when unloading %s",
MOD_HEADER(m_unsqline).name);
}
return MOD_SUCCESS;
}
示例15: MOD_UNLOAD
DLLFUNC int MOD_UNLOAD(m_userhost)(int module_unload)
{
if (del_Command(MSG_USERHOST, TOK_USERHOST, m_userhost) < 0)
{
sendto_realops("Failed to delete commands when unloading %s",
MOD_HEADER(m_userhost).name);
}
return MOD_SUCCESS;
}