C library for the Public Suffix List
Go to file
Tim Ruehsen 6d09d28e57 Release V0.2.3 2014-05-27 11:58:14 +02:00
data Updated to the latest PSL 2014-04-25 16:03:32 +02:00
docs/libpsl added version to HTML docs 2014-04-23 17:13:15 +02:00
include changed code to C89 standard 2014-05-12 12:20:59 +02:00
po autoconf first version 2014-03-20 22:43:04 +01:00
src use alloca instead of malloc for command buffer allocation 2014-05-12 12:27:32 +02:00
tests added special test cases '.', empty string, NULL, unknown TLD 2014-05-12 14:15:40 +02:00
tools changed code to C89 standard 2014-05-12 12:20:59 +02:00
.dir-locals.el document indentation conventions for emacs users 2014-03-21 14:39:17 -04:00
.gitignore git should ignore ephemeral files. 2014-03-21 14:19:25 -04:00
.travis.yml make distcheck non-parallel, -j4 fails 2014-04-16 13:00:43 +02:00
ABOUT-NLS autoconf first version 2014-03-20 22:43:04 +01:00
AUTHORS prepared for initial release 2014-04-25 12:36:59 +02:00
COPYING LGPL->MIT license, some cleanups 2014-03-24 20:41:46 +01:00
ChangeLog autoconf first version 2014-03-20 22:43:04 +01:00
LICENSE LGPL->MIT license, some cleanups 2014-03-24 20:41:46 +01:00
Makefile.am added a 'psl' tool to acces functions from command line 2014-04-11 17:16:23 +02:00
NEWS API version 0.2 less verbose 2014-05-27 11:57:45 +02:00
README inital commit 2014-03-20 17:17:24 +01:00
README.md updated README.md 2014-04-24 12:41:21 +02:00
autogen.sh create m4 directory before gtkdocize 2014-04-02 11:23:38 +02:00
configure.ac API version 0.2 less verbose 2014-05-27 11:57:45 +02:00
libpsl.pc.in autoconf first version 2014-03-20 22:43:04 +01:00

README.md

Build Status

libpsl - C library to handle the Public Suffix List

A "public suffix" is a domain name under which Internet users can directly register own names.

Browsers and other web clients can use it to

  • avoid privacy-leaking "supercookies"
  • avoid privacy-leaking "super domain" certificates (see post from Jeffry Walton)
  • domain highlighting parts of the domain in a user interface
  • sorting domain lists by site

Libpsl...

  • has built-in PSL data for fast access
  • allows to load PSL data from files
  • checks if a given domain is a "public suffix"
  • provides immediate cookie domain verification
  • finds the longest public part of a given domain
  • finds the shortest private part of a given domain
  • works with international domains (UTF-8 and IDNA2008 Punycode)
  • is thread-safe

Find more information about the Publix Suffix List here.

Download the Public Suffix List here.

API Documentation

You find the current API documentation here.

Quick API example

#include <stdio.h>
#include <libpsl.h>

int main(int argc, char **argv)
{
	const char *domain = "www.example.com";
	const char *cookie_domain = ".com";
	const psl_ctx_t *psl = psl_builtin();
	int is_public, is_acceptable;

	is_public = psl_is_public_suffix(psl, domain);
	printf("%s %s a public suffix.\n", domain, is_public ? "is" : "is not");

	is_acceptable = psl_is_cookie_domain_acceptable(psl, domain, cookie_domain);
	printf("cookie domain '%s' %s acceptable for domain '%s'.\n",
		cookie_domain, is_acceptable ? "is" : "is not", domain);

	return 0;
}

Command Line Tool

Libpsl comes with a tool 'psl' that gives you access to most of the library API via command line.

$ psl --help

prints the usage.

License

Libpsl is made available under the terms of the MIT license.
See the LICENSE file that accompanies this distribution for the full text of the license.

Building from git

Download project and prepare sources with

	git clone http://github.com/rockdaboot/libpsl
	./autogen.sh
	./configure
	make
	make check

Mailing List

Mailing List Archive

Mailing List

To join the mailing list send an email to

libpsl-bugs+subscribe@googlegroups.com

and follow the instructions provided by the answer mail.

Or click join.