Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8335 | maxcodehac | 1 | |
2 | GNU UnRTF, a command-line program to convert RTF documents to other formats. |
||
3 | Copyright (C) 2000,2001 Zachary Thayer Smith |
||
4 | |||
5 | |||
6 | it under the terms of the GNU General Public License as published by |
||
7 | the Free Software Foundation; either version 2 of the License, or |
||
8 | (at your option) any later version. |
||
9 | |||
10 | |||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
13 | GNU General Public License for more details. |
||
14 | |||
15 | |||
16 | along with this program; if not, write to the Free Software |
||
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
18 | |||
19 | |||
20 | =============================================================================*/ |
||
21 | |||
22 | |||
23 | |||
24 | * Module name: text |
||
25 | * Author name: Zach Smith |
||
26 | * Create date: 19 Sep 01 |
||
27 | * Purpose: Plain text output module |
||
28 | *---------------------------------------------------------------------- |
||
29 | * Changes: |
||
30 | * 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks |
||
31 | *--------------------------------------------------------------------*/ |
||
32 | |||
33 | |||
34 | |||
35 | #include |
||
36 | #include "malloc.h" |
||
37 | #include "defs.h" |
||
38 | #include "error.h" |
||
39 | #include "main.h" |
||
40 | #include "output.h" |
||
41 | |||
42 | |||
43 | |||
44 | ascii_translation_table [96] = { |
||
45 | /* 0x20 */ " ", "!", "\"", "#", "$", "%", "&", "'", |
||
46 | /* 0x28 */ "(", ")", "*", "+", ",", "-", ".", "/", |
||
47 | /* 0x30 */ "0", "1", "2", "3", "4", "5", "6", "7", |
||
48 | /* 0x38 */ "8", "9", ":", ";", "<", "=", ">", "?", |
||
49 | /* 0x40 */ "@", "A", "B", "C", "D", "E", "F", "G", |
||
50 | /* 0x48 */ "H", "I", "J", "K", "L", "M", "N", "O", |
||
51 | /* 0x50 */ "P", "Q", "R", "S", "T", "U", "V", "W", |
||
52 | /* 0x58 */ "X", "Y", "Z", "[", "\\", "]", "^", "_", |
||
53 | /* 0x60 */ "`", "a", "b", "c", "d", "e", "f", "g", |
||
54 | /* 0x68 */ "h", "i", "j", "k", "l", "m", "n", "o", |
||
55 | /* 0x70 */ "p", "q", "r", "s", "t", "u", "v", "w", |
||
56 | /* 0x78 */ "x", "y", "z", "{", "|", "}", "~", "", |
||
57 | }; |
||
58 | |||
59 | |||
60 | upper_translation_table [128] = { |
||
61 | "?", "?", "?", "?", "?", "?", "?", "?", |
||
62 | "?", "?", "?", "?", "?", "?", "?", "?", |
||
63 | "?", "?", "?", "?", "?", "?", "?", "?", |
||
64 | "?", "?", "?", "?", "?", "?", "?", "?", |
||
65 | "?", "?", "?", "?", "?", "?", "?", "?", |
||
66 | "?", "?", "?", "?", "?", "?", "?", "?", |
||
67 | "?", "?", "?", "?", "?", "?", "?", "?", |
||
68 | "?", "?", "?", "?", "?", "?", "?", "?", |
||
69 | "?", "?", "?", "?", "?", "?", "?", "?", |
||
70 | "?", "?", "?", "?", "?", "?", "?", "?", |
||
71 | "?", "?", "?", "?", "?", "?", "?", "?", |
||
72 | "?", "?", "?", "?", "?", "?", "?", "?", |
||
73 | "?", "?", "?", "?", "?", "?", "?", "?", |
||
74 | "?", "?", "?", "?", "?", "?", "?", "?", |
||
75 | "?", "?", "?", "?", "?", "?", "?", "?", |
||
76 | "?", "?", "?", "?", "?", "?", "?", "?", |
||
77 | }; |
||
78 | |||
79 | |||
80 | |||
81 | |||
82 | * Name: text_init |
||
83 | * Purpose: Generates an output personality for the plain text format. |
||
84 | * Args: None. |
||
85 | * Returns: OutputPersonality. |
||
86 | *=======================================================================*/ |
||
87 | |||
88 | |||
89 | text_init (void) |
||
90 | { |
||
91 | OutputPersonality* text_op; |
||
92 | |||
93 | |||
94 | |||
95 | |||
96 | text_op->comment_end = "\n"; |
||
97 | |||
98 | |||
99 | text_op->document_end = ""; |
||
100 | |||
101 | |||
102 | text_op->header_end = ""; |
||
103 | |||
104 | |||
105 | text_op->document_title_end = "\n"; |
||
106 | |||
107 | |||
108 | text_op->document_author_end = "\n"; |
||
109 | |||
110 | |||
111 | text_op->document_changedate_end = "\n"; |
||
112 | |||
113 | |||
114 | text_op->body_end = ""; |
||
115 | |||
116 | |||
117 | text_op->paragraph_end = "\n"; |
||
118 | |||
119 | |||
120 | text_op->center_end = ""; |
||
121 | |||
122 | |||
123 | text_op->justify_end = ""; |
||
124 | |||
125 | |||
126 | text_op->align_left_end = ""; |
||
127 | |||
128 | |||
129 | text_op->align_right_end = ""; |
||
130 | |||
131 | |||
132 | text_op->line_break = "\n"; |
||
133 | text_op->page_break = "\n"; |
||
134 | |||
135 | |||
136 | text_op->hyperlink_end = ""; |
||
137 | |||
138 | |||
139 | text_op->imagelink_end = ""; |
||
140 | |||
141 | |||
142 | text_op->table_end = "\n"; |
||
143 | |||
144 | |||
145 | text_op->table_row_end = "\n"; |
||
146 | |||
147 | |||
148 | text_op->table_cell_end = ""; |
||
149 | |||
150 | |||
151 | text_op->font_begin = ""; |
||
152 | text_op->font_end = ""; |
||
153 | |||
154 | |||
155 | text_op->fontsize_end = ""; |
||
156 | |||
157 | |||
158 | text_op->fontsize8_end = ""; |
||
159 | text_op->fontsize10_begin = ""; |
||
160 | text_op->fontsize10_end = ""; |
||
161 | text_op->fontsize12_begin = ""; |
||
162 | text_op->fontsize12_end = ""; |
||
163 | text_op->fontsize14_begin = ""; |
||
164 | text_op->fontsize14_end = ""; |
||
165 | text_op->fontsize18_begin = ""; |
||
166 | text_op->fontsize18_end = ""; |
||
167 | text_op->fontsize24_begin = ""; |
||
168 | text_op->fontsize24_end = ""; |
||
169 | |||
170 | |||
171 | text_op->smaller_end = ""; |
||
172 | |||
173 | |||
174 | text_op->bigger_end = ""; |
||
175 | |||
176 | |||
177 | text_op->foreground_end = ""; |
||
178 | |||
179 | |||
180 | text_op->background_end = ""; |
||
181 | |||
182 | |||
183 | text_op->bold_end = ""; |
||
184 | |||
185 | |||
186 | text_op->italic_end = ""; |
||
187 | |||
188 | |||
189 | text_op->underline_end = ""; |
||
190 | |||
191 | |||
192 | text_op->dbl_underline_end = ""; |
||
193 | |||
194 | |||
195 | text_op->superscript_end = ""; |
||
196 | |||
197 | |||
198 | text_op->subscript_end = ""; |
||
199 | |||
200 | |||
201 | text_op->strikethru_end = ""; |
||
202 | |||
203 | |||
204 | text_op->dbl_strikethru_end = ""; |
||
205 | |||
206 | |||
207 | text_op->emboss_end = ""; |
||
208 | |||
209 | |||
210 | text_op->engrave_end = ""; |
||
211 | |||
212 | |||
213 | text_op->shadow_end= ""; |
||
214 | |||
215 | |||
216 | text_op->outline_end= ""; |
||
217 | |||
218 | |||
219 | text_op->expand_end = ""; |
||
220 | |||
221 | |||
222 | text_op->pointlist_end = "\n"; |
||
223 | text_op->pointlist_item_begin = " * "; |
||
224 | text_op->pointlist_item_end = "\n"; |
||
225 | |||
226 | |||
227 | text_op->numericlist_end = "\n"; |
||
228 | text_op->numericlist_item_begin = " # "; |
||
229 | text_op->numericlist_item_end = "\n"; |
||
230 | |||
231 | |||
232 | text_op->simulate_all_caps = TRUE; |
||
233 | text_op->simulate_word_underline = TRUE; |
||
234 | |||
235 | |||
236 | |||
237 | |||
238 | text_op->ansi_first_char = 0x80; |
||
239 | text_op->ansi_last_char = 0xff; |
||
240 | |||
241 | |||
242 | text_op->cp437_first_char = 0x80; |
||
243 | text_op->cp437_last_char = 0xff; |
||
244 | |||
245 | |||
246 | text_op->cp850_first_char = 0x80; |
||
247 | text_op->cp850_last_char = 0xff; |
||
248 | |||
249 | |||
250 | text_op->mac_first_char = 0x80; |
||
251 | text_op->mac_last_char = 0xff; |
||
252 | |||
253 | |||
254 | text_op->chars.left_quote = "`"; |
||
255 | text_op->chars.right_dbl_quote = "''"; |
||
256 | text_op->chars.left_dbl_quote = "``"; |
||
257 | |||
258 | |||
259 | }",> |
||
260 |