From 8e5db471e4d8b052f072ce8a351222c6edb42d19 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Thu, 14 Jan 2016 14:10:00 +0100 Subject: Use GLib's regexp interface (backed by PCRE) --- src/fe-common/core/hilight-text.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/fe-common/core/hilight-text.h') diff --git a/src/fe-common/core/hilight-text.h b/src/fe-common/core/hilight-text.h index ae05e1ca..a74c38b0 100644 --- a/src/fe-common/core/hilight-text.h +++ b/src/fe-common/core/hilight-text.h @@ -1,10 +1,6 @@ #ifndef __HILIGHT_TEXT_H #define __HILIGHT_TEXT_H -#ifdef HAVE_REGEX_H -# include -#endif - #include "formats.h" struct _HILIGHT_REC { @@ -24,10 +20,8 @@ struct _HILIGHT_REC { unsigned int fullword:1; /* match `text' only for full words */ unsigned int regexp:1; /* `text' is a regular expression */ unsigned int case_sensitive:1;/* `text' must match case */ -#ifdef HAVE_REGEX_H unsigned int regexp_compiled:1; /* should always be TRUE, unless regexp is invalid */ - regex_t preg; -#endif + GRegex *preg; char *servertag; }; -- cgit v1.2.3 From 3fcd3cd2b9fae07a0b7cd3e5ba91049f19cc6501 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Fri, 29 Jan 2016 16:22:14 +0100 Subject: Remove the regexp_compiled field. It was made redundant by the introduction of the pointer to the GRegex structure. Silence the compiler warning in textbuffer.c about preg being initialized by setting it to NULL. --- src/fe-common/core/hilight-text.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/fe-common/core/hilight-text.h') diff --git a/src/fe-common/core/hilight-text.h b/src/fe-common/core/hilight-text.h index a74c38b0..93c573c2 100644 --- a/src/fe-common/core/hilight-text.h +++ b/src/fe-common/core/hilight-text.h @@ -20,7 +20,6 @@ struct _HILIGHT_REC { unsigned int fullword:1; /* match `text' only for full words */ unsigned int regexp:1; /* `text' is a regular expression */ unsigned int case_sensitive:1;/* `text' must match case */ - unsigned int regexp_compiled:1; /* should always be TRUE, unless regexp is invalid */ GRegex *preg; char *servertag; }; -- cgit v1.2.3 From f5cbbebc2ee858e8792ab40eea6abc9fd7865a28 Mon Sep 17 00:00:00 2001 From: Ailin Nemui Date: Tue, 3 Jan 2017 12:04:56 +0100 Subject: switch for gregex and regex.h --- src/fe-common/core/hilight-text.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/fe-common/core/hilight-text.h') diff --git a/src/fe-common/core/hilight-text.h b/src/fe-common/core/hilight-text.h index 93c573c2..76beec1f 100644 --- a/src/fe-common/core/hilight-text.h +++ b/src/fe-common/core/hilight-text.h @@ -1,6 +1,10 @@ #ifndef __HILIGHT_TEXT_H #define __HILIGHT_TEXT_H +#ifndef USE_GREGEX +# include +#endif + #include "formats.h" struct _HILIGHT_REC { @@ -20,7 +24,12 @@ struct _HILIGHT_REC { unsigned int fullword:1; /* match `text' only for full words */ unsigned int regexp:1; /* `text' is a regular expression */ unsigned int case_sensitive:1;/* `text' must match case */ +#ifdef USE_GREGEX GRegex *preg; +#else + unsigned int regexp_compiled:1; /* should always be TRUE, unless regexp is invalid */ + regex_t preg; +#endif char *servertag; }; -- cgit v1.2.3