X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/fda6c724eab4723783dd1f98347aa18e5bd395ec..581fa5c4999f82a176e39e4edad2990759c94f56:/modules/core/m_sjoin.c?ds=sidebyside diff --git a/modules/core/m_sjoin.c b/modules/core/m_sjoin.c index fc65db2..7acac51 100644 --- a/modules/core/m_sjoin.c +++ b/modules/core/m_sjoin.c @@ -75,7 +75,7 @@ static int pargs; static void set_final_mode(struct Mode *mode, struct Mode *oldmode); static void remove_our_modes(struct Channel *chptr, struct Client *source_p); static void remove_ban_list(struct Channel *chptr, struct Client *source_p, - dlink_list * list, char c, int cap, int mems); + rb_dlink_list * list, char c, int cap, int mems); static int ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) @@ -105,7 +105,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char char *p; int i, joinc = 0, timeslice = 0; static char empty[] = ""; - dlink_node *ptr, *next_ptr; + rb_dlink_node *ptr, *next_ptr; if(!IsChannelName(parv[2]) || !check_channel_name(parv[2])) return 0; @@ -263,13 +263,13 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char { struct membership *msptr; struct Client *who; - int l = dlink_list_length(&chptr->members); - int b = dlink_list_length(&chptr->banlist) + - dlink_list_length(&chptr->exceptlist) + - dlink_list_length(&chptr->invexlist) + - dlink_list_length(&chptr->quietlist); + int l = rb_dlink_list_length(&chptr->members); + int b = rb_dlink_list_length(&chptr->banlist) + + rb_dlink_list_length(&chptr->exceptlist) + + rb_dlink_list_length(&chptr->invexlist) + + rb_dlink_list_length(&chptr->quietlist); - DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->locmembers.head) + RB_DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->locmembers.head) { msptr = ptr->data; who = msptr->client_p; @@ -343,7 +343,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char if(!keep_our_modes) { remove_our_modes(chptr, fakesource_p); - DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->invites.head) + RB_DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->invites.head) { del_invite(chptr, ptr->data); } @@ -367,14 +367,14 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char else modes = empty_modes; - mlen_nick = ircsprintf(buf_nick, ":%s SJOIN %ld %s %s :", + mlen_nick = rb_sprintf(buf_nick, ":%s SJOIN %ld %s %s :", source_p->name, (long) chptr->channelts, parv[2], modes); ptr_nick = buf_nick + mlen_nick; /* working on the presumption eventually itll be more efficient to * build a TS6 buffer without checking its needed.. */ - mlen_uid = ircsprintf(buf_uid, ":%s SJOIN %ld %s %s :", + mlen_uid = rb_sprintf(buf_uid, ":%s SJOIN %ld %s %s :", use_id(source_p), (long) chptr->channelts, parv[2], modes); ptr_uid = buf_uid + mlen_uid; @@ -455,10 +455,10 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char } /* copy the nick to the two buffers */ - len = ircsprintf(ptr_nick, "%s ", target_p->name); + len = rb_sprintf(ptr_nick, "%s ", target_p->name); ptr_nick += len; len_nick += len; - len = ircsprintf(ptr_uid, "%s ", use_id(target_p)); + len = rb_sprintf(ptr_uid, "%s ", use_id(target_p)); ptr_uid += len; len_uid += len; @@ -577,18 +577,18 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char */ if(!keep_our_modes && source_p->id[0] != '\0') { - if(dlink_list_length(&chptr->banlist) > 0) + if(rb_dlink_list_length(&chptr->banlist) > 0) remove_ban_list(chptr, fakesource_p, &chptr->banlist, 'b', NOCAPS, ALL_MEMBERS); - if(dlink_list_length(&chptr->exceptlist) > 0) + if(rb_dlink_list_length(&chptr->exceptlist) > 0) remove_ban_list(chptr, fakesource_p, &chptr->exceptlist, 'e', CAP_EX, ONLY_CHANOPS); - if(dlink_list_length(&chptr->invexlist) > 0) + if(rb_dlink_list_length(&chptr->invexlist) > 0) remove_ban_list(chptr, fakesource_p, &chptr->invexlist, 'I', CAP_IE, ONLY_CHANOPS); - if(dlink_list_length(&chptr->quietlist) > 0) + if(rb_dlink_list_length(&chptr->quietlist) > 0) remove_ban_list(chptr, fakesource_p, &chptr->quietlist, 'q', NOCAPS, ALL_MEMBERS); @@ -651,7 +651,7 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode) dir = MODE_DEL; } *mbuf++ = 'k'; - len = ircsprintf(pbuf, "%s ", oldmode->key); + len = rb_sprintf(pbuf, "%s ", oldmode->key); pbuf += len; pargs++; } @@ -681,7 +681,7 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode) dir = MODE_ADD; } *mbuf++ = 'l'; - len = ircsprintf(pbuf, "%d ", mode->limit); + len = rb_sprintf(pbuf, "%d ", mode->limit); pbuf += len; pargs++; } @@ -693,7 +693,7 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode) dir = MODE_ADD; } *mbuf++ = 'k'; - len = ircsprintf(pbuf, "%s ", mode->key); + len = rb_sprintf(pbuf, "%s ", mode->key); pbuf += len; pargs++; } @@ -705,7 +705,7 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode) dir = MODE_ADD; } *mbuf++ = 'j'; - len = ircsprintf(pbuf, "%d:%d ", mode->join_num, mode->join_time); + len = rb_sprintf(pbuf, "%d:%d ", mode->join_num, mode->join_time); pbuf += len; pargs++; } @@ -717,7 +717,7 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode) dir = MODE_ADD; } *mbuf++ = 'f'; - len = ircsprintf(pbuf, "%s ", mode->forward); + len = rb_sprintf(pbuf, "%s ", mode->forward); pbuf += len; pargs++; } @@ -735,7 +735,7 @@ static void remove_our_modes(struct Channel *chptr, struct Client *source_p) { struct membership *msptr; - dlink_node *ptr; + rb_dlink_node *ptr; char lmodebuf[MODEBUFLEN]; char *lpara[MAXMODEPARAMS]; int count = 0; @@ -747,7 +747,7 @@ remove_our_modes(struct Channel *chptr, struct Client *source_p) for (i = 0; i < MAXMODEPARAMS; i++) lpara[i] = NULL; - DLINK_FOREACH(ptr, chptr->members.head) + RB_DLINK_FOREACH(ptr, chptr->members.head) { msptr = ptr->data; @@ -831,23 +831,23 @@ remove_our_modes(struct Channel *chptr, struct Client *source_p) */ static void remove_ban_list(struct Channel *chptr, struct Client *source_p, - dlink_list * list, char c, int cap, int mems) + rb_dlink_list * list, char c, int cap, int mems) { static char lmodebuf[BUFSIZE]; static char lparabuf[BUFSIZE]; struct Ban *banptr; - dlink_node *ptr; - dlink_node *next_ptr; + rb_dlink_node *ptr; + rb_dlink_node *next_ptr; char *pbuf; int count = 0; int cur_len, mlen, plen; pbuf = lparabuf; - cur_len = mlen = ircsprintf(lmodebuf, ":%s MODE %s -", source_p->name, chptr->chname); + cur_len = mlen = rb_sprintf(lmodebuf, ":%s MODE %s -", source_p->name, chptr->chname); mbuf = lmodebuf + mlen; - DLINK_FOREACH_SAFE(ptr, next_ptr, list->head) + RB_DLINK_FOREACH_SAFE(ptr, next_ptr, list->head) { banptr = ptr->data; @@ -875,7 +875,7 @@ remove_ban_list(struct Channel *chptr, struct Client *source_p, *mbuf++ = c; cur_len += plen; - pbuf += ircsprintf(pbuf, "%s ", banptr->banstr); + pbuf += rb_sprintf(pbuf, "%s ", banptr->banstr); count++; free_ban(banptr);