… | |
… | |
19 | */ |
19 | */ |
20 | |
20 | |
21 | #include "config.h" |
21 | #include "config.h" |
22 | #include <stdio.h> |
22 | #include <stdio.h> |
23 | #include <string.h> |
23 | #include <string.h> |
24 | #include "data.h" |
24 | #include "psiconv/data.h" |
25 | #include "list.h" |
25 | #include "psiconv/list.h" |
26 | #include "gen.h" |
26 | #include "gen.h" |
27 | #include "psiconv.h" |
27 | #include "psiconv.h" |
|
|
28 | |
|
|
29 | #ifdef DMALLOC |
|
|
30 | #include "dmalloc.h" |
|
|
31 | #endif |
28 | |
32 | |
29 | |
33 | |
30 | /* |
34 | /* |
31 | * Various string tables for HTML4 settings |
35 | * Various string tables for HTML4 settings |
32 | */ |
36 | */ |
… | |
… | |
94 | static void psiconv_gen_txt_texted(FILE * of, psiconv_texted_f tf) |
98 | static void psiconv_gen_txt_texted(FILE * of, psiconv_texted_f tf) |
95 | { |
99 | { |
96 | int i; |
100 | int i; |
97 | psiconv_paragraph para; |
101 | psiconv_paragraph para; |
98 | |
102 | |
|
|
103 | if (tf->page_sec->header->text) { |
99 | if (tf->page_sec->header->on_first_page) { |
104 | if (tf->page_sec->header->on_first_page) { |
100 | for (i=0; i < psiconv_list_length(tf->page_sec->header->text->paragraphs); i++) { |
105 | for (i=0; i < psiconv_list_length(tf->page_sec->header->text->paragraphs); i++) { |
101 | para = psiconv_list_get(tf->page_sec->header->text->paragraphs, i); |
106 | para = psiconv_list_get(tf->page_sec->header->text->paragraphs, i); |
102 | fput_text(of, para->text, strlen(para->text)); |
107 | fput_text(of, para->text, strlen(para->text)); |
103 | fputs("\n", of); |
108 | fputs("\n", of); |
|
|
109 | } |
104 | } |
110 | } |
105 | } |
111 | } |
106 | fputs("\n",of); |
112 | fputs("\n",of); |
107 | |
113 | |
108 | for (i=0; i < psiconv_list_length(tf->texted_sec->paragraphs); i++) { |
114 | for (i=0; i < psiconv_list_length(tf->texted_sec->paragraphs); i++) { |
109 | para = psiconv_list_get(tf->texted_sec->paragraphs, i); |
115 | para = psiconv_list_get(tf->texted_sec->paragraphs, i); |
110 | fput_para(of, para,0); |
116 | fput_para(of, para,0); |
111 | } |
117 | } |
112 | |
118 | |
113 | fputs("\n",of); |
119 | fputs("\n",of); |
|
|
120 | if (tf->page_sec->header->text) { |
114 | for (i=0; i < psiconv_list_length(tf->page_sec->footer->text->paragraphs); i++) { |
121 | for (i=0; i < psiconv_list_length(tf->page_sec->footer->text->paragraphs); i++) { |
115 | para = psiconv_list_get(tf->page_sec->footer->text->paragraphs, i); |
122 | para = psiconv_list_get(tf->page_sec->footer->text->paragraphs, i); |
116 | fput_text(of, para->text, strlen(para->text)); |
123 | fput_text(of, para->text, strlen(para->text)); |
117 | fputs("\n", of); |
124 | fputs("\n", of); |
|
|
125 | } |
118 | } |
126 | } |
119 | } |
127 | } |
120 | |
128 | |
121 | static void psiconv_gen_txt_word(FILE * of, psiconv_word_f wf) |
129 | static void psiconv_gen_txt_word(FILE * of, psiconv_word_f wf) |
122 | { |
130 | { |