… | |
… | |
40 | } |
40 | } |
41 | if (!(*buf = psiconv_buffer_new())) |
41 | if (!(*buf = psiconv_buffer_new())) |
42 | return -PSICONV_E_NOMEM; |
42 | return -PSICONV_E_NOMEM; |
43 | |
43 | |
44 | if (value->type == psiconv_word_file) { |
44 | if (value->type == psiconv_word_file) { |
|
|
45 | if ((res = psiconv_write_header_section(*buf,PSICONV_ID_PSION5, |
|
|
46 | PSICONV_ID_DATA_FILE, |
|
|
47 | PSICONV_ID_WORD))) |
|
|
48 | goto ERROR; |
45 | if ((res =psiconv_write_word_file(*buf,(psiconv_word_f) (value->file)))) |
49 | if ((res =psiconv_write_word_file(*buf,(psiconv_word_f) (value->file)))) |
46 | goto ERROR; |
50 | goto ERROR; |
47 | } else if (value->type == psiconv_texted_file) { |
51 | } else if (value->type == psiconv_texted_file) { |
|
|
52 | if ((res = psiconv_write_header_section(*buf,PSICONV_ID_PSION5, |
|
|
53 | PSICONV_ID_DATA_FILE, |
|
|
54 | PSICONV_ID_TEXTED))) |
|
|
55 | goto ERROR; |
48 | if ((res =psiconv_write_texted_file(*buf, |
56 | if ((res =psiconv_write_texted_file(*buf, |
49 | (psiconv_texted_f) (value->file)))) |
57 | (psiconv_texted_f) (value->file)))) |
50 | goto ERROR; |
58 | goto ERROR; |
51 | #if 0 |
59 | #if 0 |
52 | } else if (value->type == psiconv_sketch_file) { |
60 | } else if (value->type == psiconv_sketch_file) { |
… | |
… | |
107 | } |
115 | } |
108 | if (!(base_para = psiconv_basic_paragraph_layout())) { |
116 | if (!(base_para = psiconv_basic_paragraph_layout())) { |
109 | res = -PSICONV_E_NOMEM; |
117 | res = -PSICONV_E_NOMEM; |
110 | goto ERROR4; |
118 | goto ERROR4; |
111 | } |
119 | } |
112 | |
|
|
113 | if ((res = psiconv_write_header_section(buf,PSICONV_ID_PSION5, |
|
|
114 | PSICONV_ID_DATA_FILE, |
|
|
115 | PSICONV_ID_TEXTED))) |
|
|
116 | goto ERROR5; |
|
|
117 | |
120 | |
118 | section_table_id = psiconv_buffer_unique_id(); |
121 | section_table_id = psiconv_buffer_unique_id(); |
119 | if ((res = psiconv_write_offset(buf,section_table_id))) |
122 | if ((res = psiconv_write_offset(buf,section_table_id))) |
120 | goto ERROR5; |
123 | goto ERROR5; |
121 | |
124 | |
… | |
… | |
191 | if (!(entry = malloc(sizeof(*entry)))) { |
194 | if (!(entry = malloc(sizeof(*entry)))) { |
192 | res = -PSICONV_E_NOMEM; |
195 | res = -PSICONV_E_NOMEM; |
193 | goto ERROR2; |
196 | goto ERROR2; |
194 | } |
197 | } |
195 | |
198 | |
196 | if ((res = psiconv_write_header_section(buf,PSICONV_ID_PSION5, |
|
|
197 | PSICONV_ID_DATA_FILE, |
|
|
198 | PSICONV_ID_WORD))) |
|
|
199 | goto ERROR3; |
|
|
200 | |
|
|
201 | section_table_id = psiconv_buffer_unique_id(); |
199 | section_table_id = psiconv_buffer_unique_id(); |
202 | if ((res = psiconv_write_offset(buf,section_table_id))) |
200 | if ((res = psiconv_write_offset(buf,section_table_id))) |
203 | goto ERROR3; |
201 | goto ERROR3; |
204 | |
202 | |
205 | entry->id = PSICONV_ID_APPL_ID_SECTION; |
203 | entry->id = PSICONV_ID_APPL_ID_SECTION; |