Commit 992ebc91 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Implement VRE options with hard linkage to PCRE options instead

of maintaining magic hex-bit values that must match.
parent 2befbaf9
......@@ -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,
......
......@@ -43,6 +43,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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment