diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-06-24 14:56:28 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-07-21 10:37:54 +0200 |
commit | 9200bb30d02f68d35c0fd820e10ff2bed06393e7 (patch) | |
tree | dfbee81edb135d9ffcabc485828861bfa18f8b71 /src/journal/pcre2-dlopen.h | |
parent | dlfcn-util: add dlsym_many_and_warn() helper (diff) | |
download | systemd-9200bb30d02f68d35c0fd820e10ff2bed06393e7.tar.xz systemd-9200bb30d02f68d35c0fd820e10ff2bed06393e7.zip |
journalctl: make pcre2 a dlopen() dependency
Let's make use of the library if it is installed, but otherwise just
generate a nice error and provide all other functionality.
Diffstat (limited to 'src/journal/pcre2-dlopen.h')
-rw-r--r-- | src/journal/pcre2-dlopen.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/journal/pcre2-dlopen.h b/src/journal/pcre2-dlopen.h new file mode 100644 index 0000000000..e7cb0a5907 --- /dev/null +++ b/src/journal/pcre2-dlopen.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#if HAVE_PCRE2 + +#define PCRE2_CODE_UNIT_WIDTH 8 +#include <pcre2.h> + +extern pcre2_match_data* (*sym_pcre2_match_data_create)(uint32_t, pcre2_general_context *); +extern void (*sym_pcre2_match_data_free)(pcre2_match_data *); +extern void (*sym_pcre2_code_free)(pcre2_code *); +extern pcre2_code* (*sym_pcre2_compile)(PCRE2_SPTR, PCRE2_SIZE, uint32_t, int *, PCRE2_SIZE *, pcre2_compile_context *); +extern int (*sym_pcre2_get_error_message)(int, PCRE2_UCHAR *, PCRE2_SIZE); +extern int (*sym_pcre2_match)(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, uint32_t, pcre2_match_data *, pcre2_match_context *); +extern PCRE2_SIZE* (*sym_pcre2_get_ovector_pointer)(pcre2_match_data *); +#endif + +int dlopen_pcre2(void); |