diff --git a/api-index-full.html b/api-index-full.html index d840788..b9eeef6 100644 --- a/api-index-full.html +++ b/api-index-full.html @@ -17,8 +17,12 @@  |  C  |  + E +  |  F  |  + G +  |  I  |  L @@ -62,11 +66,21 @@ psl_ctx_t, typedef in Public Suffix List functions
+

E

+
+psl_error_t, enum in Public Suffix List functions +
+

F

psl_free, function in Public Suffix List functions
+

G

+
+psl_get_version, function in Public Suffix List functions +
+

I

psl_is_cookie_domain_acceptable, function in Public Suffix List functions @@ -92,6 +106,10 @@

S

+psl_str_to_utf8lower, function in Public Suffix List functions +
+
+
psl_suffix_count, function in Public Suffix List functions
diff --git a/index.html b/index.html index 083d73f..a440f06 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,7 @@

- for Libpsl 0.2.1 + for Libpsl 0.4.0 . The latest version of this documentation can be found on-line at GitHub. diff --git a/index.sgml b/index.sgml index 7825391..8ea2118 100644 --- a/index.sgml +++ b/index.sgml @@ -21,5 +21,8 @@ + + + diff --git a/libpsl-Public-Suffix-List-functions.html b/libpsl-Public-Suffix-List-functions.html index ae276a2..1a4e290 100644 --- a/libpsl-Public-Suffix-List-functions.html +++ b/libpsl-Public-Suffix-List-functions.html @@ -151,6 +151,21 @@ Unstable, unless otherwise indicated psl_is_cookie_domain_acceptable () + +const char * + + +psl_get_version () + + + + +int + + +psl_str_to_utf8lower () + +

