New silcconfig library and server parser. Merged silc-newconfig-final.patch.
[crypto.git] / apps / irssi / src / fe-common / core / hilight-text.h
1 #ifndef __HILIGHT_TEXT_H
2 #define __HILIGHT_TEXT_H
3
4 #ifdef HAVE_REGEX_H
5 #  include <regex.h>
6 #endif
7
8 typedef struct {
9         char *text;
10
11         char **channels; /* if non-NULL, check the text only from these channels */
12         int level; /* match only messages with this level, 0=default */
13         char *color; /* if starts with number, \003 is automatically
14                         inserted before it. */
15         char *act_color; /* color for window activity */
16         int priority;
17
18         unsigned int nick:1; /* hilight only nick if possible */
19         unsigned int word:1; /* hilight only word, not full line */
20
21         unsigned int nickmask:1; /* `text' is a nick mask */
22         unsigned int fullword:1; /* match `text' only for full words */
23         unsigned int regexp:1; /* `text' is a regular expression */
24 #ifdef HAVE_REGEX_H
25         unsigned int regexp_compiled:1; /* should always be TRUE, unless regexp is invalid */
26         regex_t preg;
27 #endif
28 } HILIGHT_REC;
29
30 extern GSList *hilights;
31
32 HILIGHT_REC *hilight_match(SERVER_REC *server, const char *channel,
33                            const char *nick, const char *address,
34                            int level, const char *str,
35                            int *match_beg, int *match_end);
36
37 char *hilight_match_nick(SERVER_REC *server, const char *channel,
38                          const char *nick, const char *address,
39                          int level, const char *msg);
40
41 void hilight_text_init(void);
42 void hilight_text_deinit(void);
43
44 #endif