Extend visibility support
Also renamed PSL_PUBLIC -> PSL_API (conforming to other known libraries).
This commit is contained in:
parent
8e91838fd5
commit
6244c731b9
|
@ -17,6 +17,9 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||||
dnl Check that compiler understands inline
|
dnl Check that compiler understands inline
|
||||||
AC_C_INLINE
|
AC_C_INLINE
|
||||||
|
|
||||||
|
dnl Check for visibility support
|
||||||
|
gl_VISIBILITY
|
||||||
|
|
||||||
#
|
#
|
||||||
# Generate version defines for include file
|
# Generate version defines for include file
|
||||||
#
|
#
|
||||||
|
|
|
@ -40,8 +40,16 @@
|
||||||
#define PSL_VERSION_PATCH @LIBPSL_VERSION_PATCH@
|
#define PSL_VERSION_PATCH @LIBPSL_VERSION_PATCH@
|
||||||
#define PSL_VERSION_NUMBER @LIBPSL_VERSION_NUMBER@
|
#define PSL_VERSION_NUMBER @LIBPSL_VERSION_NUMBER@
|
||||||
|
|
||||||
#ifndef PSL_PUBLIC
|
#ifndef PSL_API
|
||||||
# define PSL_PUBLIC
|
#if defined BUILDING_PSL && HAVE_VISIBILITY
|
||||||
|
# define PSL_API __attribute__ ((__visibility__("default")))
|
||||||
|
#elif defined BUILDING_PSL && defined _MSC_VER && !defined PSL_STATIC
|
||||||
|
# define PSL_API __declspec(dllexport)
|
||||||
|
#elif defined _MSC_VER && !defined PSL_STATIC
|
||||||
|
# define PSL_API __declspec(dllimport)
|
||||||
|
#else
|
||||||
|
# define PSL_API
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -81,112 +89,112 @@ typedef enum {
|
||||||
typedef struct _psl_ctx_st psl_ctx_t;
|
typedef struct _psl_ctx_st psl_ctx_t;
|
||||||
|
|
||||||
/* frees PSL context */
|
/* frees PSL context */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
void
|
void
|
||||||
psl_free(psl_ctx_t *psl);
|
psl_free(psl_ctx_t *psl);
|
||||||
|
|
||||||
/* frees memory allocated by libpsl routines */
|
/* frees memory allocated by libpsl routines */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
void
|
void
|
||||||
psl_free_string(char *str);
|
psl_free_string(char *str);
|
||||||
|
|
||||||
/* loads PSL data from file */
|
/* loads PSL data from file */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
psl_ctx_t *
|
psl_ctx_t *
|
||||||
psl_load_file(const char *fname);
|
psl_load_file(const char *fname);
|
||||||
|
|
||||||
/* loads PSL data from FILE pointer */
|
/* loads PSL data from FILE pointer */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
psl_ctx_t *
|
psl_ctx_t *
|
||||||
psl_load_fp(FILE *fp);
|
psl_load_fp(FILE *fp);
|
||||||
|
|
||||||
/* retrieves builtin PSL data */
|
/* retrieves builtin PSL data */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
const psl_ctx_t *
|
const psl_ctx_t *
|
||||||
psl_builtin(void);
|
psl_builtin(void);
|
||||||
|
|
||||||
/* retrieves most recent PSL data */
|
/* retrieves most recent PSL data */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
psl_ctx_t *
|
psl_ctx_t *
|
||||||
psl_latest(const char *fname);
|
psl_latest(const char *fname);
|
||||||
|
|
||||||
/* checks whether domain is a public suffix or not */
|
/* checks whether domain is a public suffix or not */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
int
|
int
|
||||||
psl_is_public_suffix(const psl_ctx_t *psl, const char *domain);
|
psl_is_public_suffix(const psl_ctx_t *psl, const char *domain);
|
||||||
|
|
||||||
/* checks whether domain is a public suffix regarding the type or not */
|
/* checks whether domain is a public suffix regarding the type or not */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
int
|
int
|
||||||
psl_is_public_suffix2(const psl_ctx_t *psl, const char *domain, int type);
|
psl_is_public_suffix2(const psl_ctx_t *psl, const char *domain, int type);
|
||||||
|
|
||||||
/* checks whether cookie_domain is acceptable for domain or not */
|
/* checks whether cookie_domain is acceptable for domain or not */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
int
|
int
|
||||||
psl_is_cookie_domain_acceptable(const psl_ctx_t *psl, const char *hostname, const char *cookie_domain);
|
psl_is_cookie_domain_acceptable(const psl_ctx_t *psl, const char *hostname, const char *cookie_domain);
|
||||||
|
|
||||||
/* returns the longest not registrable domain within 'domain' or NULL if none found */
|
/* returns the longest not registrable domain within 'domain' or NULL if none found */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
const char *
|
const char *
|
||||||
psl_unregistrable_domain(const psl_ctx_t *psl, const char *domain);
|
psl_unregistrable_domain(const psl_ctx_t *psl, const char *domain);
|
||||||
|
|
||||||
/* returns the shortest possible registrable domain part or NULL if domain is not registrable at all */
|
/* returns the shortest possible registrable domain part or NULL if domain is not registrable at all */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
const char *
|
const char *
|
||||||
psl_registrable_domain(const psl_ctx_t *psl, const char *domain);
|
psl_registrable_domain(const psl_ctx_t *psl, const char *domain);
|
||||||
|
|
||||||
/* convert a string into lowercase UTF-8 */
|
/* convert a string into lowercase UTF-8 */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
psl_error_t
|
psl_error_t
|
||||||
psl_str_to_utf8lower(const char *str, const char *encoding, const char *locale, char **lower);
|
psl_str_to_utf8lower(const char *str, const char *encoding, const char *locale, char **lower);
|
||||||
|
|
||||||
/* does not include exceptions */
|
/* does not include exceptions */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
int
|
int
|
||||||
psl_suffix_count(const psl_ctx_t *psl);
|
psl_suffix_count(const psl_ctx_t *psl);
|
||||||
|
|
||||||
/* just counts exceptions */
|
/* just counts exceptions */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
int
|
int
|
||||||
psl_suffix_exception_count(const psl_ctx_t *psl);
|
psl_suffix_exception_count(const psl_ctx_t *psl);
|
||||||
|
|
||||||
/* just counts wildcards */
|
/* just counts wildcards */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
int
|
int
|
||||||
psl_suffix_wildcard_count(const psl_ctx_t *psl);
|
psl_suffix_wildcard_count(const psl_ctx_t *psl);
|
||||||
|
|
||||||
/* returns mtime of PSL source file */
|
/* returns mtime of PSL source file */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
time_t
|
time_t
|
||||||
psl_builtin_file_time(void);
|
psl_builtin_file_time(void);
|
||||||
|
|
||||||
/* returns SHA1 checksum (hex-encoded, lowercase) of PSL source file */
|
/* returns SHA1 checksum (hex-encoded, lowercase) of PSL source file */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
const char *
|
const char *
|
||||||
psl_builtin_sha1sum(void);
|
psl_builtin_sha1sum(void);
|
||||||
|
|
||||||
/* returns file name of PSL source file */
|
/* returns file name of PSL source file */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
const char *
|
const char *
|
||||||
psl_builtin_filename(void);
|
psl_builtin_filename(void);
|
||||||
|
|
||||||
/* returns name of distribution PSL data file */
|
/* returns name of distribution PSL data file */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
const char *
|
const char *
|
||||||
psl_dist_filename(void);
|
psl_dist_filename(void);
|
||||||
|
|
||||||
/* returns library version string */
|
/* returns library version string */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
const char *
|
const char *
|
||||||
psl_get_version(void);
|
psl_get_version(void);
|
||||||
|
|
||||||
/* checks library version number */
|
/* checks library version number */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
int
|
int
|
||||||
psl_check_version_number(int version);
|
psl_check_version_number(int version);
|
||||||
|
|
||||||
/* returns whether the built-in data is outdated or not */
|
/* returns whether the built-in data is outdated or not */
|
||||||
PSL_PUBLIC
|
PSL_API
|
||||||
int
|
int
|
||||||
psl_builtin_outdated(void);
|
psl_builtin_outdated(void);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,9 @@ CLEANFILES = suffixes_dafsa.c
|
||||||
lib_LTLIBRARIES = libpsl.la
|
lib_LTLIBRARIES = libpsl.la
|
||||||
|
|
||||||
libpsl_la_SOURCES = psl.c lookup_string_in_fixed_set.c
|
libpsl_la_SOURCES = psl.c lookup_string_in_fixed_set.c
|
||||||
libpsl_la_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -DPSL_DISTFILE=\"$(PSL_DISTFILE)\"
|
libpsl_la_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -DPSL_DISTFILE=\"$(PSL_DISTFILE)\" \
|
||||||
|
$(CFLAG_VISIBILITY) -DBUILDING_PSL
|
||||||
|
|
||||||
# include ABI version information
|
# include ABI version information
|
||||||
libpsl_la_LDFLAGS = -version-info $(LIBPSL_SO_VERSION)
|
libpsl_la_LDFLAGS = -version-info $(LIBPSL_SO_VERSION)
|
||||||
if WITH_LIBICU
|
if WITH_LIBICU
|
||||||
|
|
Loading…
Reference in New Issue