本文整理汇总了C++中egg_strcasecmp函数的典型用法代码示例。如果您正苦于以下问题:C++ egg_strcasecmp函数的具体用法?C++ egg_strcasecmp怎么用?C++ egg_strcasecmp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了egg_strcasecmp函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: tcl_boot
static int tcl_boot(ClientData cd, Tcl_Interp *irp,
int argc, char *argv[])
{
char who[NOTENAMELEN + 1];
int i, ok = 0;
BADARGS(2, 3, " [email protected] ?reason?");
strncpyz(who, argv[1], sizeof who);
if (strchr(who, '@') != NULL) {
char whonick[HANDLEN + 1];
splitc(whonick, who, '@');
whonick[HANDLEN] = 0;
if (!egg_strcasecmp(who, botnetnick))
strncpyz(who, whonick, sizeof who);
else if (remote_boots > 0) {
i = nextbot(who);
if (i < 0)
return TCL_OK;
botnet_send_reject(i, botnetnick, NULL, whonick, who,
argv[2] ? argv[2] : "");
} else
return TCL_OK;
}
for (i = 0; i < dcc_total; i++)
if (!ok && (dcc[i].type->flags & DCT_CANBOOT) &&
!egg_strcasecmp(dcc[i].nick, who)) {
do_boot(i, botnetnick, argv[2] ? argv[2] : "");
ok = 1;
}
return TCL_OK;
}
开发者ID:Estella,项目名称:eggdrop-1.7,代码行数:34,代码来源:tcldcc.c
示例2: bot_traced
/* traced <[email protected]> <chain:chain..>
*/
static void bot_traced(int idx, char *par)
{
char *to, *p;
int i, sock;
to = newsplit(&par);
p = strchr(to, '@');
if (p == NULL)
p = to;
else {
*p = 0;
p++;
}
if (!egg_strcasecmp(p, botnetnick)) {
time_t t = 0;
char *p = par, *ss = TBUF;
splitc(ss, to, ':');
if (ss[0])
sock = atoi(ss);
else
sock = -1;
if (par[0] == ':') {
t = atoi(par + 1);
p = strchr(par + 1, ':');
if (p)
p++;
else
p = par + 1;
}
for (i = 0; i < dcc_total; i++)
if ((dcc[i].type->flags & DCT_CHAT) &&
(!egg_strcasecmp(dcc[i].nick, to)) &&
((sock == -1) || (sock == dcc[i].sock))) {
if (t) {
int j = 0;
{
register char *c = p;
for (; *c != '\0'; c++)
if (*c == ':')
j++;
}
dprintf(i, "%s -> %s (%lu secs, %d hop%s)\n", BOT_TRACERESULT, p,
now - t, j, (j != 1) ? "s" : "");
} else
dprintf(i, "%s -> %s\n", BOT_TRACERESULT, p);
}
} else {
i = nextbot(p);
if (p != to)
*--p = '@';
if (i >= 0)
botnet_send_traced(i, to, par);
}
}
开发者ID:Estella,项目名称:eggdrop-1.7,代码行数:59,代码来源:botcmd.c
示例3: wordshift
static void wordshift(char *first, char *rest)
{
char *p, *q = rest;
do {
p = newsplit(&q);
strcpy(first, p);
strcpy(rest, q);
} while (!egg_strcasecmp(first, "and") || !egg_strcasecmp(first, "or"));
}
开发者ID:Abysim,项目名称:NyanLion,代码行数:10,代码来源:seen.c
示例4: ngetudef
static intptr_t ngetudef(char *name, char *chan)
{
struct udef_struct *l;
struct udef_chans *ll;
for (l = udef; l; l = l->next)
if (!egg_strcasecmp(l->name, name)) {
for (ll = l->values; ll; ll = ll->next)
if (!egg_strcasecmp(ll->chan, chan))
return ll->value;
break;
}
return 0;
}
开发者ID:Abysim,项目名称:NyanLion,代码行数:14,代码来源:udefchan.c
示例5: deflag_translate
int deflag_translate(const char *buf)
{
if (str_isdigit(buf))
return (atoi(buf));
if (!egg_strcasecmp(buf, "ignore"))
return P_IGNORE;
else if (!egg_strcasecmp(buf, "deop"))
return P_DEOP;
else if (!egg_strcasecmp(buf, "kick"))
return P_KICK;
else if (!egg_strcasecmp(buf, "delete") || !egg_strcasecmp(buf, "remove"))
return P_DELETE;
return P_IGNORE;
}
开发者ID:Estella,项目名称:wraith,代码行数:15,代码来源:flags.c
示例6: bot_link
/* link <[email protected]> <who> <to-whom>
*/
static void bot_link(int idx, char *par)
{
char *from, *bot, *rfrom;
int i;
from = newsplit(&par);
bot = newsplit(&par);
if (!egg_strcasecmp(bot, botnetnick)) {
if ((rfrom = strchr(from, ':')))
rfrom++;
else
rfrom = from;
putlog(LOG_CMDS, "*", "#%s# link %s", rfrom, par);
if (botlink(from, -1, par))
botnet_send_priv(idx, botnetnick, from, NULL, "%s %s ...",
BOT_LINKATTEMPT, par);
else
botnet_send_priv(idx, botnetnick, from, NULL, "%s.", BOT_CANTLINKTHERE);
} else {
i = nextbot(bot);
if (i >= 0)
botnet_send_link(i, from, bot, par);
}
}
开发者ID:Estella,项目名称:eggdrop-1.7,代码行数:27,代码来源:botcmd.c
示例7: bot_who
/* who <[email protected]> <tobot> <chan#>
*/
static void bot_who(int idx, char *par)
{
char *from, *to, *p;
int i, chan;
from = newsplit(&par);
p = strchr(from, '@');
if (!p) {
sprintf(TBUF, "%[email protected]%s", from, dcc[idx].nick);
from = TBUF;
}
to = newsplit(&par);
if (!egg_strcasecmp(to, botnetnick))
to[0] = 0;
#ifndef NO_OLD_BOTNET
if (dcc[idx].u.bot->numver < NEAT_BOTNET)
chan = atoi(par);
else
#endif
chan = base64_to_int(par);
if (to[0]) {
i = nextbot(to);
if (i >= 0)
botnet_send_who(i, from, to, chan);
} else
remote_tell_who(idx, from, chan);
}
开发者ID:Estella,项目名称:eggdrop-1.7,代码行数:29,代码来源:botcmd.c
示例8: bot_filereq
/* filereq <sock:[email protected]> <bot:file>
*/
static void bot_filereq(int idx, char *tobot)
{
char *from, *path;
int i;
from = newsplit(&tobot);
if ((path = strchr(tobot, ':'))) {
*path++ = 0;
if (!egg_strcasecmp(tobot, botnetnick)) { /* For me! */
/* Process this */
module_entry *fs = module_find("filesys", 0, 0);
if (fs == NULL)
botnet_send_priv(idx, botnetnick, from, NULL, MOD_NOFILESYSMOD);
else {
Function f = fs->funcs[FILESYS_REMOTE_REQ];
f(idx, from, path);
}
} else { /* Pass it on */
i = nextbot(tobot);
if (i >= 0)
botnet_send_filereq(i, from, tobot, path);
}
}
}
开发者ID:Estella,项目名称:eggdrop-1.7,代码行数:29,代码来源:botcmd.c
示例9: bot_filereject
/* These are still here, so that they will pass the relevant
* requests through even if no filesys is loaded.
*
* filereject <bot:filepath> <sock:[email protected]> <reason...>
*/
static void bot_filereject(int idx, char *par)
{
char *path, *to, *tobot, *p;
int i;
path = newsplit(&par);
to = newsplit(&par);
if ((tobot = strchr(to, '@')))
tobot++;
else
tobot = to; /* Bot wants a file?! :) */
if (egg_strcasecmp(tobot, botnetnick)) { /* for me! */
p = strchr(to, ':');
if (p != NULL) {
*p = 0;
for (i = 0; i < dcc_total; i++) {
if (dcc[i].sock == atoi(to))
dprintf(i, "%s (%s): %s\n", BOT_XFERREJECTED, path, par);
}
*p = ':';
}
/* No ':'? malformed */
putlog(LOG_FILES, "*", "%s %s: %s", path, MISC_REJECTED, par);
} else { /* Pass it on */
i = nextbot(tobot);
if (i >= 0)
botnet_send_filereject(i, path, to, par);
}
}
开发者ID:Estella,项目名称:eggdrop-1.7,代码行数:34,代码来源:botcmd.c
示例10: initudef
static void initudef(int type, char *name, int defined)
{
struct udef_struct *ul, *ul_last = NULL;
if (strlen(name) < 1)
return;
for (ul = udef; ul; ul_last = ul, ul = ul->next)
if (ul->name && !egg_strcasecmp(ul->name, name)) {
if (defined) {
debug1("UDEF: %s defined", ul->name);
ul->defined = 1;
}
return;
}
debug2("Creating %s (type %d)", name, type);
ul = nmalloc(sizeof(struct udef_struct));
ul->name = nmalloc(strlen(name) + 1);
strcpy(ul->name, name);
if (defined)
ul->defined = 1;
else
ul->defined = 0;
ul->type = type;
ul->values = NULL;
ul->next = NULL;
if (ul_last)
ul_last->next = ul;
else
udef = ul;
}
开发者ID:Abysim,项目名称:NyanLion,代码行数:32,代码来源:udefchan.c
示例11: join_notes
static void join_notes(char *nick, char *uhost, char *handle, char *par)
{
int i = -1, j;
struct chanset_t *chan = chanset;
if (notify_onjoin) { /* drummer */
for (j = 0; j < dcc_total; j++)
if ((dcc[j].type->flags & DCT_CHAT) &&
(!egg_strcasecmp(dcc[j].nick, handle)))
return; /* They already know they have notes */
while (chan) {
if (ismember(chan, nick))
return; /* They already know they have notes */
chan = chan->next;
}
i = num_notes(handle);
if (i) {
dprintf(DP_HELP, NOTES_WAITING_NOTICE, nick, i, (i == 1) ? "" : "s", botname);
dprintf(DP_HELP, "NOTICE %s :%s /MSG %s NOTES <pass> INDEX\n",
nick, NOTES_FORLIST, botname);
}
}
}
开发者ID:ArNz8o8,项目名称:Fr3shness,代码行数:25,代码来源:notes.c
示例12: Assert
tcl_bind_list_t *add_bind_table(const char *nme, int flg, Function func)
{
tcl_bind_list_t *tl, *tl_prev;
int v;
/* Do not allow coders to use bind table names longer than
* 4 characters. */
Assert(strlen(nme) <= 4);
for (tl = bind_table_list, tl_prev = NULL; tl; tl_prev = tl, tl = tl->next) {
if (tl->flags & HT_DELETED)
continue;
v = egg_strcasecmp(tl->name, nme);
if (!v)
return tl; /* Duplicate, just return old value. */
if (v > 0)
break; /* New. Insert at start of list. */
}
tl = nmalloc_null(sizeof *tl);
strcpy(tl->name, nme);
tl->flags = flg;
tl->func = func;
if (tl_prev) {
tl->next = tl_prev->next;
tl_prev->next = tl;
} else {
tl->next = bind_table_list;
bind_table_list = tl;
}
putlog(LOG_DEBUG, "*", "Allocated bind table %s (flags %d).", nme, flg);
return tl;
}
开发者ID:Estella,项目名称:eggdrop-1.7,代码行数:35,代码来源:tclhash.c
示例13: zapf_assoc
static void zapf_assoc(char *botnick, char *code, char *par)
{
int idx = nextbot(botnick);
char *s, *s1, *nick;
int linking = 0, chan;
if ((idx >= 0) && !(bot_flags(dcc[idx].user) & BOT_ISOLATE)) {
if (!egg_strcasecmp(dcc[idx].nick, botnick))
linking = b_status(idx) & STAT_LINKING;
s = newsplit(&par);
chan = base64_to_int(s);
if ((chan > 0) || (chan < GLOBAL_CHANS)) {
nick = newsplit(&par);
s1 = get_assoc_name(chan);
if (linking && ((s1 == NULL) || (s1[0] == 0) ||
(((intptr_t) get_user(find_entry_type("BOTFL"),
dcc[idx].user) & BOT_HUB)))) {
add_assoc(par, chan);
botnet_send_assoc(idx, chan, nick, par);
chanout_but(-1, chan, ASSOC_CHNAME_NAMED, nick, par);
} else if (par[0] == '0') {
kill_assoc(chan);
chanout_but(-1, chan, ASSOC_CHNAME_REM, botnick, nick);
} else if (get_assoc(par) != chan) {
/* New one i didn't know about -- pass it on */
s1 = get_assoc_name(chan);
add_assoc(par, chan);
chanout_but(-1, chan, ASSOC_CHNAME_NAMED2, botnick, nick, par);
}
}
}
}
开发者ID:Protospace,项目名称:protobot,代码行数:32,代码来源:assoc.c
示例14: got442
/* Got 442: not on channel
*/
static int got442(char *from, char *msg)
{
char *chname, *key;
struct chanset_t *chan;
if (!realservername || egg_strcasecmp(from, realservername))
return 0;
newsplit(&msg);
chname = newsplit(&msg);
chan = findchan(chname);
if (chan && !channel_inactive(chan)) {
module_entry *me = module_find("channels", 0, 0);
putlog(LOG_MISC, chname, IRC_SERVNOTONCHAN, chname);
if (me && me->funcs)
(me->funcs[CHANNEL_CLEAR]) (chan, 1);
chan->status &= ~CHAN_ACTIVE;
key = chan->channel.key[0] ? chan->channel.key : chan->key_prot;
if (key[0])
dprintf(DP_SERVER, "JOIN %s %s\n", chan->name, key);
else
dprintf(DP_SERVER, "JOIN %s\n", chan->name);
}
return 0;
}
开发者ID:Estella,项目名称:eggdrop-1.8,代码行数:28,代码来源:servmsg.c
示例15: call_ipbyhost
void call_ipbyhost(char *hostn, IP ip, int ok)
{
devent_t *de = dns_events, *ode = NULL, *nde = NULL;
Context;
while (de) {
nde = de->next;
if ((de->lookup == RES_IPBYHOST) &&
(!de->res_data.hostname ||
!egg_strcasecmp(de->res_data.hostname, hostn))) {
/* Remove the event from the list here, to avoid conflicts if one of
* the event handlers re-adds another event. */
if (ode)
ode->next = de->next;
else
dns_events = de->next;
if (de->type && de->type->event)
de->type->event(ip, hostn, ok, de->other);
else
putlog(LOG_MISC, "*", "(!) Unknown DNS event type found: %s",
(de->type && de->type->name) ? de->type->name : "<empty>");
if (de->res_data.hostname)
nfree(de->res_data.hostname);
nfree(de);
de = ode;
}
ode = de;
de = nde;
}
}
开发者ID:nawawi,项目名称:eggdrop1.5.4,代码行数:32,代码来源:dns.c
示例16: get_user_by_handle
static char *getxtra(char *hand, char *field)
{
struct userrec *urec;
struct user_entry *ue;
struct xtra_key *xk;
urec = get_user_by_handle(userlist, hand);
if (urec) {
ue = find_user_entry(&USERENTRY_XTRA, urec);
if (ue)
for (xk = ue->u.extra; xk; xk = xk->next)
if (xk->key && !egg_strcasecmp(xk->key, field)) {
if (xk->data[0] == '{' && xk->data[strlen(xk->data) - 1] == '}' &&
strlen(xk->data) > 2) {
strncpy(fixit, &xk->data[1], strlen(xk->data) - 2);
fixit[strlen(xk->data) - 2] = 0;
return fixit;
} else {
return xk->data;
}
}
}
return "";
}
开发者ID:Abysim,项目名称:NyanLion,代码行数:25,代码来源:seen.c
示例17: num_notes
/* Determine how many notes are waiting for a user.
*/
static int num_notes(char *user)
{
int tot = 0;
FILE *f;
char s[513], *to, *s1;
if (!notefile[0])
return 0;
f = fopen(notefile, "r");
if (f == NULL)
return 0;
while (!feof(f)) {
fgets(s, 512, f);
if (!feof(f)) {
if (s[strlen(s) - 1] == '\n')
s[strlen(s) - 1] = 0;
rmspace(s);
if ((s[0]) && (s[0] != '#') && (s[0] != ';')) { /* Not comment */
s1 = s;
to = newsplit(&s1);
if (!egg_strcasecmp(to, user))
tot++;
}
}
}
fclose(f);
return tot;
}
开发者ID:ArNz8o8,项目名称:Fr3shness,代码行数:30,代码来源:notes.c
示例18: bind_bind_entry
/* Add command (remove old one if necessary)
*/
static int bind_bind_entry(tcl_bind_list_t *tl, const char *flags,
const char *cmd, const char *proc)
{
tcl_cmd_t *tc;
tcl_bind_mask_t *tm;
/* Search for matching bind in bind list. */
for (tm = tl->first; tm; tm = tm->next) {
if (tm->flags & TBM_DELETED)
continue;
if (!strcmp(cmd, tm->mask))
break; /* Found it! fall out! */
}
/* Create bind if it doesn't exist yet. */
if (!tm) {
tm = nmalloc_null(sizeof *tm);
tm->mask = nmalloc(strlen(cmd) + 1);
strcpy(tm->mask, cmd);
/* Link into linked list of binds. */
tm->next = tl->first;
tl->first = tm;
}
/* Proc already defined? If so, replace. */
for (tc = tm->first; tc; tc = tc->next) {
if (tc->attributes & TC_DELETED)
continue;
if (!egg_strcasecmp(tc->func_name, proc)) {
tc->flags.match = FR_GLOBAL | FR_CHAN;
break_down_flags(flags, &(tc->flags), NULL);
return 1;
}
}
/* If this bind list is not stackable, remove the
* old entry from this bind. */
if (!(tl->flags & HT_STACKABLE)) {
for (tc = tm->first; tc; tc = tc->next) {
if (tc->attributes & TC_DELETED)
continue;
/* NOTE: We assume there's only one not-yet-deleted entry. */
tc->attributes |= TC_DELETED;
break;
}
}
tc = nmalloc_null(sizeof *tc);
tc->flags.match = FR_GLOBAL | FR_CHAN;
break_down_flags(flags, &(tc->flags), NULL);
tc->func_name = nmalloc(strlen(proc) + 1);
strcpy(tc->func_name, proc);
/* Link into linked list of the bind's command list. */
tc->next = tm->first;
tm->first = tc;
return 1;
}
开发者ID:Estella,项目名称:eggdrop-1.7,代码行数:62,代码来源:tclhash.c
示例19: unbind_bind_entry
static int unbind_bind_entry(tcl_bind_list_t *tl, const char *flags,
const char *cmd, const char *proc)
{
tcl_bind_mask_t *tm;
/* Search for matching bind in bind list. */
for (tm = tl->first; tm; tm = tm->next) {
if (tm->flags & TBM_DELETED)
continue;
if (!strcmp(cmd, tm->mask))
break; /* Found it! fall out! */
}
if (tm) {
tcl_cmd_t *tc;
/* Search for matching proc in bind. */
for (tc = tm->first; tc; tc = tc->next) {
if (tc->attributes & TC_DELETED)
continue;
if (!egg_strcasecmp(tc->func_name, proc)) {
/* Erase proc regardless of flags. */
tc->attributes |= TC_DELETED;
return 1; /* Match. */
}
}
}
return 0; /* No match. */
}
开发者ID:Estella,项目名称:eggdrop-1.7,代码行数:29,代码来源:tclhash.c
示例20: dcc_dnsipbyhost
void dcc_dnsipbyhost(char *hostn)
{
devent_t *de = dns_events;
Context;
while (de) {
if (de->type && (de->type == &DNS_DCCEVENT_IPBYHOST) &&
(de->lookup == RES_IPBYHOST)) {
if (de->res_data.hostname &&
!egg_strcasecmp(de->res_data.hostname, hostn))
/* No need to add anymore. */
return;
}
de = de->next;
}
de = nmalloc(sizeof(devent_t));
egg_bzero(de, sizeof(devent_t));
/* Link into list. */
de->next = dns_events;
dns_events = de;
de->type = &DNS_DCCEVENT_IPBYHOST;
de->lookup = RES_IPBYHOST;
de->res_data.hostname = nmalloc(strlen(hostn) + 1);
strcpy(de->res_data.hostname, hostn);
/* Send request. */
dns_ipbyhost(hostn);
}
开发者ID:nawawi,项目名称:eggdrop1.5.4,代码行数:31,代码来源:dns.c
注:本文中的egg_strcasecmp函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论