Chapter 3. Preparation

To use `Libidn', you have to perform some changes to your sources and the build system. The necessary changes are small and explained in the following sections. At the end of this chapter, it is described how the library is initialized, and how the requirements of the library are verified.

A faster way to find out how to adapt your application for use with `Libidn' may be to look at the examples at the end of this manual (Chapter 8).

3.1. Header

The library contains a few independent parts, and each part export the interfaces (data types and functions) in a header file. You must include the appropriate header files in all programs using the library, either directly or through some other header file, like this:

#include <stringprep.h>

The header files and the functions they define are categorized as follows:

stringprep.h

The low-level stringprep API entry point. For IDN applications, this is usually invoked via IDNA. Some applications, specifically non-IDN ones, may want to prepare strings directly though, and should include this header file.

The name space of the stringprep part of Libidn is stringprep* for function names, Stringprep* for data types and STRINGPREP_* for other symbols. In addition the same name prefixes with one prepended underscore are reserved for internal use and should never be used by an application.

punycode.h

The entry point to Punycode encoding and decoding functions. Normally punycode is used via the idna.h interface, but some application may want to perform raw punycode operations.

The name space of the punycode part of Libidn is punycode_* for function names, Punycode* for data types and PUNYCODE_* for other symbols. In addition the same name prefixes with one prepended underscore are reserved for internal use and should never be used by an application.

idna.h

The entry point to the IDNA functions. This is the normal entry point for applications that need IDN functionality.

The name space of the IDNA part of Libidn is idna_* for function names, Idna* for data types and IDNA_* for other symbols. In addition the same name prefixes with one prepended underscore are reserved for internal use and should never be used by an application.