@@ -161,10 +176,16 @@ Unstable, unless otherwise indicated - + + +enum +psl_error_t + + typedef psl_ctx_t - + +
@@ -190,14 +211,9 @@ psl_load_file (const char

This function loads the public suffixes file named fname . To free the allocated resources, call psl_free().

-

If you want to use punycode representations for functions like psl_is_public_suffix(), -these have to exist as entries within fname -. This is a design decision to not pull in -dependencies for UTF-8 case-handling and IDNA libraries.

-

On the contrary, the builtin data already contains punycode entries.

-

Have a look into psl2c.c for example code on how to convert UTF-8 to lowercase and to punycode.

+

The suffixes are expected to be lowercase UTF-8 encoded if they are international.

-

Parameters

+

Parameters

@@ -212,7 +228,7 @@ dependencies for UTF-8 case-handling and IDNA libraries.

-

Returns

+

Returns

Pointer to a PSL context or NULL on failure.

@@ -225,7 +241,7 @@ dependencies for UTF-8 case-handling and IDNA libraries.

psl_load_fp (FILE *fp);

This function loads the public suffixes from a FILE pointer. To free the allocated resources, call psl_free().

-

Have a look at psl_load_fp() for punycode considerations.

+

The suffixes are expected to be lowercase UTF-8 encoded if they are international.

Parameters

@@ -282,11 +298,14 @@ psl_is_public_suffix (const Mozilla Public Suffix List.

For cookie domain checking see psl_is_cookie_domain_acceptable().

+

International domain + names have to be either in lowercase UTF-8 or in ASCII form (punycode). +Other encodings result in unexpected behavior.

psl is a context returned by either psl_load_file(), psl_load_fp() or psl_builtin().

-

Parameters

+

Parameters

@@ -308,7 +327,7 @@ psl_is_public_suffix (const -

Returns

+

Returns

1 if domain is a public suffix, 0 if not.

@@ -323,11 +342,14 @@ psl_unregistrable_domain (const This function finds the longest publix suffix part of domain by the means of the Mozilla Public Suffix List.

+

International domain + names have to be either in lowercase UTF-8 or in ASCII form (punycode). +Other encodings result in unexpected behavior.

psl is a context returned by either psl_load_file(), psl_load_fp() or psl_builtin().

-

Parameters

+

Parameters

@@ -349,7 +371,7 @@ of the Mozilla Pub
-

Returns

+

Returns

Pointer to longest public suffix part of domain or NULL if domain does not contain a public suffix (or if psl @@ -367,11 +389,14 @@ psl_registrable_domain (const domain by the means of the Mozilla Public Suffix List.

+

International domain + names have to be either in lowercase UTF-8 or in ASCII form (punycode). +Other encodings result in unexpected behavior.

psl is a context returned by either psl_load_file(), psl_load_fp() or psl_builtin().

-

Parameters

+

Parameters

@@ -393,7 +418,7 @@ of the Mozilla Pub
-

Returns

+

Returns

Pointer to shortest private suffix part of domain or NULL if domain does not contain a private suffix (or if psl @@ -531,6 +556,10 @@ psl_is_cookie_domain_acceptable (const hostname .

+

For international domain names both, hostname + and cookie_domain +, have to be either in lowercase UTF-8 +or in ASCII form (punycode). Other encodings or mixing UTF-8 and punycode result in unexpected behavior.

Examples:

  1. Cookie domain 'example.com' would be acceptable for hostname 'www.example.com', @@ -539,7 +568,7 @@ but '.com' or 'com' would NOT be acceptable since 'com' is a public suffix.

    < but NOT for 'forgot.his.name' since 'forgot.his.name' is a public suffix.

-

Parameters

+

Parameters

@@ -566,16 +595,152 @@ but NOT for 'forgot.his.name' since 'forgot.his.name' is a public suffix.

-

Returns

+

Returns

1 if acceptable, 0 if not acceptable.

Since 0.1

+
+
+

psl_get_version ()

+
const char *
+psl_get_version (void);
+

Get libpsl version.

+
+

Returns

+

String containing version of libpsl.

+

+
+

Since 0.2.5

+
+
+
+

psl_str_to_utf8lower ()

+
int
+psl_str_to_utf8lower (const char *str,
+                      const char *encoding,
+                      const char *locale,
+                      char **lower);
+

This helper function converts a string to lowercase UTF-8 representation. +Lowercase UTF-8 is needed as input to the domain checking functions.

+

lower + is NULL on error. +The return value 'lower' must be freed after usage.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

str

string to convert

 

encoding

charset encoding of str +, e.g. 'iso-8859-1' or NULL

 

locale

locale of str +for to lowercase conversion, e.g. 'de' or NULL

 

lower

return value containing the converted string

 
+
+
+

Returns

+

psl_error_t value. +PSL_SUCCESS: Success +PSL_ERR_INVALID_ARG: str +is a NULL value. +PSL_ERR_CONVERTER: Failed to open the unicode converter with name encoding +PSL_ERR_TO_UTF16: Failed to convert str +to unicode +PSL_ERR_TO_LOWER: Failed to convert unicode to lowercase +PSL_ERR_TO_UTF8: Failed to convert unicode to UTF-8

+

+
+

Since 0.4

+

Types and Values

+

enum psl_error_t

+

Return codes for PSL functions. +Negative return codes mean failure. +Positive values are reserved for non-error return codes.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

PSL_SUCCESS

+

Successful return.

+
 

PSL_ERR_INVALID_ARG

+

Invalid argument.

+
 

PSL_ERR_CONVERTER

+

Failed to open libicu utf-16 converter

+
 

PSL_ERR_TO_UTF16

+

Failed to convert to utf-16.

+
 

PSL_ERR_TO_LOWER

+

Failed to convert utf-16 to lowercase.

+
 

PSL_ERR_TO_UTF8

+

Failed to convert utf-16 to utf-8.

+
 
+
+
+
+

psl_ctx_t

typedef struct _psl_ctx_st psl_ctx_t;
 
diff --git a/libpsl.devhelp2 b/libpsl.devhelp2 index 4de325b..92973fb 100644 --- a/libpsl.devhelp2 +++ b/libpsl.devhelp2 @@ -24,6 +24,9 @@ + + +