| 1 |
/* texlang.h |
| 2 |
|
| 3 |
Copyright 2009 Taco Hoekwater <[email protected]> |
| 4 |
|
| 5 |
This file is part of LuaTeX. |
| 6 |
|
| 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. |
| 11 |
|
| 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. |
| 16 |
|
| 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/>. */ |
| 19 |
|
| 20 |
#ifndef TEXLANG_H |
| 21 |
# define TEXLANG_H |
| 22 |
|
| 23 |
typedef struct _lang_variables { |
| 24 |
int pre_hyphen_char; |
| 25 |
int post_hyphen_char; |
| 26 |
int pre_exhyphen_char; |
| 27 |
int post_exhyphen_char; |
| 28 |
} lang_variables; |
| 29 |
|
| 30 |
# include "lang/hyphen.h" |
| 31 |
|
| 32 |
struct tex_language { |
| 33 |
HyphenDict *patterns; |
| 34 |
int exceptions; /* lua registry pointer, should be replaced */ |
| 35 |
int id; |
| 36 |
int pre_hyphen_char; |
| 37 |
int post_hyphen_char; |
| 38 |
int pre_exhyphen_char; |
| 39 |
int post_exhyphen_char; |
| 40 |
int hyphenation_min; |
| 41 |
}; |
| 42 |
|
| 43 |
# define MAX_WORD_LEN 65536 /* in chars */ |
| 44 |
|
| 45 |
extern struct tex_language *new_language(int n); |
| 46 |
extern struct tex_language *get_language(int n); |
| 47 |
extern void load_patterns(struct tex_language *lang, const unsigned char *buf); |
| 48 |
extern void load_hyphenation(struct tex_language *lang, const unsigned char *buf); |
| 49 |
extern int hyphenate_string(struct tex_language *lang, char *w, char **ret); |
| 50 |
|
| 51 |
extern void new_hyphenation(halfword h, halfword t); |
| 52 |
extern void clear_patterns(struct tex_language *lang); |
| 53 |
extern void clear_hyphenation(struct tex_language *lang); |
| 54 |
extern const char *clean_hyphenation(int id, const char *buffer, char **cleaned); |
| 55 |
extern void hnj_hyphenation(halfword head, halfword tail); |
| 56 |
|
| 57 |
extern void set_pre_hyphen_char(int lan, int val); |
| 58 |
extern void set_post_hyphen_char(int lan, int val); |
| 59 |
extern int get_pre_hyphen_char(int lan); |
| 60 |
extern int get_post_hyphen_char(int lan); |
| 61 |
|
| 62 |
extern void set_pre_exhyphen_char(int lan, int val); |
| 63 |
extern void set_post_exhyphen_char(int lan, int val); |
| 64 |
extern int get_pre_exhyphen_char(int lan); |
| 65 |
extern int get_post_exhyphen_char(int lan); |
| 66 |
|
| 67 |
extern void set_hyphenation_min(int lan, int val); |
| 68 |
extern int get_hyphenation_min(int lan); |
| 69 |
|
| 70 |
/* extern halfword compound_word_break(halfword t, int clang); */ |
| 71 |
|
| 72 |
extern void dump_language_data(void); |
| 73 |
extern void undump_language_data(void); |
| 74 |
extern char *exception_strings(struct tex_language *lang); |
| 75 |
|
| 76 |
extern void new_hyph_exceptions(void); |
| 77 |
extern void new_patterns(void); |
| 78 |
extern void new_pre_hyphen_char(void); |
| 79 |
extern void new_post_hyphen_char(void); |
| 80 |
extern void new_pre_exhyphen_char(void); |
| 81 |
extern void new_post_exhyphen_char(void); |
| 82 |
extern void new_hyphenation_min(void); |
| 83 |
extern void new_hj_code(void); |
| 84 |
|
| 85 |
extern void set_disc_field(halfword f, halfword t); |
| 86 |
extern halfword insert_syllable_discretionary(halfword t, lang_variables * lan); |
| 87 |
|
| 88 |
#endif |