X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/212380e3f42f585dc1ea927402252eb943f91f7b..90a3c35b295b07ebe3793bf5d3b882c3c1a5dc7c:/src/class.c diff --git a/src/class.c b/src/class.c index 95f7b8f..106d146 100644 --- a/src/class.c +++ b/src/class.c @@ -27,7 +27,6 @@ #include "stdinc.h" #include "config.h" -#include "tools.h" #include "class.h" #include "client.h" #include "common.h" @@ -37,14 +36,12 @@ #include "s_newconf.h" #include "send.h" #include "irc_string.h" -#include "memory.h" -#include "patricia.h" #define BAD_CONF_CLASS -1 #define BAD_PING -2 #define BAD_CLIENT_CLASS -3 -dlink_list class_list; +rb_dlink_list class_list; struct Class *default_class; struct Class * @@ -59,7 +56,7 @@ make_class(void) MaxUsers(tmp) = 1; MaxSendq(tmp) = DEFAULT_SENDQ; - tmp->ip_limits = New_Patricia(PATRICIA_BITS); + tmp->ip_limits = rb_new_patricia(PATRICIA_BITS); return tmp; } @@ -67,10 +64,10 @@ void free_class(struct Class *tmp) { if(tmp->ip_limits) - Destroy_Patricia(tmp->ip_limits, NULL); + rb_destroy_patricia(tmp->ip_limits, NULL); - MyFree(tmp->class_name); - MyFree(tmp); + rb_free(tmp->class_name); + rb_free(tmp); } @@ -190,7 +187,7 @@ add_class(struct Class *classptr) if(tmpptr == default_class) { - dlinkAddAlloc(classptr, &class_list); + rb_dlinkAddAlloc(classptr, &class_list); CurrUsers(classptr) = 0; } else @@ -221,12 +218,12 @@ struct Class * find_class(const char *classname) { struct Class *cltmp; - dlink_node *ptr; + rb_dlink_node *ptr; if(classname == NULL) return default_class; - DLINK_FOREACH(ptr, class_list.head) + RB_DLINK_FOREACH(ptr, class_list.head) { cltmp = ptr->data; @@ -248,16 +245,16 @@ void check_class() { struct Class *cltmp; - dlink_node *ptr; - dlink_node *next_ptr; + rb_dlink_node *ptr; + rb_dlink_node *next_ptr; - DLINK_FOREACH_SAFE(ptr, next_ptr, class_list.head) + RB_DLINK_FOREACH_SAFE(ptr, next_ptr, class_list.head) { cltmp = ptr->data; if(MaxUsers(cltmp) < 0) { - dlinkDestroy(ptr, &class_list); + rb_dlinkDestroy(ptr, &class_list); if(CurrUsers(cltmp) <= 0) free_class(cltmp); } @@ -289,9 +286,9 @@ void report_classes(struct Client *source_p) { struct Class *cltmp; - dlink_node *ptr; + rb_dlink_node *ptr; - DLINK_FOREACH(ptr, class_list.head) + RB_DLINK_FOREACH(ptr, class_list.head) { cltmp = ptr->data;