1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
4 #include "hash-funcs.h"
9 #include "dlfcn-util.h"
11 #define PCRE2_CODE_UNIT_WIDTH 8
14 DLSYM_PROTOTYPE(pcre2_match_data_create
);
15 DLSYM_PROTOTYPE(pcre2_match_data_free
);
16 DLSYM_PROTOTYPE(pcre2_code_free
);
17 DLSYM_PROTOTYPE(pcre2_compile
);
18 DLSYM_PROTOTYPE(pcre2_get_error_message
);
19 DLSYM_PROTOTYPE(pcre2_match
);
20 DLSYM_PROTOTYPE(pcre2_get_ovector_pointer
);
22 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(pcre2_match_data
*, sym_pcre2_match_data_free
, NULL
);
23 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(pcre2_code
*, sym_pcre2_code_free
, NULL
);
26 typedef struct {} pcre2_code
;
30 extern const struct hash_ops pcre2_code_hash_ops_free
;
33 PATTERN_COMPILE_CASE_AUTO
,
34 PATTERN_COMPILE_CASE_SENSITIVE
,
35 PATTERN_COMPILE_CASE_INSENSITIVE
,
36 _PATTERN_COMPILE_CASE_MAX
,
37 _PATTERN_COMPILE_CASE_INVALID
= -EINVAL
,
40 int pattern_compile_and_log(const char *pattern
, PatternCompileCase case_
, pcre2_code
**ret
);
41 int pattern_matches_and_log(pcre2_code
*compiled_pattern
, const char *message
, size_t size
, size_t *ret_ovec
);
42 void *pattern_free(pcre2_code
*p
);
44 DEFINE_TRIVIAL_CLEANUP_FUNC(pcre2_code
*, pattern_free
);
46 int dlopen_pcre2(void);