diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/extern.h | 6 | ||||
| -rw-r--r-- | include/services.h | 11 |
2 files changed, 15 insertions, 2 deletions
diff --git a/include/extern.h b/include/extern.h index d826bd62e..9942d8271 100644 --- a/include/extern.h +++ b/include/extern.h @@ -634,8 +634,10 @@ E char *stristr(char *s1, char *s2); E char *strnrepl(char *s, int32 size, const char *old, const char *nstr); E const char *merge_args(int argc, char **argv); E const char *merge_args(int argc, const char **argv); -E int match_wild(const char *pattern, const char *str); -E int match_wild_nocase(const char *pattern, const char *str); + +// Use Anope::Match() instead of these. +E int match_wild(const char *pattern, const char *str) MARK_DEPRECATED; +E int match_wild_nocase(const char *pattern, const char *str) MARK_DEPRECATED; E int dotime(const char *s); E char *duration(NickAlias * na, char *buf, int bufsize, time_t seconds); E char *expire_left(NickAlias * na, char *buf, int len, time_t expires); diff --git a/include/services.h b/include/services.h index bceb829a0..55b9a2a4a 100644 --- a/include/services.h +++ b/include/services.h @@ -1364,6 +1364,17 @@ struct Uplink { } }; +class Anope +{ + public: + /** Check whether two strings match. + * @param mask The pattern to check (e.g. foo*bar) + * @param str The string to check against the pattern (e.g. foobar) + * @param case_sensitive Whether or not the match is case sensitive, default false. + */ + CoreExport static bool Anope::Match(const std::string &str, const std::string &mask, bool case_sensitive = false); +}; + /*************************************************************************/ #endif /* SERVICES_H */ |
