diff options
Diffstat (limited to 'src/core/ignore.h')
-rw-r--r-- | src/core/ignore.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/core/ignore.h b/src/core/ignore.h index 46025d4c..80ae1d12 100644 --- a/src/core/ignore.h +++ b/src/core/ignore.h @@ -1,7 +1,7 @@ #ifndef __IGNORE_H #define __IGNORE_H -#ifdef HAVE_REGEX_H +#ifndef USE_GREGEX # include <regex.h> #endif @@ -20,7 +20,9 @@ struct _IGNORE_REC { unsigned int regexp:1; unsigned int fullword:1; unsigned int replies:1; /* ignore replies to nick in channel */ -#ifdef HAVE_REGEX_H +#ifdef USE_GREGEX + GRegex *preg; +#else unsigned int regexp_compiled:1; /* should always be TRUE, unless regexp is invalid */ regex_t preg; #endif @@ -31,6 +33,16 @@ extern GSList *ignores; int ignore_check(SERVER_REC *server, const char *nick, const char *host, const char *channel, const char *text, int level); +enum { + IGNORE_FIND_PATTERN = 0x01, // Match the pattern + IGNORE_FIND_NOACT = 0x02, // Exclude the targets with NOACT level +}; + +IGNORE_REC *ignore_find_full (const char *servertag, const char *mask, const char *pattern, + char **channels, const int flags); + +// Convenience wrappers around ignore_find_full, for compatibility purpose + IGNORE_REC *ignore_find(const char *servertag, const char *mask, char **channels); IGNORE_REC *ignore_find_noact(const char *servertag, const char *mask, char **channels, int noact); |