From 71f6ebfa1ffd8a75c816d44809c18d8abfa4be70 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Tue, 1 Apr 2008 16:20:40 -0500 Subject: [PATCH] make all extensions libratbox-clean. --- extensions/extb_extgecos.c | 4 ++-- extensions/hurt.c | 12 ++++++++---- extensions/ip_cloaking_old.c | 4 ++-- extensions/m_findforwards.c | 4 ++-- extensions/m_mkpasswd.c | 1 - extensions/m_ojoin.c | 8 +++----- extensions/m_olist.c | 5 ++--- extensions/m_opme.c | 5 ++--- 8 files changed, 21 insertions(+), 22 deletions(-) diff --git a/extensions/extb_extgecos.c b/extensions/extb_extgecos.c index b4023cb..c3a311f 100644 --- a/extensions/extb_extgecos.c +++ b/extensions/extb_extgecos.c @@ -42,14 +42,14 @@ static int eb_extended(const char *data, struct Client *client_p, if (data == NULL) return EXTBAN_INVALID; - ircsnprintf(buf, BUFSIZE, "%s!%s@%s#%s", + rb_snprintf(buf, BUFSIZE, "%s!%s@%s#%s", client_p->name, client_p->username, client_p->host, client_p->info); ret = match(data, buf) ? EXTBAN_MATCH : EXTBAN_NOMATCH; if (ret == EXTBAN_NOMATCH && IsDynSpoof(client_p)) { - ircsnprintf(buf, BUFSIZE, "%s!%s@%s#%s", + rb_snprintf(buf, BUFSIZE, "%s!%s@%s#%s", client_p->name, client_p->username, client_p->orighost, client_p->info); ret = match(data, buf) ? EXTBAN_MATCH : EXTBAN_NOMATCH; diff --git a/extensions/hurt.c b/extensions/hurt.c index 57fcdb4..1f20343 100644 --- a/extensions/hurt.c +++ b/extensions/hurt.c @@ -130,6 +130,10 @@ hurt_state_t hurt_state = { */ /* {{{ static int modinit() */ + +struct ev_entry *hurt_expire_ev = NULL; +struct ev_entry *hurt_check_ev = NULL; + static int modinit(void) { @@ -137,8 +141,8 @@ modinit(void) hurt_state.start_time = CurrentTime; /* add our event handlers. */ - eventAdd("hurt_expire", hurt_expire_event, NULL, 60); - eventAdd("hurt_check", hurt_check_event, NULL, 5); + hurt_expire_ev = rb_event_add("hurt_expire", hurt_expire_event, NULL, 60); + hurt_check_ev = rb_event_add("hurt_check", hurt_check_event, NULL, 5); return 0; } @@ -151,8 +155,8 @@ modfini(void) dlink_node *ptr, *next_ptr; /* and delete our events. */ - eventDelete(hurt_expire_event, NULL); - eventDelete(hurt_check_event, NULL); + rb_event_delete(hurt_expire_ev); + rb_event_delete(hurt_check_ev); DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_state.hurt_clients.head) { diff --git a/extensions/ip_cloaking_old.c b/extensions/ip_cloaking_old.c index 54e13c9..bcc900e 100644 --- a/extensions/ip_cloaking_old.c +++ b/extensions/ip_cloaking_old.c @@ -94,7 +94,7 @@ do_host_cloak(const char *inbuf, char *outbuf, int ipmask) if (ipmask == 0) { - ircsnprintf(outbuf, HOSTLEN, "%s-%X%X", + rb_snprintf(outbuf, HOSTLEN, "%s-%X%X", ServerInfo.network_name, hosthash2, hosthash); len1 = strlen(outbuf); rest = strchr(inbuf, '.'); @@ -106,7 +106,7 @@ do_host_cloak(const char *inbuf, char *outbuf, int ipmask) strlcat(outbuf, rest, HOSTLEN); } else - ircsnprintf(outbuf, HOSTLEN, "%X%X.%s", + rb_snprintf(outbuf, HOSTLEN, "%X%X.%s", hosthash2, hosthash, ServerInfo.network_name); } diff --git a/extensions/m_findforwards.c b/extensions/m_findforwards.c index 488c610..746b590 100644 --- a/extensions/m_findforwards.c +++ b/extensions/m_findforwards.c @@ -59,7 +59,7 @@ m_findforwards(struct Client *client_p, struct Client *source_p, int parc, const static time_t last_used = 0; struct Channel *chptr; struct membership *msptr; - dlink_node *ptr; + rb_dlink_node *ptr; char buf[414]; char *p = buf, *end = buf + sizeof buf - 1; *p = '\0'; @@ -91,7 +91,7 @@ m_findforwards(struct Client *client_p, struct Client *source_p, int parc, const last_used = CurrentTime; } - DLINK_FOREACH(ptr, global_channel_list.head) + RB_DLINK_FOREACH(ptr, global_channel_list.head) { chptr = ptr->data; if(chptr->mode.forward && !irccmp(chptr->mode.forward, parv[1])) diff --git a/extensions/m_mkpasswd.c b/extensions/m_mkpasswd.c index b160c5f..dd84b8f 100644 --- a/extensions/m_mkpasswd.c +++ b/extensions/m_mkpasswd.c @@ -16,7 +16,6 @@ #include "ircd.h" #include "irc_string.h" #include "numeric.h" -#include "patricia.h" #include "s_newconf.h" #include "s_conf.h" #include "s_log.h" diff --git a/extensions/m_ojoin.c b/extensions/m_ojoin.c index e3a6fa5..96a1775 100644 --- a/extensions/m_ojoin.c +++ b/extensions/m_ojoin.c @@ -21,24 +21,22 @@ #include "stdinc.h" #include "tools.h" -#include "patricia.h" #include "channel.h" -#include "client.h" +#include "client.h" #include "ircd.h" #include "numeric.h" #include "s_log.h" #include "s_serv.h" #include "s_conf.h" -#include "s_newconf.h" +#include "s_newconf.h" #include "send.h" #include "whowas.h" #include "irc_string.h" -#include "hash.h" +#include "hash.h" #include "msg.h" #include "parse.h" #include "modules.h" - static int mo_ojoin(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); diff --git a/extensions/m_olist.c b/extensions/m_olist.c index 3893917..8d295c1 100644 --- a/extensions/m_olist.c +++ b/extensions/m_olist.c @@ -28,7 +28,6 @@ #include "stdinc.h" #include "tools.h" -#include "patricia.h" #include "channel.h" #include "client.h" #include "ircd.h" @@ -101,10 +100,10 @@ static void list_all_channels(struct Client *source_p) { struct Channel *chptr; - dlink_node *ptr; + rb_dlink_node *ptr; sendto_one(source_p, form_str(RPL_LISTSTART), me.name, source_p->name); - DLINK_FOREACH(ptr, global_channel_list.head) + RB_DLINK_FOREACH(ptr, global_channel_list.head) { chptr = ptr->data; diff --git a/extensions/m_opme.c b/extensions/m_opme.c index 193a1eb..78a7706 100644 --- a/extensions/m_opme.c +++ b/extensions/m_opme.c @@ -20,7 +20,6 @@ */ #include "stdinc.h" #include "tools.h" -#include "patricia.h" #include "channel.h" #include "client.h" #include "ircd.h" @@ -59,7 +58,7 @@ mo_opme(struct Client *client_p, struct Client *source_p, int parc, const char * { struct Channel *chptr; struct membership *msptr; - dlink_node *ptr; + rb_dlink_node *ptr; /* admins only */ if(!IsOperAdmin(source_p)) @@ -75,7 +74,7 @@ mo_opme(struct Client *client_p, struct Client *source_p, int parc, const char * return 0; } - DLINK_FOREACH(ptr, chptr->members.head) + RB_DLINK_FOREACH(ptr, chptr->members.head) { msptr = ptr->data;