Added SILC Thread Queue API
[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 #include "formats.h"
9
10 typedef struct _HILIGHT_REC HILIGHT_REC;
11
12 struct _HILIGHT_REC {
13         char *text;
14
15         char **channels; /* if non-NULL, check the text only from these channels */
16         int level; /* match only messages with this level, 0=default */
17         char *color; /* if starts with number, \003 is automatically
18                         inserted before it. */
19         char *act_color; /* color for window activity */
20         int priority;
21
22         unsigned int nick:1; /* hilight only nick if possible */
23         unsigned int word:1; /* hilight only word, not full line */
24
25         unsigned int nickmask:1; /* `text' is a nick mask */
26         unsigned int fullword:1; /* match `text' only for full words */
27         unsigned int regexp:1; /* `text' is a regular expression */
28 #ifdef HAVE_REGEX_H
29         unsigned int regexp_compiled:1; /* should always be TRUE, unless regexp is invalid */
30         regex_t preg;
31 #endif
32 };
33
34 extern GSList *hilights;
35
36 HILIGHT_REC *hilight_match(SERVER_REC *server, const char *channel,
37                            const char *nick, const char *address,
38                            int level, const char *str,
39                            int *match_beg, int *match_end);
40
41 HILIGHT_REC *hilight_match_nick(SERVER_REC *server, const char *channel,
42                          const char *nick, const char *address,
43                          int level, const char *msg);
44                          
45 char *hilight_get_color(HILIGHT_REC *rec);
46 void hilight_update_text_dest(TEXT_DEST_REC *dest, HILIGHT_REC *rec);
47
48 void hilight_create(HILIGHT_REC *rec);
49 void hilight_remove(HILIGHT_REC *rec);
50
51 void hilight_text_init(void);
52 void hilight_text_deinit(void);
53
54 #endif