mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 04:43:34 +02:00
Highlighting updates. -word renamed to -full. Added new -word option
meaning to highlight only the found word in line. Removed -nonick option but added -line which means pretty much the same. -actcolor specifies what color to show in activity list, default is the same as -color. Also uses the nick cache to match nickmasks faster. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1139 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
1bfa0e1ee3
commit
391a7e5710
6 changed files with 438 additions and 159 deletions
|
|
@ -1,6 +1,10 @@
|
|||
#ifndef __HILIGHT_TEXT_H
|
||||
#define __HILIGHT_TEXT_H
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
# include <regex.h>
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char *text;
|
||||
|
||||
|
|
@ -8,22 +12,33 @@ typedef struct {
|
|||
int level; /* match only messages with this level, 0=default */
|
||||
char *color; /* if starts with number, \003 is automatically
|
||||
inserted before it. */
|
||||
char *act_color; /* color for window activity */
|
||||
int priority;
|
||||
|
||||
unsigned int nick:1; /* hilight only the nick, not a full line - works only with msgs. */
|
||||
unsigned int nickmask:1; /* `text 'is a nick mask - colorify the nick */
|
||||
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 */
|
||||
unsigned int fullword:1; /* match `text' only for full words */
|
||||
unsigned int regexp:1; /* `text' is a regular expression */
|
||||
#ifdef HAVE_REGEX_H
|
||||
unsigned int regexp_compiled:1; /* should always be TRUE, unless regexp is invalid */
|
||||
regex_t preg;
|
||||
#endif
|
||||
} HILIGHT_REC;
|
||||
|
||||
extern GSList *hilights;
|
||||
|
||||
HILIGHT_REC *hilight_match(const char *channel, const char *nickmask,
|
||||
int level, const char *str);
|
||||
char *hilight_get_color(HILIGHT_REC *rec);
|
||||
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(const char *channel, const char *nick,
|
||||
const char *address, int level, const char *msg);
|
||||
char *hilight_get_color(HILIGHT_REC *rec, int activity);
|
||||
|
||||
char *hilight_match_nick(SERVER_REC *server, const char *channel,
|
||||
const char *nick, const char *address,
|
||||
int level, const char *msg);
|
||||
|
||||
void hilight_text_init(void);
|
||||
void hilight_text_deinit(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue