2 /* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002
3 Free Software Foundation, Inc.
4 Written by James Clark (jjc@jclark.com)
6 This file is part of groff.
8 groff is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2, or (at your option) any later
13 groff is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License along
19 with groff; see the file COPYING. If not, write to the Free Software
20 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
25 static int next_index;
26 charinfo *translation;
30 unsigned char special_translation;
31 unsigned char hyphenation_code;
33 unsigned char ascii_code;
34 unsigned char asciify_code;
36 char transparent_translate; // non-zero means translation applies
37 // to transparent throughput
38 char translate_input; // non-zero means that asciify_code is
39 // active for .asciify (set by .trin)
46 OVERLAPS_HORIZONTALLY = 8,
47 OVERLAPS_VERTICALLY = 16,
55 TRANSLATE_STRETCHABLE_SPACE,
56 TRANSLATE_HYPHEN_INDICATOR
62 int overlaps_vertically();
63 int overlaps_horizontally();
64 int can_break_before();
65 int can_break_after();
67 unsigned char get_hyphenation_code();
68 unsigned char get_ascii_code();
69 unsigned char get_asciify_code();
70 void set_hyphenation_code(unsigned char);
71 void set_ascii_code(unsigned char);
72 void set_asciify_code(unsigned char);
73 void set_translation_input();
74 int get_translation_input();
75 charinfo *get_translation(int = 0);
76 void set_translation(charinfo *, int, int);
77 void set_flags(unsigned char);
78 void set_special_translation(int, int);
79 int get_special_translation(int = 0);
80 macro *set_macro(macro *, int = 0);
82 int first_time_not_found();
90 charinfo *get_charinfo(symbol);
91 extern charinfo *charset_table[];
92 charinfo *get_charinfo_by_number(int);
94 inline int charinfo::overlaps_horizontally()
96 return flags & OVERLAPS_HORIZONTALLY;
99 inline int charinfo::overlaps_vertically()
101 return flags & OVERLAPS_VERTICALLY;
104 inline int charinfo::can_break_before()
106 return flags & BREAK_BEFORE;
109 inline int charinfo::can_break_after()
111 return flags & BREAK_AFTER;
114 inline int charinfo::ends_sentence()
116 return flags & ENDS_SENTENCE;
119 inline int charinfo::transparent()
121 return flags & TRANSPARENT;
124 inline int charinfo::numbered()
126 return flags & NUMBERED;
129 inline int charinfo::is_fallback()
134 inline charinfo *charinfo::get_translation(int transparent_throughput)
136 return (transparent_throughput && !transparent_translate
141 inline unsigned char charinfo::get_hyphenation_code()
143 return hyphenation_code;
146 inline unsigned char charinfo::get_ascii_code()
151 inline unsigned char charinfo::get_asciify_code()
153 return (translate_input ? asciify_code : 0);
156 inline void charinfo::set_flags(unsigned char c)
161 inline int charinfo::get_index()
166 inline void charinfo::set_translation_input()
171 inline int charinfo::get_translation_input()
173 return translate_input;
176 inline int charinfo::get_special_translation(int transparent_throughput)
178 return (transparent_throughput && !transparent_translate
179 ? int(TRANSLATE_NONE)
180 : special_translation);
183 inline macro *charinfo::get_macro()
188 inline int charinfo::first_time_not_found()
198 inline symbol *charinfo::get_symbol()