Added SILC Thread Queue API
[crypto.git] / apps / irssi / src / core / ignore.h
1 #ifndef __IGNORE_H
2 #define __IGNORE_H
3
4 #ifdef HAVE_REGEX_H
5 #  include <regex.h>
6 #endif
7
8 typedef struct _IGNORE_REC IGNORE_REC;
9
10 struct _IGNORE_REC {
11         int level; /* ignore these levels */
12         char *mask; /* nick mask */
13         char *servertag; /* this is for autoignoring */
14         char **channels; /* ignore only in these channels */
15         char *pattern; /* text body must match this pattern */
16
17         time_t unignore_time; /* time in sec for temp ignores */
18
19         unsigned int exception:1; /* *don't* ignore */
20         unsigned int regexp:1;
21         unsigned int fullword:1;
22         unsigned int replies:1; /* ignore replies to nick in channel */
23 #ifdef HAVE_REGEX_H
24         unsigned int regexp_compiled:1; /* should always be TRUE, unless regexp is invalid */
25         regex_t preg;
26 #endif
27 };
28
29 extern GSList *ignores;
30
31 int ignore_check(SERVER_REC *server, const char *nick, const char *host,
32                  const char *channel, const char *text, int level);
33
34 IGNORE_REC *ignore_find(const char *servertag, const char *mask, char **channels);
35
36 void ignore_add_rec(IGNORE_REC *rec);
37 void ignore_update_rec(IGNORE_REC *rec);
38
39 void ignore_init(void);
40 void ignore_deinit(void);
41
42 #endif