C library for the Public Suffix List
Go to file
Daniel Kahn Gillmor 9883a5af6d Release v0.8.0
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCgAGBQJVw3EoAAoJEAgwLbaiZwQovbwQAKmQA8xrnTau05LUyyffyi1Q
 qKNMqXQFKeAJWfJ0tYCHi0vh6wLRUDPL/Xxa4DUoN5Lj8KsHqQOPGk41iScRm6ff
 xSGYzMxznQOcS9rhq+VcwHq/JvEPk9KDKH9gctJNdPQqY4uVfP+Vd7vxCuJZXeRK
 rj7oTVmojzLjWj2MYG1qJJD+EZroRiMFfbNplLZL7547Q1YJ30tcrs8zyqRIm7UI
 YeThQc4MutXG9TvPX+Bja+HWYWg4aKBddLpnmjfF/7gkQGASbCPvvVRflIDK6y13
 mfDgpF3C5/j4Zp5D3W9KlgRKAZH4zUuKh5Yv03TgEZBqSd8+M7kMP57qMcLIrmOt
 3HQY/als0Ct7BBS5XeE+PmzeX6njJ/GYjTghzOIlo1hKFXvqMtSFVwFDfsCuKiGq
 2v6+537oRmTnSNCjQR+n/gswV4SjmAf2yHnEJ/sNtRUQyDSG/2Zca5v4Q0E41oWv
 ys1BNGKG3SOb+pQG5UwzcS88rk1PrP6C4fMz/Y8KSIfkGHoQNA7FC6VqaskwtvMV
 DdtM3CICGyrG59DdFW4Tehyx6DbKgYR97EQtuSbGYw+/1tMM61bzh6eYOWpXCrkr
 Gk48/fhTsMVqXUg42J5WMtoxNp2EWJ0dfj9pXTrSLFYneAm2BI57XZ7sPCtzLkO+
 2iEa7H1VnNzWzARvcTOd
 =/73c
 -----END PGP SIGNATURE-----

Merge tag 'libpsl-0.8.0' into debian

Release v0.8.0
2015-08-06 15:48:31 -04:00
contrib Add contrib/check-hard to test configure options 2015-08-06 13:23:38 +02:00
debian use autogen.sh directly instead of relying on dh_autoreconf to guess the right thing. 2015-07-12 16:15:37 -04:00
docs/libpsl fixed docs for 'make distcheck' after 'make clean' 2015-01-21 17:02:27 +01:00
include fixed typos in comments 2014-07-07 11:45:24 +02:00
list@f1c4849aef Add https://github.com/publicsuffix as git submodule 2015-07-14 13:25:42 +02:00
po autoconf first version 2014-03-20 22:43:04 +01:00
src src/psl.c: Fix C99 comment to C89 2015-08-06 12:31:21 +02:00
tests Add https://github.com/publicsuffix as git submodule 2015-07-14 13:25:42 +02:00
tools added code for all of runtime and builtin options 2014-06-30 13:21:16 +02:00
.dir-locals.el document indentation conventions for emacs users 2014-03-21 14:39:17 -04:00
.gitignore Brush up .gitignore 2015-08-06 13:21:57 +02:00
.gitmodules Add https://github.com/publicsuffix as git submodule 2015-07-14 13:25:42 +02:00
.travis.yml fixed libidn package names in .travis.yml 2014-06-30 14:49:22 +02:00
ABOUT-NLS autoconf first version 2014-03-20 22:43:04 +01:00
AUTHORS Release v0.8.0 2015-08-06 16:35:16 +02:00
COPYING fixed authors name to UTF-8 2014-06-27 09:54:32 +02:00
LICENSE fixed authors name to UTF-8 2014-06-27 09:54:32 +02:00
Makefile.am Add https://github.com/publicsuffix as git submodule 2015-07-14 13:25:42 +02:00
NEWS Release v0.8.0 2015-08-06 16:35:16 +02:00
README inital commit 2014-03-20 17:17:24 +01:00
README.md Release V0.3.0 2014-06-05 16:29:20 +02:00
autogen.sh Add https://github.com/publicsuffix as git submodule 2015-07-14 13:25:42 +02:00
configure.ac Release v0.8.0 2015-08-06 16:35:16 +02:00
libpsl.pc.in Fixed pkg-config file 2014-11-14 11:40:29 +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
  • handles IDNA2008 UTS#46 (libicu is used by psl2c if installed)

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.