2000-04-26 04:03:38 -04:00
|
|
|
#ifndef __HILIGHT_TEXT_H
|
|
|
|
#define __HILIGHT_TEXT_H
|
|
|
|
|
2001-01-20 23:14:24 -05:00
|
|
|
#ifdef HAVE_REGEX_H
|
|
|
|
# include <regex.h>
|
|
|
|
#endif
|
|
|
|
|
2002-05-17 17:01:06 -04:00
|
|
|
typedef struct _HILIGHT_REC HILIGHT_REC;
|
|
|
|
|
|
|
|
struct _HILIGHT_REC {
|
2000-04-26 04:03:38 -04:00
|
|
|
char *text;
|
|
|
|
|
|
|
|
char **channels; /* if non-NULL, check the text only from these channels */
|
|
|
|
int level; /* match only messages with this level, 0=default */
|
|
|
|
char *color; /* if starts with number, \003 is automatically
|
|
|
|
inserted before it. */
|
2001-01-20 23:14:24 -05:00
|
|
|
char *act_color; /* color for window activity */
|
2001-01-09 16:06:45 -05:00
|
|
|
int priority;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2001-01-20 23:14:24 -05:00
|
|
|
unsigned int nick:1; /* hilight only nick if possible */
|
|
|
|
unsigned int word:1; /* hilight only word, not full line */
|
|
|
|
|
|
|
|
unsigned int nickmask:1; /* `text' is a nick mask */
|
2000-11-23 17:57:59 -05:00
|
|
|
unsigned int fullword:1; /* match `text' only for full words */
|
|
|
|
unsigned int regexp:1; /* `text' is a regular expression */
|
2001-01-20 23:14:24 -05:00
|
|
|
#ifdef HAVE_REGEX_H
|
|
|
|
unsigned int regexp_compiled:1; /* should always be TRUE, unless regexp is invalid */
|
|
|
|
regex_t preg;
|
|
|
|
#endif
|
2002-05-17 17:01:06 -04:00
|
|
|
};
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
extern GSList *hilights;
|
|
|
|
|
2001-01-20 23:14:24 -05:00
|
|
|
HILIGHT_REC *hilight_match(SERVER_REC *server, const char *channel,
|
|
|
|
const char *nick, const char *address,
|
|
|
|
int level, const char *str,
|
|
|
|
int *match_beg, int *match_end);
|
|
|
|
|
|
|
|
char *hilight_match_nick(SERVER_REC *server, const char *channel,
|
|
|
|
const char *nick, const char *address,
|
|
|
|
int level, const char *msg);
|
2000-06-28 17:47:13 -04:00
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
void hilight_text_init(void);
|
|
|
|
void hilight_text_deinit(void);
|
|
|
|
|
|
|
|
#endif
|