diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-05-29 15:32:43 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-05-29 15:32:43 +0000 |
commit | 4d45e1d9b2feecd408d1170b826a2f12a4ebea1e (patch) | |
tree | 02c33133df099a8412da12b4881e55d8c76b0a7b | |
parent | 20460b95142289aaa1cd057684dfcdfe21a3d60b (diff) |
- 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
-rw-r--r-- | include/conf.h | 1 | ||||
-rw-r--r-- | include/resv.h | 1 | ||||
-rw-r--r-- | src/conf.c | 31 | ||||
-rw-r--r-- | 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 */ @@ -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 @@ -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; -} |