Move irc_* data structures to librb.

This makes the base ircd less cluttered up with data structures that can
go elsewhere.
This commit is contained in:
Elizabeth Myers 2016-03-06 14:17:19 -06:00
parent eddf454cd3
commit a4bf26dd34
31 changed files with 809 additions and 786 deletions

View file

@ -146,7 +146,7 @@ mr_nick(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
return 0;
}
if(irc_dictionary_find(nd_dict, nick))
if(rb_dictionary_find(nd_dict, nick))
{
sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),
me.name, EmptyString(source_p->name) ? "*" : source_p->name, nick);
@ -198,7 +198,7 @@ m_nick(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p
return 0;
}
if(irc_dictionary_find(nd_dict, nick))
if(rb_dictionary_find(nd_dict, nick))
{
sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),
me.name, EmptyString(source_p->name) ? "*" : source_p->name, nick);
@ -754,7 +754,7 @@ change_remote_nick(struct Client *client_p, struct Client *source_p,
del_from_client_hash(source_p->name, source_p);
/* invalidate nick delay when a remote client uses the nick.. */
if((nd = irc_dictionary_retrieve(nd_dict, nick)))
if((nd = rb_dictionary_retrieve(nd_dict, nick)))
free_nd_entry(nd);
strcpy(source_p->name, nick);
@ -1076,7 +1076,7 @@ register_client(struct Client *client_p, struct Client *server,
}
/* remove any nd entries for this nick */
if((nd = irc_dictionary_retrieve(nd_dict, nick)))
if((nd = rb_dictionary_retrieve(nd_dict, nick)))
free_nd_entry(nd);
add_to_client_hash(nick, source_p);

View file

@ -34,7 +34,7 @@
#include "modules.h"
#include "hash.h"
#include "cache.h"
#include "irc_dictionary.h"
#include "rb_dictionary.h"
static int m_help(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
static int mo_help(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
@ -97,7 +97,7 @@ dohelp(struct Client *source_p, int flags, const char *topic)
if(EmptyString(topic))
topic = ntopic;
hptr = irc_dictionary_retrieve(flags & HELP_OPER ? help_dict_oper : help_dict_user, topic);
hptr = rb_dictionary_retrieve(flags & HELP_OPER ? help_dict_oper : help_dict_user, topic);
if(hptr == NULL || !(hptr->flags & flags))
{

View file

@ -49,7 +49,7 @@
#include "inline/stringops.h"
#include "s_assert.h"
#include "logger.h"
#include "irc_radixtree.h"
#include "rb_radixtree.h"
static rb_dlink_list safelisting_clients = { NULL, NULL, 0 };
@ -472,9 +472,9 @@ static void safelist_one_channel(struct Client *source_p, struct Channel *chptr,
static void safelist_iterate_client(struct Client *source_p)
{
struct Channel *chptr;
struct irc_radixtree_iteration_state iter;
struct rb_radixtree_iteration_state iter;
IRC_RADIXTREE_FOREACH_FROM(chptr, &iter, channel_tree, source_p->localClient->safelist_data->chname)
RB_RADIXTREE_FOREACH_FROM(chptr, &iter, channel_tree, source_p->localClient->safelist_data->chname)
{
if (safelist_sendq_exceeded(source_p->from) == YES)
{

View file

@ -41,7 +41,7 @@
#include "reject.h"
#include "hash.h"
#include "cache.h"
#include "irc_radixtree.h"
#include "rb_radixtree.h"
#include "sslproc.h"
static int mo_rehash(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
@ -194,7 +194,7 @@ static void
rehash_tresvs(struct Client *source_p)
{
struct ConfItem *aconf;
struct irc_radixtree_iteration_state iter;
struct rb_radixtree_iteration_state iter;
rb_dlink_node *ptr;
rb_dlink_node *next_ptr;
int i;
@ -204,12 +204,12 @@ rehash_tresvs(struct Client *source_p)
if (!MyConnect(source_p))
remote_rehash_oper_p = source_p;
IRC_RADIXTREE_FOREACH(aconf, &iter, resv_tree)
RB_RADIXTREE_FOREACH(aconf, &iter, resv_tree)
{
if(!aconf->hold || aconf->lifetime)
continue;
irc_radixtree_delete(resv_tree, aconf->host);
rb_radixtree_delete(resv_tree, aconf->host);
free_conf(aconf);
}

View file

@ -280,7 +280,7 @@ me_nickdelay(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *so
duration = atoi(parv[1]);
if (duration <= 0)
{
nd = irc_dictionary_retrieve(nd_dict, parv[2]);
nd = rb_dictionary_retrieve(nd_dict, parv[2]);
if (nd != NULL)
free_nd_entry(nd);
}
@ -289,7 +289,7 @@ me_nickdelay(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *so
if (duration > 86400)
duration = 86400;
add_nd_entry(parv[2]);
nd = irc_dictionary_retrieve(nd_dict, parv[2]);
nd = rb_dictionary_retrieve(nd_dict, parv[2]);
if (nd != NULL)
nd->expire = rb_current_time() + duration;
}

View file

@ -46,7 +46,7 @@
#include "hash.h"
#include "reject.h"
#include "whowas.h"
#include "irc_radixtree.h"
#include "rb_radixtree.h"
#include "sslproc.h"
static int m_stats (struct MsgBuf *, struct Client *, struct Client *, int, const char **);
@ -292,8 +292,8 @@ stats_hash(struct Client *source_p)
sendto_one_numeric(source_p, RPL_STATSDEBUG, "B :%-30s %-15s %-10s %-10s %-10s %-10s",
"NAME", "TYPE", "OBJECTS", "DEPTH SUM", "AVG DEPTH", "MAX DEPTH");
irc_dictionary_stats_walk(stats_hash_cb, source_p);
irc_radixtree_stats_walk(stats_hash_cb, source_p);
rb_dictionary_stats_walk(stats_hash_cb, source_p);
rb_radixtree_stats_walk(stats_hash_cb, source_p);
}
static void
@ -856,7 +856,7 @@ static void
stats_tresv(struct Client *source_p)
{
struct ConfItem *aconf;
struct irc_radixtree_iteration_state state;
struct rb_radixtree_iteration_state state;
rb_dlink_node *ptr;
int i;
@ -869,7 +869,7 @@ stats_tresv(struct Client *source_p)
'q', aconf->port, aconf->host, aconf->passwd);
}
IRC_RADIXTREE_FOREACH(aconf, &state, resv_tree)
RB_RADIXTREE_FOREACH(aconf, &state, resv_tree)
{
if(aconf->hold)
sendto_one_numeric(source_p, RPL_STATSQLINE,
@ -883,7 +883,7 @@ static void
stats_resv(struct Client *source_p)
{
struct ConfItem *aconf;
struct irc_radixtree_iteration_state state;
struct rb_radixtree_iteration_state state;
rb_dlink_node *ptr;
int i;
@ -896,7 +896,7 @@ stats_resv(struct Client *source_p)
'Q', aconf->port, aconf->host, aconf->passwd);
}
IRC_RADIXTREE_FOREACH(aconf, &state, resv_tree)
RB_RADIXTREE_FOREACH(aconf, &state, resv_tree)
{
if(!aconf->hold)
sendto_one_numeric(source_p, RPL_STATSQLINE,