From 4d45e1d9b2feecd408d1170b826a2f12a4ebea1e Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 29 May 2013 15:32:43 +0000 Subject: - resv.c: move valid_wild_card_simple() to conf.c git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2131 82007160-df01-0410-b94d-b575c5fd34c7 --- include/conf.h | 1 + include/resv.h | 1 - src/conf.c | 31 +++++++++++++++++++++++++++++++ src/resv.c | 31 ------------------------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/include/conf.h b/include/conf.h index 81cfb30..311ad38 100644 --- a/include/conf.h +++ b/include/conf.h @@ -338,6 +338,7 @@ extern struct config_channel_entry ConfigChannel;/* defined in channel.c*/ extern struct config_server_hide ConfigServerHide; /* defined in s_conf.c */ extern struct server_info ServerInfo; /* defined in ircd.c */ extern struct admin_info AdminInfo; /* defined in ircd.c */ +extern int valid_wild_card_simple(const char *); extern int valid_wild_card(struct Client *, int, int, ...); /* End GLOBAL section */ diff --git a/include/resv.h b/include/resv.h index 4705b52..8d4a6a0 100644 --- a/include/resv.h +++ b/include/resv.h @@ -29,7 +29,6 @@ extern dlink_list nresv_items; extern dlink_list resv_channel_list; extern struct MaskItem *create_resv(const char *, const char *, const dlink_list *); -extern int valid_wild_card_simple(const char *); extern int resv_find_exempt(const struct Client *, const struct MaskItem *); extern struct MaskItem *match_find_resv(const char *); #endif /* INCLUDED_resv_h */ diff --git a/src/conf.c b/src/conf.c index 84149c1..2704e52 100644 --- a/src/conf.c +++ b/src/conf.c @@ -1754,6 +1754,37 @@ valid_tkline(const char *p, int minutes) return result; } +/* valid_wild_card_simple() + * + * inputs - data to check for sufficient non-wildcard characters + * outputs - 1 if valid, else 0 + * side effects - none + */ +int +valid_wild_card_simple(const char *data) +{ + const unsigned char *p = (const unsigned char *)data; + unsigned char tmpch = '\0'; + int nonwild = 0; + + while ((tmpch = *p++)) + { + if (tmpch == '\\') + { + ++p; + if (++nonwild >= ConfigFileEntry.min_nonwildcard_simple) + return 1; + } + else if (!IsMWildChar(tmpch)) + { + if (++nonwild >= ConfigFileEntry.min_nonwildcard_simple) + return 1; + } + } + + return 0; +} + /* valid_wild_card() * * input - pointer to client diff --git a/src/resv.c b/src/resv.c index 1f5b057..29380b2 100644 --- a/src/resv.c +++ b/src/resv.c @@ -186,34 +186,3 @@ match_find_resv(const char *name) return NULL; } - -/* valid_wild_card_simple() - * - * inputs - data to check for sufficient non-wildcard characters - * outputs - 1 if valid, else 0 - * side effects - none - */ -int -valid_wild_card_simple(const char *data) -{ - const unsigned char *p = (const unsigned char *)data; - unsigned char tmpch = '\0'; - int nonwild = 0; - - while ((tmpch = *p++)) - { - if (tmpch == '\\') - { - ++p; - if (++nonwild >= ConfigFileEntry.min_nonwildcard_simple) - return 1; - } - else if (!IsMWildChar(tmpch)) - { - if (++nonwild >= ConfigFileEntry.min_nonwildcard_simple) - return 1; - } - } - - return 0; -} -- cgit