--- psiconv/trunk/program/psiconv/gen_html.c 1999/10/11 19:17:17 14
+++ psiconv/trunk/program/psiconv/gen_html.c 2000/12/15 18:52:49 67
@@ -21,9 +21,10 @@
#include
#include
#include
-#include "data.h"
-#include "list.h"
+#include "psiconv/data.h"
+#include "psiconv/list.h"
#include "gen.h"
+#include "psiconv.h"
/* This determines for each character how it is displayed */
static const char *char_table[0x100] =
@@ -92,18 +93,21 @@
const psiconv_color color,
const psiconv_color back_color)
{
- struct psiconv_character_layout base_char_struct =
+ struct psiconv_character_layout_s base_char_struct =
{
- color, /* color */
- back_color, /* back_color */
+ NULL, /* color */
+ NULL, /* back_color */
13.0, /* font_size */
psiconv_bool_false, /* italic */
psiconv_bool_false, /* bold */
psiconv_normalscript, /* super_sub */
psiconv_bool_false, /* underline */
- psiconv_bool_false, /* strike_out */
- font, /* font */
+ psiconv_bool_false, /* strikethrough */
+ NULL, /* font */
};
+ base_char_struct.color = color;
+ base_char_struct.back_color = back_color;
+ base_char_struct.font = font;
return psiconv_clone_character_layout(&base_char_struct);
}
@@ -129,7 +133,7 @@
fputs("",of);
if (old->underline)
fputs("",of);
- if (old->strike_out)
+ if (old->strikethrough)
fputs("",of);
if (old->super_sub == psiconv_superscript)
fputs("",of);
@@ -171,7 +175,7 @@
fputs("",of);
if (new->underline)
fputs("",of);
- if (new->strike_out)
+ if (new->strikethrough)
fputs("",of);
if (new->super_sub == psiconv_superscript)
fputs("",of);
@@ -196,8 +200,8 @@
else
fputs("",of);
}
- if (old->strike_out != new->strike_out) {
- if (old->strike_out)
+ if (old->strikethrough != new->strikethrough) {
+ if (old->strikethrough)
fputs("",of);
else
fputs("",of);
@@ -275,14 +279,22 @@
fputs("
\n",of);
}
-void psiconv_gen_html(FILE *of,psiconv_file file)
+int psiconv_gen_html(const char * filename,const psiconv_file file,
+ const char *dest)
{
- if (file->type == psiconv_word_file)
+ FILE *of = fopen(filename,"w");
+ if (! of)
+ return -1;
+
+ if (file->type == psiconv_word_file) {
psiconv_gen_html_word(of,(psiconv_word_f) file->file);
- else if (file->type == psiconv_texted_file)
+ } else if (file->type == psiconv_texted_file) {
psiconv_gen_html_texted(of,(psiconv_texted_f) file->file);
- else
- return;
+ } else {
+ fclose(of);
+ return -1;
+ }
+ return fclose(of);
}
void psiconv_gen_html_texted(FILE *of,psiconv_texted_f tf)
@@ -343,4 +355,14 @@
psiconv_free_character_layout(base_char);
}
+static struct psiconv_fileformat_s ff =
+ {
+ "HTML3",
+ "HTML 3.2, not verified so probably not completely compliant",
+ &psiconv_gen_html
+ };
+void init_html(void)
+{
+ psiconv_list_add(fileformat_list,&ff);
+}