
tfheen at varnish-cache
Apr 16, 2012, 1:20 AM
Post #1 of 1
(30 views)
Permalink
|
|
[3.0] 3156777 Implement VRE options with hard linkage to PCRE options instead of maintaining magic hex-bit values that must match.
|
|
commit 315677722d1c144b1bcd8a607242d21fee608581 Author: Poul-Henning Kamp <phk [at] FreeBSD> Date: Tue Nov 8 15:04:04 2011 +0000 Implement VRE options with hard linkage to PCRE options instead of maintaining magic hex-bit values that must match. diff --git a/include/vre.h b/include/vre.h index a1206e5..59ffeb0 100644 --- a/include/vre.h +++ b/include/vre.h @@ -48,8 +48,8 @@ typedef struct vre vre_t; #define VRE_ERROR_NOMATCH (-1) /* And those to PCRE options */ -#define VRE_CASELESS 0x00000001 -#define VRE_NOTEMPTY_ATSTART 0x10000000 +extern const unsigned VRE_CASELESS; +extern const unsigned VRE_NOTEMPTY_ATSTART; vre_t *VRE_compile(const char *, int, const char **, int *); int VRE_exec(const vre_t *code, const char *subject, int length, diff --git a/lib/libvarnish/vre.c b/lib/libvarnish/vre.c index 68beaf8..62da7a0 100644 --- a/lib/libvarnish/vre.c +++ b/lib/libvarnish/vre.c @@ -39,6 +39,19 @@ struct vre { pcre *re; }; +/* + * We don't want to spread or even expose the majority of PCRE options + * so we establish our own options and implement hard linkage to PCRE + * here. + */ +const unsigned VRE_CASELESS = PCRE_CASELESS; +const unsigned VRE_NOTEMPTY_ATSTART = +#ifdef PCRE_NOTEMPTY_ATSTART + PCRE_NOTEMPTY_ATSTART; +#else + 0; +#endif + vre_t * VRE_compile(const char *pattern, int options, const char **errptr, int *erroffset) _______________________________________________ varnish-commit mailing list varnish-commit [at] varnish-cache https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit
|