… | |
… | |
22 | #include <string.h> |
22 | #include <string.h> |
23 | #include <stdlib.h> |
23 | #include <stdlib.h> |
24 | #include "data.h" |
24 | #include "data.h" |
25 | #include "list.h" |
25 | #include "list.h" |
26 | #include "gen.h" |
26 | #include "gen.h" |
|
|
27 | #include "psiconv.h" |
27 | |
28 | |
28 | /* This determines for each character how it is displayed */ |
29 | /* This determines for each character how it is displayed */ |
29 | static const char *char_table[0x100] = |
30 | static const char *char_table[0x100] = |
30 | { |
31 | { |
31 | /* 0x00 */ "" ,"" ,"" ,"" ,"" ,"" ,"<P> ","<BR>" , |
32 | /* 0x00 */ "" ,"" ,"" ,"" ,"" ,"" ,"<P> ","<BR>" , |
… | |
… | |
276 | fputs("</UL>",of); |
277 | fputs("</UL>",of); |
277 | |
278 | |
278 | fputs("</P>\n",of); |
279 | fputs("</P>\n",of); |
279 | } |
280 | } |
280 | |
281 | |
281 | void psiconv_gen_html(FILE *of,psiconv_file file) |
282 | int psiconv_gen_html(FILE *of,const psiconv_file file, const char *dest) |
282 | { |
283 | { |
283 | if (file->type == psiconv_word_file) |
284 | if (file->type == psiconv_word_file) { |
284 | psiconv_gen_html_word(of,(psiconv_word_f) file->file); |
285 | psiconv_gen_html_word(of,(psiconv_word_f) file->file); |
|
|
286 | return 0; |
285 | else if (file->type == psiconv_texted_file) |
287 | } else if (file->type == psiconv_texted_file) { |
286 | psiconv_gen_html_texted(of,(psiconv_texted_f) file->file); |
288 | psiconv_gen_html_texted(of,(psiconv_texted_f) file->file); |
287 | else |
|
|
288 | return; |
289 | return 0; |
|
|
290 | } else |
|
|
291 | return -1; |
289 | } |
292 | } |
290 | |
293 | |
291 | void psiconv_gen_html_texted(FILE *of,psiconv_texted_f tf) |
294 | void psiconv_gen_html_texted(FILE *of,psiconv_texted_f tf) |
292 | { |
295 | { |
293 | psiconv_character_layout base_char; |
296 | psiconv_character_layout base_char; |
… | |
… | |
344 | } |
347 | } |
345 | fputs("</BODY>\n</HTML>\n",of); |
348 | fputs("</BODY>\n</HTML>\n",of); |
346 | psiconv_free_character_layout(base_char); |
349 | psiconv_free_character_layout(base_char); |
347 | } |
350 | } |
348 | |
351 | |
|
|
352 | static struct psiconv_fileformat ff = |
|
|
353 | { |
|
|
354 | "HTML3", |
|
|
355 | "HTML 3.2, not verified so probably not completely compliant", |
|
|
356 | &psiconv_gen_html |
|
|
357 | }; |
349 | |
358 | |
|
|
359 | void init_html(void) |
|
|
360 | { |
|
|
361 | psiconv_list_add(fileformat_list,&ff); |
|
|
362 | } |