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
*);
81 macro
*setx_macro(macro
*, char_mode
);
83 int first_time_not_found();
93 charinfo
*get_charinfo(symbol
);
94 extern charinfo
*charset_table
[];
95 charinfo
*get_charinfo_by_number(int);
97 inline int charinfo::overlaps_horizontally()
99 return flags
& OVERLAPS_HORIZONTALLY
;
102 inline int charinfo::overlaps_vertically()
104 return flags
& OVERLAPS_VERTICALLY
;
107 inline int charinfo::can_break_before()
109 return flags
& BREAK_BEFORE
;
112 inline int charinfo::can_break_after()
114 return flags
& BREAK_AFTER
;
117 inline int charinfo::ends_sentence()
119 return flags
& ENDS_SENTENCE
;
122 inline int charinfo::transparent()
124 return flags
& TRANSPARENT
;
127 inline int charinfo::numbered()
129 return flags
& NUMBERED
;
132 inline int charinfo::is_normal()
134 return mode
== CHAR_NORMAL
;
137 inline int charinfo::is_fallback()
139 return mode
== CHAR_FALLBACK
;
142 inline int charinfo::is_special()
144 return mode
== CHAR_SPECIAL
;
147 inline charinfo
*charinfo::get_translation(int transparent_throughput
)
149 return (transparent_throughput
&& !transparent_translate
154 inline unsigned char charinfo::get_hyphenation_code()
156 return hyphenation_code
;
159 inline unsigned char charinfo::get_ascii_code()
164 inline unsigned char charinfo::get_asciify_code()
166 return (translate_input
? asciify_code
: 0);
169 inline void charinfo::set_flags(unsigned char c
)
174 inline int charinfo::get_index()
179 inline void charinfo::set_translation_input()
184 inline int charinfo::get_translation_input()
186 return translate_input
;
189 inline int charinfo::get_special_translation(int transparent_throughput
)
191 return (transparent_throughput
&& !transparent_translate
192 ? int(TRANSLATE_NONE
)
193 : special_translation
);
196 inline macro
*charinfo::get_macro()
201 inline int charinfo::first_time_not_found()
211 inline symbol
*charinfo::get_symbol()