-#include "data.h"
-#include "list.h"
-#include "gen.h"
-#include "psiconv.h"
-#ifndef TRUE
-#define TRUE (0==0)
+#ifdef DMALLOC
+#include "dmalloc.h"
#endif
-/*
- * Various string tables for HTML4 settings
- */
-
-/* How to display each character */
-static const char *char_table[0x100] = {
- /* 0x00 */ "", "", "", "", "", "", "
\n", "
\n",
- /* 0x08 */ "\n
\n", "\t", "", "", "", "", "", "",
- /* 0x10 */ " ", "", "", "", "", "", "", "",
- /* 0x18 */ "", "", "", "", "", "", "", "",
- /* 0x20 */ " ", "!", """, "#", "$", "%", "&", "'",
- /* 0x28 */ "(", ")", "*", "+", ",", "-", ".", "/",
- /* 0x30 */ "0", "1", "2", "3", "4", "5", "6", "7",
- /* 0x38 */ "8", "9", ":", ";", "<", "=", ">", "?",
- /* 0x40 */ "@", "A", "B", "C", "D", "E", "F", "G",
- /* 0x48 */ "H", "I", "J", "K", "L", "M", "N", "O",
- /* 0x50 */ "P", "Q", "R", "S", "T", "U", "V", "W",
- /* 0x58 */ "X", "Y", "Z", "[", "\\", "]", "^", "_",
- /* 0x60 */ "`", "a", "b", "c", "d", "e", "f", "g",
- /* 0x68 */ "h", "i", "j", "k", "l", "m", "n", "o",
- /* 0x70 */ "p", "q", "r", "s", "t", "u", "v", "w",
- /* 0x78 */ "x", "y", "z", "{", "|", "}", "~", "",
- /* 0x80 */ "", "", "‚", "ƒ",
- "„", "…", "†", "‡",
- /* 0x88 */ "", "‰", "Š", "<",
- "Œ", "", "", "",
- /* 0x90 */ "", "‘", "’", "“",
- "”","•", "–", "—",
- /* 0x98 */ "˜", "™", "š", ">",
- "œ", "", "", "Ÿ",
- /* 0xa0 */ " ", "¡", "¢", "£",
- "¤", "¥", "¦", "§",
- /* 0xa8 */ "¨", "©", "ª", "«",
- "¬", "", "®", "¯",
- /* 0xb0 */ "°", "±", "²", "³",
- "´", "µ", "¶", "·",
- /* 0xb8 */ "¸", "¹", "º", "»",
- "¼", "½", "¾", "¿",
- /* 0xc0 */ "À", "Á", "Â", "Ã",
- "Ä", "Å", "Æ", "Ç",
- /* 0xc8 */ "È", "É", "Ê", "Ë",
- "Ì", "Í", "Î", "Ï",
- /* 0xd0 */ "Ð", "Ñ", "Ò", "Ó",
- "Ô", "Õ", "Ö", "×",
- /* 0xd8 */ "Ø", "Ù", "Ú", "Û",
- "Ü", "Ý", "Þ", "ß",
- /* 0xe0 */ "à", "á", "â", "ã",
- "ä", "å", "æ", "ç",
- /* 0xe8 */ "è", "é", "ê", "ë",
- "ì", "í", "î", "ï",
- /* 0xf0 */ "ð", "ñ", "ò", "ó",
- "ô", "õ", "ö", "÷",
- /* 0xf8 */ "ø", "ù", "ú", "û",
- "ü", "ý", "þ", "ÿ"
-};
-
-/* The order of these must match the enum psiconv_border_kind (data.h) */
-static const char *border_strings[] = {
- "none", "solid", "double", "dotted", "dashed", "dashed", "dotted"
-};
-
-/* The order of these must match the enum psiconv_justify (data.h) */
-static const char *justify_strings[] = {
- "left", "center", "right", "justify"
-};
-
-/* The order of these must match the enum psiconv_super_sub (data.h) */
-static const char *vertical_strings[] = {
- "baseline", "super", "sub"
-};
-
-
-/*
- * Support routines for particular formatting structures
- */
-
-static void fput_name(FILE * of, const char *string) {
- int i;
-
- for (i = 0; i < strlen(string); i++)
- if (isalnum(string[i]))
- putc(string[i], of);
-}
-
-static void fput_text(FILE * of, const char *text, int length, int *pwasspace) {
- int j;
- int space;
-
- for (j = 0; j < length; j++) {
- space = (text[j] == ' ');
- if (*pwasspace && space)
- fputs(" ", of);
- else
- fputs(char_table[(unsigned char) (text[j])], of);
- *pwasspace = space;
- }
-}
-
-static const char *screenfont_name(psiconv_u8 screenfont)
-{
- if (screenfont == 1)
- return "sans-serif";
- else if (screenfont == 2)
- return "monospace";
- else if (screenfont == 3)
- return "serif";
- else
- return "serif";
-}
-
-static const char *generic_font_family(const char *font_name) {
- static const char *sans_font_names[] = {
- "Arial", "Univers", "Sans Serif"
- };
- static const char *mono_font_names[] = {
- "Courier New", "Courier", "Mono", "Lineprinter", "Elite", "Swiss",
- "Courier (compressed)", "Courier (expanded)", "Letter Gothic"
- };
- int i;
-
- for (i=0; i < sizeof(sans_font_names) / sizeof(sans_font_names[0]); i++)
- if (!strcmp(font_name, sans_font_names[i]))
- return "sans-serif";
-
- for (i=0; i < sizeof(mono_font_names) / sizeof(mono_font_names[0]); i++)
- if (!strcmp(font_name, mono_font_names[i]))
- return "monospace";
-
- return "serif";
-}
-
-static int colors_different(
- const psiconv_color old,
- const psiconv_color new)
-{
- return ((old->red != new->red) ||
- (old->green != new->green) ||
- (old->blue != new->blue));
-}
-
-
-/* Borders */
-static int borders_different(
- const psiconv_border old,
- const psiconv_border new)
-{
- return (!old ||
- (old->kind != new->kind) ||
- colors_different(old->color, new->color) ||
- (old->thickness != new->thickness));
-}
+#define TEMPSTR_LEN 100
-static void fput_border(FILE * of,
- const char *which,
- const psiconv_border old,
- const psiconv_border new)
-{
- /* If the border changed at all we'll set all parameters, as they're
- * fairly closely linked and it's much easier to do it this way */
- if (borders_different(old, new)) {
- fprintf(of, "border-%s-style:%s;",
- which, border_strings[new->kind]);
- if ((new->kind != psiconv_border_none) &&
- (new->color->red || new->color->green || new->color->blue))
- fprintf(of, "border-%s-color:#%02x%02x%02x;", which,
- new->color->red, new->color->green, new->color->blue);
- if ((new->kind == psiconv_border_solid) ||
- (new->kind == psiconv_border_double))
- fprintf(of, "border-%s-width:%.0fpx;",
- which, (new->thickness / 10.0) - 1);
- else if (new->kind != psiconv_border_none)
- fprintf(of, "border-%s-width:1px;", which);
+static void text(const psiconv_config config,psiconv_list list,
+ psiconv_string_t data,const encoding enc);
+static void header(const psiconv_config config, psiconv_list list,
+ const encoding enc);
+static void footer(const psiconv_config config, psiconv_list list,
+ const encoding enc);
+static void characters(const psiconv_config config, psiconv_list list,
+ const psiconv_string_t textstr,
+ const psiconv_character_layout layout,const encoding enc);
+static void paragraph(const psiconv_config config, psiconv_list list,
+ psiconv_paragraph para, const encoding enc);
+static void paragraphs(const psiconv_config config, psiconv_list list,
+ psiconv_text_and_layout paragraphs, const encoding enc);
+static void gen_word(const psiconv_config config, psiconv_list list,
+ const psiconv_word_f file, const encoding enc);
+static void gen_texted(const psiconv_config config, psiconv_list list,
+ const psiconv_texted_f file, const encoding enc);
+
+
+void text(const psiconv_config config,psiconv_list list,
+ psiconv_string_t data,const encoding enc)
+{
+ int i;
+ for (i = 0; i < psiconv_unicode_strlen(data); i++) {
+ if ((data[i] == 0x06) || (data[i] == 0x07) || (data[i] == 0x08))
+ output_simple_chars(config,list,"
",enc);
+ else if ((data[i] == 0x0b) || (data[i] == 0x0c))
+ output_simple_chars(config,list,"-",enc);
+ else if (data[i] == 0x0f)
+ output_simple_chars(config,list," ",enc);
+ else if (data[i] >= 0x20)
+ output_char(config,list,data[i],enc);
+ }
+}
+
+void header(const psiconv_config config, psiconv_list list, const encoding enc)
+{
+ output_simple_chars(config,list,"\n",
+ enc);
+ output_simple_chars(config,list,"\n",enc);
+ output_simple_chars(config,list,"\n",enc);
+ output_simple_chars(config,list,"\n",enc);
+ output_simple_chars(config,list,"EPOC32 file "
+ "converted by psiconv\n",enc);
+ output_simple_chars(config,list,"\n",enc);
+ output_simple_chars(config,list,"\n",enc);
+}
+
+void footer(const psiconv_config config, psiconv_list list, const encoding enc)
+{
+ output_simple_chars(config,list,"\n",enc);
+ output_simple_chars(config,list,"\n",enc);
+}
+
+
+void characters(const psiconv_config config, psiconv_list list,
+ const psiconv_string_t textstr,
+ const psiconv_character_layout layout,const encoding enc)
+{
+ char tempstr[TEMPSTR_LEN];
+
+ output_simple_chars(config,list,"font->screenfont == psiconv_font_serif?"serif":
+ layout->font->screenfont == psiconv_font_sansserif?"sans-serif":
+ layout->font->screenfont == psiconv_font_nonprop?"monospace":
+ layout->font->screenfont == psiconv_font_misc?"fantasy":"",
+ enc);
+ output_simple_chars(config,list,"\"",enc);
+
+ if ((layout->font_size < 10) || (layout->font_size >= 13)) {
+ output_simple_chars(config,list," size=",enc);
+ output_simple_chars(config,list,
+ layout->font_size < 8 ?"1":
+ layout->font_size < 10 ?"2":
+ layout->font_size < 13 ?"3":
+ layout->font_size < 17 ?"4":
+ layout->font_size < 24 ?"5":
+ layout->font_size < 36 ?"6":"7",enc);
+ }
+ if ((layout->color->red != 0) || (layout->color->green != 0) ||
+ (layout->color->blue != 0)) {
+ snprintf(tempstr,TEMPSTR_LEN,"%02x%02x%02x",
+ layout->color->red,layout->color->green,layout->color->blue);
+ output_simple_chars(config,list," color=#",enc);
+ output_simple_chars(config,list,tempstr,enc);
+ }
+ output_simple_chars(config,list,">",enc);
+
+
+ if (layout->italic)
+ output_simple_chars(config,list,"",enc);
+ if (layout->bold)
+ output_simple_chars(config,list,"",enc);
+ if (layout->super_sub != psiconv_normalscript)
+ output_simple_chars(config,list,
+ layout->super_sub == psiconv_superscript?"":
+ layout->super_sub == psiconv_subscript?"":
+ "",enc);
+ if (layout->strikethrough)
+ output_simple_chars(config,list,"",enc);
+ if (layout->underline)
+ output_simple_chars(config,list,"",enc);
+
+ text(config,list,textstr,enc);
+
+ if (layout->underline)
+ output_simple_chars(config,list,"",enc);
+ if (layout->strikethrough)
+ output_simple_chars(config,list,"",enc);
+ if (layout->super_sub != psiconv_normalscript)
+ output_simple_chars(config,list,
+ layout->super_sub == psiconv_superscript?"":
+ layout->super_sub == psiconv_subscript?"":
+ "",enc);
+ if (layout->bold)
+ output_simple_chars(config,list,"",enc);
+ if (layout->italic)
+ output_simple_chars(config,list,"",enc);
+ output_simple_chars(config,list,"",enc);
+}
+
+void paragraph(const psiconv_config config, psiconv_list list,
+ psiconv_paragraph para, const encoding enc)
+{
+ int i,charnr;
+ psiconv_string_t text;
+ psiconv_in_line_layout layout;
+
+
+ output_simple_chars(config,list,
+ para->base_paragraph->bullet->on?"- base_paragraph->justify_hor == psiconv_justify_centre)
+ output_simple_chars(config,list," align=center",enc);
+ else if (para->base_paragraph->justify_hor == psiconv_justify_right)
+ output_simple_chars(config,list," align=right",enc);
+ else if (para->base_paragraph->justify_hor == psiconv_justify_full)
+ output_simple_chars(config,list," align=justify",enc);
+
+ output_simple_chars(config,list,">",enc);
+
+ if (psiconv_list_length(para->in_lines) == 0) {
+ characters(config,list,para->text,para->base_character,enc);
+ } else {
+ charnr = 0;
+ for (i = 0; i < psiconv_list_length(para->in_lines); i++) {
+ if (!(layout = psiconv_list_get(para->in_lines,i))) {
+ fputs("Internal data structures corruption\n",stderr);
+ exit(1);
+ }
+ if (!(text = malloc(sizeof (*text) * (layout->length + 1)))) {
+ fputs("Out of memory error\n",stderr);
+ exit(1);
+ }
+ memcpy(text,para->text+charnr,layout->length * sizeof(*text));
+ text[layout->length] = 0;
+ characters(config,list,text,layout->layout,enc);
+ free(text);
+ charnr += layout->length;
}
+ }
+ output_simple_chars(config, list,
+ para->base_paragraph->bullet->on?"
\n":"\n",enc);
}
-/* Paragraph formats */
-static int paragraph_layouts_different(
- const psiconv_paragraph_layout old,
- const psiconv_paragraph_layout new)
-{
- return ((old->top_space != new->top_space) ||
- (old->indent_right != new->indent_right) ||
- (old->bottom_space != new->bottom_space) ||
- (old->indent_left != new->indent_left) ||
- (old->indent_first != new->indent_first) ||
- (old->justify_hor != new->justify_hor) ||
- (old->interline_exact != new->interline_exact) ||
- borders_different(old->left_border, new->left_border) ||
- borders_different(old->right_border, new->right_border) ||
- borders_different(old->top_border, new->top_border) ||
- borders_different(old->bottom_border, new->bottom_border));
-}
-
-static void fput_paragraph_layout(FILE * of,
- const psiconv_paragraph_layout old,
- const psiconv_paragraph_layout new)
+void paragraphs(const psiconv_config config, psiconv_list list,
+ psiconv_text_and_layout paragraphs, const encoding enc)
{
- if (!old || (old->top_space != new->top_space))
- fprintf(of, "margin-top:%.1fpt;", new->top_space);
- if (!old || (old->indent_right != new->indent_right))
- fprintf(of, "margin-right:%.2fcm;", new->indent_right);
- if (!old || (old->bottom_space != new->bottom_space))
- fprintf(of, "margin-bottom:%.1fpt;", new->bottom_space);
- if (!old ||
- (old->bullet->on != new->bullet->on) ||
- (old->bullet->indent != new->bullet->indent) ||
- (old->indent_left != new->indent_left) ||
- (old->indent_first != new->indent_first)) {
- psiconv_length_t indent = new->indent_first;
- psiconv_length_t margin = new->indent_left;
- /* Bullets with indent set cause strange margin behaviour: */
- if (new->bullet->on && new->bullet->indent) {
- if (indent > 0.0) {
- margin += indent;
- indent = new->indent_left - indent;
- }
- }
- fprintf(of, "margin-left:%.2fcm;", margin);
- fprintf(of, "text-indent:%.2fcm;", indent);
- }
- if (!old || (old->justify_hor != new->justify_hor))
- fprintf(of, "text-align:%s;", justify_strings[new->justify_hor]);
- if (!old || (old->interline_exact != new->interline_exact)) {
- if (!old || old->interline_exact)
- fputs("line-height:normal;", of);
- else
- fprintf(of, "line-height:%.1fpt;", new->interline);
+ int i;
+ psiconv_paragraph para;
+ for (i = 0; i < psiconv_list_length(paragraphs); i++) {
+ if (!(para = psiconv_list_get(paragraphs,i))) {
+ fputs("Internal datastructure corruption\n",stderr);
+ exit(1);
}
- fput_border(of, "left", old ? old->left_border : NULL,
- new->left_border);
- fput_border(of, "right", old ? old->right_border : NULL,
- new->right_border);
- fput_border(of, "top", old ? old->top_border : NULL,
- new->top_border);
- fput_border(of, "bottom", old ? old->bottom_border : NULL,
- new->bottom_border);
+ paragraph(config,list,para,enc);
+ }
}
-/* Character formats */
-static int character_layouts_different(
- const psiconv_character_layout old,
- const psiconv_character_layout new)
+void gen_word(const psiconv_config config, psiconv_list list,
+ const psiconv_word_f file, const encoding enc)
{
- return ((old->font->screenfont != new->font->screenfont) ||
- (strcmp(old->font->name,new->font->name)) ||
- (old->font_size != new->font_size) ||
- (old->color->red != new->color->red) ||
- (old->color->green != new->color->green) ||
- (old->color->blue != new->color->blue) ||
- (old->back_color->red != new->back_color->red) ||
- (old->back_color->green != new->back_color->green) ||
- (old->back_color->blue != new->back_color->blue) ||
- (old->italic != new->italic) ||
- (old->bold != new->bold) ||
- (old->super_sub != new->super_sub) ||
- (old->underline != new->underline) ||
- (old->strike_out != new->strike_out));
-}
+ if (!file)
+ return;
-static void fput_character_layout(FILE * of,
- const psiconv_character_layout old,
- const psiconv_character_layout new,
- psiconv_word_f wf)
-{
- if (!old || (old->font->screenfont != new->font->screenfont) ||
- strcmp(old->font->name,new->font->name)) {
- fprintf(of, "font-family:%s,%s,%s;", new->font->name,
- generic_font_family(new->font->name),
- screenfont_name(new->font->screenfont));
- }
- if (!old || (old->font_size != new->font_size))
- fprintf(of, "font-size:%.1f%%;", 100.0 * new->font_size / 10.0);
- if (!old || (old->bold != new->bold))
- fprintf(of, "font-weight:%s;", new->bold ? "bold" : "normal");
- if (!old || (old->italic != new->italic))
- fprintf(of, "font-style:%s;", new->italic ? "italic" : "normal");
- if (!old || (colors_different(old->color, new->color)))
- fprintf(of, "color:#%02x%02x%02x;",
- new->color->red, new->color->green, new->color->blue);
- if (!old || (colors_different(old->back_color, new->back_color)))
- fprintf(of, "background-color:#%02x%02x%02x;",
- new->back_color->red, new->back_color->green, new->back_color->blue);
- if (!old || (old->super_sub != new->super_sub))
- fprintf(of, "vertical-align:%s;", vertical_strings[new->super_sub]);
- if (!old || (old->underline != new->underline) ||
- (old->strike_out != new->strike_out)) {
- fputs("text-decoration:", of);
- if (new->strike_out)
- fputs("line-through ", of);
- if (new->underline)
- fputs("underline", of);
- else if (!new->strike_out)
- fputs("none", of);
- fputs(";", of);
- }
+ header(config,list,enc);
+ paragraphs(config,list,file->paragraphs,enc);
+ footer(config,list,enc);
}
-/* Formatted paragraphs */
-static void fput_para(FILE * of,
- const psiconv_paragraph para,
- psiconv_word_f wf)
+void gen_texted(const psiconv_config config, psiconv_list list,
+ const psiconv_texted_f file, const encoding enc)
{
- psiconv_paragraph_layout base_para = para->base_paragraph;
- psiconv_character_layout base_char = para->base_character;
- psiconv_character_layout cur_char;
- psiconv_character_layout *layout_stack;
- psiconv_in_line_layout inl;
- psiconv_word_style sty;
- int spans = 0;
- int wasspace = 0;
- int i, j, loc;
-
- layout_stack = calloc(psiconv_list_length(para->in_lines),
- sizeof(*layout_stack));
- fputs("styles_sec, para->base_style);
- cur_char = sty->character;
-
- if (sty->name) {
- fputs(" CLASS=\"", of);
- fput_name(of, sty->name);
- putc('"', of);
- }
-
- if (paragraph_layouts_different(sty->paragraph, base_para) ||
- character_layouts_different(cur_char, base_char)) {
- fputs(" STYLE=\"", of);
- fput_paragraph_layout(of, sty->paragraph, base_para);
- fput_character_layout(of, cur_char, base_char, wf);
- cur_char = base_char;
- putc('"', of);
- }
- putc('>', of);
-
- if (base_para->bullet->on) {
- fputs("bullet->font != base_char->font) {
- fprintf(of, "font-family:%s,%s,%s;",
- base_para->bullet->font->name,
- generic_font_family(base_para->bullet->font->name),
- screenfont_name(base_para->bullet->font->screenfont));
- }
- if (base_para->bullet->font_size != base_char->font_size)
- fprintf(of, "font-size:%.1f%%;",
- 100.0 * base_para->bullet->font_size / 10.0);
- if ((base_para->bullet->color->red != base_char->color->red) ||
- (base_para->bullet->color->green != base_char->color->green) ||
- (base_para->bullet->color->blue != base_char->color->blue))
- fprintf(of, "color:#%02x%02x%02x;",
- base_para->bullet->color->red,
- base_para->bullet->color->green,
- base_para->bullet->color->blue);
- fprintf(of, "\">%s ",
- char_table[base_para->bullet->character]);
- wasspace = TRUE;
- }
-
- loc = 0;
- for (i = 0; i < psiconv_list_length(para->in_lines); i++) {
- inl = psiconv_list_get(para->in_lines, i);
- if (character_layouts_different(cur_char, inl->layout)) {
- for (j = 0; j < spans; j++)
- if (!character_layouts_different(inl->layout, layout_stack[j]))
- break;
- if (j < spans) {
- while (spans > j) {
- fputs("",of);
- spans--;
- }
- } else {
- fputs("layout, wf);
- fputs("\">",of);
- layout_stack[spans++] = cur_char;
- }
- cur_char = inl->layout;
- }
- fput_text(of, ¶->text[loc], inl->length, &wasspace);
- loc += inl->length;
- }
-
- while (spans > 0) {
- fputs("",of);
- spans--;
- }
-
- if (loc < strlen(para->text)) {
- fput_text(of, ¶->text[loc], strlen(para->text) - loc, &wasspace);
- }
-
- if (strlen(para->text) == 0)
- fputs(" ", of);
-
- fputs("
\n", of);
- free(layout_stack);
+ header(config,list,enc);
+ paragraphs(config,list,file->texted_sec->paragraphs,enc);
+ footer(config,list,enc);
}
-static void fput_style(FILE * of,
- const psiconv_word_style normal,
- const psiconv_word_style sty,
- psiconv_word_f wf)
+int gen_html4(const psiconv_config config, psiconv_list list,
+ const psiconv_file file, const char *dest,
+ const encoding enc)
{
- if (sty->name == NULL)
- fputs(" P {", of);
- else {
- fputs(" P.", of);
- fput_name(of, sty->name);
- fputs(" {", of);
- }
- fput_paragraph_layout(of, normal ? normal->paragraph : NULL, sty->paragraph);
- fput_character_layout(of, normal ? normal->character : NULL, sty->character, wf);
- fputs("}\n", of);
-}
+ encoding enc1 = enc;
-static int psiconv_gen_html4(FILE * of, const psiconv_file file,
- const char *dest)
-{
- int i;
- psiconv_paragraph para;
- psiconv_word_style normal, sty;
- psiconv_word_f wf;
-
- if (file->type == psiconv_word_file)
- wf = file->file;
- else {
- /* Fall back on the normal HTML generator */
- return psiconv_gen_html(of,file,dest);
- }
+ if (enc == ENCODING_PSION) {
+ fputs("Unsupported encoding\n",stderr);
+ return -1;
+ } else if (enc == ENCODING_ASCII)
+ enc1 = ENCODING_ASCII_HTML;
- fputs("", of);
- fputs("\n\n\n \n", of);
-
- if (psiconv_list_length(wf->page_sec->header->text->paragraphs) > 0) {
- fputs(" ", of);
- para = psiconv_list_get(wf->page_sec->header->text->paragraphs, 0);
- i = 0;
- fput_text(of, para->text, strlen(para->text), &i);
- fputs("\n", of);
- }
-
- normal = wf->styles_sec->normal;
- fputs(" \n\n\n", of);
- for (i = 0; i < psiconv_list_length(wf->paragraphs); i++) {
- para = psiconv_list_get(wf->paragraphs, i);
- fput_para(of, para, wf);
- }
- fputs("\n\n", of);
+ if (file->type == psiconv_word_file) {
+ gen_word(config,list,(psiconv_word_f) file->file,enc1);
+ return 0;
+ } else if (file->type == psiconv_texted_file) {
+ gen_texted(config,list,(psiconv_texted_f) file->file,enc1);
return 0;
+ } else
+ return -1;
}
+
-static struct psiconv_fileformat ff =
+static struct fileformat_s ffs[] =
{
- "HTML4",
- "HTML 4.0 with cascading style sheets",
- psiconv_gen_html4
+ {
+ "HTML4",
+ "HTML 4.01 Transitional, without CSS",
+ FORMAT_WORD | FORMAT_TEXTED,
+ gen_html4
+ },
+ {
+ NULL,
+ NULL,
+ 0,
+ NULL
+ }
};
+
void init_html4(void)
{
- psiconv_list_add(fileformat_list,&ff);
+ int i;
+ for (i = 0; ffs[i].name; i++)
+ psiconv_list_add(fileformat_list,ffs+i);
}
-