]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/send.c
Various changes for libratbox.
[irc/rqf/shadowircd.git] / src / send.c
index 26abee2497b9055103ee3d4eb059a5149e5ba6c1..9f1f41d9b5e4f182d9a38408940ffeba23b8543a 100644 (file)
@@ -446,12 +446,12 @@ sendto_server(struct Client *one, struct Channel *chptr, unsigned long caps,
 {
        va_list args;
        struct Client *target_p;
-       dlink_node *ptr;
-       dlink_node *next_ptr;
+       rb_dlink_node *ptr;
+       rb_dlink_node *next_ptr;
        buf_head_t linebuf;
 
        /* noone to send to.. */
-       if(dlink_list_length(&serv_list) == 0)
+       if(rb_dlink_list_length(&serv_list) == 0)
                return;
 
        if(chptr != NULL && *chptr->chname != '#')
@@ -462,7 +462,7 @@ sendto_server(struct Client *one, struct Channel *chptr, unsigned long caps,
        linebuf_putmsg(&linebuf, format, &args, NULL);
        va_end(args);
 
-       DLINK_FOREACH_SAFE(ptr, next_ptr, serv_list.head)
+       RB_DLINK_FOREACH_SAFE(ptr, next_ptr, serv_list.head)
        {
                target_p = ptr->data;
 
@@ -502,8 +502,8 @@ sendto_channel_flags(struct Client *one, int type, struct Client *source_p,
        buf_head_t linebuf_id;
        struct Client *target_p;
        struct membership *msptr;
-       dlink_node *ptr;
-       dlink_node *next_ptr;
+       rb_dlink_node *ptr;
+       rb_dlink_node *next_ptr;
 
        linebuf_newbuf(&linebuf_local);
        linebuf_newbuf(&linebuf_name);
@@ -527,7 +527,7 @@ sendto_channel_flags(struct Client *one, int type, struct Client *source_p,
        linebuf_putmsg(&linebuf_name, NULL, NULL, ":%s %s", source_p->name, buf);
        linebuf_putmsg(&linebuf_id, NULL, NULL, ":%s %s", use_id(source_p), buf);
 
-       DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->members.head)
+       RB_DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->members.head)
        {
                msptr = ptr->data;
                target_p = msptr->client_p;
@@ -582,8 +582,8 @@ sendto_channel_local(int type, struct Channel *chptr, const char *pattern, ...)
        buf_head_t linebuf;
        struct membership *msptr;
        struct Client *target_p;
-       dlink_node *ptr;
-       dlink_node *next_ptr;
+       rb_dlink_node *ptr;
+       rb_dlink_node *next_ptr;
        
        linebuf_newbuf(&linebuf); 
        
@@ -591,7 +591,7 @@ sendto_channel_local(int type, struct Channel *chptr, const char *pattern, ...)
        linebuf_putmsg(&linebuf, pattern, &args, NULL);
        va_end(args);
 
-       DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->locmembers.head)
+       RB_DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->locmembers.head)
        {
                msptr = ptr->data;
                target_p = msptr->client_p;
@@ -622,8 +622,8 @@ sendto_channel_local_butone(struct Client *one, int type, struct Channel *chptr,
        buf_head_t linebuf;
        struct membership *msptr;
        struct Client *target_p;
-       dlink_node *ptr;
-       dlink_node *next_ptr;
+       rb_dlink_node *ptr;
+       rb_dlink_node *next_ptr;
        
        linebuf_newbuf(&linebuf); 
        
@@ -631,7 +631,7 @@ sendto_channel_local_butone(struct Client *one, int type, struct Channel *chptr,
        linebuf_putmsg(&linebuf, pattern, &args, NULL);
        va_end(args);
 
-       DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->locmembers.head)
+       RB_DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->locmembers.head)
        {
                msptr = ptr->data;
                target_p = msptr->client_p;
@@ -665,10 +665,10 @@ void
 sendto_common_channels_local(struct Client *user, const char *pattern, ...)
 {
        va_list args;
-       dlink_node *ptr;
-       dlink_node *next_ptr;
-       dlink_node *uptr;
-       dlink_node *next_uptr;
+       rb_dlink_node *ptr;
+       rb_dlink_node *next_ptr;
+       rb_dlink_node *uptr;
+       rb_dlink_node *next_uptr;
        struct Channel *chptr;
        struct Client *target_p;
        struct membership *msptr;
@@ -682,12 +682,12 @@ sendto_common_channels_local(struct Client *user, const char *pattern, ...)
 
        ++current_serial;
 
-       DLINK_FOREACH_SAFE(ptr, next_ptr, user->user->channel.head)
+       RB_DLINK_FOREACH_SAFE(ptr, next_ptr, user->user->channel.head)
        {
                mscptr = ptr->data;
                chptr = mscptr->chptr;
 
-               DLINK_FOREACH_SAFE(uptr, next_uptr, chptr->locmembers.head)
+               RB_DLINK_FOREACH_SAFE(uptr, next_uptr, chptr->locmembers.head)
                {
                        msptr = uptr->data;
                        target_p = msptr->client_p;
@@ -723,10 +723,10 @@ void
 sendto_common_channels_local_butone(struct Client *user, const char *pattern, ...)
 {
        va_list args;
-       dlink_node *ptr;
-       dlink_node *next_ptr;
-       dlink_node *uptr;
-       dlink_node *next_uptr;
+       rb_dlink_node *ptr;
+       rb_dlink_node *next_ptr;
+       rb_dlink_node *uptr;
+       rb_dlink_node *next_uptr;
        struct Channel *chptr;
        struct Client *target_p;
        struct membership *msptr;
@@ -742,12 +742,12 @@ sendto_common_channels_local_butone(struct Client *user, const char *pattern, ..
        /* Skip them -- jilles */
        user->serial = current_serial;
 
-       DLINK_FOREACH_SAFE(ptr, next_ptr, user->user->channel.head)
+       RB_DLINK_FOREACH_SAFE(ptr, next_ptr, user->user->channel.head)
        {
                mscptr = ptr->data;
                chptr = mscptr->chptr;
 
-               DLINK_FOREACH_SAFE(uptr, next_uptr, chptr->locmembers.head)
+               RB_DLINK_FOREACH_SAFE(uptr, next_uptr, chptr->locmembers.head)
                {
                        msptr = uptr->data;
                        target_p = msptr->client_p;
@@ -777,8 +777,8 @@ sendto_match_butone(struct Client *one, struct Client *source_p,
        static char buf[BUFSIZE];
        va_list args;
        struct Client *target_p;
-       dlink_node *ptr;
-       dlink_node *next_ptr;
+       rb_dlink_node *ptr;
+       rb_dlink_node *next_ptr;
        buf_head_t linebuf_local;
        buf_head_t linebuf_name;
        buf_head_t linebuf_id;
@@ -805,7 +805,7 @@ sendto_match_butone(struct Client *one, struct Client *source_p,
 
        if(what == MATCH_HOST)
        {
-               DLINK_FOREACH_SAFE(ptr, next_ptr, lclient_list.head)
+               RB_DLINK_FOREACH_SAFE(ptr, next_ptr, lclient_list.head)
                {
                        target_p = ptr->data;
 
@@ -816,14 +816,14 @@ sendto_match_butone(struct Client *one, struct Client *source_p,
        /* what = MATCH_SERVER, if it doesnt match us, just send remote */
        else if(match(mask, me.name))
        {
-               DLINK_FOREACH_SAFE(ptr, next_ptr, lclient_list.head)
+               RB_DLINK_FOREACH_SAFE(ptr, next_ptr, lclient_list.head)
                {
                        target_p = ptr->data;
                        _send_linebuf(target_p, &linebuf_local);
                }
        }
 
-       DLINK_FOREACH(ptr, serv_list.head)
+       RB_DLINK_FOREACH(ptr, serv_list.head)
        {
                target_p = ptr->data;
 
@@ -853,7 +853,7 @@ sendto_match_servs(struct Client *source_p, const char *mask, int cap,
 {
        static char buf[BUFSIZE];
        va_list args;
-       dlink_node *ptr;
+       rb_dlink_node *ptr;
        struct Client *target_p;
        buf_head_t linebuf_id;
        buf_head_t linebuf_name;
@@ -875,7 +875,7 @@ sendto_match_servs(struct Client *source_p, const char *mask, int cap,
 
        current_serial++;
 
-       DLINK_FOREACH(ptr, global_serv_list.head)
+       RB_DLINK_FOREACH(ptr, global_serv_list.head)
        {
                target_p = ptr->data;
 
@@ -922,8 +922,8 @@ sendto_monitor(struct monitor *monptr, const char *pattern, ...)
        va_list args;
        buf_head_t linebuf;
        struct Client *target_p;
-       dlink_node *ptr;
-       dlink_node *next_ptr;
+       rb_dlink_node *ptr;
+       rb_dlink_node *next_ptr;
        
        linebuf_newbuf(&linebuf); 
        
@@ -931,7 +931,7 @@ sendto_monitor(struct monitor *monptr, const char *pattern, ...)
        linebuf_putmsg(&linebuf, pattern, &args, NULL);
        va_end(args);
 
-       DLINK_FOREACH_SAFE(ptr, next_ptr, monptr->users.head)
+       RB_DLINK_FOREACH_SAFE(ptr, next_ptr, monptr->users.head)
        {
                target_p = ptr->data;
 
@@ -998,8 +998,8 @@ void
 sendto_realops_flags(int flags, int level, const char *pattern, ...)
 {
        struct Client *client_p;
-       dlink_node *ptr;
-       dlink_node *next_ptr;
+       rb_dlink_node *ptr;
+       rb_dlink_node *next_ptr;
        va_list args;
        buf_head_t linebuf;
 
@@ -1010,7 +1010,7 @@ sendto_realops_flags(int flags, int level, const char *pattern, ...)
                       ":%s NOTICE * :*** Notice -- ", me.name);
        va_end(args);
 
-       DLINK_FOREACH_SAFE(ptr, next_ptr, local_oper_list.head)
+       RB_DLINK_FOREACH_SAFE(ptr, next_ptr, local_oper_list.head)
        {
                client_p = ptr->data;
 
@@ -1040,8 +1040,8 @@ sendto_realops_snomask(int flags, int level, const char *pattern, ...)
        static char buf[BUFSIZE];
        char *snobuf;
        struct Client *client_p;
-       dlink_node *ptr;
-       dlink_node *next_ptr;
+       rb_dlink_node *ptr;
+       rb_dlink_node *next_ptr;
        va_list args;
        buf_head_t linebuf;
 
@@ -1077,7 +1077,7 @@ sendto_realops_snomask(int flags, int level, const char *pattern, ...)
        }
        level &= ~L_NETWIDE;
 
-       DLINK_FOREACH_SAFE(ptr, next_ptr, local_oper_list.head)
+       RB_DLINK_FOREACH_SAFE(ptr, next_ptr, local_oper_list.head)
        {
                client_p = ptr->data;
 
@@ -1105,8 +1105,8 @@ sendto_realops_snomask_from(int flags, int level, struct Client *source_p,
                const char *pattern, ...)
 {
        struct Client *client_p;
-       dlink_node *ptr;
-       dlink_node *next_ptr;
+       rb_dlink_node *ptr;
+       rb_dlink_node *next_ptr;
        va_list args;
        buf_head_t linebuf;
 
@@ -1117,7 +1117,7 @@ sendto_realops_snomask_from(int flags, int level, struct Client *source_p,
                       ":%s NOTICE * :*** Notice -- ", source_p->name);
        va_end(args);
 
-       DLINK_FOREACH_SAFE(ptr, next_ptr, local_oper_list.head)
+       RB_DLINK_FOREACH_SAFE(ptr, next_ptr, local_oper_list.head)
        {
                client_p = ptr->data;
 
@@ -1148,8 +1148,8 @@ void
 sendto_wallops_flags(int flags, struct Client *source_p, const char *pattern, ...)
 {
        struct Client *client_p;
-       dlink_node *ptr;
-       dlink_node *next_ptr;
+       rb_dlink_node *ptr;
+       rb_dlink_node *next_ptr;
        va_list args;
        buf_head_t linebuf;
 
@@ -1166,7 +1166,7 @@ sendto_wallops_flags(int flags, struct Client *source_p, const char *pattern, ..
 
        va_end(args);
 
-       DLINK_FOREACH_SAFE(ptr, next_ptr, IsPerson(source_p) && flags == UMODE_WALLOP ? lclient_list.head : local_oper_list.head)
+       RB_DLINK_FOREACH_SAFE(ptr, next_ptr, IsPerson(source_p) && flags == UMODE_WALLOP ? lclient_list.head : local_oper_list.head)
        {
                client_p = ptr->data;
 
@@ -1218,8 +1218,8 @@ kill_client_serv_butone(struct Client *one, struct Client *target_p, const char
        static char buf[BUFSIZE];
        va_list args;
        struct Client *client_p;
-       dlink_node *ptr;
-       dlink_node *next_ptr;
+       rb_dlink_node *ptr;
+       rb_dlink_node *next_ptr;
        buf_head_t linebuf_id;
        buf_head_t linebuf_name;
 
@@ -1235,7 +1235,7 @@ kill_client_serv_butone(struct Client *one, struct Client *target_p, const char
        linebuf_putmsg(&linebuf_id, NULL, NULL, ":%s KILL %s :%s",
                       use_id(&me), use_id(target_p), buf);
 
-       DLINK_FOREACH_SAFE(ptr, next_ptr, serv_list.head)
+       RB_DLINK_FOREACH_SAFE(ptr, next_ptr, serv_list.head)
        {
                client_p = ptr->data;