diff --git a/include/libpsl.h b/include/libpsl.h index 8bb4a74..706b1e8 100644 --- a/include/libpsl.h +++ b/include/libpsl.h @@ -34,24 +34,10 @@ #include #include -// Let C++ include C headers #ifdef __cplusplus -# define PSL_BEGIN_DECLS extern "C" { -# define PSL_END_DECLS } -#else -# define PSL_BEGIN_DECLS -# define PSL_END_DECLS +extern "C" { #endif -#if ENABLE_NLS != 0 -# include -# define _(STRING) gettext(STRING) -#else -# define _(STRING) STRING -# define ngettext(STRING1,STRING2,N) STRING2 -#endif - -PSL_BEGIN_DECLS typedef struct _psl_ctx_st psl_ctx_t; @@ -88,6 +74,8 @@ const char * psl_builtin_sha1sum(void); -PSL_END_DECLS +#ifdef __cplusplus +} +#endif #endif /* _LIBPSL_LIBPSL_H */ diff --git a/src/psl.c b/src/psl.c index 9374273..d1761eb 100644 --- a/src/psl.c +++ b/src/psl.c @@ -37,6 +37,14 @@ # include #endif +#if ENABLE_NLS != 0 +# include +# define _(STRING) gettext(STRING) +#else +# define _(STRING) STRING +# define ngettext(STRING1,STRING2,N) STRING2 +#endif + #include #include #include @@ -44,6 +52,17 @@ #include +/** + * SECTION:libpsl + * @short_description: Public Suffix List library functions + * @title: libpsl + * @stability: unstable + * @include: libpsl.h + * + * Public Suffix List library functions. + * + */ + #define countof(a) (sizeof(a)/sizeof(*(a))) typedef struct { @@ -75,6 +94,7 @@ struct _psl_ctx_st { *suffix_exceptions; }; +// include the PSL data compiled by 'psl2c' #include "suffixes.c" // references to this PSL will result in lookups to built-in data