liblouis-rb 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +520 -0
- data/README.md +100 -0
- data/Rakefile +80 -0
- data/ext/liblouis/braille_character.c +200 -0
- data/ext/liblouis/braille_table.c +198 -0
- data/ext/liblouis/braille_text.c +223 -0
- data/ext/liblouis/extconf.rb +73 -0
- data/ext/liblouis/liblouis.c +168 -0
- data/ext/liblouis/liblouis_ext.h +49 -0
- data/ext/liblouis/table_source.c +161 -0
- data/ext/liblouis/translation.c +443 -0
- data/liblouis-rb.gemspec +49 -0
- data/spec/liblouis_spec.rb +62 -0
- data/test/integration/packaging_test.rb +82 -0
- data/test/table_source_cases.rb +9 -0
- data/test/test_braille_character.rb +62 -0
- data/test/test_braille_table.rb +379 -0
- data/test/test_braille_text.rb +30 -0
- data/test/test_helper.rb +7 -0
- data/test/translation_cases.rb +33 -0
- data/vendor/liblouis/COPYING +674 -0
- data/vendor/liblouis/COPYING.LESSER +502 -0
- data/vendor/liblouis/configure.ac +290 -0
- data/vendor/liblouis/liblouis/commonTranslationFunctions.c +95 -0
- data/vendor/liblouis/liblouis/compileTranslationTable.c +5515 -0
- data/vendor/liblouis/liblouis/internal.h +781 -0
- data/vendor/liblouis/liblouis/liblouis.h.in +514 -0
- data/vendor/liblouis/liblouis/logging.c +233 -0
- data/vendor/liblouis/liblouis/lou_backTranslateString.c +1855 -0
- data/vendor/liblouis/liblouis/lou_translateString.c +4177 -0
- data/vendor/liblouis/liblouis/maketable.c +463 -0
- data/vendor/liblouis/liblouis/metadata.c +1258 -0
- data/vendor/liblouis/liblouis/pattern.c +1632 -0
- data/vendor/liblouis/liblouis/utils.c +448 -0
- data/vendor/liblouis/tables/Es-Es-G0.utb +248 -0
- data/vendor/liblouis/tables/IPA-unicode-range.uti +200 -0
- data/vendor/liblouis/tables/IPA.utb +164 -0
- data/vendor/liblouis/tables/Lv-Lv-g1.utb +509 -0
- data/vendor/liblouis/tables/Makefile.am +503 -0
- data/vendor/liblouis/tables/Pl-Pl-g1.utb +312 -0
- data/vendor/liblouis/tables/README +6 -0
- data/vendor/liblouis/tables/afr-za-g1.ctb +63 -0
- data/vendor/liblouis/tables/afr-za-g2.ctb +1050 -0
- data/vendor/liblouis/tables/akk-borger.utb +997 -0
- data/vendor/liblouis/tables/akk.utb +1002 -0
- data/vendor/liblouis/tables/ancient-languages-borger.utb +114 -0
- data/vendor/liblouis/tables/ancient-languages-us.utb +114 -0
- data/vendor/liblouis/tables/ar-ar-comp8.utb +293 -0
- data/vendor/liblouis/tables/ar-ar-g1-core.uti +291 -0
- data/vendor/liblouis/tables/ar-ar-g1.utb +26 -0
- data/vendor/liblouis/tables/ar-ar-g2.ctb +447 -0
- data/vendor/liblouis/tables/ar-ar-math.uti +501 -0
- data/vendor/liblouis/tables/ar.tbl +17 -0
- data/vendor/liblouis/tables/as-in-g1.utb +27 -0
- data/vendor/liblouis/tables/as.tbl +18 -0
- data/vendor/liblouis/tables/aw-in-g1.utb +27 -0
- data/vendor/liblouis/tables/awa.tbl +18 -0
- data/vendor/liblouis/tables/ba.utb +64 -0
- data/vendor/liblouis/tables/be-in-g1.utb +27 -0
- data/vendor/liblouis/tables/bel-comp.utb +42 -0
- data/vendor/liblouis/tables/bel-detailed.utb +32 -0
- data/vendor/liblouis/tables/bel.utb +61 -0
- data/vendor/liblouis/tables/bengali.cti +238 -0
- data/vendor/liblouis/tables/bg.ctb +215 -0
- data/vendor/liblouis/tables/bg.dis +84 -0
- data/vendor/liblouis/tables/bg.tbl +21 -0
- data/vendor/liblouis/tables/bg.utb +454 -0
- data/vendor/liblouis/tables/bh.ctb +24 -0
- data/vendor/liblouis/tables/bh.tbl +17 -0
- data/vendor/liblouis/tables/bn.tbl +18 -0
- data/vendor/liblouis/tables/bo.ctb +184 -0
- data/vendor/liblouis/tables/bo.tbl +21 -0
- data/vendor/liblouis/tables/boxes.ctb +162 -0
- data/vendor/liblouis/tables/br-in-g1.utb +27 -0
- data/vendor/liblouis/tables/bra.tbl +18 -0
- data/vendor/liblouis/tables/braille-patterns.cti +287 -0
- data/vendor/liblouis/tables/ca-chardefs.cti +225 -0
- data/vendor/liblouis/tables/ca-g1.ctb +46 -0
- data/vendor/liblouis/tables/ca.tbl +18 -0
- data/vendor/liblouis/tables/chr-us-g1.ctb +180 -0
- data/vendor/liblouis/tables/ckb-chardefs.cti +219 -0
- data/vendor/liblouis/tables/ckb-g1.ctb +31 -0
- data/vendor/liblouis/tables/ckb-translation.cti +131 -0
- data/vendor/liblouis/tables/ckb.tbl +18 -0
- data/vendor/liblouis/tables/compress.cti +44 -0
- data/vendor/liblouis/tables/controlchars.cti +27 -0
- data/vendor/liblouis/tables/cop-eg-comp8.utb +255 -0
- data/vendor/liblouis/tables/cop.utb +231 -0
- data/vendor/liblouis/tables/corrections.cti +47 -0
- data/vendor/liblouis/tables/countries.cti +263 -0
- data/vendor/liblouis/tables/critical-apparatus.uti +54 -0
- data/vendor/liblouis/tables/cs-chardefs.cti +385 -0
- data/vendor/liblouis/tables/cs-comp8.utb +405 -0
- data/vendor/liblouis/tables/cs-g1.ctb +37 -0
- data/vendor/liblouis/tables/cs-translation.cti +63 -0
- data/vendor/liblouis/tables/cs.tbl +20 -0
- data/vendor/liblouis/tables/cuneiform-transliterated-compact.utb +432 -0
- data/vendor/liblouis/tables/cuneiform-transliterated.utb +160 -0
- data/vendor/liblouis/tables/cy-cy-g1.utb +487 -0
- data/vendor/liblouis/tables/cy-cy-g2.ctb +199 -0
- data/vendor/liblouis/tables/cy.tbl +19 -0
- data/vendor/liblouis/tables/da-dk-6miscChars.cti +385 -0
- data/vendor/liblouis/tables/da-dk-6miscChars_1993.cti +412 -0
- data/vendor/liblouis/tables/da-dk-8miscChars.cti +90 -0
- data/vendor/liblouis/tables/da-dk-8miscChars_1993.cti +102 -0
- data/vendor/liblouis/tables/da-dk-g08.ctb +290 -0
- data/vendor/liblouis/tables/da-dk-g08_1993.ctb +331 -0
- data/vendor/liblouis/tables/da-dk-g16-lit_1993.ctb +294 -0
- data/vendor/liblouis/tables/da-dk-g16.ctb +289 -0
- data/vendor/liblouis/tables/da-dk-g16_1993.ctb +305 -0
- data/vendor/liblouis/tables/da-dk-g18.ctb +545 -0
- data/vendor/liblouis/tables/da-dk-g18_1993.ctb +563 -0
- data/vendor/liblouis/tables/da-dk-g2.dic +7439 -0
- data/vendor/liblouis/tables/da-dk-g26-lit_1993.ctb +898 -0
- data/vendor/liblouis/tables/da-dk-g26.ctb +1345 -0
- data/vendor/liblouis/tables/da-dk-g26_1993.ctb +1127 -0
- data/vendor/liblouis/tables/da-dk-g26l-lit_1993.ctb +588 -0
- data/vendor/liblouis/tables/da-dk-g26l_1993.ctb +604 -0
- data/vendor/liblouis/tables/da-dk-g28.ctb +2426 -0
- data/vendor/liblouis/tables/da-dk-g28_1993.ctb +2063 -0
- data/vendor/liblouis/tables/da-dk-g28l_1993.ctb +1594 -0
- data/vendor/liblouis/tables/da-dk-octobraille.dis +316 -0
- data/vendor/liblouis/tables/da-dk-octobraille_1993.dis +313 -0
- data/vendor/liblouis/tables/de-accents-detailed.cti +214 -0
- data/vendor/liblouis/tables/de-accents.cti +214 -0
- data/vendor/liblouis/tables/de-chardefs6.cti +289 -0
- data/vendor/liblouis/tables/de-chardefs8.cti +278 -0
- data/vendor/liblouis/tables/de-chess.ctb +37 -0
- data/vendor/liblouis/tables/de-comp6.utb +226 -0
- data/vendor/liblouis/tables/de-de-comp8.ctb +492 -0
- data/vendor/liblouis/tables/de-de.dis +331 -0
- data/vendor/liblouis/tables/de-eurobrl6.dis +101 -0
- data/vendor/liblouis/tables/de-eurobrl6u.dis +96 -0
- data/vendor/liblouis/tables/de-g0-core.uti +732 -0
- data/vendor/liblouis/tables/de-g0-detailed.utb +84 -0
- data/vendor/liblouis/tables/de-g0.utb +57 -0
- data/vendor/liblouis/tables/de-g1-core-patterns.dic +4863 -0
- data/vendor/liblouis/tables/de-g1-core.cti +67 -0
- data/vendor/liblouis/tables/de-g1-detailed.ctb +79 -0
- data/vendor/liblouis/tables/de-g1.ctb +54 -0
- data/vendor/liblouis/tables/de-g2-core-patterns.dic +26711 -0
- data/vendor/liblouis/tables/de-g2-core.cti +607 -0
- data/vendor/liblouis/tables/de-g2-detailed.ctb +60 -0
- data/vendor/liblouis/tables/de-g2.ctb +57 -0
- data/vendor/liblouis/tables/devanagari.cti +325 -0
- data/vendor/liblouis/tables/digits6Dots.uti +30 -0
- data/vendor/liblouis/tables/digits6DotsPlusDot6.uti +30 -0
- data/vendor/liblouis/tables/digits8Dots.uti +30 -0
- data/vendor/liblouis/tables/dra.ctb +23 -0
- data/vendor/liblouis/tables/dra.tbl +21 -0
- data/vendor/liblouis/tables/el.ctb +775 -0
- data/vendor/liblouis/tables/en-GB-g2.ctb +829 -0
- data/vendor/liblouis/tables/en-chardefs.cti +193 -0
- data/vendor/liblouis/tables/en-chess.ctb +37 -0
- data/vendor/liblouis/tables/en-g3-patterns.dic +11194 -0
- data/vendor/liblouis/tables/en-g3.ctb +2261 -0
- data/vendor/liblouis/tables/en-gb-comp8.ctb +282 -0
- data/vendor/liblouis/tables/en-gb-g1.utb +527 -0
- data/vendor/liblouis/tables/en-in-g1.ctb +162 -0
- data/vendor/liblouis/tables/en-nabcc.utb +166 -0
- data/vendor/liblouis/tables/en-nz-g1.utb +65 -0
- data/vendor/liblouis/tables/en-nz-g2.ctb +46 -0
- data/vendor/liblouis/tables/en-ueb-chardefs.uti +938 -0
- data/vendor/liblouis/tables/en-ueb-g1.ctb +167 -0
- data/vendor/liblouis/tables/en-ueb-g2.ctb +3925 -0
- data/vendor/liblouis/tables/en-ueb-math.ctb +71 -0
- data/vendor/liblouis/tables/en-us-brf.dis +102 -0
- data/vendor/liblouis/tables/en-us-comp6.ctb +149 -0
- data/vendor/liblouis/tables/en-us-comp8-ext.utb +626 -0
- data/vendor/liblouis/tables/en-us-comp8.ctb +62 -0
- data/vendor/liblouis/tables/en-us-compbrl.uti +69 -0
- data/vendor/liblouis/tables/en-us-emphasis.uti +45 -0
- data/vendor/liblouis/tables/en-us-g1.ctb +199 -0
- data/vendor/liblouis/tables/en-us-g2.ctb +1081 -0
- data/vendor/liblouis/tables/en-us-interline.ctb +1126 -0
- data/vendor/liblouis/tables/en-us-mathtext.ctb +880 -0
- data/vendor/liblouis/tables/en_CA.ctb +195 -0
- data/vendor/liblouis/tables/en_CA.tbl +21 -0
- data/vendor/liblouis/tables/en_GB.tbl +26 -0
- data/vendor/liblouis/tables/en_US-comp8-ext.tbl +15 -0
- data/vendor/liblouis/tables/en_US.tbl +26 -0
- data/vendor/liblouis/tables/eo-g1-x-system.ctb +85 -0
- data/vendor/liblouis/tables/eo-g1.ctb +165 -0
- data/vendor/liblouis/tables/eo.tbl +14 -0
- data/vendor/liblouis/tables/es-chardefs.cti +206 -0
- data/vendor/liblouis/tables/es-g1.ctb +36 -0
- data/vendor/liblouis/tables/es-g2.ctb +955 -0
- data/vendor/liblouis/tables/es-new.dis +284 -0
- data/vendor/liblouis/tables/es-no.utb +79 -0
- data/vendor/liblouis/tables/es-old.dis +284 -0
- data/vendor/liblouis/tables/es.tbl +19 -0
- data/vendor/liblouis/tables/et-6dot.utb +269 -0
- data/vendor/liblouis/tables/et-g0.utb +139 -0
- data/vendor/liblouis/tables/ethio-g1.ctb +335 -0
- data/vendor/liblouis/tables/eurodefs.cti +107 -0
- data/vendor/liblouis/tables/fa-ir-comp8.ctb +250 -0
- data/vendor/liblouis/tables/fa-ir-g1.utb +311 -0
- data/vendor/liblouis/tables/fi-fi-8dot.ctb +278 -0
- data/vendor/liblouis/tables/fi.utb +354 -0
- data/vendor/liblouis/tables/fil-g2.ctb +491 -0
- data/vendor/liblouis/tables/fr-bfu-comp6-puncs-math.uti +351 -0
- data/vendor/liblouis/tables/fr-bfu-comp6.utb +238 -0
- data/vendor/liblouis/tables/fr-bfu-comp68.cti +251 -0
- data/vendor/liblouis/tables/fr-bfu-comp8.utb +323 -0
- data/vendor/liblouis/tables/fr-bfu-g2.ctb +4644 -0
- data/vendor/liblouis/tables/ga-g1.utb +95 -0
- data/vendor/liblouis/tables/ga-g2.ctb +231 -0
- data/vendor/liblouis/tables/gd.ctb +123 -0
- data/vendor/liblouis/tables/gd.tbl +21 -0
- data/vendor/liblouis/tables/gez.tbl +21 -0
- data/vendor/liblouis/tables/gon.ctb +25 -0
- data/vendor/liblouis/tables/gon.tbl +17 -0
- data/vendor/liblouis/tables/gr-pl-comp8.uti +256 -0
- data/vendor/liblouis/tables/grc-international-common.uti +104 -0
- data/vendor/liblouis/tables/grc-international-composed.uti +268 -0
- data/vendor/liblouis/tables/grc-international-decomposed.uti +268 -0
- data/vendor/liblouis/tables/grc-international-en-composed.utb +54 -0
- data/vendor/liblouis/tables/grc-international-en.utb +206 -0
- data/vendor/liblouis/tables/grc-international-es.utb +228 -0
- data/vendor/liblouis/tables/gu-in-g1.utb +27 -0
- data/vendor/liblouis/tables/gu.tbl +18 -0
- data/vendor/liblouis/tables/gujarati.cti +221 -0
- data/vendor/liblouis/tables/gurumuki.cti +393 -0
- data/vendor/liblouis/tables/haw-us-g1.ctb +54 -0
- data/vendor/liblouis/tables/hbo-cantillated-rules.uti +71 -0
- data/vendor/liblouis/tables/hbo-cantillated.utb +109 -0
- data/vendor/liblouis/tables/hbo-common-rules.uti +152 -0
- data/vendor/liblouis/tables/hbo-ihbc-rules.uti +58 -0
- data/vendor/liblouis/tables/hbo-slim-rules.uti +68 -0
- data/vendor/liblouis/tables/hbo-slim.utb +100 -0
- data/vendor/liblouis/tables/hbo.utb +107 -0
- data/vendor/liblouis/tables/he-IL-comp8.utb +464 -0
- data/vendor/liblouis/tables/he-IL.utb +406 -0
- data/vendor/liblouis/tables/he-common-consonants.uti +102 -0
- data/vendor/liblouis/tables/he-common-vowels-ihbc.uti +161 -0
- data/vendor/liblouis/tables/hi-in-g1.utb +27 -0
- data/vendor/liblouis/tables/hi.tbl +18 -0
- data/vendor/liblouis/tables/hr-chardefs.cti +278 -0
- data/vendor/liblouis/tables/hr-comp8.tbl +21 -0
- data/vendor/liblouis/tables/hr-comp8.utb +239 -0
- data/vendor/liblouis/tables/hr-digits.uti +40 -0
- data/vendor/liblouis/tables/hr-g1.ctb +36 -0
- data/vendor/liblouis/tables/hr-g1.tbl +9 -0
- data/vendor/liblouis/tables/hr-translation.cti +364 -0
- data/vendor/liblouis/tables/ht-frenchcompatibility.uti +61 -0
- data/vendor/liblouis/tables/ht-g1.utb +114 -0
- data/vendor/liblouis/tables/hu-backtranslate-correction.dis +38 -0
- data/vendor/liblouis/tables/hu-backtranslate-word-corrections.cti +4293 -0
- data/vendor/liblouis/tables/hu-chardefs.cti +298 -0
- data/vendor/liblouis/tables/hu-exceptionwords.cti +3204 -0
- data/vendor/liblouis/tables/hu-hu-comp8.ctb +183 -0
- data/vendor/liblouis/tables/hu-hu-g1.ctb +129 -0
- data/vendor/liblouis/tables/hu-hu-g1_braille_input.cti +486 -0
- data/vendor/liblouis/tables/hu-hu-g2.ctb +270 -0
- data/vendor/liblouis/tables/hu-hu-g2_exceptions.cti +1164 -0
- data/vendor/liblouis/tables/hy.ctb +121 -0
- data/vendor/liblouis/tables/hy.tbl +21 -0
- data/vendor/liblouis/tables/hyph_cs_CZ.dic +3637 -0
- data/vendor/liblouis/tables/hyph_da_DK.dic +8896 -0
- data/vendor/liblouis/tables/hyph_de_DE.dic +5799 -0
- data/vendor/liblouis/tables/hyph_en_US.dic +5537 -0
- data/vendor/liblouis/tables/hyph_eo.dic +1024 -0
- data/vendor/liblouis/tables/hyph_es_ES.dic +877 -0
- data/vendor/liblouis/tables/hyph_fr_FR.dic +1067 -0
- data/vendor/liblouis/tables/hyph_hu_HU.dic +98519 -0
- data/vendor/liblouis/tables/hyph_it_IT.dic +410 -0
- data/vendor/liblouis/tables/hyph_nb_NO.dic +27142 -0
- data/vendor/liblouis/tables/hyph_nl_NL.dic +12725 -0
- data/vendor/liblouis/tables/hyph_nn_NO.dic +27142 -0
- data/vendor/liblouis/tables/hyph_pl_PL.dic +4074 -0
- data/vendor/liblouis/tables/hyph_pt_PT.dic +308 -0
- data/vendor/liblouis/tables/hyph_ru.dic +6480 -0
- data/vendor/liblouis/tables/hyph_sv_SE.dic +4697 -0
- data/vendor/liblouis/tables/is-chardefs6.cti +170 -0
- data/vendor/liblouis/tables/is-chardefs8.cti +293 -0
- data/vendor/liblouis/tables/is.ctb +157 -0
- data/vendor/liblouis/tables/is.tbl +18 -0
- data/vendor/liblouis/tables/it-it-comp6.utb +404 -0
- data/vendor/liblouis/tables/it-it-comp8.utb +663 -0
- data/vendor/liblouis/tables/iu-ca-g1.ctb +236 -0
- data/vendor/liblouis/tables/ja-kantenji-ucs2.utb +11448 -0
- data/vendor/liblouis/tables/ja-kantenji.utb +53 -0
- data/vendor/liblouis/tables/ja-rokutenkanji.utb +8710 -0
- data/vendor/liblouis/tables/ka-in-g1.utb +27 -0
- data/vendor/liblouis/tables/ka.utb +128 -0
- data/vendor/liblouis/tables/kannada.cti +282 -0
- data/vendor/liblouis/tables/kh-in-g1.utb +26 -0
- data/vendor/liblouis/tables/kha.tbl +18 -0
- data/vendor/liblouis/tables/kk.utb +77 -0
- data/vendor/liblouis/tables/km-g1.utb +412 -0
- data/vendor/liblouis/tables/kmr.tbl +108 -0
- data/vendor/liblouis/tables/kn.tbl +18 -0
- data/vendor/liblouis/tables/ko-2006-g1.ctb +49 -0
- data/vendor/liblouis/tables/ko-2006-g2.ctb +53 -0
- data/vendor/liblouis/tables/ko-2006.cti +190 -0
- data/vendor/liblouis/tables/ko-chars.cti +15140 -0
- data/vendor/liblouis/tables/ko-g1-rules.cti +634 -0
- data/vendor/liblouis/tables/ko-g1.ctb +48 -0
- data/vendor/liblouis/tables/ko-g2-rules.cti +9263 -0
- data/vendor/liblouis/tables/ko-g2.ctb +52 -0
- data/vendor/liblouis/tables/ko.cti +223 -0
- data/vendor/liblouis/tables/kok.ctb +24 -0
- data/vendor/liblouis/tables/kok.tbl +17 -0
- data/vendor/liblouis/tables/kru.ctb +24 -0
- data/vendor/liblouis/tables/kru.tbl +17 -0
- data/vendor/liblouis/tables/ks-in-g1.utb +27 -0
- data/vendor/liblouis/tables/latinLetterDef6Dots.uti +78 -0
- data/vendor/liblouis/tables/latinLetterDef8Dots.uti +75 -0
- data/vendor/liblouis/tables/latinLowercase.uti +389 -0
- data/vendor/liblouis/tables/latinUppercaseComp6.uti +78 -0
- data/vendor/liblouis/tables/lg-ug-g1.utb +60 -0
- data/vendor/liblouis/tables/litdigits6Dots.uti +30 -0
- data/vendor/liblouis/tables/litdigits6DotsPlusDot6.uti +30 -0
- data/vendor/liblouis/tables/lo-g1.utb +3127 -0
- data/vendor/liblouis/tables/loweredDigits6Dots.uti +30 -0
- data/vendor/liblouis/tables/loweredDigits8Dots.uti +30 -0
- data/vendor/liblouis/tables/lt-6dot.utb +308 -0
- data/vendor/liblouis/tables/lt-8dot.utb +281 -0
- data/vendor/liblouis/tables/lt.ctb +313 -0
- data/vendor/liblouis/tables/lv.tbl +22 -0
- data/vendor/liblouis/tables/maketablelist.sh +52 -0
- data/vendor/liblouis/tables/malayalam.cti +674 -0
- data/vendor/liblouis/tables/mao-nz-g1.ctb +65 -0
- data/vendor/liblouis/tables/marburg_single_cell_defs.cti +66 -0
- data/vendor/liblouis/tables/marburg_unicode_defs.cti +297 -0
- data/vendor/liblouis/tables/mk-g1.utb +240 -0
- data/vendor/liblouis/tables/ml-in-g1.utb +27 -0
- data/vendor/liblouis/tables/ml.tbl +21 -0
- data/vendor/liblouis/tables/mn-MN-common.cti +110 -0
- data/vendor/liblouis/tables/mn-MN-g1.utb +52 -0
- data/vendor/liblouis/tables/mn-MN-g2.ctb +50 -0
- data/vendor/liblouis/tables/mn-in-g1.utb +27 -0
- data/vendor/liblouis/tables/mni.tbl +18 -0
- data/vendor/liblouis/tables/mr-in-g1.utb +27 -0
- data/vendor/liblouis/tables/mr.tbl +18 -0
- data/vendor/liblouis/tables/ms-my-g2.ctb +4897 -0
- data/vendor/liblouis/tables/mt.ctb +114 -0
- data/vendor/liblouis/tables/mt.tbl +21 -0
- data/vendor/liblouis/tables/mun.ctb +24 -0
- data/vendor/liblouis/tables/mun.tbl +17 -0
- data/vendor/liblouis/tables/mwr.ctb +24 -0
- data/vendor/liblouis/tables/mwr.tbl +17 -0
- data/vendor/liblouis/tables/my-g1.utb +771 -0
- data/vendor/liblouis/tables/my-g2.ctb +3805 -0
- data/vendor/liblouis/tables/ne.ctb +22 -0
- data/vendor/liblouis/tables/ne.tbl +18 -0
- data/vendor/liblouis/tables/nemethdefs.cti +382 -0
- data/vendor/liblouis/tables/nl-BE.dis +532 -0
- data/vendor/liblouis/tables/nl-NL-g0.utb.in +646 -0
- data/vendor/liblouis/tables/nl-chardefs.uti.in +455 -0
- data/vendor/liblouis/tables/nl-comp8.utb +411 -0
- data/vendor/liblouis/tables/nl-print.dis +551 -0
- data/vendor/liblouis/tables/nl-unicode.dis +540 -0
- data/vendor/liblouis/tables/no-no-8dot-fallback-6dot-g0.utb +59 -0
- data/vendor/liblouis/tables/no-no-8dot.utb +629 -0
- data/vendor/liblouis/tables/no-no-braillo-047-01.dis +247 -0
- data/vendor/liblouis/tables/no-no-chardefs6.uti +305 -0
- data/vendor/liblouis/tables/no-no-comp8.ctb +323 -0
- data/vendor/liblouis/tables/no-no-cyrillic6dot.uti +95 -0
- data/vendor/liblouis/tables/no-no-g0.utb +320 -0
- data/vendor/liblouis/tables/no-no-g1.ctb +272 -0
- data/vendor/liblouis/tables/no-no-g2.ctb +737 -0
- data/vendor/liblouis/tables/no-no-g3.ctb +3597 -0
- data/vendor/liblouis/tables/no-no-generic.ctb +295 -0
- data/vendor/liblouis/tables/no-no-generic.dis +295 -0
- data/vendor/liblouis/tables/no-no-latinLetterDef6Dots_diacritics.uti +852 -0
- data/vendor/liblouis/tables/no-no.dis +291 -0
- data/vendor/liblouis/tables/np-in-g1.utb +27 -0
- data/vendor/liblouis/tables/nso-za-g1.utb +38 -0
- data/vendor/liblouis/tables/nso-za-g2.ctb +38 -0
- data/vendor/liblouis/tables/ny-mw.utb +70 -0
- data/vendor/liblouis/tables/or-in-g1.utb +27 -0
- data/vendor/liblouis/tables/or.tbl +18 -0
- data/vendor/liblouis/tables/oriya.cti +238 -0
- data/vendor/liblouis/tables/ovd-6g0.utb +64 -0
- data/vendor/liblouis/tables/ovd-8g0.utb +81 -0
- data/vendor/liblouis/tables/pa.tbl +18 -0
- data/vendor/liblouis/tables/pi.ctb +24 -0
- data/vendor/liblouis/tables/pi.tbl +17 -0
- data/vendor/liblouis/tables/pl-pl-comp8.ctb +658 -0
- data/vendor/liblouis/tables/pl.tbl +12 -0
- data/vendor/liblouis/tables/printables.cti +70 -0
- data/vendor/liblouis/tables/pt-comp6.utb +299 -0
- data/vendor/liblouis/tables/pt-pt-comp8.ctb +395 -0
- data/vendor/liblouis/tables/pt-pt-g1.utb +1312 -0
- data/vendor/liblouis/tables/pt-pt-g2.ctb +874 -0
- data/vendor/liblouis/tables/pt.tbl +20 -0
- data/vendor/liblouis/tables/pu-in-g1.utb +42 -0
- data/vendor/liblouis/tables/quotation-marks.uti +30 -0
- data/vendor/liblouis/tables/ro-g0.utb +85 -0
- data/vendor/liblouis/tables/ro.ctb +126 -0
- data/vendor/liblouis/tables/ro.tbl +21 -0
- data/vendor/liblouis/tables/ru-brf.dis +116 -0
- data/vendor/liblouis/tables/ru-comp6.utb +258 -0
- data/vendor/liblouis/tables/ru-comp8.utb +740 -0
- data/vendor/liblouis/tables/ru-letters.dis +145 -0
- data/vendor/liblouis/tables/ru-litbrl-detailed.utb +77 -0
- data/vendor/liblouis/tables/ru-litbrl.ctb +857 -0
- data/vendor/liblouis/tables/ru-math.uti +395 -0
- data/vendor/liblouis/tables/ru-ru-g1.ctb +804 -0
- data/vendor/liblouis/tables/ru-unicode.dis +121 -0
- data/vendor/liblouis/tables/rw-rw-g1.utb +133 -0
- data/vendor/liblouis/tables/sa-in-g1.utb +27 -0
- data/vendor/liblouis/tables/sa.tbl +18 -0
- data/vendor/liblouis/tables/sah.utb +72 -0
- data/vendor/liblouis/tables/sd.tbl +18 -0
- data/vendor/liblouis/tables/se-se.ctb +246 -0
- data/vendor/liblouis/tables/se-se.dis +334 -0
- data/vendor/liblouis/tables/si-in-g1.utb +27 -0
- data/vendor/liblouis/tables/sin.cti +213 -0
- data/vendor/liblouis/tables/sin.utb +35 -0
- data/vendor/liblouis/tables/sk-g1.ctb +1019 -0
- data/vendor/liblouis/tables/sk-sk-g1.utb +206 -0
- data/vendor/liblouis/tables/sk-sk.utb +112 -0
- data/vendor/liblouis/tables/sl-si-comp8.ctb +204 -0
- data/vendor/liblouis/tables/sl-si-g1.utb +471 -0
- data/vendor/liblouis/tables/sl.tbl +20 -0
- data/vendor/liblouis/tables/smi-6g0.utb +64 -0
- data/vendor/liblouis/tables/smi-8g0.utb +61 -0
- data/vendor/liblouis/tables/sot-za-g1.ctb +72 -0
- data/vendor/liblouis/tables/sot-za-g2.ctb +244 -0
- data/vendor/liblouis/tables/spaces.uti +62 -0
- data/vendor/liblouis/tables/sr-Cyrl.ctb +59 -0
- data/vendor/liblouis/tables/sr-common.cti +161 -0
- data/vendor/liblouis/tables/sr-cyrletters.cti +92 -0
- data/vendor/liblouis/tables/sr-g1.ctb +57 -0
- data/vendor/liblouis/tables/sr-latletters.cti +45 -0
- data/vendor/liblouis/tables/sv-1989.ctb +241 -0
- data/vendor/liblouis/tables/sv-1996.ctb +180 -0
- data/vendor/liblouis/tables/sv-6common.uti +1199 -0
- data/vendor/liblouis/tables/sv-6g0d.utb +508 -0
- data/vendor/liblouis/tables/sv-6g0p.utb +61 -0
- data/vendor/liblouis/tables/sv-6g1.uti +106 -0
- data/vendor/liblouis/tables/sv-6g1d.ctb +57 -0
- data/vendor/liblouis/tables/sv-6g2.uti +254 -0
- data/vendor/liblouis/tables/sv-6g2d.ctb +57 -0
- data/vendor/liblouis/tables/sv-8g0d.utb +495 -0
- data/vendor/liblouis/tables/sv-8g0n.utb +1236 -0
- data/vendor/liblouis/tables/sv-8g1.uti +199 -0
- data/vendor/liblouis/tables/sv-8g1d.ctb +73 -0
- data/vendor/liblouis/tables/sv-8g1n.ctb +73 -0
- data/vendor/liblouis/tables/sv-8g2.uti +486 -0
- data/vendor/liblouis/tables/sv-8g2d.ctb +73 -0
- data/vendor/liblouis/tables/sv-8g2n.ctb +73 -0
- data/vendor/liblouis/tables/sv-g0.utb +65 -0
- data/vendor/liblouis/tables/sv-g1.ctb +57 -0
- data/vendor/liblouis/tables/sv-g2.ctb +57 -0
- data/vendor/liblouis/tables/sv-phon.uti +241 -0
- data/vendor/liblouis/tables/sw-ke-g1-2.ctb +90 -0
- data/vendor/liblouis/tables/sw-ke-g1-3.ctb +109 -0
- data/vendor/liblouis/tables/sw-ke-g1-4.ctb +107 -0
- data/vendor/liblouis/tables/sw-ke-g1-5.ctb +73 -0
- data/vendor/liblouis/tables/sw-ke-g1.utb +278 -0
- data/vendor/liblouis/tables/sw-ke-g2.ctb +276 -0
- data/vendor/liblouis/tables/syc.utb +195 -0
- data/vendor/liblouis/tables/ta-ta-g1.ctb +167 -0
- data/vendor/liblouis/tables/ta.ctb +24 -0
- data/vendor/liblouis/tables/ta.tbl +21 -0
- data/vendor/liblouis/tables/tamil.cti +86 -0
- data/vendor/liblouis/tables/te-in-g1.utb +27 -0
- data/vendor/liblouis/tables/te.tbl +18 -0
- data/vendor/liblouis/tables/telugu.cti +239 -0
- data/vendor/liblouis/tables/text_nabcc.dis +426 -0
- data/vendor/liblouis/tables/th-comp8-backward.utb +226 -0
- data/vendor/liblouis/tables/th-g0.utb +177 -0
- data/vendor/liblouis/tables/th-g1.utb +89 -0
- data/vendor/liblouis/tables/th-g1.uti +315 -0
- data/vendor/liblouis/tables/th-g2.ctb +616 -0
- data/vendor/liblouis/tables/tr-g1.ctb +254 -0
- data/vendor/liblouis/tables/tr-g2.ctb +863 -0
- data/vendor/liblouis/tables/tr-g2.tbl +20 -0
- data/vendor/liblouis/tables/tr.ctb +324 -0
- data/vendor/liblouis/tables/tr.tbl +21 -0
- data/vendor/liblouis/tables/tsn-za-g1.ctb +33 -0
- data/vendor/liblouis/tables/tsn-za-g2.ctb +33 -0
- data/vendor/liblouis/tables/tt.utb +74 -0
- data/vendor/liblouis/tables/uga.utb +86 -0
- data/vendor/liblouis/tables/uk-comp.utb +53 -0
- data/vendor/liblouis/tables/uk-detailed.utb +32 -0
- data/vendor/liblouis/tables/uk.utb +101 -0
- data/vendor/liblouis/tables/ukchardefs.cti +106 -0
- data/vendor/liblouis/tables/ukmaths_single_cell_defs.cti +65 -0
- data/vendor/liblouis/tables/ukmaths_unicode_defs.cti +298 -0
- data/vendor/liblouis/tables/uni-text.dis +330 -0
- data/vendor/liblouis/tables/unicode-braille.utb +291 -0
- data/vendor/liblouis/tables/unicode-without-blank.dis +24 -0
- data/vendor/liblouis/tables/unicode.dis +278 -0
- data/vendor/liblouis/tables/ur-pk-g1.utb +248 -0
- data/vendor/liblouis/tables/ur-pk-g2.ctb +641 -0
- data/vendor/liblouis/tables/us-table.dis +67 -0
- data/vendor/liblouis/tables/uz-g1.utb +117 -0
- data/vendor/liblouis/tables/ve-za-g1.utb +69 -0
- data/vendor/liblouis/tables/ve-za-g2.ctb +208 -0
- data/vendor/liblouis/tables/vi-cb8.utb +49 -0
- data/vendor/liblouis/tables/vi-charsdef.uti +36 -0
- data/vendor/liblouis/tables/vi-lettersdef.uti +401 -0
- data/vendor/liblouis/tables/vi-puncsdef.uti +446 -0
- data/vendor/liblouis/tables/vi-saigon-g1.ctb +530 -0
- data/vendor/liblouis/tables/vi-vn-g0.utb +135 -0
- data/vendor/liblouis/tables/vi-vn-g1.ctb +574 -0
- data/vendor/liblouis/tables/vi-vn-g2.ctb +743 -0
- data/vendor/liblouis/tables/wiskunde-chardefs.cti +261 -0
- data/vendor/liblouis/tables/wordcx.dis +91 -0
- data/vendor/liblouis/tables/xh-za-g1.utb +61 -0
- data/vendor/liblouis/tables/xh-za-g2.ctb +386 -0
- data/vendor/liblouis/tables/yi.utb +236 -0
- data/vendor/liblouis/tables/zh-chn.ctb +45011 -0
- data/vendor/liblouis/tables/zh-hk.ctb +10461 -0
- data/vendor/liblouis/tables/zh-tw.ctb +53810 -0
- data/vendor/liblouis/tables/zh_CHN.tbl +23 -0
- data/vendor/liblouis/tables/zhcn-cbs.ctb +31523 -0
- data/vendor/liblouis/tables/zhcn-g1.ctb +26523 -0
- data/vendor/liblouis/tables/zhcn-g2.ctb +26519 -0
- data/vendor/liblouis/tables/zu-za-g1.utb +33 -0
- data/vendor/liblouis/tables/zu-za-g2.ctb +33 -0
- metadata +558 -0
|
@@ -0,0 +1,781 @@
|
|
|
1
|
+
/* liblouis Braille Translation and Back-Translation Library
|
|
2
|
+
|
|
3
|
+
Based on the Linux screenreader BRLTTY, copyright (C) 1999-2006 by The
|
|
4
|
+
BRLTTY Team
|
|
5
|
+
|
|
6
|
+
Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com
|
|
7
|
+
Copyright (C) 2004, 2005, 2006 JJB Software, Inc. www.jjb-software.com
|
|
8
|
+
Copyright (C) 2016 Mike Gray, American Printing House for the Blind
|
|
9
|
+
Copyright (C) 2016 Davy Kager, Dedicon
|
|
10
|
+
|
|
11
|
+
This file is part of liblouis.
|
|
12
|
+
|
|
13
|
+
liblouis is free software: you can redistribute it and/or modify it
|
|
14
|
+
under the terms of the GNU Lesser General Public License as published
|
|
15
|
+
by the Free Software Foundation, either version 2.1 of the License, or
|
|
16
|
+
(at your option) any later version.
|
|
17
|
+
|
|
18
|
+
liblouis is distributed in the hope that it will be useful, but
|
|
19
|
+
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
21
|
+
Lesser General Public License for more details.
|
|
22
|
+
|
|
23
|
+
You should have received a copy of the GNU Lesser General Public
|
|
24
|
+
License along with liblouis. If not, see <http://www.gnu.org/licenses/>.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @file
|
|
29
|
+
* @brief Internal API of liblouis
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
#ifndef __LOUIS_H_
|
|
33
|
+
#define __LOUIS_H_
|
|
34
|
+
|
|
35
|
+
#ifdef __cplusplus
|
|
36
|
+
extern "C" {
|
|
37
|
+
#endif /* __cplusplus */
|
|
38
|
+
|
|
39
|
+
#include <stdbool.h>
|
|
40
|
+
#include <stdio.h>
|
|
41
|
+
#include "liblouis.h"
|
|
42
|
+
|
|
43
|
+
/* Unlike Windows, Mingw can handle forward slashes as directory
|
|
44
|
+
separator, see http://mingw.org/wiki/Posix_path_conversion */
|
|
45
|
+
#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__)
|
|
46
|
+
#define PATH_SEP ';'
|
|
47
|
+
#define DIR_SEP '\\'
|
|
48
|
+
#else
|
|
49
|
+
#define PATH_SEP ':'
|
|
50
|
+
#define DIR_SEP '/'
|
|
51
|
+
#endif
|
|
52
|
+
|
|
53
|
+
#ifdef _MSC_VER
|
|
54
|
+
#define strcasecmp _stricmp
|
|
55
|
+
#define strncasecmp _strnicmp
|
|
56
|
+
#endif
|
|
57
|
+
|
|
58
|
+
#define NUMVAR 50
|
|
59
|
+
#define EMPHMODECHARSSIZE 256
|
|
60
|
+
#define NOEMPHCHARSSIZE 256
|
|
61
|
+
#define LETSIGNSIZE 256
|
|
62
|
+
// noletsignbefore and noletsignafter is hardly ever used and usually
|
|
63
|
+
// only with very few chars, so it only needs a small array
|
|
64
|
+
#define LETSIGNBEFORESIZE 64
|
|
65
|
+
#define LETSIGNAFTERSIZE 64
|
|
66
|
+
#define SEQPATTERNSIZE 128
|
|
67
|
+
#define CHARSIZE sizeof(widechar)
|
|
68
|
+
#define DEFAULTRULESIZE 50
|
|
69
|
+
|
|
70
|
+
typedef struct intCharTupple {
|
|
71
|
+
unsigned long long key;
|
|
72
|
+
char value;
|
|
73
|
+
} intCharTupple;
|
|
74
|
+
|
|
75
|
+
/* HASHNUM must be prime */
|
|
76
|
+
#define HASHNUM 1123
|
|
77
|
+
|
|
78
|
+
#define MAXPASS 4
|
|
79
|
+
#define MAXSTRING 2048
|
|
80
|
+
#define MAX_MACRO_VAR 100 // maximal number of variable substitutions a macro can contain
|
|
81
|
+
#define MAX_EMPH_CLASSES 10 // maximal number of emphasis classes
|
|
82
|
+
#define MAX_MODES 6 // maximal number of modes that can be handled
|
|
83
|
+
#define MAX_SOURCE_FILES 100 // maximal number of files a table can consist of
|
|
84
|
+
|
|
85
|
+
typedef unsigned int TranslationTableOffset;
|
|
86
|
+
|
|
87
|
+
/* Basic type for translation table data, which carries all alignment
|
|
88
|
+
* constraints that fields contained in translation table may have.
|
|
89
|
+
* Notably TranslationTableCharacterAttributes is unsigned long long, so we need
|
|
90
|
+
* at least this big basic type. */
|
|
91
|
+
typedef unsigned long long TranslationTableData;
|
|
92
|
+
#define OFFSETSIZE sizeof(TranslationTableData)
|
|
93
|
+
|
|
94
|
+
typedef enum {
|
|
95
|
+
/* The first 8 are the predefined character classes. They need to be listed first and
|
|
96
|
+
in this order because of how allocateCharacterClasses works. */
|
|
97
|
+
CTC_Space = 0x1,
|
|
98
|
+
CTC_Letter = 0x2,
|
|
99
|
+
CTC_Digit = 0x4,
|
|
100
|
+
CTC_Punctuation = 0x8,
|
|
101
|
+
CTC_UpperCase = 0x10,
|
|
102
|
+
CTC_LowerCase = 0x20,
|
|
103
|
+
CTC_Math = 0x40,
|
|
104
|
+
CTC_Sign = 0x80,
|
|
105
|
+
CTC_LitDigit = 0x100,
|
|
106
|
+
CTC_CapsMode = 0x200,
|
|
107
|
+
// bit 0x400 used to be taken by CTC_EmphMode
|
|
108
|
+
CTC_NumericMode = 0x800,
|
|
109
|
+
CTC_NumericNoContract = 0x1000,
|
|
110
|
+
CTC_SeqDelimiter = 0x2000,
|
|
111
|
+
CTC_SeqBefore = 0x4000,
|
|
112
|
+
CTC_SeqAfter = 0x8000,
|
|
113
|
+
/* The following 8 are reserved for %0 to %7 (in no particular order) */
|
|
114
|
+
/* Be careful with changing these values (and also CTC_EndOfInput) because in
|
|
115
|
+
pattern_compile_expression they are stored in a unsigned int after cutting off the
|
|
116
|
+
16 least significant bits. */
|
|
117
|
+
CTC_UserDefined1 = 0x10000,
|
|
118
|
+
CTC_UserDefined2 = 0x20000,
|
|
119
|
+
CTC_UserDefined3 = 0x40000,
|
|
120
|
+
CTC_UserDefined4 = 0x80000,
|
|
121
|
+
CTC_UserDefined5 = 0x100000,
|
|
122
|
+
CTC_UserDefined6 = 0x200000,
|
|
123
|
+
CTC_UserDefined7 = 0x400000,
|
|
124
|
+
CTC_UserDefined8 = 0x800000,
|
|
125
|
+
CTC_EndOfInput = 0x1000000, // only used by pattern matcher
|
|
126
|
+
CTC_EmpMatch = 0x2000000, // only used in TranslationTableRule->before and
|
|
127
|
+
// TranslationTableRule->after
|
|
128
|
+
CTC_MidEndNumericMode = 0x4000000,
|
|
129
|
+
/* At least 37 more bits available in an unsigned long long (at least 64 bits). Used
|
|
130
|
+
for custom attributes 9 to 45. These need to be the last values of the enum. */
|
|
131
|
+
CTC_UserDefined9 = 0x8000000,
|
|
132
|
+
CTC_UserDefined10 = 0x10000000,
|
|
133
|
+
CTC_UserDefined11 = 0x20000000,
|
|
134
|
+
CTC_UserDefined12 = 0x40000000,
|
|
135
|
+
} TranslationTableCharacterAttribute;
|
|
136
|
+
|
|
137
|
+
typedef enum {
|
|
138
|
+
pass_first = '`',
|
|
139
|
+
pass_last = '~',
|
|
140
|
+
pass_lookback = '_',
|
|
141
|
+
pass_string = '\"',
|
|
142
|
+
pass_dots = '@',
|
|
143
|
+
pass_omit = '?',
|
|
144
|
+
pass_startReplace = '[',
|
|
145
|
+
pass_endReplace = ']',
|
|
146
|
+
pass_startGroup = '{',
|
|
147
|
+
pass_endGroup = '}',
|
|
148
|
+
pass_variable = '#',
|
|
149
|
+
pass_not = '!',
|
|
150
|
+
pass_search = '/',
|
|
151
|
+
pass_any = 'a',
|
|
152
|
+
pass_digit = 'd',
|
|
153
|
+
pass_litDigit = 'D',
|
|
154
|
+
pass_letter = 'l',
|
|
155
|
+
pass_math = 'm',
|
|
156
|
+
pass_punctuation = 'p',
|
|
157
|
+
pass_sign = 'S',
|
|
158
|
+
pass_space = 's',
|
|
159
|
+
pass_uppercase = 'U',
|
|
160
|
+
pass_lowercase = 'u',
|
|
161
|
+
pass_class1 = 'w',
|
|
162
|
+
pass_class2 = 'x',
|
|
163
|
+
pass_class3 = 'y',
|
|
164
|
+
pass_class4 = 'z',
|
|
165
|
+
pass_attributes = '$',
|
|
166
|
+
pass_groupstart = '{',
|
|
167
|
+
pass_groupend = '}',
|
|
168
|
+
pass_groupreplace = ';',
|
|
169
|
+
pass_swap = '%',
|
|
170
|
+
pass_hyphen = '-',
|
|
171
|
+
pass_until = '.',
|
|
172
|
+
pass_eq = '=',
|
|
173
|
+
pass_lt = '<',
|
|
174
|
+
pass_gt = '>',
|
|
175
|
+
pass_endTest = 32,
|
|
176
|
+
pass_plus = '+',
|
|
177
|
+
pass_copy = '*',
|
|
178
|
+
pass_leftParen = '(',
|
|
179
|
+
pass_rightParen = ')',
|
|
180
|
+
pass_comma = ',',
|
|
181
|
+
pass_lteq = 130,
|
|
182
|
+
pass_gteq = 131,
|
|
183
|
+
pass_invalidToken = 132,
|
|
184
|
+
pass_noteq = 133,
|
|
185
|
+
pass_and = 134,
|
|
186
|
+
pass_or = 135,
|
|
187
|
+
pass_nameFound = 136,
|
|
188
|
+
pass_numberFound = 137,
|
|
189
|
+
pass_boolean = 138,
|
|
190
|
+
pass_class = 139,
|
|
191
|
+
pass_define = 140,
|
|
192
|
+
pass_emphasis = 141,
|
|
193
|
+
pass_group = 142,
|
|
194
|
+
pass_mark = 143,
|
|
195
|
+
pass_repGroup = 143,
|
|
196
|
+
pass_script = 144,
|
|
197
|
+
pass_noMoreTokens = 145,
|
|
198
|
+
pass_replace = 146,
|
|
199
|
+
pass_if = 147,
|
|
200
|
+
pass_then = 148,
|
|
201
|
+
pass_all = 255
|
|
202
|
+
} pass_Codes;
|
|
203
|
+
|
|
204
|
+
typedef unsigned long long TranslationTableCharacterAttributes;
|
|
205
|
+
|
|
206
|
+
typedef struct {
|
|
207
|
+
TranslationTableOffset next;
|
|
208
|
+
widechar lookFor;
|
|
209
|
+
widechar found;
|
|
210
|
+
} CharDotsMapping;
|
|
211
|
+
|
|
212
|
+
typedef struct {
|
|
213
|
+
const char *sourceFile;
|
|
214
|
+
int sourceLine;
|
|
215
|
+
TranslationTableOffset next;
|
|
216
|
+
TranslationTableOffset definitionRule;
|
|
217
|
+
TranslationTableOffset otherRules;
|
|
218
|
+
TranslationTableCharacterAttributes attributes;
|
|
219
|
+
TranslationTableCharacterAttributes mode;
|
|
220
|
+
TranslationTableOffset compRule;
|
|
221
|
+
widechar value;
|
|
222
|
+
TranslationTableOffset basechar;
|
|
223
|
+
TranslationTableOffset linked;
|
|
224
|
+
int ruleIndex; /** sequence number of rule within table */
|
|
225
|
+
int finalized;
|
|
226
|
+
} TranslationTableCharacter;
|
|
227
|
+
|
|
228
|
+
typedef enum { /* Op codes */
|
|
229
|
+
CTO_IncludeFile,
|
|
230
|
+
CTO_Locale, /* Deprecated, do not use */
|
|
231
|
+
CTO_Undefined,
|
|
232
|
+
/* Do not change the order of the following opcodes! */
|
|
233
|
+
CTO_CapsLetter,
|
|
234
|
+
CTO_BegCapsWord,
|
|
235
|
+
CTO_EndCapsWord,
|
|
236
|
+
CTO_BegCaps,
|
|
237
|
+
CTO_EndCaps,
|
|
238
|
+
CTO_BegCapsPhrase,
|
|
239
|
+
CTO_EndCapsPhrase,
|
|
240
|
+
CTO_LenCapsPhrase,
|
|
241
|
+
CTO_ModeLetter,
|
|
242
|
+
CTO_BegModeWord,
|
|
243
|
+
CTO_EndModeWord,
|
|
244
|
+
CTO_BegMode,
|
|
245
|
+
CTO_EndMode,
|
|
246
|
+
CTO_BegModePhrase,
|
|
247
|
+
CTO_EndModePhrase,
|
|
248
|
+
CTO_LenModePhrase,
|
|
249
|
+
/* End of ordered opcodes */
|
|
250
|
+
CTO_LetterSign,
|
|
251
|
+
CTO_NoLetsignBefore,
|
|
252
|
+
CTO_NoLetsign,
|
|
253
|
+
CTO_NoLetsignAfter,
|
|
254
|
+
CTO_NumberSign,
|
|
255
|
+
CTO_NoNumberSign,
|
|
256
|
+
CTO_NumericModeChars,
|
|
257
|
+
CTO_MidEndNumericModeChars,
|
|
258
|
+
CTO_NumericNoContractChars,
|
|
259
|
+
CTO_SeqDelimiter,
|
|
260
|
+
CTO_SeqBeforeChars,
|
|
261
|
+
CTO_SeqAfterChars,
|
|
262
|
+
CTO_SeqAfterPattern,
|
|
263
|
+
CTO_SeqAfterExpression,
|
|
264
|
+
CTO_EmphClass,
|
|
265
|
+
|
|
266
|
+
/* Do not change the order of the following opcodes! */
|
|
267
|
+
CTO_EmphLetter,
|
|
268
|
+
CTO_BegEmphWord,
|
|
269
|
+
CTO_EndEmphWord,
|
|
270
|
+
CTO_BegEmph,
|
|
271
|
+
CTO_EndEmph,
|
|
272
|
+
CTO_BegEmphPhrase,
|
|
273
|
+
CTO_EndEmphPhrase,
|
|
274
|
+
CTO_LenEmphPhrase,
|
|
275
|
+
/* End of ordered opcodes */
|
|
276
|
+
|
|
277
|
+
CTO_CapsModeChars,
|
|
278
|
+
CTO_EmphModeChars,
|
|
279
|
+
CTO_NoEmphChars,
|
|
280
|
+
CTO_BegComp,
|
|
281
|
+
CTO_EndComp,
|
|
282
|
+
CTO_NoContractSign,
|
|
283
|
+
CTO_MultInd,
|
|
284
|
+
CTO_CompDots,
|
|
285
|
+
CTO_Comp6,
|
|
286
|
+
CTO_Class, /* define a character class */
|
|
287
|
+
CTO_After, /* only match if after character in class */
|
|
288
|
+
CTO_Before, /* only match if before character in class 30 */
|
|
289
|
+
CTO_NoBack,
|
|
290
|
+
CTO_NoFor,
|
|
291
|
+
CTO_EmpMatchBefore,
|
|
292
|
+
CTO_EmpMatchAfter,
|
|
293
|
+
CTO_SwapCc,
|
|
294
|
+
CTO_SwapCd,
|
|
295
|
+
CTO_SwapDd,
|
|
296
|
+
CTO_Space,
|
|
297
|
+
CTO_Digit,
|
|
298
|
+
CTO_Punctuation,
|
|
299
|
+
CTO_Math,
|
|
300
|
+
CTO_Sign,
|
|
301
|
+
CTO_Letter,
|
|
302
|
+
CTO_UpperCase,
|
|
303
|
+
CTO_LowerCase,
|
|
304
|
+
CTO_Grouping,
|
|
305
|
+
CTO_UpLow,
|
|
306
|
+
CTO_LitDigit,
|
|
307
|
+
CTO_Display,
|
|
308
|
+
CTO_Replace,
|
|
309
|
+
CTO_Context,
|
|
310
|
+
CTO_Correct,
|
|
311
|
+
CTO_Pass2,
|
|
312
|
+
CTO_Pass3,
|
|
313
|
+
CTO_Pass4,
|
|
314
|
+
CTO_Repeated,
|
|
315
|
+
CTO_RepWord,
|
|
316
|
+
CTO_RepEndWord,
|
|
317
|
+
CTO_CapsNoCont,
|
|
318
|
+
CTO_Always,
|
|
319
|
+
CTO_ExactDots,
|
|
320
|
+
CTO_NoCross,
|
|
321
|
+
CTO_Syllable,
|
|
322
|
+
CTO_NoCont,
|
|
323
|
+
CTO_CompBrl,
|
|
324
|
+
CTO_Literal,
|
|
325
|
+
CTO_LargeSign,
|
|
326
|
+
CTO_WholeWord,
|
|
327
|
+
CTO_PartWord,
|
|
328
|
+
CTO_JoinNum,
|
|
329
|
+
CTO_JoinableWord,
|
|
330
|
+
CTO_LowWord,
|
|
331
|
+
CTO_Contraction,
|
|
332
|
+
CTO_SuffixableWord, /** whole word or beginning of word */
|
|
333
|
+
CTO_PrefixableWord, /** whole word or end of word */
|
|
334
|
+
CTO_BegWord, /** beginning of word only */
|
|
335
|
+
CTO_BegMidWord, /** beginning or middle of word */
|
|
336
|
+
CTO_MidWord, /** middle of word only 20 */
|
|
337
|
+
CTO_MidEndWord, /** middle or end of word */
|
|
338
|
+
CTO_EndWord, /** end of word only */
|
|
339
|
+
CTO_PrePunc, /** punctuation in string at beginning of word */
|
|
340
|
+
CTO_PostPunc, /** punctuation in string at end of word */
|
|
341
|
+
CTO_BegNum, /** beginning of number */
|
|
342
|
+
CTO_MidNum, /** middle of number, e.g., decimal point */
|
|
343
|
+
CTO_EndNum, /** end of number */
|
|
344
|
+
CTO_DecPoint,
|
|
345
|
+
CTO_Hyphen,
|
|
346
|
+
// CTO_Apostrophe,
|
|
347
|
+
// CTO_Initial,
|
|
348
|
+
CTO_NoBreak,
|
|
349
|
+
CTO_Match,
|
|
350
|
+
CTO_BackMatch,
|
|
351
|
+
CTO_Attribute,
|
|
352
|
+
CTO_Base,
|
|
353
|
+
CTO_Macro,
|
|
354
|
+
CTO_None,
|
|
355
|
+
|
|
356
|
+
/** "internal" opcodes */
|
|
357
|
+
CTO_EndCapsPhraseBefore,
|
|
358
|
+
CTO_EndCapsPhraseAfter,
|
|
359
|
+
|
|
360
|
+
CTO_All
|
|
361
|
+
} TranslationTableOpcode;
|
|
362
|
+
|
|
363
|
+
typedef struct {
|
|
364
|
+
const char *sourceFile;
|
|
365
|
+
int sourceLine;
|
|
366
|
+
int index; /** sequence number of rule within table */
|
|
367
|
+
TranslationTableOffset charsnext; /** next chars entry */
|
|
368
|
+
TranslationTableOffset dotsnext; /** next dots entry */
|
|
369
|
+
TranslationTableCharacterAttributes after; /** character types which must follow */
|
|
370
|
+
TranslationTableCharacterAttributes before; /** character types which must precede */
|
|
371
|
+
TranslationTableOffset patterns; /** before and after patterns */
|
|
372
|
+
TranslationTableOpcode opcode; /** rule for testing validity of replacement */
|
|
373
|
+
char nocross;
|
|
374
|
+
short charslen; /** length of string to be replaced */
|
|
375
|
+
short dotslen; /** length of replacement string */
|
|
376
|
+
widechar charsdots[DEFAULTRULESIZE]; /** find and replacement strings */
|
|
377
|
+
} TranslationTableRule;
|
|
378
|
+
|
|
379
|
+
typedef struct /* state transition */
|
|
380
|
+
{
|
|
381
|
+
widechar ch;
|
|
382
|
+
widechar newState;
|
|
383
|
+
} HyphenationTrans;
|
|
384
|
+
|
|
385
|
+
typedef union {
|
|
386
|
+
HyphenationTrans *pointer;
|
|
387
|
+
TranslationTableOffset offset;
|
|
388
|
+
} PointOff;
|
|
389
|
+
|
|
390
|
+
typedef struct /* one state */
|
|
391
|
+
{
|
|
392
|
+
PointOff trans;
|
|
393
|
+
TranslationTableOffset hyphenPattern;
|
|
394
|
+
widechar fallbackState;
|
|
395
|
+
widechar numTrans;
|
|
396
|
+
} HyphenationState;
|
|
397
|
+
|
|
398
|
+
typedef struct CharacterClass {
|
|
399
|
+
struct CharacterClass *next;
|
|
400
|
+
TranslationTableCharacterAttributes attribute;
|
|
401
|
+
widechar length;
|
|
402
|
+
widechar name[1];
|
|
403
|
+
} CharacterClass;
|
|
404
|
+
|
|
405
|
+
typedef struct RuleName {
|
|
406
|
+
struct RuleName *next;
|
|
407
|
+
TranslationTableOffset ruleOffset;
|
|
408
|
+
widechar length;
|
|
409
|
+
widechar name[1];
|
|
410
|
+
} RuleName;
|
|
411
|
+
|
|
412
|
+
typedef struct {
|
|
413
|
+
/* either typeform or mode should be set, not both */
|
|
414
|
+
formtype typeform; /* corresponding value in "typeforms" enum */
|
|
415
|
+
TranslationTableCharacterAttributes mode; /* corresponding character attribute */
|
|
416
|
+
unsigned int value; /* bit field that contains a single "1" */
|
|
417
|
+
unsigned short
|
|
418
|
+
rule; /* emphasis rules (index in emphRules, emphModeChars and noEmphChars) */
|
|
419
|
+
} EmphasisClass;
|
|
420
|
+
|
|
421
|
+
typedef struct {
|
|
422
|
+
TranslationTableOffset tableSize;
|
|
423
|
+
TranslationTableOffset bytesUsed;
|
|
424
|
+
TranslationTableOffset charToDots[HASHNUM];
|
|
425
|
+
TranslationTableOffset dotsToChar[HASHNUM];
|
|
426
|
+
TranslationTableData ruleArea[1]; /** Space for storing all rules and values */
|
|
427
|
+
} DisplayTableHeader;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Translation table header
|
|
431
|
+
*/
|
|
432
|
+
typedef struct { /* translation table */
|
|
433
|
+
|
|
434
|
+
/* state needed during compilation */
|
|
435
|
+
TranslationTableOffset tableSize;
|
|
436
|
+
TranslationTableOffset bytesUsed;
|
|
437
|
+
CharacterClass *characterClasses;
|
|
438
|
+
TranslationTableCharacterAttributes nextCharacterClassAttribute;
|
|
439
|
+
TranslationTableCharacterAttributes nextNumberedCharacterClassAttribute;
|
|
440
|
+
RuleName *ruleNames;
|
|
441
|
+
TranslationTableCharacterAttributes
|
|
442
|
+
numberedAttributes[8]; /* attributes 0-7 used in match rules (could also be
|
|
443
|
+
stored in `characterClasses', but this is slightly
|
|
444
|
+
faster) */
|
|
445
|
+
int usesAttributeOrClass; /* 1 = attribute, 2 = class */
|
|
446
|
+
char *sourceFiles[MAX_SOURCE_FILES + 1];
|
|
447
|
+
int ruleCounter;
|
|
448
|
+
|
|
449
|
+
/* needed for translation or other api functions */
|
|
450
|
+
int finalized;
|
|
451
|
+
int capsNoCont;
|
|
452
|
+
int numPasses;
|
|
453
|
+
int corrections;
|
|
454
|
+
int syllables;
|
|
455
|
+
int usesSequences;
|
|
456
|
+
int usesNumericMode;
|
|
457
|
+
int hasCapsModeChars;
|
|
458
|
+
TranslationTableOffset undefined;
|
|
459
|
+
TranslationTableOffset letterSign;
|
|
460
|
+
TranslationTableOffset numberSign;
|
|
461
|
+
TranslationTableOffset noContractSign;
|
|
462
|
+
TranslationTableOffset noNumberSign;
|
|
463
|
+
widechar seqPatterns[SEQPATTERNSIZE];
|
|
464
|
+
char *emphClassNames[MAX_EMPH_CLASSES];
|
|
465
|
+
EmphasisClass emphClasses[MAX_EMPH_CLASSES];
|
|
466
|
+
EmphasisClass modes[MAX_MODES];
|
|
467
|
+
int seqPatternsCount;
|
|
468
|
+
widechar seqAfterExpression[SEQPATTERNSIZE];
|
|
469
|
+
int seqAfterExpressionLength;
|
|
470
|
+
TranslationTableOffset emphRules[MAX_EMPH_CLASSES + MAX_MODES]
|
|
471
|
+
[9]; /* 9 is the size of the EmphCodeOffset enum */
|
|
472
|
+
TranslationTableOffset begComp;
|
|
473
|
+
TranslationTableOffset endComp;
|
|
474
|
+
TranslationTableOffset hyphenStatesArray;
|
|
475
|
+
widechar noLetsignBefore[LETSIGNBEFORESIZE];
|
|
476
|
+
int noLetsignBeforeCount;
|
|
477
|
+
widechar noLetsign[LETSIGNSIZE];
|
|
478
|
+
int noLetsignCount;
|
|
479
|
+
widechar noLetsignAfter[LETSIGNAFTERSIZE];
|
|
480
|
+
int noLetsignAfterCount;
|
|
481
|
+
widechar emphModeChars[MAX_EMPH_CLASSES] /* does not include caps: capsmodechars are
|
|
482
|
+
* currently stored as character attributes
|
|
483
|
+
*/
|
|
484
|
+
[EMPHMODECHARSSIZE + 1];
|
|
485
|
+
widechar noEmphChars[MAX_EMPH_CLASSES] /* does not include caps */
|
|
486
|
+
[NOEMPHCHARSSIZE + 1];
|
|
487
|
+
TranslationTableOffset characters[HASHNUM]; /** Character definitions */
|
|
488
|
+
TranslationTableOffset dots[HASHNUM]; /** Dot definitions */
|
|
489
|
+
TranslationTableOffset forPassRules[MAXPASS + 1];
|
|
490
|
+
TranslationTableOffset backPassRules[MAXPASS + 1];
|
|
491
|
+
TranslationTableOffset forRules[HASHNUM]; /** Chains of forward rules */
|
|
492
|
+
TranslationTableOffset backRules[HASHNUM]; /** Chains of backward rules */
|
|
493
|
+
TranslationTableData ruleArea[1]; /** Space for storing all rules and values */
|
|
494
|
+
} TranslationTableHeader;
|
|
495
|
+
|
|
496
|
+
typedef enum {
|
|
497
|
+
alloc_typebuf,
|
|
498
|
+
alloc_wordBuffer,
|
|
499
|
+
alloc_emphasisBuffer,
|
|
500
|
+
alloc_passbuf,
|
|
501
|
+
alloc_posMapping1,
|
|
502
|
+
alloc_posMapping2,
|
|
503
|
+
alloc_posMapping3
|
|
504
|
+
} AllocBuf;
|
|
505
|
+
|
|
506
|
+
#define MAXPASSBUF 3
|
|
507
|
+
|
|
508
|
+
typedef enum {
|
|
509
|
+
begPhraseOffset = 0,
|
|
510
|
+
endPhraseBeforeOffset = 1,
|
|
511
|
+
endPhraseAfterOffset = 2,
|
|
512
|
+
begOffset = 3,
|
|
513
|
+
endOffset = 4,
|
|
514
|
+
letterOffset = 5,
|
|
515
|
+
begWordOffset = 6,
|
|
516
|
+
endWordOffset = 7,
|
|
517
|
+
lenPhraseOffset = 8
|
|
518
|
+
} EmphCodeOffset;
|
|
519
|
+
|
|
520
|
+
/* Grouping the begin, end, word and symbol bits and using the type of
|
|
521
|
+
* a single bit group for representing the emphasis classes allows us
|
|
522
|
+
* to do simple bit operations. */
|
|
523
|
+
|
|
524
|
+
/* fields contain sums of EmphasisClass.value */
|
|
525
|
+
/* MAX_EMPH_CLASSES + MAX_MODES may not exceed 16 */
|
|
526
|
+
typedef struct {
|
|
527
|
+
unsigned int begin : 16;
|
|
528
|
+
unsigned int end : 16;
|
|
529
|
+
unsigned int word : 16;
|
|
530
|
+
unsigned int symbol : 16;
|
|
531
|
+
} EmphasisInfo;
|
|
532
|
+
|
|
533
|
+
typedef enum { noEncoding, bigEndian, littleEndian, ascii8 } EncodingType;
|
|
534
|
+
|
|
535
|
+
typedef struct {
|
|
536
|
+
const char *fileName;
|
|
537
|
+
const char *sourceFile;
|
|
538
|
+
FILE *in;
|
|
539
|
+
int lineNumber;
|
|
540
|
+
EncodingType encoding;
|
|
541
|
+
int status;
|
|
542
|
+
int linelen;
|
|
543
|
+
int linepos;
|
|
544
|
+
int checkencoding[2];
|
|
545
|
+
widechar line[MAXSTRING];
|
|
546
|
+
} FileInfo;
|
|
547
|
+
|
|
548
|
+
/* The following function definitions are hooks into
|
|
549
|
+
* compileTranslationTable.c. Some are used by other library modules.
|
|
550
|
+
* Others are used by tools like lou_allround.c and lou_debug.c. */
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Comma separated list of directories to search for tables.
|
|
554
|
+
*/
|
|
555
|
+
char *EXPORT_CALL
|
|
556
|
+
_lou_getTablePath(void);
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Resolve tableList against base.
|
|
560
|
+
*/
|
|
561
|
+
char **EXPORT_CALL
|
|
562
|
+
_lou_resolveTable(const char *tableList, const char *base);
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* The default table resolver
|
|
566
|
+
*/
|
|
567
|
+
char **EXPORT_CALL
|
|
568
|
+
_lou_defaultTableResolver(const char *tableList, const char *base);
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Return single-cell dot pattern corresponding to a character.
|
|
572
|
+
* TODO: move to commonTranslationFunctions.c
|
|
573
|
+
*/
|
|
574
|
+
widechar EXPORT_CALL
|
|
575
|
+
_lou_getDotsForChar(widechar c, const DisplayTableHeader *table);
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Return character corresponding to a single-cell dot pattern.
|
|
579
|
+
* TODO: move to commonTranslationFunctions.c
|
|
580
|
+
*/
|
|
581
|
+
widechar EXPORT_CALL
|
|
582
|
+
_lou_getCharForDots(widechar d, const DisplayTableHeader *table);
|
|
583
|
+
|
|
584
|
+
void EXPORT_CALL
|
|
585
|
+
_lou_getTable(const char *tableList, const char *displayTableList,
|
|
586
|
+
const TranslationTableHeader **translationTable,
|
|
587
|
+
const DisplayTableHeader **displayTable);
|
|
588
|
+
|
|
589
|
+
const TranslationTableHeader *EXPORT_CALL
|
|
590
|
+
_lou_getTranslationTable(const char *tableList);
|
|
591
|
+
|
|
592
|
+
const DisplayTableHeader *EXPORT_CALL
|
|
593
|
+
_lou_getDisplayTable(const char *tableList);
|
|
594
|
+
|
|
595
|
+
int EXPORT_CALL
|
|
596
|
+
_lou_compileTranslationRule(const char *tableList, const char *inString);
|
|
597
|
+
|
|
598
|
+
int EXPORT_CALL
|
|
599
|
+
_lou_compileDisplayRule(const char *tableList, const char *inString);
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Allocate memory for internal buffers
|
|
603
|
+
*
|
|
604
|
+
* Used by lou_translateString.c and lou_backTranslateString.c ONLY
|
|
605
|
+
* to allocate memory for internal buffers.
|
|
606
|
+
* TODO: move to utils.c
|
|
607
|
+
*/
|
|
608
|
+
void *EXPORT_CALL
|
|
609
|
+
_lou_allocMem(AllocBuf buffer, int index, int srcmax, int destmax);
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Hash function for character strings
|
|
613
|
+
*
|
|
614
|
+
* @param lowercase Whether to convert the string to lowercase because
|
|
615
|
+
* making the hash of it.
|
|
616
|
+
*/
|
|
617
|
+
unsigned long int EXPORT_CALL
|
|
618
|
+
_lou_stringHash(const widechar *c, int lowercase, const TranslationTableHeader *table);
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Hash function for single characters
|
|
622
|
+
*/
|
|
623
|
+
unsigned long int EXPORT_CALL
|
|
624
|
+
_lou_charHash(widechar c);
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Return a string in the same format as the characters operand in opcodes
|
|
628
|
+
*/
|
|
629
|
+
const char *EXPORT_CALL
|
|
630
|
+
_lou_showString(widechar const *chars, int length, int forceHex);
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Print out dot numbers
|
|
634
|
+
*
|
|
635
|
+
* @return a string containing the dot numbers. The longest possible
|
|
636
|
+
* output is "\123456789ABCDEF0/"
|
|
637
|
+
*/
|
|
638
|
+
const char *EXPORT_CALL
|
|
639
|
+
_lou_unknownDots(widechar dots);
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* Return a character string in the format of the dots operand
|
|
643
|
+
*/
|
|
644
|
+
const char *EXPORT_CALL
|
|
645
|
+
_lou_showDots(widechar const *dots, int length);
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Return a character string where the attributes are indicated
|
|
649
|
+
* by the attribute letters used in multipass opcodes
|
|
650
|
+
*/
|
|
651
|
+
char *EXPORT_CALL
|
|
652
|
+
_lou_showAttributes(TranslationTableCharacterAttributes a);
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Return number of the opcode
|
|
656
|
+
*
|
|
657
|
+
* @param toFind the opcodes
|
|
658
|
+
*/
|
|
659
|
+
TranslationTableOpcode EXPORT_CALL
|
|
660
|
+
_lou_findOpcodeNumber(const char *tofind);
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Return the name of the opcode associated with an opcode number
|
|
664
|
+
*
|
|
665
|
+
* @param opcode an opcode
|
|
666
|
+
*/
|
|
667
|
+
const char *EXPORT_CALL
|
|
668
|
+
_lou_findOpcodeName(TranslationTableOpcode opcode);
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Convert string to wide characters
|
|
672
|
+
*
|
|
673
|
+
* Takes a character string and produces a sequence of wide characters.
|
|
674
|
+
* Opposite of _lou_showString.
|
|
675
|
+
*
|
|
676
|
+
* @param inString the input string
|
|
677
|
+
* @param outString the output wide char sequence
|
|
678
|
+
* @return length of the widechar sequence.
|
|
679
|
+
*/
|
|
680
|
+
int EXPORT_CALL
|
|
681
|
+
_lou_extParseChars(const char *inString, widechar *outString);
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Convert string to wide characters containing dot patterns
|
|
685
|
+
*
|
|
686
|
+
* Takes a character string and produces a sequence of wide characters
|
|
687
|
+
* containing dot patterns. Opposite of _lou_showDots.
|
|
688
|
+
* @param inString the input string
|
|
689
|
+
* @param outString the output wide char sequence
|
|
690
|
+
* @return length of the widechar sequence.
|
|
691
|
+
*/
|
|
692
|
+
int EXPORT_CALL
|
|
693
|
+
_lou_extParseDots(const char *inString, widechar *outString);
|
|
694
|
+
|
|
695
|
+
int EXPORT_CALL
|
|
696
|
+
_lou_translate(const char *tableList, const char *displayTableList, const widechar *inbuf,
|
|
697
|
+
int *inlen, widechar *outbuf, int *outlen, formtype *typeform, char *spacing,
|
|
698
|
+
int *outputPos, int *inputPos, int *cursorPos, int mode,
|
|
699
|
+
const TranslationTableRule **rules, int *rulesLen);
|
|
700
|
+
|
|
701
|
+
int EXPORT_CALL
|
|
702
|
+
_lou_backTranslate(const char *tableList, const char *displayTableList,
|
|
703
|
+
const widechar *inbuf, int *inlen, widechar *outbuf, int *outlen,
|
|
704
|
+
formtype *typeform, char *spacing, int *outputPos, int *inputPos, int *cursorPos,
|
|
705
|
+
int mode, const TranslationTableRule **rules, int *rulesLen);
|
|
706
|
+
|
|
707
|
+
void EXPORT_CALL
|
|
708
|
+
_lou_resetPassVariables(void);
|
|
709
|
+
|
|
710
|
+
int EXPORT_CALL
|
|
711
|
+
_lou_handlePassVariableTest(const widechar *instructions, int *IC, int *itsTrue);
|
|
712
|
+
|
|
713
|
+
int EXPORT_CALL
|
|
714
|
+
_lou_handlePassVariableAction(const widechar *instructions, int *IC);
|
|
715
|
+
|
|
716
|
+
int EXPORT_CALL
|
|
717
|
+
_lou_pattern_compile(const widechar *input, const int input_max, widechar *expr_data,
|
|
718
|
+
const int expr_max, TranslationTableHeader *table, const FileInfo *nested);
|
|
719
|
+
|
|
720
|
+
void EXPORT_CALL
|
|
721
|
+
_lou_pattern_reverse(widechar *expr_data);
|
|
722
|
+
|
|
723
|
+
int EXPORT_CALL
|
|
724
|
+
_lou_pattern_check(const widechar *input, const int input_start, const int input_minmax,
|
|
725
|
+
const int input_dir, const widechar *expr_data,
|
|
726
|
+
const TranslationTableHeader *table);
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Read a line of widechar's from an input file
|
|
730
|
+
*/
|
|
731
|
+
int EXPORT_CALL
|
|
732
|
+
_lou_getALine(FileInfo *info);
|
|
733
|
+
|
|
734
|
+
#ifdef DEBUG
|
|
735
|
+
/* Can be inserted in code to be used as a breakpoint in gdb */
|
|
736
|
+
void EXPORT_CALL
|
|
737
|
+
_lou_debugHook(void);
|
|
738
|
+
#endif
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Print an out-of-memory message and exit
|
|
742
|
+
*/
|
|
743
|
+
void EXPORT_CALL
|
|
744
|
+
_lou_outOfMemory(void);
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Helper for logging a widechar buffer
|
|
748
|
+
*/
|
|
749
|
+
void EXPORT_CALL
|
|
750
|
+
_lou_logWidecharBuf(logLevels level, const char *msg, const widechar *wbuf, int wlen);
|
|
751
|
+
|
|
752
|
+
void EXPORT_CALL
|
|
753
|
+
_lou_logMessage(logLevels level, const char *format, ...);
|
|
754
|
+
|
|
755
|
+
void EXPORT_CALL
|
|
756
|
+
_lou_freeTableIndex(void);
|
|
757
|
+
|
|
758
|
+
extern int translation_direction;
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* Return 1 if given translation mode is valid. Return 0 otherwise.
|
|
762
|
+
*/
|
|
763
|
+
int EXPORT_CALL
|
|
764
|
+
_lou_isValidMode(int mode);
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* Return the default braille representation for a character.
|
|
768
|
+
*/
|
|
769
|
+
widechar EXPORT_CALL
|
|
770
|
+
_lou_charToFallbackDots(widechar c);
|
|
771
|
+
|
|
772
|
+
static inline int
|
|
773
|
+
isASCII(widechar c) {
|
|
774
|
+
return (c >= 0X20) && (c < 0X7F);
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
#ifdef __cplusplus
|
|
778
|
+
}
|
|
779
|
+
#endif /* __cplusplus */
|
|
780
|
+
|
|
781
|
+
#endif /* __LOUIS_H_ */
|