liblouis: Overview (library)
1
1 6.2 Overview
1 ============
1
1 You use the liblouis library by calling the following functions,
1 'lou_translateString', 'lou_backTranslateString',
1 'lou_registerLogCallback', 'lou_setLogLevel', 'lou_logFile',
1 'lou_logPrint', 'lou_logEnd', 'lou_getTable', 'lou_translate',
1 'lou_backTranslate', 'lou_hyphenate', 'lou_charToDots',
1 'lou_dotsToChar', 'lou_compileString', 'lou_readCharFromFile',
1 'lou_version' and 'lou_free'. These are described below. The header
1 file, 'liblouis.h', also contains brief descriptions. Liblouis is
1 written in straight C. It has four code modules,
1 'compileTranslationTable.c', 'logging.c', 'lou_translateString.c' and
1 'lou_backTranslateString.c'. In addition, there are two header files,
1 'liblouis.h', which defines the API, and 'louis.h', used only internally
1 and by liblouisutdml. The latter includes 'liblouis.h'.
1
1 Persons who wish to use liblouis from Python may want to skip ahead
1 to ⇒Python bindings.
1
1 'compileTranslationTable.c' keeps track of all translation tables
1 which an application has used. It is called by the translation,
1 hyphenation and checking functions when they start. If a table has not
1 yet been compiled 'compileTranslationTable.c' checks it for correctness
1 and compiles it into an efficient internal representation. The main
1 entry point is 'lou_getTable'. Since it is the module that keeps track
1 of memory usage, it also contains the 'lou_free' function. In addition,
1 it contains the 'lou_registerLogCallback', 'lou_setLogLevel',
1 'lou_logFile', 'lou_logPrint' and 'lou_logEnd' functions, plus some
1 utility functions which are used by the other modules.
1
1 By default, liblouis handles all characters internally as 16-bit
1 unsigned integers. It can be compiled for 32-bit characters as
1 explained below. The meanings of these integers are not hard-coded.
1 Rather they are defined by the character-definition opcodes. However,
1 the standard printable characters, from decimal 32 to 126 are recognized
1 for the purpose of processing the opcodes. Hence, the following
1 definition is included in 'liblouis.h'. It is correct for computers
1 with at least 32-bit processors.
1
1 #define widechar unsigned short int
1
1 To make liblouis handle 32-bit Unicode simply remove the word 'short'
1 in the above 'define'. This will cause the translate and back-translate
1 functions to expect input in 32-bit form and to deliver their output in
1 this form. The input to the compiler (tables) is unaffected except that
1 two new escape sequences for 20-bit and 32-bit characters are
1 recognized.
1
1 Here are the definitions of the eleven liblouis functions and their
1 parameters. They are given in terms of 16-bit Unicode. If liblouis has
1 been compiled for 32-bit Unicode simply read 32 instead of 16.
1