]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/class.c
Fix inconsistency between --sysconfdir and --with-confdir, deprecate --with-confdir.
[irc/rqf/shadowircd.git] / src / class.c
index 186e68400b420b4c3f3d0491e97c0f9a4dc54716..59981584510d1b4a3f23405a96c292082b634cc9 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: class.c 254 2005-09-21 23:35:12Z nenolod $
  */
 
 #include "stdinc.h"
 #include "config.h"
 
-#include "tools.h"
 #include "class.h"
 #include "client.h"
 #include "common.h"
@@ -36,9 +34,7 @@
 #include "s_conf.h"
 #include "s_newconf.h"
 #include "send.h"
-#include "irc_string.h"
-#include "memory.h"
-#include "patricia.h"
+#include "match.h"
 
 #define BAD_CONF_CLASS          -1
 #define BAD_PING                -2
@@ -52,14 +48,14 @@ make_class(void)
 {
        struct Class *tmp;
 
-       tmp = (struct Class *) MyMalloc(sizeof(struct Class));
+       tmp = rb_malloc(sizeof(struct Class));
 
        ConFreq(tmp) = DEFAULT_CONNECTFREQUENCY;
        PingFreq(tmp) = DEFAULT_PINGFREQUENCY;
        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 +63,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);
 
 }
 
@@ -202,7 +198,8 @@ add_class(struct Class *classptr)
                PingFreq(tmpptr) = PingFreq(classptr);
                MaxSendq(tmpptr) = MaxSendq(classptr);
                ConFreq(tmpptr) = ConFreq(classptr);
-               CidrBitlen(tmpptr) = CidrBitlen(classptr);
+               CidrIpv4Bitlen(tmpptr) = CidrIpv4Bitlen(classptr);
+               CidrIpv6Bitlen(tmpptr) = CidrIpv6Bitlen(classptr);
                CidrAmount(tmpptr) = CidrAmount(classptr);
 
                free_class(classptr);
@@ -226,7 +223,7 @@ find_class(const char *classname)
        if(classname == NULL)
                return default_class;
 
-       DLINK_FOREACH(ptr, class_list.head)
+       RB_DLINK_FOREACH(ptr, class_list.head)
        {
                cltmp = ptr->data;
 
@@ -251,7 +248,7 @@ check_class()
        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;
 
@@ -275,7 +272,7 @@ void
 initclass()
 {
        default_class = make_class();
-       DupString(ClassName(default_class), "default");
+       ClassName(default_class) = rb_strdup("default");
 }
 
 /*
@@ -291,7 +288,7 @@ report_classes(struct Client *source_p)
        struct Class *cltmp;
        rb_dlink_node *ptr;
 
-       DLINK_FOREACH(ptr, class_list.head)
+       RB_DLINK_FOREACH(ptr, class_list.head)
        {
                cltmp = ptr->data;