/[public]/psiconv/trunk/program/psiconv/gen_html.c
ViewVC logotype

Diff of /psiconv/trunk/program/psiconv/gen_html.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 14 Revision 34
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 */
29static const char *char_table[0x100] = 30static const char *char_table[0x100] =
30{ 31{
31 /* 0x00 */ "" ,"" ,"" ,"" ,"" ,"" ,"<P> ","<BR>" , 32 /* 0x00 */ "" ,"" ,"" ,"" ,"" ,"" ,"<P> ","<BR>" ,
92 const psiconv_color color, 93 const psiconv_color color,
93 const psiconv_color back_color) 94 const psiconv_color back_color)
94{ 95{
95 struct psiconv_character_layout base_char_struct = 96 struct psiconv_character_layout base_char_struct =
96 { 97 {
97 color, /* color */ 98 NULL, /* color */
98 back_color, /* back_color */ 99 NULL, /* back_color */
99 13.0, /* font_size */ 100 13.0, /* font_size */
100 psiconv_bool_false, /* italic */ 101 psiconv_bool_false, /* italic */
101 psiconv_bool_false, /* bold */ 102 psiconv_bool_false, /* bold */
102 psiconv_normalscript, /* super_sub */ 103 psiconv_normalscript, /* super_sub */
103 psiconv_bool_false, /* underline */ 104 psiconv_bool_false, /* underline */
104 psiconv_bool_false, /* strike_out */ 105 psiconv_bool_false, /* strike_out */
105 font, /* font */ 106 NULL, /* font */
106 }; 107 };
108 base_char_struct.color = color;
109 base_char_struct.back_color = back_color;
110 base_char_struct.font = font;
107 return psiconv_clone_character_layout(&base_char_struct); 111 return psiconv_clone_character_layout(&base_char_struct);
108} 112}
109 113
110/* flags & 1: 0 if no <FONT> was yet generated. 114/* flags & 1: 0 if no <FONT> was yet generated.
111 flags & 2: 1 if at end-of-paragraph 115 flags & 2: 1 if at end-of-paragraph
273 fputs("</UL>",of); 277 fputs("</UL>",of);
274 278
275 fputs("</P>\n",of); 279 fputs("</P>\n",of);
276} 280}
277 281
278void psiconv_gen_html(FILE *of,psiconv_file file) 282int psiconv_gen_html(FILE *of,const psiconv_file file, const char *dest)
279{ 283{
280 if (file->type == psiconv_word_file) 284 if (file->type == psiconv_word_file) {
281 psiconv_gen_html_word(of,(psiconv_word_f) file->file); 285 psiconv_gen_html_word(of,(psiconv_word_f) file->file);
286 return 0;
282 else if (file->type == psiconv_texted_file) 287 } else if (file->type == psiconv_texted_file) {
283 psiconv_gen_html_texted(of,(psiconv_texted_f) file->file); 288 psiconv_gen_html_texted(of,(psiconv_texted_f) file->file);
284 else
285 return; 289 return 0;
290 } else
291 return -1;
286} 292}
287 293
288void psiconv_gen_html_texted(FILE *of,psiconv_texted_f tf) 294void psiconv_gen_html_texted(FILE *of,psiconv_texted_f tf)
289{ 295{
290 psiconv_character_layout base_char; 296 psiconv_character_layout base_char;
341 } 347 }
342 fputs("</BODY>\n</HTML>\n",of); 348 fputs("</BODY>\n</HTML>\n",of);
343 psiconv_free_character_layout(base_char); 349 psiconv_free_character_layout(base_char);
344} 350}
345 351
352static struct psiconv_fileformat ff =
353 {
354 "HTML3",
355 "HTML 3.2, not verified so probably not completely compliant",
356 &psiconv_gen_html
357 };
346 358
359void init_html(void)
360{
361 psiconv_list_add(fileformat_list,&ff);
362}

Legend:
Removed from v.14  
changed lines
  Added in v.34

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26