gint flags;
gint pcre_flags;
gint ncaptures;
- gint nbackref;
};
struct rspamd_regexp_cache {
&ncaptures) == 0) {
res->ncaptures = ncaptures;
}
-
- /* Check number of backrefs */
- if (pcre_fullinfo (res->raw_re, res->extra, PCRE_INFO_BACKREFMAX,
- &ncaptures) == 0) {
- res->nbackref = ncaptures;
- }
#else
/* Check number of captures */
if (pcre2_pattern_info (res->raw_re, PCRE2_INFO_CAPTURECOUNT,
&ncaptures) == 0) {
res->ncaptures = ncaptures;
}
-
- /* Check number of backrefs */
- if (pcre2_pattern_info (res->raw_re, PCRE2_INFO_BACKREFMAX,
- &ncaptures) == 0) {
- res->nbackref = ncaptures;
- }
#endif
return res;
return re->pcre_flags;
}
-gint
-rspamd_regexp_get_nbackrefs (const rspamd_regexp_t *re)
-{
- g_assert (re != NULL);
-
- return re->nbackref;
-}
-
-gint
-rspamd_regexp_get_ncaptures (const rspamd_regexp_t *re)
-{
- g_assert (re != NULL);
-
- return re->ncaptures;
-}
-
guint
rspamd_regexp_get_maxhits (const rspamd_regexp_t *re)
{
*/
guint rspamd_regexp_set_maxhits (rspamd_regexp_t *re, guint new_maxhits);
-/**
- * Returns number of backreferences in a regexp
- */
-gint rspamd_regexp_get_nbackrefs (const rspamd_regexp_t *re);
-
-/**
- * Returns number of capture groups in a regexp
- */
-gint rspamd_regexp_get_ncaptures (const rspamd_regexp_t *re);
-
/**
* Returns cache id for a regexp
*/