0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 07:20:55 +01:00

ircd: irc_radixtree: add irc_radixtree_irccasecanon and irc_radixtree_strcasecanon helpers

This commit is contained in:
William Pitcock 2016-01-09 01:00:55 -06:00
parent 325cc939b7
commit db891ac3ca
2 changed files with 25 additions and 0 deletions

View file

@ -138,4 +138,7 @@ unsigned int irc_radixtree_size(struct irc_radixtree *dict);
void irc_radixtree_stats(struct irc_radixtree *dict, void (*cb)(const char *line, void *privdata), void *privdata);
void irc_radixtree_stats_walk(void (*cb)(const char *line, void *privdata), void *privdata);
void irc_radixtree_strcasecanon(char *key);
void irc_radixtree_irccasecanon(char *key);
#endif

View file

@ -34,6 +34,7 @@
#include "stdinc.h"
#include "s_assert.h"
#include "match.h"
#include "irc_radixtree.h"
rb_dlink_list radixtree_list = {NULL, NULL, 0};
@ -1056,3 +1057,24 @@ irc_radixtree_stats_walk(void (*cb)(const char *line, void *privdata), void *pri
irc_radixtree_stats(ptr->data, cb, privdata);
}
}
void irc_radixtree_irccasecanon(char *str)
{
while (*str)
{
*str = ToUpper(*str);
str++;
}
return;
}
void irc_radixtree_strcasecanon(char *str)
{
while (*str)
{
*str = toupper((unsigned char)*str);
str++;
}
return;
}