beta-0.89.2
[luatex.git] / source / texk / web2c / luatexdir / lang / texlang.h
blob0920dc9f740ae761f9a1c56b5b84de856e3975c8
1 /* texlang.h
3 Copyright 2009 Taco Hoekwater <taco@luatex.org>
5 This file is part of LuaTeX.
7 LuaTeX is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2 of the License, or (at your
10 option) any later version.
12 LuaTeX is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 License for more details.
17 You should have received a copy of the GNU General Public License along
18 with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
21 #ifndef TEXLANG_H
22 # define TEXLANG_H
24 typedef struct _lang_variables {
25 int pre_hyphen_char;
26 int post_hyphen_char;
27 int pre_exhyphen_char;
28 int post_exhyphen_char;
29 } lang_variables;
31 # include "lang/hyphen.h"
33 struct tex_language {
34 HyphenDict *patterns;
35 int exceptions; /* lua registry pointer, should be replaced */
36 int id;
37 int pre_hyphen_char;
38 int post_hyphen_char;
39 int pre_exhyphen_char;
40 int post_exhyphen_char;
41 int hyphenation_min;
44 # define MAX_WORD_LEN 65536 /* in chars */
46 extern struct tex_language *new_language(int n);
47 extern struct tex_language *get_language(int n);
48 extern void load_patterns(struct tex_language *lang, const unsigned char *buf);
49 extern void load_hyphenation(struct tex_language *lang,
50 const unsigned char *buf);
51 extern int hyphenate_string(struct tex_language *lang, char *w, char **ret);
53 extern void new_hyphenation(halfword h, halfword t);
54 extern void clear_patterns(struct tex_language *lang);
55 extern void clear_hyphenation(struct tex_language *lang);
56 extern const char *clean_hyphenation(int id, const char *buffer, char **cleaned);
57 extern void hnj_hyphenation(halfword head, halfword tail);
59 extern void set_pre_hyphen_char(int lan, int val);
60 extern void set_post_hyphen_char(int lan, int val);
61 extern int get_pre_hyphen_char(int lan);
62 extern int get_post_hyphen_char(int lan);
64 extern void set_pre_exhyphen_char(int lan, int val);
65 extern void set_post_exhyphen_char(int lan, int val);
66 extern int get_pre_exhyphen_char(int lan);
67 extern int get_post_exhyphen_char(int lan);
69 extern void set_hyphenation_min(int lan, int val);
70 extern int get_hyphenation_min(int lan);
72 extern halfword compound_word_break(halfword t, int clang);
74 extern void dump_language_data(void);
75 extern void undump_language_data(void);
76 extern char *exception_strings(struct tex_language *lang);
78 extern void new_hyph_exceptions(void);
79 extern void new_patterns(void);
80 extern void new_pre_hyphen_char(void);
81 extern void new_post_hyphen_char(void);
82 extern void new_pre_exhyphen_char(void);
83 extern void new_post_exhyphen_char(void);
84 extern void new_hyphenation_min(void);
85 extern void new_hj_code(void);
88 #endif