1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/* automatically generated by rust-bindgen */

pub const EMPH_NAME_BOLD : & 'static [ u8 ; 5usize ] = b"bold\0" ; pub const EMPH_NAME_ITALIC : & 'static [ u8 ; 7usize ] = b"italic\0" ; pub const EMPH_NAME_UNDERLINE : & 'static [ u8 ; 10usize ] = b"underline\0" ; pub type widechar = :: std :: os :: raw :: c_uint ; pub type formtype = :: std :: os :: raw :: c_ushort ; pub const typeforms_plain_text : typeforms = 0 ; pub const typeforms_emph_1 : typeforms = 1 ; pub const typeforms_emph_2 : typeforms = 2 ; pub const typeforms_emph_3 : typeforms = 4 ; pub const typeforms_emph_4 : typeforms = 8 ; pub const typeforms_emph_5 : typeforms = 16 ; pub const typeforms_emph_6 : typeforms = 32 ; pub const typeforms_emph_7 : typeforms = 64 ; pub const typeforms_emph_8 : typeforms = 128 ; pub const typeforms_emph_9 : typeforms = 256 ; pub const typeforms_emph_10 : typeforms = 512 ; pub const typeforms_computer_braille : typeforms = 1024 ; pub const typeforms_no_translate : typeforms = 2048 ; pub const typeforms_no_contract : typeforms = 4096 ; pub type typeforms = u32 ; pub const translationModes_noContractions : translationModes = 1 ; pub const translationModes_compbrlAtCursor : translationModes = 2 ; pub const translationModes_dotsIO : translationModes = 4 ; pub const translationModes_pass1Only : translationModes = 16 ; pub const translationModes_compbrlLeftCursor : translationModes = 32 ; pub const translationModes_ucBrl : translationModes = 64 ; pub const translationModes_noUndefinedDots : translationModes = 128 ; pub const translationModes_partialTrans : translationModes = 256 ; pub type translationModes = u32 ; extern "C" { pub fn lou_version ( ) -> * mut :: std :: os :: raw :: c_char ; } extern "C" { 
 /// Return the size of widechar 
 pub fn lou_charSize ( ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn lou_translateString ( tableList : * const :: std :: os :: raw :: c_char , inbuf : * const widechar , inlen : * mut :: std :: os :: raw :: c_int , outbuf : * mut widechar , outlen : * mut :: std :: os :: raw :: c_int , typeform : * mut formtype , spacing : * mut :: std :: os :: raw :: c_char , mode : :: std :: os :: raw :: c_int ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn lou_translate ( tableList : * const :: std :: os :: raw :: c_char , inbuf : * const widechar , inlen : * mut :: std :: os :: raw :: c_int , outbuf : * mut widechar , outlen : * mut :: std :: os :: raw :: c_int , typeform : * mut formtype , spacing : * mut :: std :: os :: raw :: c_char , outputPos : * mut :: std :: os :: raw :: c_int , inputPos : * mut :: std :: os :: raw :: c_int , cursorPos : * mut :: std :: os :: raw :: c_int , mode : :: std :: os :: raw :: c_int ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn lou_translatePrehyphenated ( tableList : * const :: std :: os :: raw :: c_char , inbuf : * const widechar , inlen : * mut :: std :: os :: raw :: c_int , outbuf : * mut widechar , outlen : * mut :: std :: os :: raw :: c_int , typeform : * mut formtype , spacing : * mut :: std :: os :: raw :: c_char , outputPos : * mut :: std :: os :: raw :: c_int , inputPos : * mut :: std :: os :: raw :: c_int , cursorPos : * mut :: std :: os :: raw :: c_int , inputHyphens : * mut :: std :: os :: raw :: c_char , outputHyphens : * mut :: std :: os :: raw :: c_char , mode : :: std :: os :: raw :: c_int ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn lou_hyphenate ( tableList : * const :: std :: os :: raw :: c_char , inbuf : * const widechar , inlen : :: std :: os :: raw :: c_int , hyphens : * mut :: std :: os :: raw :: c_char , mode : :: std :: os :: raw :: c_int ) -> :: std :: os :: raw :: c_int ; } extern "C" { 
 /// Convert a string of dot patterns to a string of chars
///
/// @param[in]  tableList comma separated list of braille tables
/// @param[in]  inbuf widechar string of dot patterns, either in liblouis format or Unicode
/// braille
/// @param[out] outbuf widechar string corresponding to the dot patterns in `inbuf`
/// @param[in,out] length of both `inbuf` and `outbuf`
/// @param[in] mode (deprecated)
///
/// @return 1 on success and 0 on failure. 
 pub fn lou_dotsToChar ( tableList : * const :: std :: os :: raw :: c_char , inbuf : * mut widechar , outbuf : * mut widechar , length : :: std :: os :: raw :: c_int , mode : :: std :: os :: raw :: c_int ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn lou_charToDots ( tableList : * const :: std :: os :: raw :: c_char , inbuf : * const widechar , outbuf : * mut widechar , length : :: std :: os :: raw :: c_int , mode : :: std :: os :: raw :: c_int ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn lou_backTranslateString ( tableList : * const :: std :: os :: raw :: c_char , inbuf : * const widechar , inlen : * mut :: std :: os :: raw :: c_int , outbuf : * mut widechar , outlen : * mut :: std :: os :: raw :: c_int , typeform : * mut formtype , spacing : * mut :: std :: os :: raw :: c_char , mode : :: std :: os :: raw :: c_int ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn lou_backTranslate ( tableList : * const :: std :: os :: raw :: c_char , inbuf : * const widechar , inlen : * mut :: std :: os :: raw :: c_int , outbuf : * mut widechar , outlen : * mut :: std :: os :: raw :: c_int , typeform : * mut formtype , spacing : * mut :: std :: os :: raw :: c_char , outputPos : * mut :: std :: os :: raw :: c_int , inputPos : * mut :: std :: os :: raw :: c_int , cursorPos : * mut :: std :: os :: raw :: c_int , mode : :: std :: os :: raw :: c_int ) -> :: std :: os :: raw :: c_int ; } extern "C" { 
 /// Print error messages to a file
///
/// @deprecated As of 2.6.0, applications using liblouis should
/// implement their own logging system. 
 pub fn lou_logPrint ( format : * const :: std :: os :: raw :: c_char , ... ) ; } extern "C" { 
 /// Specify the name of the file to be used by lou_logPrint.
///
/// If it is not used, this file is stderr
///
/// @deprecated As of 2.6.0, applications using liblouis should
/// implement their own logging system. 
 pub fn lou_logFile ( filename : * const :: std :: os :: raw :: c_char ) ; } extern "C" { 
 /// Read a character from a file, whether big-encian, little-endian or ASCII8
///
/// and return it as an integer. EOF at end of file. Mode = 1 on first
/// call, any other value thereafter 
 pub fn lou_readCharFromFile ( fileName : * const :: std :: os :: raw :: c_char , mode : * mut :: std :: os :: raw :: c_int ) -> :: std :: os :: raw :: c_int ; } extern "C" { 
 /// Close the log file so it can be read by other functions.
///
/// @deprecated As of 2.6.0, applications using liblouis should
/// implement their own logging system. 
 pub fn lou_logEnd ( ) ; } extern "C" { 
 /// Load and compile a translation table
///
/// Check the table for errors. If none are found load the table into
/// memory and return a pointer to it. If errors are found return a
/// null pointer. It is called by lou_translateString() and
/// lou_backTranslateString() and also by functions in liblouisutdml
/// and by the tools. 
 pub fn lou_getTable ( tableList : * const :: std :: os :: raw :: c_char ) -> * mut :: std :: os :: raw :: c_void ; } extern "C" { 
 /// Check a translation table for errors.
///
/// If no errors are found it load the table into memory and returns a
/// non-zero value. Else the return value is 0. 
 pub fn lou_checkTable ( tableList : * const :: std :: os :: raw :: c_char ) -> :: std :: os :: raw :: c_int ; } extern "C" { 
 /// Register a new table resolver. Overrides the default resolver. 
 pub fn lou_registerTableResolver ( resolver : :: std :: option :: Option < unsafe extern "C" fn ( table : * const :: std :: os :: raw :: c_char , base : * const :: std :: os :: raw :: c_char ) -> * mut * mut :: std :: os :: raw :: c_char > ) ; } extern "C" { 
 /// Compile a table entry on the fly at run-time
///
/// This function enables you to compile a table entry on the fly at
/// run-time. The new entry is added to tableList and remains in
/// force until lou_free() is called. If tableList has not
/// previously been loaded it is loaded and compiled.
///
/// @param inString contains the table entry to be added. It may be
/// anything valid. Error messages will be produced if it is invalid.
///
/// @return 1 on success and 0 on failure. 
 pub fn lou_compileString ( tableList : * const :: std :: os :: raw :: c_char , inString : * const :: std :: os :: raw :: c_char ) -> :: std :: os :: raw :: c_int ; } extern "C" { 
 /// Get the typeform bit for the named emphasis class.
///
/// If the table defines the specified emphasis class the corresponding
/// typeform is returned. Else the return value is 0. 
 pub fn lou_getTypeformForEmphClass ( tableList : * const :: std :: os :: raw :: c_char , emphClass : * const :: std :: os :: raw :: c_char ) -> formtype ; } extern "C" { 
 /// Return the emphasis class names declared in tableList as a
/// NULL-terminated array of strings. The array is acquired with malloc()
/// and should be released with free(). The strings must not be released,
/// and are no longer valid after lou_free() has been called. 
 pub fn lou_getEmphClasses ( tableList : * const :: std :: os :: raw :: c_char ) -> * mut * const :: std :: os :: raw :: c_char ; } extern "C" { 
 /// Set the path used for searching for tables and liblouisutdml files.
///
/// Overrides the installation path. 
 pub fn lou_setDataPath ( path : * const :: std :: os :: raw :: c_char ) -> * mut :: std :: os :: raw :: c_char ; } extern "C" { 
 /// Get the path set in the previous function. 
 pub fn lou_getDataPath ( ) -> * mut :: std :: os :: raw :: c_char ; } pub const logLevels_LOG_ALL : logLevels = 0 ; pub const logLevels_LOG_DEBUG : logLevels = 10000 ; pub const logLevels_LOG_INFO : logLevels = 20000 ; pub const logLevels_LOG_WARN : logLevels = 30000 ; pub const logLevels_LOG_ERROR : logLevels = 40000 ; pub const logLevels_LOG_FATAL : logLevels = 50000 ; pub const logLevels_LOG_OFF : logLevels = 60000 ; pub type logLevels = u32 ; pub type logcallback = :: std :: option :: Option < unsafe extern "C" fn ( level : logLevels , message : * const :: std :: os :: raw :: c_char ) > ; extern "C" { 
 /// Register logging callbacks
/// Set to NULL for default callback. 
 pub fn lou_registerLogCallback ( callback : logcallback ) ; } extern "C" { 
 /// Set the level for logging callback to be called at 
 pub fn lou_setLogLevel ( level : logLevels ) ; } extern "C" { 
 /// Parse, analyze and index tables.
///
/// This function must be called prior to lou_findTable() and
/// lou_listTables(). Table names must be provided as a NULL-terminated
/// array of strings. Each table should resolve to exactly one file. An
/// error message is given when a table contains invalid or duplicate
/// metadata fields. 
 pub fn lou_indexTables ( tables : * mut * const :: std :: os :: raw :: c_char ) ; } extern "C" { 
 /// Find the best match for a query.
///
/// Returns the name of the table, or NULL when no match can be
/// found. If lou_indexTables() has not been previously called, the
/// table search path specified with LOUIS_TABLEPATH will be indexed
/// first. An error message is given when the query is invalid. Freeing
/// the memory of the returned string is the responsibility of the
/// caller. 
 pub fn lou_findTable ( query : * const :: std :: os :: raw :: c_char ) -> * mut :: std :: os :: raw :: c_char ; } extern "C" { 
 /// Find all matches for a query, best match first.
///
/// Returns the names of the matched table as a NULL-terminated array
/// of string. If lou_indexTables() has not been previously called, the
/// table search path specified with LOUIS_TABLEPATH will be indexed
/// first. An error message is given when the query is invalid. Freeing
/// the memory of the returned array and strings is the responsibility
/// of the caller. 
 pub fn lou_findTables ( query : * const :: std :: os :: raw :: c_char ) -> * mut * mut :: std :: os :: raw :: c_char ; } extern "C" { 
 /// Read metadata from a file.
///
/// Returns the value of the metadata field specified by `key' in
/// `table', or NULL when the field does not exist. Freeing the memory
/// of the returned string is the responsibility of the caller. 
 pub fn lou_getTableInfo ( table : * const :: std :: os :: raw :: c_char , key : * const :: std :: os :: raw :: c_char ) -> * const :: std :: os :: raw :: c_char ; } extern "C" { 
 /// List available tables.
///
/// Returns the names of available tables as a NULL-terminated array of
/// strings. Only tables that are discoverable, i.e. the have active
/// metadata, are listed. If lou_indexTables() has not been previously
/// called, the table search path specified with LOUIS_TABLEPATH will
/// be indexed first. Freeing the memory of the returned array and
/// strings is the responsibility of the caller. 
 pub fn lou_listTables ( ) -> * mut * const :: std :: os :: raw :: c_char ; } extern "C" { 
 /// Free all memory allocated by liblouis.
///
/// This function should be called at the end of the application to
/// free all memory allocated by liblouis. 
 pub fn lou_free ( ) ; }