diff options
Diffstat (limited to 'src/shared/idn-util.c')
-rw-r--r-- | src/shared/idn-util.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/shared/idn-util.c b/src/shared/idn-util.c index 26a9d60..aa88e11 100644 --- a/src/shared/idn-util.c +++ b/src/shared/idn-util.c @@ -16,11 +16,16 @@ static void* idn_dl = NULL; #endif #if HAVE_LIBIDN2 -int (*sym_idn2_lookup_u8)(const uint8_t* src, uint8_t** lookupname, int flags) = NULL; +DLSYM_FUNCTION(idn2_lookup_u8); const char *(*sym_idn2_strerror)(int rc) _const_ = NULL; -int (*sym_idn2_to_unicode_8z8z)(const char * input, char ** output, int flags) = NULL; +DLSYM_FUNCTION(idn2_to_unicode_8z8z); int dlopen_idn(void) { + ELF_NOTE_DLOPEN("idn", + "Support for internationalized domain names", + ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED, + "libidn2.so.0"); + return dlopen_many_sym_or_warn( &idn_dl, "libidn2.so.0", LOG_DEBUG, DLSYM_ARG(idn2_lookup_u8), @@ -30,15 +35,20 @@ int dlopen_idn(void) { #endif #if HAVE_LIBIDN -int (*sym_idna_to_ascii_4i)(const uint32_t * in, size_t inlen, char *out, int flags); -int (*sym_idna_to_unicode_44i)(const uint32_t * in, size_t inlen, uint32_t * out, size_t * outlen, int flags); -char* (*sym_stringprep_ucs4_to_utf8)(const uint32_t * str, ssize_t len, size_t * items_read, size_t * items_written); -uint32_t* (*sym_stringprep_utf8_to_ucs4)(const char *str, ssize_t len, size_t *items_written); +DLSYM_FUNCTION(idna_to_ascii_4i); +DLSYM_FUNCTION(idna_to_unicode_44i); +DLSYM_FUNCTION(stringprep_ucs4_to_utf8); +DLSYM_FUNCTION(stringprep_utf8_to_ucs4); int dlopen_idn(void) { _cleanup_(dlclosep) void *dl = NULL; int r; + ELF_NOTE_DLOPEN("idn", + "Support for internationalized domain names", + ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED, + "libidn.so.12", "libidn.so.11"); + if (idn_dl) return 0; /* Already loaded */ |