Product Information for Software Developers

The lid language identifier is a software library that provides an easy to use API, is thread-safe and has no software dependencies other than the system's standard C and thread library. As a result, you can integrate lid into C/C++ software projects both easily and quickly. The lack of dependencies allows to bundle lid with your own software product without the hassle of including other third party libraries as well.

lid is documented in detail in a German and an English manual. They describe every single step necessary: from installation of the library to the efficient usage of lid in software projects. The manuals are part of the lid software distribution, but are available for download in German and English as well.

A Minimal Introduction to lid's API

lid's API has been designed as simple and compact as possible using common C/C++ design patterns and practices as well.

You can access lid's functionality through two main functions that allow language and character encoding (charset) identification using either a string or file as source: lid_fstr(3) and lid_ffile(3). Both return a pointer to a lid_t data structure that provides the identified language, its ISO 639-3 code and the character encoding on success. Otherwise, a pointer to NULL is returned and the per-thread error indicator lid_errno is set to an appropriate error code that can be translated to a natural language error message using the function lid_strerror(3). Finally, any memory allocated by a lid_t data structure can be freed conveniently using lid_free(3).

Besides that, the functions lid_fwstr(3) and lid_fnstr(3) are provided to handle wide-character strings and those which may contain UTF-16 or UTF-32 encoded characters as input.

Source Code of a Minimal Application

The complete C source code of a minimal application, accompanied by explanations and exemplary output, is available in the EXAMPLES section of lid_ffile(3)'s man page.