blob: 6fcb383d7a930578ff7cdfb641a67f91f0501b44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#ifndef SP_PCRE_COMPAT_H
#define SP_PCRE_COMPAT_H
#include <stdlib.h>
#include <stdbool.h>
#undef pcre_exec
#undef pcre_compile
#if HAVE_BUNDLED_PCRE
#if PHP_VERSION_ID >= 70300
#include "ext/pcre/php_pcre.h"
#else
#include "ext/pcre/pcrelib/pcre.h"
#endif
#else
#define PCRE2_CODE_UNIT_WIDTH 8
#include "pcre2.h"
#endif
#define sp_pcre pcre2_code
sp_pcre* sp_pcre_compile(const char* str);
#define sp_is_regexp_matching_zend(regexp, zstr) \
sp_is_regexp_matching_len(regexp, ZSTR_VAL(zstr), ZSTR_LEN(zstr))
#define sp_is_regexp_matching(regexp, str) \
sp_is_regexp_matching_len(regexp, str, strlen(str))
bool sp_is_regexp_matching_len(const sp_pcre* regexp, const char* str,
size_t len);
#endif // SP_PCRE_COMPAT_H
|