libtld: Main Page

The libtld project is a library that gives you the capability to determine the TLD part of any Internet URI.

The library takes a URI string and a tld_info structure. The library then computes the position where the TLD starts in your URI.

The only function offered by the library is tld().

All the other functions in this library are private or part of a test.

Programmers & Maintainers

If you want to work on the library, there are certainly things to enhance. We could for example offer more offsets in the info string, or functions to clearly define each part of the URI.

However, the most important part of this library is the XML file which defines all the TLDs. Maintaining that file is what will help the most. It includes all the TLDs known at this point (as defined in different places such as Wikipedia and each different authority in that area.) The file is easy to read so you can easily find whether your extension is defined and if not you can let us know.

Library Requirements

The library doesn't need anything special. It's one C function.

To compile the library, you'll need CMake, a C++ compile for the parser that makes use of QtXml and QtCore (Qt4). The QtXml library is used to parse the XML file (tld_data.xml).

To regenerate the documentation we use Doxygen. It is optional.

Tests Coming with the Library

We have the following tests at this time:

This test checks the tld() function as end users of the library. It checks all the existing TLDs, a few unknown TLDs, and invalid TLDs.
This test includes the tld.c directly so it can check each internal function directly. This test checks the cmp() and search() functions, with full coverage.

This document is part of the libtld Project.

Copyright by Made to Order Software Corp.

Syndicate content

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly